/* =========================================================
   SorpresaBox · vendor.css
   Panel vendedor ordenado, claro y responsive
   Reemplazo completo para: public_html/assets/vendor.css
   ========================================================= */

/* =======================
   Variables
   ======================= */
:root {
  --primary: #f59e0b;
  --primary-2: #fbbf24;
  --primary-3: #fde68a;
  --primary-dark: #b45309;

  --emerald: #34d399;
  --emerald-dark: #059669;
  --red: #fb7185;
  --red-dark: #dc2626;
  --sky: #60a5fa;
  --violet: #a78bfa;
  --slate: #94a3b8;

  --bg: #080b13;
  --bg2: #0d1320;
  --card: #111827;
  --card-2: #172033;
  --card-3: #1f2937;
  --border: rgba(148, 163, 184, .18);
  --border-strong: rgba(251, 191, 36, .32);
  --fg: #f8fafc;
  --muted: #a5b4c7;

  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 18px 45px rgba(0, 0, 0, .28);
  --shadow-soft: 0 14px 34px rgba(15, 23, 42, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* =======================
   Base
   ======================= */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

.vendor-body,
body.vendor-body {
  margin: 0;
  min-height: 100vh;
  color: var(--fg);
  background:
    radial-gradient(circle at 0% 0%, rgba(245, 158, 11, .17), transparent 28%),
    radial-gradient(circle at 100% 0%, rgba(96, 165, 250, .12), transparent 25%),
    linear-gradient(180deg, #0b1020 0%, #080b13 100%);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: none; color: var(--primary-3); }

button,
input,
select,
textarea {
  font-family: inherit;
}

::selection {
  background: var(--primary);
  color: #111827;
}

/* =======================
   Layout general
   ======================= */
.vendor-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.main-wrap {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.content {
  width: 100%;
  flex: 1;
  padding: 24px;
  overflow-x: hidden;
}

/* =======================
   Sidebar
   ======================= */
.sidebar {
  width: 286px;
  flex: 0 0 286px;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(17, 24, 39, .98), rgba(8, 11, 19, .98)),
    #0b1020;
  border-right: 1px solid var(--border);
  box-shadow: 14px 0 50px rgba(0, 0, 0, .22);
  transition: left .28s ease, transform .28s ease;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .26); border-radius: 999px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 22px 18px;
  border-bottom: 1px solid var(--border);
}

.brand-emoji,
.brand-logo,
.brand-logo-orb {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), #f97316);
  color: #111827;
  box-shadow: 0 15px 36px rgba(245, 158, 11, .24);
  font-size: 24px;
}

.brand-text {
  min-width: 0;
  flex: 1;
}

.brand-name,
.brand-title {
  display: block;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -.03em;
  color: #fff;
}

.brand-sub {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tarjeta opcional dentro del sidebar */
.vendor-mini-card {
  margin: 16px;
  padding: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .08);
}

.vendor-avatar,
.player-avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 900;
  color: #111827;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
}

.vendor-mini-name {
  font-weight: 800;
  color: #fff;
  font-size: 14px;
  line-height: 1.2;
}
.vendor-mini-role {
  color: var(--muted);
  font-size: 12px;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px 12px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid transparent;
  border-radius: 15px;
  color: #cbd5e1;
  background: transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, color .16s ease, border-color .16s ease;
}

.nav-item:hover {
  transform: translateX(3px);
  color: #fff;
  background: rgba(255, 255, 255, .06);
  text-decoration: none;
}

.nav-item.active {
  color: #fff7ed;
  background: linear-gradient(135deg, rgba(245, 158, 11, .22), rgba(249, 115, 22, .10));
  border-color: var(--border-strong);
  box-shadow: 0 14px 32px rgba(245, 158, 11, .10);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 16%;
  width: 4px;
  height: 68%;
  border-radius: 0 999px 999px 0;
  background: var(--primary-2);
}

.nav-icon,
.nav-ico {
  width: 24px;
  text-align: center;
  font-size: 18px;
  line-height: 1;
}

.nav-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  min-width: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--primary-2);
  color: #111827;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.sidebar-quick-actions {
  padding: 2px 12px 12px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 12px 18px;
  border-top: 1px solid var(--border);
}

.service-pill {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border-radius: 16px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .08);
}

.service-pill > span:first-child,
.service-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
}

.service-ok { border-color: rgba(52, 211, 153, .22); }
.service-ok > span:first-child,
.service-ok .service-icon {
  color: #86efac;
  background: rgba(52, 211, 153, .14);
}

.service-bad { border-color: rgba(251, 113, 133, .22); }
.service-bad > span:first-child,
.service-bad .service-icon {
  color: #fecdd3;
  background: rgba(251, 113, 133, .14);
}

.service-pill-title,
.service-title {
  font-size: 13px;
  line-height: 1.15;
  font-weight: 900;
  color: #fff;
}

.service-pill-sub,
.service-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.logout-link,
.logout-btn,
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  color: #cbd5e1;
  text-decoration: none;
}

.logout-btn-main {
  justify-content: center;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(251, 113, 133, .28);
  background: linear-gradient(135deg, rgba(239, 68, 68, .18), rgba(251, 113, 133, .10));
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -.01em;
  box-shadow: 0 14px 30px rgba(239, 68, 68, .12);
}

.logout-btn-main .logout-icon {
  font-size: 18px;
  line-height: 1;
}

.logout-btn-main .logout-label {
  white-space: nowrap;
}

.logout-link:hover,
.logout-btn:hover,
.sidebar-link:hover {
  color: #fecdd3;
  background: rgba(251, 113, 133, .10);
  border-color: rgba(251, 113, 133, .22);
}

