/* ═══════════════════════════════════════════════════════════════
   Villa Server · Notion-inspired dark mode
   Warm dark neutrals · whisper borders · Notion Blue accent
   Mobile-first · persistent dark theme
   ─────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;

  /* ── Surfaces (warm-biased dark) ── */
  --bg:           #191918;   /* page canvas — warm near-black */
  --bg-raised:    #212020;   /* sections, hero, dividers */
  --bg-card:      #262524;   /* cards, panels */
  --bg-hover:     #2d2b29;   /* interactive hover surface */
  --bg-inverse:   #fafaf9;   /* rare: light surface on dark */

  /* ── Text (warm whites) ── */
  --ink:            rgba(255,255,255,.94);
  --ink-secondary:  #a5a29c;
  --ink-muted:      #78746e;
  --ink-subtle:     #555150;
  --ink-inverse:    #191918;

  /* ── Borders (whispers) ── */
  --border:         rgba(255,255,255,.08);
  --border-strong:  rgba(255,255,255,.16);
  --border-focus:   rgba(90,170,255,.55);

  /* ── Accent — Notion Blue adapted for dark ── */
  --accent:         #4a9eff;
  --accent-hover:   #6bb0ff;
  --accent-active:  #2e7cd6;
  --accent-bg:      rgba(74,158,255,.10);
  --accent-bg-hover:rgba(74,158,255,.16);
  --accent-text:    #7cb8ff;
  --accent-border:  rgba(74,158,255,.28);

  /* ── Semantic accents (desaturated for dark) ── */
  --success-bg:     rgba(87,188,107,.12);
  --success-text:   #6fd18c;
  --success-line:   rgba(87,188,107,.26);
  --success-dot:    #4dbb66;

  --warn-bg:        rgba(230,170,80,.12);
  --warn-text:      #e6bf7a;
  --warn-line:      rgba(230,170,80,.26);

  --error-bg:       rgba(230,90,90,.10);
  --error-text:     #f08080;
  --error-line:     rgba(230,90,90,.28);

  --purple-bg:      rgba(170,130,220,.10);
  --purple-text:    #c5a6e4;
  --purple-line:    rgba(170,130,220,.24);

  --amber-bg:       rgba(210,170,80,.10);
  --amber-text:     #d4b06a;
  --amber-line:     rgba(210,170,80,.26);

  /* ── MercadoPago / PayPal — brand recognition ── */
  --mp-blue:        #00a5dd;
  --mp-ink:         #ffffff;
  --pp-yellow:      #ffc439;
  --pp-ink:         #1a1a1a;

  /* ── Shadows (multi-layer whisper stack for dark) ── */
  --shadow-card:
    rgba(0,0,0,.24) 0 1px 2px,
    rgba(0,0,0,.20) 0 3px 6px,
    rgba(0,0,0,.14) 0 8px 16px;
  --shadow-deep:
    rgba(0,0,0,.30) 0 1px 3px,
    rgba(0,0,0,.25) 0 4px 10px,
    rgba(0,0,0,.20) 0 10px 22px,
    rgba(0,0,0,.15) 0 22px 44px;
  --shadow-spotlight:
    0 0 0 1px var(--accent-border),
    rgba(74,158,255,.08) 0 0 28px -4px,
    rgba(0,0,0,.20) 0 4px 12px;

  /* ── Layout ── */
  --shell:        min(100%, 560px);
  --admin-shell:  min(100%, 1200px);
  --radius-xs:    4px;
  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    16px;
  --radius-pill:  9999px;
}

/* ───────────── reset ───────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--bg); }

body {
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: 'lnum' 1, 'locl' 1, 'cv11' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.24); }

/* ───────────── shell ───────────── */
.app-shell {
  width: var(--shell);
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  padding: 0 14px 104px;
}
.admin-width .app-shell { --shell: var(--admin-shell); }

/* ═════════════ HEADER ═════════════ */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 4px 14px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--border);
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-img {
  width: 32px; height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.logo-img img { image-rendering: pixelated; }
.logo-text {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.015em;
  color: var(--ink);
}
.logo-text span {
  font-size: .66rem;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--ink-muted);
  text-transform: uppercase;
}
.user-badge {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 5px 12px 5px 10px;
  font-size: .82rem;
  color: var(--ink-secondary);
}
.online-dot {
  width: 7px; height: 7px;
  background: var(--success-dot);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(77,187,102,.16);
}
.online-dot.gold {
  background: var(--amber-text);
  box-shadow: 0 0 0 3px rgba(212,176,106,.16);
}