.logout-btn-main:hover {
  color: #fff;
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(239, 68, 68, .24), rgba(251, 113, 133, .14));
  border-color: rgba(251, 113, 133, .40);
}

/* =======================
   Topbar
   ======================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 14px 24px;
  background: rgba(8, 11, 19, .72);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar-left,
.topbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-title {
  flex-direction: row;
}

.topbar-emoji {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  border-radius: 14px;
  background: rgba(245, 158, 11, .14);
  border: 1px solid rgba(245, 158, 11, .18);
}

.topbar-greeting,
.topbar-sub {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-name {
  color: #fff;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: -.02em;
}

.topbar-actions,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hamburger,
.icon-btn.hamburger {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: none;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.hamburger:hover {
  background: rgba(255, 255, 255, .10);
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  margin: 3px 0;
}

.balance-chip,
.balance-card {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 128px;
  padding: 9px 13px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, .16), rgba(245, 158, 11, .06));
  border: 1px solid rgba(245, 158, 11, .24);
}

.balance-label {
  font-size: 10px;
  line-height: 1;
  color: var(--primary-2);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 900;
}

.balance-amount {
  margin-top: 3px;
  font-size: 17px;
  line-height: 1;
  color: #fff;
  font-weight: 950;
}

.badge,
.topbar-status .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.badge-success,
.status-connected {
  color: #86efac;
  background: rgba(52, 211, 153, .12);
  border: 1px solid rgba(52, 211, 153, .22);
}

.badge-warning,
.status-disconnected {
  color: #fcd34d;
  background: rgba(245, 158, 11, .12);
  border: 1px solid rgba(245, 158, 11, .22);
}

.whatsapp-controls {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.whatsapp-recover-btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid rgba(96, 165, 250, .28);
  border-radius: 999px;
  color: #bfdbfe;
  background: rgba(59, 130, 246, .12);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease;
}

.whatsapp-recover-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  color: #dbeafe;
  background: rgba(59, 130, 246, .20);
  border-color: rgba(96, 165, 250, .45);
}

.whatsapp-recover-btn:focus-visible {
  outline: 3px solid rgba(96, 165, 250, .30);
  outline-offset: 2px;
}

.whatsapp-recover-btn:disabled {
  opacity: .65;
  cursor: wait;
}

.whatsapp-recover-icon {
  display: inline-block;
  font-size: 18px;
  line-height: .8;
}

.whatsapp-recover-btn[aria-busy="true"] .whatsapp-recover-icon {
  animation: whatsapp-recovery-spin .85s linear infinite;
}

.whatsapp-recovery-status {
  position: absolute;
  z-index: 55;
  top: calc(100% + 10px);
  right: 0;
  width: max-content;
  max-width: min(360px, calc(100vw - 28px));
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #dbeafe;
  background: rgba(15, 23, 42, .98);
  box-shadow: 0 16px 36px rgba(2, 6, 23, .38);
  font-size: 12px;
  line-height: 1.4;
}

.whatsapp-recovery-status.is-success { color: #86efac; border-color: rgba(52, 211, 153, .30); }
.whatsapp-recovery-status.is-error { color: #fecdd3; border-color: rgba(251, 113, 133, .30); }
.whatsapp-recovery-status.is-pending { color: #fde68a; border-color: rgba(245, 158, 11, .30); }

@keyframes whatsapp-recovery-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .whatsapp-recover-btn[aria-busy="true"] .whatsapp-recover-icon {
    animation: none;
  }
}

.badge-danger { color: #fecdd3; background: rgba(251,113,133,.13); border: 1px solid rgba(251,113,133,.22); }
.badge-info { color: #bfdbfe; background: rgba(96,165,250,.13); border: 1px solid rgba(96,165,250,.22); }
.badge-violet { color: #ddd6fe; background: rgba(167,139,250,.13); border: 1px solid rgba(167,139,250,.22); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgba(2, 6, 23, .72);
  backdrop-filter: blur(4px);
}
.sidebar-overlay.show { display: block; }

/* =======================
   Cards / Utilities
   ======================= */
.card,
.url-card,
.config-card,
.new-player-form,
.service-banner,
.callout,
.section,
.collapse,
.scroll-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .026)),
    rgba(17, 24, 39, .92);
  box-shadow: var(--shadow-soft);
}

.card,
.url-card,
.config-card,
.section,
.collapse {
  padding: 18px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-title,
.section-title,
.config-title,
.url-title,
.collapse-title {
  color: #fff;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -.025em;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 6px 0 14px;
}

.emoji { font-size: 21px; }

.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-muted { color: var(--muted); }

.grid { display: grid; gap: 12px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* =======================
   Botones / Inputs
   ======================= */
.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, .075);
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, .11);
}

.btn-primary {
  color: #111827;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  box-shadow: 0 14px 30px rgba(245, 158, 11, .20);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fde68a, var(--primary-2));
}

.btn-ghost {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .045);
}

.btn-danger {
  background: rgba(251, 113, 133, .18);
  color: #fecdd3;
  border: 1px solid rgba(251,113,133,.28);
}

.btn-sm {
  min-height: 34px;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 12px;
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 13px;
  color: #fff;
  background: rgba(2, 6, 23, .46);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.input:focus,
select:focus,
textarea:focus {
  border-color: rgba(251, 191, 36, .55);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .12);
  background: rgba(2, 6, 23, .62);
}

label {
  display: block;
  color: #dbe5f3;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 850;
}

.form-field { min-width: 0; }
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.input-hint,
.config-sub,
.url-sub {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-group .input { flex: 1; }

.input-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  color: #fff;
  background: rgba(255,255,255,.06);
  cursor: pointer;
}

.code-chip,
.cell-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 8px;
  background: rgba(245, 158, 11, .12);
  color: var(--primary-2);
  border: 1px solid rgba(245, 158, 11, .2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
}

/* =======================
   Estados vacíos / errores
   ======================= */
.loading-screen,
.loading-block,
.empty-state,
.error-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 12px;
  padding: 34px 18px;
  color: var(--muted);
}

.loading-screen,
.loading-block {
  min-height: 320px;
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid rgba(148, 163, 184, .20);
  border-top-color: var(--primary-2);
  animation: spin .85s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-icon,
.error-icon {
  font-size: 40px;
  line-height: 1;
}

.empty-title {
  color: #fff;
  font-size: 18px;
  font-weight: 950;
}
.empty-desc {
  max-width: 460px;
  color: var(--muted);
  font-size: 14px;
}
.error-state {
  border: 1px solid rgba(251,113,133,.22);
  border-radius: var(--radius-lg);
  background: rgba(251,113,133,.07);
  color: #fecdd3;
}

/* =======================
   Dashboard
   ======================= */
.service-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 17px;
}

.service-banner.ok { border-color: rgba(52, 211, 153, .24); }
.service-banner.bad { border-color: rgba(251, 113, 133, .24); }

.sb-emoji {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .07);
  font-size: 24px;
}

.sb-text { flex: 1; min-width: 0; }
.sb-title { color: #fff; font-size: 17px; font-weight: 950; }
.sb-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.sb-progress {
  height: 8px;
  border-radius: 999px;
  margin-top: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, .08);
}
.sb-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--emerald), var(--primary-2));
}

.callout {
  display: flex;
  gap: 12px;
  padding: 15px 16px;
  margin-bottom: 16px;
  color: #e5edf8;
}
.callout.warning { border-color: rgba(245,158,11,.30); background: rgba(245,158,11,.08); }
.callout.danger { border-color: rgba(251,113,133,.30); background: rgba(251,113,133,.08); }
.callout.info { border-color: rgba(96,165,250,.30); background: rgba(96,165,250,.08); }
.co-emoji { font-size: 22px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 142px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0%, rgba(255,255,255,.09), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.028));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: auto -30px -40px auto;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: rgba(245, 158, 11, .12);
}

.stat-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 15px;
  background: rgba(255, 255, 255, .07);
  font-size: 21px;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.stat-value {
  margin-top: 5px;
  color: #fff;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
  font-weight: 950;
  letter-spacing: -.04em;
}

.stat-sub {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.accent-sky::after { background: rgba(96,165,250,.14); }
.accent-amber::after { background: rgba(245,158,11,.15); }
.accent-violet::after { background: rgba(167,139,250,.14); }
.accent-emerald::after { background: rgba(52,211,153,.14); }

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 16px;
}

.url-card { padding: 18px; }
.url-box {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.url-text,
.url-preview {
  min-width: 0;
  flex: 1;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, .46);
  color: #eaf1fb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.url-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Mini stats */
.card-pad {
  border: 1px solid var(--border);
}

/* Chart */
.bar-chart {
  height: 250px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 18px 6px 4px;
}
.bar-col {
  flex: 1;
  min-width: 36px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
.bar-value {
  min-height: 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  writing-mode: horizontal-tb;
}
.bar-fill {
  width: 100%;
  max-width: 54px;
  min-height: 5px;
  border-radius: 12px 12px 5px 5px;
  background: linear-gradient(180deg, var(--primary-2), var(--primary-dark));
  box-shadow: 0 10px 24px rgba(245, 158, 11, .15);
}
.bar-fill.empty {
  background: rgba(148, 163, 184, .18);
  box-shadow: none;
}
.bar-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

/* =======================
   Participantes
   ======================= */
.new-player-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 16px;
  margin-bottom: 16px;
}

.section {
  margin-bottom: 16px;
  padding: 18px;
}

.count-pill {
  min-width: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(245, 158, 11, .13);
  color: var(--primary-2);
  border: 1px solid rgba(245, 158, 11, .20);
  font-size: 12px;
  font-weight: 950;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.list-scroll {
  max-height: 560px;
  overflow-y: auto;
  padding-right: 2px;
}

.list-scroll::-webkit-scrollbar,
.scroll-table::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.list-scroll::-webkit-scrollbar-thumb,
.scroll-table::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,.24);
  border-radius: 999px;
}