/* ═════════════ HERO ═════════════ */
.hero-banner {
  position: relative;
  margin: 0 0 16px;
  padding: 22px 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.hero-banner::before {
  content: '';
  position: absolute;
  top: -40%; right: -20%;
  width: 80%; height: 150%;
  background: radial-gradient(ellipse at center, var(--accent-bg), transparent 60%);
  pointer-events: none;
  opacity: .85;
}
.hero-top { display: flex; align-items: flex-start; gap: 16px; position: relative; }
.hero-avatar {
  width: 68px; height: 68px; flex-shrink: 0;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.hero-avatar svg, .hero-avatar img { image-rendering: pixelated; }
.hero-avatar svg { width: 56px; height: 56px; }

.hero-info { flex: 1; min-width: 0; }
.hero-info .subtitle {
  font-size: .70rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: var(--ink-muted);
  margin-bottom: 6px;
}
.hero-info h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.025em;
  color: var(--ink);
  margin-bottom: 6px;
  font-feature-settings: 'lnum' 1;
}
.hero-info p {
  font-size: .90rem;
  color: var(--ink-secondary);
  line-height: 1.45;
}

/* hero quick actions — shop shortcut lives here */
.hero-actions {
  position: relative;
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 14px;
}
.hero-action-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 11px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--accent-text);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-pill);
  transition: background .15s, color .15s;
  cursor: pointer;
}
.hero-action-pill:hover { background: var(--accent-bg-hover); color: var(--accent-hover); }
.hero-action-pill svg { width: 13px; height: 13px; fill: currentColor; }

/* rank pills */
.rank-ribbons { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; position: relative; }
.ribbon {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px 3px 8px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .01em;
  border-radius: var(--radius-pill);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--ink-secondary);
}
.ribbon svg { width: 10px; height: 10px; }
.ribbon.vip     { background: var(--amber-bg);  color: var(--amber-text);  border-color: var(--amber-line); }
.ribbon.vip svg { fill: var(--amber-text); }
.ribbon.builder { background: var(--accent-bg); color: var(--accent-text); border-color: var(--accent-border); }
.ribbon.builder svg { fill: var(--accent-text); }
.ribbon.mvp     { background: var(--purple-bg); color: var(--purple-text); border-color: var(--purple-line); }
.ribbon.mvp svg { fill: var(--purple-text); }

/* status pill — top right */
.status-glossy {
  position: absolute; top: 16px; right: 16px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px 4px 9px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--success-text);
  background: var(--success-bg);
  border: 1px solid var(--success-line);
  border-radius: var(--radius-pill);
}
.status-glossy.offline { color: var(--ink-muted); background: var(--bg-raised); border-color: var(--border); }
.status-glossy.pending { color: var(--warn-text); background: var(--warn-bg); border-color: var(--warn-line); }
.status-glossy .sdot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success-dot);
  box-shadow: 0 0 0 3px rgba(77,187,102,.20);
}

/* ═════════════ STATS ═════════════ */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 0 16px;
}
.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 10px 12px;
  text-align: left;
  transition: border-color .15s, background .15s;
}
.stat-box:hover { border-color: var(--border-strong); }
.stat-box .ico {
  width: 26px; height: 26px;
  margin: 0 0 8px;
  border-radius: 7px;
  background: var(--bg-raised);
  display: flex; align-items: center; justify-content: center;
}
.stat-box .ico svg { width: 14px; height: 14px; }
.stat-box .ico.gold  { background: var(--amber-bg); }
.stat-box .ico.gold svg  { fill: var(--amber-text); stroke: var(--amber-text); }
.stat-box .ico.blue  { background: var(--accent-bg); }
.stat-box .ico.blue svg  { fill: var(--accent-text); stroke: var(--accent-text); }
.stat-box .ico.green { background: var(--success-bg); }
.stat-box .ico.green svg { fill: var(--success-text); stroke: var(--success-text); }
.stat-box .ico.red   { background: var(--error-bg); }
.stat-box .ico.red svg   { fill: var(--error-text); stroke: var(--error-text); }