.player-card {
  position: relative;
  padding: 14px;
  border-radius: 18px;
  background: rgba(2, 6, 23, .31);
  border: 1px solid var(--border);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.player-card:hover {
  transform: translateY(-1px);
  border-color: rgba(251, 191, 36, .24);
  background: rgba(2, 6, 23, .40);
}

.player-card.is-playing {
  border-color: rgba(245, 158, 11, .42);
  box-shadow: 0 0 0 1px rgba(245,158,11,.10), 0 18px 40px rgba(245,158,11,.09);
}

.player-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-name {
  color: #fff;
  font-size: 15px;
  font-weight: 950;
}
.player-phone {
  color: var(--muted);
  font-size: 13px;
  margin-top: 1px;
}
.player-pos {
  padding: 5px 8px;
  border-radius: 10px;
  background: rgba(245,158,11,.13);
  color: var(--primary-2);
  font-size: 12px;
  font-weight: 950;
}
.player-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}
.player-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* Badges de estado */
.status-badge,
.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.s-waiting { color: #cbd5e1; background: rgba(148,163,184,.13); border: 1px solid rgba(148,163,184,.18); }
.s-activated { color: #fde68a; background: rgba(245,158,11,.13); border: 1px solid rgba(245,158,11,.22); }
.s-playing { color: #bfdbfe; background: rgba(96,165,250,.13); border: 1px solid rgba(96,165,250,.22); }
.s-played { color: #ddd6fe; background: rgba(167,139,250,.13); border: 1px solid rgba(167,139,250,.22); }
.s-claimed { color: #86efac; background: rgba(52,211,153,.13); border: 1px solid rgba(52,211,153,.22); }
.s-disabled { color: #fca5a5; background: rgba(251,113,133,.12); border: 1px solid rgba(251,113,133,.20); }

.r-win,
.r-jackpot { color: #86efac; background: rgba(52,211,153,.13); border: 1px solid rgba(52,211,153,.22); }
.r-retry { color: #bfdbfe; background: rgba(96,165,250,.13); border: 1px solid rgba(96,165,250,.22); }
.r-lose { color: #cbd5e1; background: rgba(148,163,184,.13); border: 1px solid rgba(148,163,184,.18); }
.r-lose_all { color: #fecdd3; background: rgba(251,113,133,.13); border: 1px solid rgba(251,113,133,.22); }

/* =======================
   Sorteos y premios
   ======================= */
.raffle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.raffle-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: rgba(17, 24, 39, .92);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.raffle-stripe {
  height: 6px;
  width: 100%;
}

.raffle-body { padding: 17px; }
.raffle-name {
  color: #fff;
  font-size: 18px;
  font-weight: 950;
}
.raffle-desc {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.raffle-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 15px 0;
}
.raffle-stat {
  padding: 11px;
  border-radius: 15px;
  background: rgba(2,6,23,.36);
  border: 1px solid var(--border);
}
.rs-num {
  display: block;
  color: #fff;
  font-weight: 950;
  font-size: 15px;
}
.rs-lbl {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}
.raffle-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
}

/* Toggle */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
  user-select: none;
}
.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle-track {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  position: relative;
  background: rgba(148,163,184,.25);
  border: 1px solid var(--border);
  transition: background .18s ease;
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  transition: transform .18s ease;
}
.toggle input:checked + .toggle-track {
  background: rgba(52,211,153,.38);
}
.toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
}

.prize-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.prize-row {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(2,6,23,.32);
}
.prize-row-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.prize-emoji-swatch {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  border-radius: 15px;
  font-size: 22px;
  border: 1px solid rgba(255,255,255,.08);
}
.prize-info { flex: 1; min-width: 0; }
.prize-label-text {
  color: #fff;
  font-weight: 950;
}
.prize-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.prize-actions {
  display: flex;
  gap: 7px;
}
.prize-weight-row {
  display: grid;
  grid-template-columns: auto minmax(130px, 1fr) 40px auto;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
}
.range-value {
  min-width: 40px;
  padding: 5px 8px;
  text-align: center;
  border-radius: 10px;
  background: rgba(245,158,11,.12);
  color: var(--primary-2);
  font-weight: 950;
}
.prize-pct {
  color: var(--muted);
  font-size: 12px;
}
.prize-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.17);
}
.ps-item { color: var(--muted); font-size: 13px; }
.ps-num { color: #fff; font-weight: 950; }

/* =======================
   Configuración
   ======================= */
.config-card {
  margin-bottom: 16px;
}
.config-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.flow-steps {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.flow-step {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(2,6,23,.28);
}
.flow-num {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  border-radius: 999px;
  background: var(--primary-2);
  color: #111827;
  font-weight: 950;
  font-size: 12px;
}
.flow-text {
  color: #e5edf8;
  font-size: 14px;
}

/* =======================
   Ingresos / tablas
   ======================= */
.scroll-table {
  overflow-x: auto;
  padding: 4px;
}
.scroll-table table,
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.scroll-table th,
.scroll-table td,
th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.scroll-table th,
th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 950;
}
.scroll-table tr:hover td,
tr:hover td {
  background: rgba(255,255,255,.035);
}

/* =======================
   Collapse / simulador
   ======================= */
.collapse {
  margin-top: 16px;
  overflow: hidden;
}
.collapse-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  padding: 2px 0;
}
.collapse-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.collapse-arrow {
  color: var(--muted);
  transition: transform .18s ease;
}
.collapse-body {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.collapse.open .collapse-body { display: block; }
.collapse.open .collapse-arrow { transform: rotate(180deg); }

/* =======================
   Modal
   ======================= */
.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 23, .78);
  backdrop-filter: blur(7px);
}
.dialog {
  width: min(620px, 100%);
  max-height: min(86vh, 820px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(30, 41, 59, .98), rgba(15, 23, 42, .98));
  box-shadow: 0 28px 90px rgba(0,0,0,.42);
}
.dialog.lg { width: min(940px, 100%); }
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--border);
}
.dialog-title {
  color: #fff;
  font-size: 18px;
  font-weight: 950;
}
.dialog-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}
.dialog-body {
  padding: 18px;
  overflow-y: auto;
}
.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 18px;
  border-top: 1px solid var(--border);
}

/* =======================
   Skeleton / extras
   ======================= */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,.07);
  border-radius: 16px;
}
.skeleton-block {
  height: 120px;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.10), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 24px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: rgba(8, 11, 19, .52);
}
.footer-muted {
  color: var(--muted);
  font-size: 12px;
}
.footer code {
  color: var(--primary-2);
  background: rgba(245,158,11,.10);
  border: 1px solid rgba(245,158,11,.18);
  padding: 3px 7px;
  border-radius: 8px;
}