.stat-box span {
  display: block;
  font-size: .70rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-muted);
  margin-bottom: 2px;
  text-transform: none;
}
.stat-box strong {
  display: block;
  font-size: 1.30rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
  font-feature-settings: 'lnum' 1;
}

/* ═════════════ SHOP SPOTLIGHT ═════════════ */
/* Panel that promotes the shop ABOVE the tabs — so users cannot miss it */
.shop-spotlight {
  position: relative;
  margin: 0 0 16px;
  padding: 16px 16px 14px;
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-raised) 100%);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-spotlight);
  transition: opacity .2s ease, transform .2s ease;
}
.spotlight-close {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--ink-muted);
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
  z-index: 2;
}
.spotlight-close:hover {
  color: var(--ink);
  background: var(--bg-hover);
  border-color: var(--border);
}
.spotlight-close svg { width: 12px; height: 12px; }

.spotlight-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
  padding-right: 30px; /* deja espacio para el botón cerrar */
}
.spotlight-head h3 {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.spotlight-head h3 .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.spotlight-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .80rem;
  font-weight: 600;
  color: var(--accent-text);
  cursor: pointer;
  transition: color .15s;
}
.spotlight-link:hover { color: var(--accent-hover); }
.spotlight-link::after { content: '→'; transition: transform .15s; }
.spotlight-link:hover::after { transform: translateX(2px); }

.spotlight-grid { display: grid; gap: 10px; }

.spotlight-item {
  display: flex; align-items: stretch;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.spotlight-item:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.spotlight-item .thumb {
  width: 56px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-raised);
  border-right: 1px solid var(--border);
}
.spotlight-item .thumb svg { width: 26px; height: 26px; }
.spotlight-item .thumb.money svg { fill: var(--amber-text); }
.spotlight-item .thumb.rank  svg { fill: var(--purple-text); }
.spotlight-item .body {
  flex: 1; min-width: 0;
  padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap;
}
.spotlight-item .text { min-width: 0; flex: 1 1 auto; }
.spotlight-item .text strong {
  display: block;
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.005em;
}
.spotlight-item .text .price {
  display: block;
  font-size: .78rem;
  color: var(--ink-muted);
  margin-top: 1px;
  font-feature-settings: 'lnum' 1;
}
/* Botones de pago dentro del spotlight — dos variantes chicas */
.spotlight-pay {
  display: flex; gap: 6px; flex-shrink: 0;
  flex-wrap: wrap; justify-content: flex-end;
}
.spotlight-pay form { display: inline-flex; }

.spotlight-featured-badge {
  display: inline-flex; align-items: center; gap: 4px;
  position: absolute; top: 14px; right: 72px;
  padding: 2px 8px;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent-text);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-pill);
}

/* En pantallas angostas los botones bajan debajo del texto */
@media (max-width: 420px) {
  .spotlight-item .body { align-items: stretch; }
  .spotlight-pay { width: 100%; justify-content: stretch; }
  .spotlight-pay form { flex: 1; }
  .spotlight-pay .pay-btn.small { width: 100%; }
}