/* =======================
   Responsive
   ======================= */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
  .new-player-form { grid-template-columns: 1fr 1fr; }
  .new-player-form .btn { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .vendor-layout { display: block; }
  .sidebar {
    position: fixed;
    left: -310px;
    top: 0;
    height: 100vh;
    width: 286px;
    transform: none;
  }
  .sidebar.open { left: 0; }
  .hamburger,
  .icon-btn.hamburger { display: grid; }
  .topbar {
    min-height: 68px;
    padding: 12px 14px;
  }
  .topbar-sub,
  .topbar-greeting,
  .topbar-status,
  .topbar .badge {
    display: none;
  }
  .whatsapp-recover-btn {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
  }
  .whatsapp-recover-label { display: none; }
  .whatsapp-recovery-status {
    position: fixed;
    top: 76px;
    right: 14px;
  }
  .topbar-name { font-size: 15px; }
  .topbar-emoji { display: none; }
  .balance-chip,
  .balance-card {
    min-width: auto;
    padding: 8px 10px;
  }
  .balance-label { font-size: 9px; }
  .balance-amount { font-size: 14px; }
  .content { padding: 14px; }
  .stat-grid { grid-template-columns: 1fr; }
  .new-player-form {
    grid-template-columns: 1fr;
    padding: 14px;
  }
  .form-row { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .raffle-grid { grid-template-columns: 1fr; }
  .player-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .player-head > div[style*="flex"] {
    min-width: 170px;
  }
  .url-box {
    flex-direction: column;
    align-items: stretch;
  }
  .url-actions .btn { flex: 1; }
  .dialog-overlay { padding: 10px; }
  .dialog { max-height: 92vh; border-radius: 20px; }
  .footer {
    padding: 14px;
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 460px) {
  .stat-card { min-height: 126px; padding: 15px; }
  .stat-value { font-size: 25px; }
  .section,
  .card,
  .url-card,
  .config-card,
  .collapse {
    padding: 14px;
    border-radius: 20px;
  }
  .prize-weight-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .raffle-stats { grid-template-columns: 1fr; }
  .bar-chart { overflow-x: auto; }
  .bar-col { min-width: 52px; }
}


/* =========================================================
   FIX acordeón simulador WhatsApp
   Evita que parezca cerrado por el refresco automático
   y mejora el área táctil del botón.
   ========================================================= */
.whatsapp-sim-collapse {
  margin-bottom: 1.25rem;
}

.whatsapp-sim-collapse .collapse-head,
.collapse-head {
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.whatsapp-sim-collapse .collapse-head:hover {
  background: rgba(255,255,255,.035);
  border-radius: 14px;
}

.whatsapp-sim-collapse .collapse-body {
  display: none;
}

.whatsapp-sim-collapse.open .collapse-body {
  display: block;
}

.whatsapp-sim-collapse.open .collapse-arrow {
  transform: rotate(180deg);
}

.whatsapp-sim-collapse .form-actions {
  justify-content: flex-start;
}

.whatsapp-sim-collapse .btn {
  min-height: 42px;
}


/* =========================================================
   FIX DEFINITIVO: Simulador WhatsApp siempre abierto
   ========================================================= */
.collapse.whatsapp-sim-collapse,
.collapse.always-open {
  overflow: visible !important;
}

.whatsapp-sim-collapse .collapse-head,
.collapse .collapse-head {
  cursor: default !important;
}

.whatsapp-sim-collapse .collapse-arrow,
.collapse.always-open .collapse-arrow {
  display: none !important;
}

.whatsapp-sim-collapse .collapse-body,
.collapse.always-open .collapse-body,
.collapse .collapse-body {
  display: block !important;
  max-height: none !important;
  height: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  overflow: visible !important;
}

.whatsapp-sim-collapse .collapse-note {
  margin-left: auto;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
}

.whatsapp-sim-form {
  align-items: flex-end;
}

.whatsapp-sim-actions {
  justify-content: flex-start;
  margin-top: .85rem;
}

.whatsapp-sim-actions .btn {
  min-height: 44px;
  padding-inline: 1.15rem;
}

@media (max-width: 768px) {
  .whatsapp-sim-collapse .collapse-note {
    display: none;
  }
}


/* =========================================================
   Botón copiar número en tarjetas de participantes
   ========================================================= */
.phone-copy-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
}

.phone-copy-text {
  color: inherit;
}

.copy-phone-btn {
  border: 1px solid rgba(245, 158, 11, .35);
  background: rgba(245, 158, 11, .12);
  color: var(--primary-2);
  border-radius: 999px;
  padding: .18rem .55rem;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.copy-phone-btn:hover {
  transform: translateY(-1px);
  background: rgba(245, 158, 11, .22);
  border-color: rgba(245, 158, 11, .65);
}

.copy-phone-btn:active {
  transform: translateY(0);
}

@media (max-width: 640px) {
  .phone-copy-row {
    gap: .4rem;
  }

  .copy-phone-btn {
    padding: .2rem .5rem;
    font-size: .65rem;
  }
}


/* ============================================================
   SorpresaBox · Panel Publicidad / Banners mejorado
   Vista ilustrada TV + móvil, edición y eliminación.
   ============================================================ */
.banner-top-intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  position: relative;
}
.banner-top-intro::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -80px;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(245,158,11,.22), transparent 64%);
  pointer-events: none;
}
.banner-intro-copy { min-width: 0; position: relative; z-index: 1; }
.banner-intro-mini {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.banner-intro-mini span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 11px;
  border-radius: 999px;
  color: #fde68a;
  font-weight: 950;
  background: rgba(245,158,11,.10);
  border: 1px solid rgba(245,158,11,.22);
}
.banner-manager-card {
  margin-top: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 0%, rgba(245,158,11,.12), transparent 34%),
    radial-gradient(circle at 90% 12%, rgba(56,189,248,.10), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.028)),
    rgba(17,24,39,.94);
}
.banner-manager-hero {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 4px 0 14px;
}
.banner-hero-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 26px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.15), rgba(255,255,255,.04)),
    rgba(245,158,11,.16);
  border: 1px solid rgba(245,158,11,.24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 16px 34px rgba(0,0,0,.22);
}
.banner-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(360px, .97fr);
  gap: 18px;
  align-items: stretch;
}
.banner-editor-form,
.banner-preview-panel {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 22px;
  background: rgba(2,6,23,.25);
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.banner-form-head,
.banner-preview-head,
.banner-list-head,
.banner-saved-top,
.banner-device-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.banner-form-head small,
.banner-preview-head small,
.banner-list-head small,
.banner-floating-copy small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.banner-compact-row { grid-template-columns: 1.2fr 1.4fr .7fr .7fr; }
.banner-active-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #cbd5e1;
  font-weight: 900;
}
.banner-actions { align-items: center; }
.banner-preview-devices,
.banner-saved-mockups {
  display: grid;
  grid-template-columns: 1.45fr .85fr;
  gap: 12px;
  margin-top: 14px;
}
.banner-saved-mockups {
  grid-template-columns: 1fr .62fr;
  max-width: 640px;
}
.banner-device {
  min-width: 0;
}
.banner-device-top {
  margin-bottom: 8px;
  color: #e5e7eb;
  font-size: 12px;
  font-weight: 900;
}
.banner-device-top b { font-size: 12px; }
.banner-device-screen {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  background:
    radial-gradient(circle at 38% 20%, rgba(148,163,184,.20), transparent 28%),
    linear-gradient(145deg, #111827, #020617);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    inset 0 -18px 34px rgba(0,0,0,.34),
    0 18px 42px rgba(0,0,0,.28);
}
.banner-device-tv .banner-device-screen { aspect-ratio: 16 / 9; }
.banner-device-phone .banner-device-screen { aspect-ratio: 9 / 16; max-height: 330px; }
.banner-device-grid {
  position: absolute;
  inset: 8px;
  opacity: .18;
  border-radius: 14px;
  background-image:
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 22px 22px;
}
.banner-floating-demo {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: min(72%, 300px);
  min-height: 70px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border-radius: 18px;
  background: rgba(15,23,42,.86);
  border: 1px solid rgba(245,158,11,.35);
  box-shadow: 0 18px 44px rgba(0,0,0,.45), 0 0 26px rgba(245,158,11,.15);
  backdrop-filter: blur(10px);
}
.banner-device-phone .banner-floating-demo {
  width: calc(100% - 18px);
  left: 9px;
  right: 9px;
  bottom: 9px;
  flex-direction: column;
  align-items: stretch;
}
.banner-media-fill {
  width: 94px;
  height: 62px;
  object-fit: cover;
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.13);
  background: #020617;
}
.banner-device-phone .banner-media-fill {
  width: 100%;
  height: 94px;
}
.banner-media-empty {
  display: grid;
  place-items: center;
  color: #fcd34d;
  background:
    radial-gradient(circle at 50% 25%, rgba(255,255,255,.16), transparent 34%),
    linear-gradient(145deg, rgba(245,158,11,.16), rgba(15,23,42,.96));
}
.banner-media-empty span { font-size: 26px; line-height: 1; }
.banner-media-empty small { color: #fde68a; font-size: 10px; font-weight: 900; }
.banner-floating-copy { min-width: 0; flex: 1; }
.banner-floating-copy b {
  display: block;
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.banner-device-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 12px;
  color: #fecdd3;
  font-size: 12px;
  font-weight: 950;
  background: rgba(2,6,23,.76);
  backdrop-filter: blur(3px);
}
.banner-device-disabled { filter: grayscale(.45); opacity: .70; }
.banner-preview-rules,
.banner-rule-strip,
.banner-saved-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.banner-preview-rules span,
.banner-rule-strip span {
  display: inline-flex;
  align-items: center;
  padding: 7px 9px;
  border-radius: 999px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 850;
  background: rgba(148,163,184,.10);
  border: 1px solid rgba(148,163,184,.16);
}
.banner-rule-strip {
  margin: 16px 0 4px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(245,158,11,.07);
  border: 1px solid rgba(245,158,11,.14);
}
.banner-list-head {
  margin: 18px 0 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: #fff;
}

/* =========================================================
   BANNER CARD RESPONSIVE - MEJORADO
   ========================================================= */
.banner-saved-card {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  margin-top: 12px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.10);
  background:
    linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018)),
    rgba(2,6,23,.28);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.banner-saved-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, .30);
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  background: rgba(2,6,23,.40);
}