/* ═════════════ TAB BAR ═════════════ */
.tab-bar {
  display: flex; gap: 3px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.gtab {
  flex: 1;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 10px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-muted);
  background: transparent;
  border: none; border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, background .15s;
  min-height: 38px;
}
.gtab svg { width: 14px; height: 14px; fill: currentColor; opacity: .85; }
.gtab:hover { color: var(--ink-secondary); background: var(--bg-hover); }
.gtab.active {
  color: var(--ink);
  background: var(--bg-raised);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

/* ═════════════ PANELS ═════════════ */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-head-icon {
  width: 28px; height: 28px;
  background: var(--bg-raised);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
}
.panel-head-icon svg { width: 13px; height: 13px; fill: var(--ink-secondary); stroke: var(--ink-secondary); }
.panel-head .ph-label {
  display: block;
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 1px;
}
.panel-head h2 {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}
.panel.amber-top .panel-head-icon { background: var(--amber-bg); }
.panel.amber-top .panel-head-icon svg { fill: var(--amber-text); stroke: var(--amber-text); }
.panel.green-top .panel-head-icon { background: var(--success-bg); }
.panel.green-top .panel-head-icon svg { fill: var(--success-text); stroke: var(--success-text); }
.panel-body { padding: 14px 16px; }

/* detail rows */
.drow {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: .90rem;
}
.drow:last-child { border: none; }
.drow span {
  display: flex; align-items: center; gap: 6px;
  color: var(--ink-muted);
  font-size: .86rem;
}
.drow span svg { width: 12px; height: 12px; fill: var(--ink-muted); }
.drow strong {
  font-weight: 500;
  color: var(--ink);
  text-align: right;
  font-feature-settings: 'lnum' 1;
}

/* mini items (list rows) */
.mini-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.mini-item:last-child { border: none; }
.mini-item:hover { background: var(--bg-hover); }
.mi-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  background: var(--bg-raised);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.mi-icon svg { width: 16px; height: 16px; fill: var(--ink-secondary); stroke: var(--ink-secondary); }
.mi-body { flex: 1; min-width: 0; }
.mi-top {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin-bottom: 3px;
}
.mi-top strong {
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.005em;
}
.mini-item p {
  color: var(--ink-muted);
  font-size: .82rem;
  margin: 2px 0 0;
  font-feature-settings: 'lnum' 1;
}

/* ═════════════ BADGES ═════════════ */
.gbadge {
  display: inline-flex; align-items: center;
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--ink-secondary);
  letter-spacing: .008em;
}
.gbadge.ok      { background: var(--success-bg); color: var(--success-text); border-color: var(--success-line); }
.gbadge.bad     { background: var(--error-bg);   color: var(--error-text);   border-color: var(--error-line); }
.gbadge.pending { background: var(--warn-bg);    color: var(--warn-text);    border-color: var(--warn-line); }
.gbadge.paid    { background: var(--accent-bg);  color: var(--accent-text);  border-color: var(--accent-border); }
.gbadge.dim     { background: var(--bg-raised);  color: var(--ink-secondary);border-color: var(--border); }
.gbadge.nether  { background: var(--error-bg);   color: var(--error-text);   border-color: var(--error-line); }

/* ═════════════ SECTION DIVIDER ═════════════ */
.section-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0 12px;
}
.section-divider::before, .section-divider::after {
  content: ''; flex: 1; height: 1px;
  background: var(--border);
}
.section-divider span {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: -.005em;
  color: var(--ink);
}
.section-divider span svg { width: 14px; height: 14px; fill: var(--ink-secondary); }

/* ═════════════ SHOP CARDS ═════════════ */
.shop-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color .15s, transform .15s;
}
.shop-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.shop-card.featured {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-spotlight);
}

.featured-ribbon {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  justify-content: center;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-text);
  background: var(--accent-bg);
  border-bottom: 1px solid var(--accent-border);
}
.featured-ribbon::before {
  content: '★';
  font-size: .80rem;
  letter-spacing: 0;
}

.shop-inner { display: flex; align-items: stretch; }
.shop-thumb {
  width: 86px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-raised);
  border-right: 1px solid var(--border);
  position: relative;
}
.shop-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(255,255,255,.03), transparent 70%);
  pointer-events: none;
}
.shop-thumb svg { width: 36px; height: 36px; position: relative; z-index: 1; }
.shop-thumb.money svg { fill: var(--amber-text); }
.shop-thumb.rank  svg { fill: var(--purple-text); }

.shop-details {
  flex: 1; padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap;
}
.shop-details > div:first-child { min-width: 140px; flex: 1; }
.shop-details strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
  margin-bottom: 3px;
}
.shop-details p {
  color: var(--ink-secondary);
  font-size: .84rem;
  line-height: 1.4;
  margin: 0;
}
.shop-right { text-align: right; flex-shrink: 0; }
.price-tag {
  display: block;
  font-size: 1.20rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
  margin-bottom: 8px;
  font-feature-settings: 'lnum' 1;
}