.banner-saved-preview {
  height: 108px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  background: #020617;
  flex-shrink: 0;
}

.banner-saved-preview .banner-media-fill {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  object-fit: cover;
}

.banner-saved-main {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.banner-saved-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.banner-saved-title {
  color: #fff;
  font-size: 17px;
  font-weight: 950;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}

.banner-saved-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.banner-saved-url {
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.banner-saved-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.banner-saved-badges .status-badge {
  font-size: 10px;
  padding: 3px 8px;
}

/* Badges de banners */
.banner-saved-badges .status-badge.s-claimed {
  background: rgba(52, 211, 153, 0.15);
  border-color: rgba(52, 211, 153, 0.30);
  color: #86efac;
}

.banner-saved-badges .status-badge.s-disabled {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.25);
  color: #fca5a5;
}

.banner-saved-badges .status-badge.s-playing {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.25);
  color: #bfdbfe;
}

.banner-saved-badges .status-badge.s-waiting {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.20);
  color: #cbd5e1;
}

.banner-saved-badges .status-badge.s-played {
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.25);
  color: #ddd6fe;
}

.banner-saved-badges .status-badge.s-activated {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.25);
  color: #fde68a;
}

.banner-saved-mockups {
  display: grid;
  grid-template-columns: 1fr 0.62fr;
  gap: 12px;
  max-width: 640px;
  margin-top: 8px;
}

/* Editor grid responsive */
.banner-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(360px, .97fr);
  gap: 18px;
  align-items: stretch;
}

.banner-compact-row {
  grid-template-columns: 1.2fr 1.4fr .7fr .7fr;
}

/* =========================================================
   RESPONSIVE - TABLET Y MÓVIL
   ========================================================= */

@media (max-width: 1024px) {
  .banner-editor-grid {
    grid-template-columns: 1fr;
  }
  .banner-preview-panel {
    order: 2;
  }
  .banner-compact-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  /* Banner card en móvil - se apila verticalmente */
  .banner-saved-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }
  
  .banner-saved-preview {
    height: 160px;
    width: 100%;
  }
  
  .banner-saved-top {
    flex-direction: column;
    align-items: stretch;
  }
  
  .banner-saved-actions {
    justify-content: flex-start;
    margin-top: 4px;
  }
  
  .banner-saved-actions .btn {
    flex: 1;
    text-align: center;
    font-size: 12px;
    padding: 6px 10px;
    min-height: 34px;
  }
  
  .banner-saved-mockups {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  .banner-saved-url {
    white-space: normal;
    word-break: break-all;
    font-size: 11px;
  }
  
  /* Editor formulario móvil */
  .banner-editor-form,
  .banner-preview-panel {
    padding: 12px;
    border-radius: 18px;
  }
  
  .banner-compact-row {
    grid-template-columns: 1fr;
  }
  
  .banner-preview-devices {
    grid-template-columns: 1fr;
  }
  
  /* Preview devices en móvil */
  .banner-device-phone .banner-device-screen {
    max-height: none;
    aspect-ratio: 9 / 16;
  }
  
  .banner-device-tv .banner-device-screen {
    aspect-ratio: 16 / 9;
  }
  
  .banner-floating-demo {
    width: calc(100% - 18px);
    left: 9px;
    right: 9px;
    bottom: 9px;
  }
  
  .banner-device-phone .banner-floating-demo {
    flex-direction: column;
    align-items: stretch;
  }
  
  .banner-device-phone .banner-media-fill {
    width: 100%;
    height: 94px;
  }
  
  .banner-actions {
    flex-wrap: wrap;
  }
  
  .banner-actions .btn {
    flex: 1;
    min-width: 80px;
    justify-content: center;
  }
  
  .banner-active-check {
    width: 100%;
    justify-content: center;
    padding: 4px 0;
  }
  
  /* Top intro móvil */
  .banner-top-intro {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .banner-intro-mini {
    width: 100%;
    justify-content: flex-start;
  }
  
  .banner-intro-mini span {
    font-size: 12px;
    padding: 6px 10px;
  }
  
  .banner-rule-strip {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }
  
  .banner-rule-strip span {
    font-size: 10px;
    padding: 4px 8px;
  }
}

@media (max-width: 480px) {
  .banner-saved-card {
    padding: 10px;
    gap: 10px;
  }
  
  .banner-saved-preview {
    height: 130px;
  }
  
  .banner-saved-mockups {
    grid-template-columns: 1fr;
  }
  
  .banner-saved-title {
    font-size: 15px;
  }
  
  .banner-saved-actions .btn {
    font-size: 11px;
    padding: 5px 8px;
    min-height: 30px;
  }
  
  .banner-saved-badges .status-badge {
    font-size: 9px;
    padding: 2px 6px;
  }
  
  .banner-hero-icon {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }
  
  .banner-manager-hero .config-title {
    font-size: 16px;
  }
  
  .banner-manager-hero .config-sub {
    font-size: 12px;
  }
  
  .banner-form-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .banner-form-head small {
    font-size: 10px;
  }
  
  .banner-preview-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  
  .banner-preview-head .status-badge {
    align-self: flex-start;
  }
  
  .banner-rule-strip span {
    font-size: 9px;
    padding: 3px 6px;
  }
}

/* =========================================================
   ANIMACIONES PARA BANNERS
   ========================================================= */
.banner-floating-demo {
  transition: transform 0.3s ease;
}

.banner-device:hover .banner-floating-demo {
  transform: scale(1.02);
}

/* Scroll horizontal para muchos banners en móvil */
@media (max-width: 768px) {
  .banner-saved-card {
    scroll-snap-align: start;
  }
}


/* Soporte visual panel: YouTube banners */
.banner-type-youtube,
.vb-type-youtube,
[data-banner-type="YOUTUBE"] {
  border-color: rgba(239, 68, 68, .35) !important;
  background: rgba(239, 68, 68, .10) !important;
  color: #fecaca !important;
}

/* Bolsa de premios */
.prize-row-off { opacity: .55; filter: grayscale(.25); }
.check-line { display:flex; align-items:center; gap:.5rem; padding:.35rem 0; font-size:.9rem; color:var(--muted); }
.check-line input { width:16px; height:16px; }


/* =========================================================
   Registro de participante en ventana popup
   ========================================================= */
.participant-launch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid rgba(251, 191, 36, .26);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(245, 158, 11, .16), transparent 32%),
    rgba(17, 24, 39, .92);
  box-shadow: 0 16px 38px rgba(0,0,0,.18);
}

.participant-launch-info {
  min-width: 0;
}

.participant-launch-title {
  color: #fff;
  font-size: 17px;
  font-weight: 950;
  letter-spacing: -.02em;
}

.participant-launch-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.participant-open-btn {
  min-width: 235px;
  min-height: 48px;
  justify-content: center;
  font-weight: 950;
  white-space: nowrap;
}

.participant-modal-form {
  display: grid;
  gap: 15px;
}