/* ═════════════ PAYMENT BUTTONS ═════════════ */
.payment-methods {
  margin-top: 4px;
  display: flex; gap: 6px; flex-wrap: wrap;
  justify-content: flex-end;
}
.payment-methods form { display: inline-flex; }
.pay-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  min-height: 36px;
}
.pay-btn:hover   { opacity: .92; }
.pay-btn:active  { transform: scale(.96); }
.pay-btn.mp { background: var(--mp-blue); color: var(--mp-ink); }
.pay-btn.pp { background: var(--pp-yellow); color: var(--pp-ink); }
/* Versión compacta para el spotlight */
.pay-btn.small {
  padding: 6px 10px;
  font-size: .72rem;
  min-height: 30px;
  white-space: nowrap;
}

/* ═════════════ BUTTONS ═════════════ */
/* Primary — Notion Blue. Keeps .btn-glossy name for Django template compat. */
.btn-glossy {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px;
  font-size: .90rem;
  font-weight: 600;
  letter-spacing: 0;
  color: #ffffff;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background .15s, transform .1s;
  min-height: 38px;
}
.btn-glossy:hover  { background: var(--accent-hover); }
.btn-glossy:active { background: var(--accent-active); transform: scale(.97); }

.btn-glossy.green {
  background: var(--success-text);
  color: var(--ink-inverse);
}
.btn-glossy.green:hover { background: #7ad898; }
.btn-glossy.block { width: 100%; padding: 12px 18px; font-size: .95rem; }
.btn-glossy.small { padding: 5px 11px; font-size: .78rem; min-height: 30px; }

/* Ghost */
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px;
  font-size: .90rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background .15s, border-color .15s;
  min-height: 38px;
}
.btn-ghost:hover  { background: var(--bg-hover); border-color: var(--border-strong); }
.btn-ghost:active { transform: scale(.97); }

/* ═════════════ DOCK NAV ═════════════ */
.dock-nav {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: var(--shell);
  display: flex; gap: 3px;
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
  background: rgba(25,25,24,.88);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-top: 1px solid var(--border);
  z-index: 50;
}
.dock-link {
  flex: 1;
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px;
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink-muted);
  border-radius: 8px;
  transition: all .15s;
  min-height: 44px;
}
.dock-link svg { width: 18px; height: 18px; fill: currentColor; stroke: currentColor; opacity: .80; }
.dock-link:hover      { color: var(--ink-secondary); background: var(--bg-hover); }
.dock-link:hover svg  { opacity: 1; }
.dock-link.active     { color: var(--accent); background: var(--accent-bg); }
.dock-link.active svg { opacity: 1; }
.dock-link.danger     { color: var(--error-text); }
.dock-link.danger:hover { background: var(--error-bg); }
.dock-link.shop-highlight::after {
  content: '';
  position: absolute; top: 8px; right: calc(50% - 14px);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* ═════════════ GRID ═════════════ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ═════════════ AUTH ═════════════ */
.auth-layout { max-width: 440px; margin: 32px auto; }
.auth-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
}
.auth-panel h1 {
  font-size: 1.60rem;
  font-weight: 700;
  letter-spacing: -.02em;
  text-align: center;
  margin-bottom: 6px;
  color: var(--ink);
}
.auth-panel .sub {
  text-align: center;
  color: var(--ink-secondary);
  font-size: .92rem;
  margin-bottom: 20px;
  line-height: 1.45;
}
.field-group { margin-bottom: 12px; }
.field-group label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-bottom: 6px;
}
.field-group input,
.field-group select,
.field-group textarea {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--ink);
  font-size: .92rem;
  transition: border-color .15s, background .15s;
  min-height: 40px;
}
.field-group input::placeholder { color: var(--ink-muted); }
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-raised);
}
.field-error {
  display: block;
  color: var(--error-text);
  font-size: .78rem;
  margin-top: 5px;
}
.helper-text {
  text-align: center;
  color: var(--ink-secondary);
  font-size: .86rem;
  margin-top: 16px;
}
.helper-text a {
  color: var(--accent-text);
  font-weight: 600;
  transition: color .15s;
}
.helper-text a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ═════════════ TOASTS ═════════════ */
.toast-stack { margin-bottom: 12px; }
.toast-msg {
  padding: 11px 14px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--ink);
  transition: opacity .3s, transform .3s;
}
.toast-msg.success { background: var(--success-bg); color: var(--success-text); border-color: var(--success-line); }
.toast-msg.error   { background: var(--error-bg);   color: var(--error-text);   border-color: var(--error-line); }
.toast-msg.info    { background: var(--accent-bg);  color: var(--accent-text);  border-color: var(--accent-border); }

/* ═════════════ LINK CARD ═════════════ */
.link-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.link-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.015em;
  margin-bottom: 8px;
  color: var(--ink);
}
.link-card p {
  color: var(--ink-secondary);
  font-size: .92rem;
  margin-bottom: 18px;
  line-height: 1.5;
}
.link-card p strong { color: var(--ink); font-weight: 600; }

/* ═════════════ ADMIN TABLE ═════════════ */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.admin-table th {
  text-align: left;
  padding: 11px 14px;
  font-size: .70rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: transparent;
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-secondary);
  font-feature-settings: 'lnum' 1;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-hover); }
.admin-table td strong { color: var(--ink); font-weight: 600; }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.admin-stats .stat-box { padding: 14px; }
.admin-stats .stat-box strong { font-size: 1.4rem; }

/* admin helpers */
.back-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--accent-text);
  font-size: .86rem;
  font-weight: 600;
  transition: color .15s;
}
.back-link:hover { color: var(--accent-hover); }

.page-title {
  font-size: 1.70rem;
  font-weight: 700;
  letter-spacing: -.025em;
  margin-bottom: 16px;
  color: var(--ink);
  font-feature-settings: 'lnum' 1;
}

/* ═════════════ MOBILE REFINEMENTS ═════════════ */
@media (max-width: 540px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-info h1 { font-size: 1.55rem; }
  .hero-banner { padding: 20px 16px 18px; }
  .status-glossy { top: 12px; right: 12px; padding: 3px 9px 3px 7px; font-size: .68rem; }
  .hero-avatar { width: 60px; height: 60px; }
  .hero-avatar svg { width: 48px; height: 48px; }
  .shop-thumb { width: 68px; }
  .shop-thumb svg { width: 30px; height: 30px; }
  .price-tag { font-size: 1.05rem; }
  .page-title { font-size: 1.45rem; }
  .gtab { padding: 8px 9px; font-size: .78rem; }
  .gtab span.tab-label-long { display: none; }
}
@media (max-width: 380px) {
  .stat-box { padding: 12px 9px; }
  .stat-box strong { font-size: 1.15rem; }
  .shop-details { padding: 12px 12px; }
  .spotlight-item .thumb { width: 48px; }
}

/* ═════════════ ANIMATIONS ═════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
.hero-banner    { animation: fadeUp .35s ease both; }
.shop-spotlight { animation: fadeUp .35s ease both; animation-delay: .04s; }
.stat-box       { animation: fadeUp .3s ease both; }
.stat-box:nth-child(1) { animation-delay: .06s; }
.stat-box:nth-child(2) { animation-delay: .10s; }
.stat-box:nth-child(3) { animation-delay: .14s; }
.stat-box:nth-child(4) { animation-delay: .18s; }
.panel          { animation: fadeUp .35s ease both; animation-delay: .10s; }
.shop-card      { animation: slideIn .25s ease both; }
.tab-content.is-active { animation: fadeUp .22s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ═════════════════════════════════════════════
   ANNOUNCEMENT MODAL
   Se muestra una vez por anuncio (localStorage).
   ═════════════════════════════════════════════ */
.announce-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  animation: announceFadeIn .22s ease both;
}
.announce-overlay[hidden] { display: none; }
.announce-overlay.is-closing { animation: announceFadeOut .18s ease both; }

.announce-modal {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-deep);
  animation: announceSlideUp .26s cubic-bezier(.2,.9,.3,1.1) both;
}

.announce-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
  z-index: 2;
}
.announce-close:hover {
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  transform: scale(1.06);
}
.announce-close svg { width: 14px; height: 14px; }