.participant-modal-note {
  padding: 12px 14px;
  border: 1px solid rgba(96, 165, 250, .18);
  border-radius: 16px;
  background: rgba(96, 165, 250, .08);
  color: var(--muted);
  line-height: 1.35;
}

.participant-modal-note strong {
  color: #fff;
}

.participant-modal-input {
  min-height: 52px;
  font-size: 16px;
  font-weight: 800;
}

.phone-fixed-57 {
  letter-spacing: .02em;
}

.phone-prefix-help {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 768px) {
  .participant-launch-card {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }
  .participant-open-btn {
    width: 100%;
    min-width: 0;
    min-height: 52px;
  }
  .dialog-foot {
    flex-direction: column-reverse;
  }
  .dialog-foot .btn {
    width: 100%;
    min-height: 48px;
  }
}

/* =========================================================
   Número de respaldo para clientes sin WhatsApp
   ========================================================= */
.service-banner-with-backup {
  align-items: stretch;
}
.backup-phone-panel {
  width: min(420px, 38vw);
  flex: 0 0 min(420px, 38vw);
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(245, 158, 11, .25);
  background: rgba(2, 6, 23, .35);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.backup-phone-title {
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: -.01em;
}
.backup-phone-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.backup-phone-input {
  min-width: 0;
  height: 38px;
  font-size: 13px;
  font-weight: 850;
}
.backup-phone-save-btn {
  min-height: 38px;
  white-space: nowrap;
}
.backup-phone-help {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.participant-backup-action {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.participant-backup-btn {
  min-height: 34px;
  padding-inline: 12px;
}
.participant-backup-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

@media (max-width: 1180px) {
  .service-banner-with-backup {
    flex-wrap: wrap;
  }
  .backup-phone-panel {
    width: 100%;
    flex: 1 1 100%;
  }
}

@media (max-width: 460px) {
  .backup-phone-row {
    flex-direction: column;
    align-items: stretch;
  }
  .backup-phone-save-btn {
    width: 100%;
  }
}

/* Modo manual de casillas */
.game-mode-select { font-weight: 700; }
.game-mode-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 0.35rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(148,163,184,0.12);
  color: #dbeafe;
}
.game-mode-badge.manual {
  background: rgba(245,158,11,0.14);
  border-color: rgba(245,158,11,0.38);
  color: #fde68a;
}
.game-mode-badge.auto {
  background: rgba(59,130,246,0.12);
  border-color: rgba(59,130,246,0.32);
  color: #bfdbfe;
}
.manual-waiting-note {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-radius: 0.75rem;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.28);
  color: #fde68a;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
}


/* Selector de modo de juego por botones */
.game-mode-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
.game-mode-choice {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(15,23,42,0.82);
  color: var(--text);
  border-radius: 0.9rem;
  padding: 0.72rem 0.8rem;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  text-align: left;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.game-mode-choice:hover {
  transform: translateY(-1px);
  border-color: rgba(245,158,11,0.34);
  box-shadow: 0 10px 24px rgba(0,0,0,0.20);
}
.game-mode-choice.active {
  background: linear-gradient(135deg, rgba(245,158,11,0.22), rgba(251,191,36,0.10));
  border-color: rgba(245,158,11,0.78);
  box-shadow: 0 0 0 2px rgba(245,158,11,0.14), 0 14px 30px rgba(245,158,11,0.10);
}
.game-mode-choice-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.72rem;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.08);
  font-size: 1.05rem;
  flex: 0 0 auto;
}
.game-mode-choice.active .game-mode-choice-icon {
  background: rgba(245,158,11,0.22);
}
.game-mode-choice-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}
.game-mode-choice-copy strong {
  font-size: 0.88rem;
  font-weight: 950;
  line-height: 1.05;
}
.game-mode-choice-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.1;
}
.game-mode-choice.active .game-mode-choice-copy small {
  color: #fde68a;
}
@media (max-width: 520px) {
  .game-mode-buttons { grid-template-columns: 1fr; }
}


/* =========================================================
   NUEVO: Cuadrícula de Premios (Prizes Grid)
   ========================================================= */
.prizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 15px;
    margin-bottom: 20px;
}

.prize-card {
    background: rgba(2,6,23,.32);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    transition: transform .16s ease, border-color .16s ease;
}

.prize-card:hover {
    border-color: rgba(245, 158, 11, .24);
}

.prize-card-off {
    opacity: 0.55;
    filter: grayscale(80%);
}

.prize-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.prize-number {
    background: rgba(245, 158, 11, .13);
    color: var(--primary-2);
    border: 1px solid rgba(245, 158, 11, .20);
    font-weight: 950;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
}

.prize-actions {
    display: flex;
    gap: 7px;
}

.prize-info {
    flex-grow: 1;
    margin-bottom: 15px;
}

.prize-title {
    font-weight: 950;
    font-size: 15px;
    color: #fff;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}

.prize-type {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

.prize-details {
    font-size: 11px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.03);
    padding: 8px;
    border-radius: 10px;
    line-height: 1.4;
}

.prize-weight-container {
    margin-top: auto;
}

.prize-weight-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.prize-weight-input {
    width: 38px;
    background: rgba(2, 6, 23, .46);
    border: 1px solid var(--border);
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 4px;
    font-size: 12px;
    font-weight: 800;
}

.prize-weight-percentage {
    font-size: 11px;
    color: var(--muted);
    text-align: right;
}

/* =========================================================
   FIX: Botones de edición/eliminación de banners en móvil
   ========================================================= */
@media (max-width: 480px) {
  .banner-saved-actions .btn {
    font-size: 10px;
    padding: 4px 6px;
    min-height: 28px;
  }
  
  .banner-saved-actions .btn-sm {
    min-height: 28px;
    padding: 4px 6px;
    font-size: 10px;
  }
}