.announce-media {
  width: 100%;
  aspect-ratio: 2 / 1;
  background: var(--bg-raised);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  overflow: hidden;
}
.announce-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.announce-body {
  padding: 24px 24px 22px;
}
.announce-tag {
  display: inline-block;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-text);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
}
.announce-body h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 10px;
}
.announce-body p {
  color: var(--ink-secondary);
  font-size: .94rem;
  line-height: 1.55;
  margin-bottom: 18px;
}
.announce-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 18px;
}
.announce-actions .btn-glossy { flex: 1 1 auto; min-width: 140px; }
.announce-dismiss {
  flex: 1 1 auto; min-width: 110px;
  padding: 10px 18px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.announce-dismiss:hover {
  color: var(--ink);
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

@keyframes announceFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes announceFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes announceSlideUp {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
  .announce-overlay { padding: 12px; align-items: flex-end; }
  .announce-modal { max-height: 90vh; }
  .announce-body { padding: 20px 18px; }
  .announce-body h2 { font-size: 1.2rem; }
}

/* ═════════════════════════════════════════════════════════════
   STORE ANALYTICS — logs dashboard additions
   ═════════════════════════════════════════════════════════════ */

/* Section divider with label */
.section-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 14px;
}
.section-sep span {
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  white-space: nowrap;
}
.section-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Colored top-border variants on stat-box */
.stat-box.top-blue   { border-top: 2px solid var(--accent); }
.stat-box.top-green  { border-top: 2px solid var(--success-dot); }
.stat-box.top-purple { border-top: 2px solid var(--purple-text); }
.stat-box.top-amber  { border-top: 2px solid var(--amber-text); }

/* KPI secondary row (smaller, muted) */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.kpi-mini {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.kpi-mini-icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kpi-mini-icon svg { width: 12px; height: 12px; stroke: var(--ink-secondary); fill: none; }
.kpi-mini span {
  display: block;
  font-size: .64rem;
  color: var(--ink-muted);
  letter-spacing: .04em;
  margin-bottom: 1px;
}
.kpi-mini strong {
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Two-column panel grid */
.panel-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

/* Minecraft item image — pixelated, fixed size */
.mc-img {
  width: 26px;
  height: 26px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-radius: 3px;
  flex-shrink: 0;
  display: block;
}
.mc-img-sm {
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-radius: 2px;
  flex-shrink: 0;
  display: block;
}

/* Top items list inside a panel */
.item-rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.item-rank-row:last-child { border-bottom: none; }
.item-rank-row:hover { background: var(--bg-hover); }

.rank-num {
  font-size: .72rem;
  font-weight: 600;
  color: var(--ink-subtle);
  width: 14px;
  text-align: right;
  flex-shrink: 0;
  font-feature-settings: 'lnum' 1;
}
.rank-num.gold   { color: var(--amber-text); }
.rank-num.silver { color: var(--ink-secondary); }
.rank-num.bronze { color: var(--purple-text); }

.item-rank-info { flex: 1; min-width: 0; }
.item-rank-name {
  font-size: .82rem;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 3px;
}
.item-rank-meta {
  font-size: .68rem;
  color: var(--ink-subtle);
}
.item-rank-bar {
  height: 3px;
  background: var(--border);
  border-radius: 99px;
  margin: 4px 0 2px;
  overflow: hidden;
}
.item-rank-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  opacity: .6;
}
.item-rank-bar-fill.green { background: var(--success-dot); }
.item-rank-total {
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent-text);
  flex-shrink: 0;
  font-feature-settings: 'lnum' 1;
}
.item-rank-total.green { color: var(--success-text); }

/* Player leaderboard inside admin-table */
.admin-table td.medal-cell {
  font-size: .80rem;
  font-weight: 700;
  color: var(--ink-subtle);
  width: 32px;
}
.admin-table td.medal-cell.gold   { color: var(--amber-text); }
.admin-table td.medal-cell.silver { color: var(--ink-secondary); }
.admin-table td.medal-cell.bronze { color: var(--purple-text); }

/* Item cell in log table (image + name) */
.td-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.td-item-name {
  font-size: .82rem;
  color: var(--ink-secondary);
}

/* Panel tabs (compras / ventas switcher) */
.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
}
.panel-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  padding: 10px 13px;
  font-size: .78rem;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: .02em;
  transition: color .15s, border-color .15s;
}
.panel-tab.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.panel-tab:hover:not(.active) { color: var(--ink-secondary); }

/* Tab panels — show/hide via JS */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

@media (max-width: 768px) {
  .panel-grid-2 { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
}
