/* Sellito — estilo "app": tarjetas blancas redondeadas, un solo color de acento
   (el del negocio), números grandes y barra flotante. Usa las variables de loop-theme.js. */

/* ---------- Piezas compartidas ---------- */
.sl-hero-dot {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: .1;
  pointer-events: none;
}
.sl-hero-dot-a { width: 180px; height: 180px; right: -50px; top: -70px; }
.sl-hero-dot-b { width: 110px; height: 110px; right: 110px; top: -55px; opacity: .07; }

.sl-card {
  background: var(--loop-surface, #ffffff);
  border-radius: 28px;
  box-shadow: 0 8px 24px rgba(26, 35, 64, .07);
  padding: 18px 20px;
}

/* ---------- Tarjeta del cliente ---------- */
.loop-client { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
.loop-client .loop-client-shell { max-width: 460px; }
.view { scroll-margin-top: 72px; }
/* Con una tarjeta real, la clienta ve solo su tarjeta (sin el menú de Sellito). */
body.sl-card-mode:has(#cliente.active) .topbar { display: none; }

.sl-topbar { justify-content: center; }
.sl-topbar .loop-biz-logo { width: 40px; height: 40px; flex-basis: 40px; border-radius: 50%; }
.sl-topbar .loop-biz-text { align-items: flex-start; }

.sl-client-grid, .sl-client-main, .sl-client-side { display: flex; flex-direction: column; gap: 18px; }

.loop-pass.sl-hero {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  padding: 22px 22px 18px;
  color: var(--loop-card-ink);
}
.sl-hero > :not(.sl-hero-dot) { position: relative; }
.sl-hello {
  margin: 4px 0 0;
  font: 500 27px/1.1 var(--loop-font);
  letter-spacing: -.02em;
  color: inherit;
  overflow-wrap: anywhere;
}
.sl-hero .sl-card-name { font-size: 14px; font-weight: 500; color: var(--loop-card-muted); }
.sl-hero .loop-pass-count { font-size: 46px; font-weight: 700; letter-spacing: -.04em; }
.sl-hero .loop-pass-count small { font-size: 18px; font-weight: 500; }

.sl-next { display: flex; flex-direction: column; gap: 14px; }
.sl-next .loop-reward { border: 0; padding: 0; background: none; box-shadow: none; }
.sl-next .loop-reward.ready .loop-reward-text small { color: var(--loop-accent); font-weight: 600; }
.sl-next .loop-reward-text strong { font-size: 18px; }
.sl-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--loop-line);
  overflow: hidden;
}
.sl-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--loop-accent);
  transition: width .6s ease;
}
.sl-next-note { margin: 0; font-size: 14px; line-height: 1.45; color: var(--loop-muted); }
.loop-client .loop-btn { border-radius: 999px; }
.loop-client .card-app-note { margin: 0; }

.sl-section-title { margin: 6px 4px -4px; font: 600 18px/1.2 var(--loop-font); letter-spacing: -.02em; }
.sl-section-title[hidden] { display: none; }
.loop-client .loop-earned .loop-reward {
  background: var(--loop-surface);
  border: 0;
  border-radius: 24px;
  padding: 16px 18px;
  box-shadow: 0 8px 24px rgba(26, 35, 64, .07), 0 0 0 2px var(--loop-accent);
}
.loop-tiers-note.sl-card { margin: 0; font-size: 14px; }
.loop-referral.sl-card { border: 0; border-radius: 28px; }

/* Barra flotante (solo celular) */
.sl-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 30;
  width: calc(100% - 32px);
  max-width: 440px;
  margin: 0 auto;
  height: 70px;
  padding: 6px;
  box-sizing: border-box;
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 10px 30px rgba(26, 35, 64, .16);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 2px;
}
.sl-tabbar button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  color: var(--loop-ink);
  font: 500 12px/1 var(--loop-font);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  min-height: 56px;
}
.sl-tabbar button[hidden] { display: none; }
.sl-tabbar button.active { background: var(--loop-accent-soft); color: var(--loop-accent); font-weight: 600; }
.sl-tabbar button:focus-visible { outline: 3px solid var(--loop-accent); outline-offset: -3px; }
.sl-tab-icon { display: inline-grid; width: 22px; height: 22px; }
.sl-tab-icon svg { width: 22px; height: 22px; }

@media (min-width: 900px) {
  .loop-client { padding-bottom: 56px; }
  .loop-client .loop-client-shell { max-width: 1080px; gap: 26px; }
  .sl-topbar { justify-content: flex-start; }
  .sl-client-grid { flex-direction: row; align-items: flex-start; gap: 24px; }
  .sl-client-main { flex: 1.45 1 0; min-width: 0; gap: 24px; }
  .sl-client-side { flex: 1 1 0; min-width: 0; }
  .loop-pass.sl-hero { padding: 32px 36px 24px; border-radius: 32px; gap: 26px; }
  .sl-hello { font-size: 34px; }
  .sl-hero .loop-pass-count { font-size: 56px; }
  .sl-hero .loop-stamps { grid-template-columns: repeat(var(--stamp-cols, 5), minmax(0, 1fr)); gap: 12px; }
  .sl-next { padding: 24px 28px; }
  .sl-next .loop-actions { flex-direction: row; }
  .sl-next .loop-actions .loop-btn { flex: 1; }
  .sl-tabbar { display: none; }
}

/* ---------- Panel de la dueña ---------- */
#admin .admin-shell { max-width: 1360px; }
.sl-admin { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.sl-admin-main { flex: 999 1 640px; min-width: 0; }

.sl-side {
  flex: 1 1 220px;
  max-width: 250px;
  min-width: 0;
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 8px 24px rgba(26, 35, 64, .07);
  padding: 16px 12px;
  box-sizing: border-box;
}
.sl-side-biz {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid #e9ecf3;
}
.sl-side-biz span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sl-side-biz strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-side-biz small { font-size: 12px; color: #55607a; }
.sl-side-initials {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--loop-card, #1a2340);
  color: var(--loop-card-ink, #ffffff);
  font-weight: 700;
}
.sl-side-nav { display: flex; flex-direction: column; gap: 2px; }
.sl-side-nav button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 12px 14px;
  border-radius: 999px;
  font: 500 15px/1.2 "Geist", system-ui, sans-serif;
  color: #1a2340;
  cursor: pointer;
}
.sl-side-nav button:hover { background: #f6f7fb; }
.sl-side-nav button.active {
  background: var(--loop-accent-soft, #fbe7df);
  color: var(--loop-accent, #d63e1f);
  font-weight: 600;
}
.sl-side-nav button[hidden] { display: none; }
.sl-side-nav button:focus-visible { outline: 3px solid var(--loop-accent, #d63e1f); outline-offset: 1px; }

#admin .admin-head { gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
#admin .admin-head h1 { font-size: clamp(30px, 3.4vw, 42px); }
#admin .admin-head-actions { display: flex; flex-wrap: wrap; gap: 10px; }
#admin .button { border-radius: 999px; }
#admin .admin-head .button:not([hidden]) { display: inline-flex; align-items: center; }
.sl-pill-accent { background: var(--loop-accent, #d63e1f); color: var(--loop-accent-ink, #ffffff); }
.sl-pill-light { background: #ffffff; color: #1a2340; box-shadow: 0 6px 18px rgba(26, 35, 64, .08); }

.sl-week {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  background: var(--loop-card, #1a2340);
  color: var(--loop-card-ink, #ffffff);
  padding: 28px 32px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  box-shadow: var(--loop-shadow, 0 14px 34px rgba(26, 35, 64, .2));
}
.sl-week[hidden] { display: none; }
.sl-week > :not(.sl-hero-dot) { position: relative; }
.sl-week span { font-size: 15px; font-weight: 500; color: var(--loop-card-muted, rgba(255,255,255,.74)); }
.sl-week-main strong { display: block; margin: 6px 0; font: 700 58px/1 "Geist", system-ui, sans-serif; letter-spacing: -.04em; }
.sl-week-side { display: flex; gap: 36px; }
.sl-week-side strong { display: block; margin-top: 4px; font: 700 32px/1 "Geist", system-ui, sans-serif; }

#admin .metrics article {
  background: #ffffff;
  border: 0;
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(26, 35, 64, .07);
}
#admin .metrics small { font-size: 12px; letter-spacing: .04em; color: #55607a; }
#admin .metrics strong { font-size: 34px; letter-spacing: -.03em; }
#admin .metrics span { color: #55607a; }

#admin .panel {
  border: 0;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(26, 35, 64, .07);
  scroll-margin-top: 96px;
}
#admin .status { background: var(--loop-accent-soft, #fbe7df); color: var(--loop-accent, #d63e1f); }
#admin .admin-grid { gap: 18px; }
#report-panel { order: -3; grid-column: 1 / -1; }
#inactive-panel { order: -2; }
#cafe-branding-panel { grid-column: 1 / -1; }
#admin .bar-stamps { background: var(--loop-accent, #d63e1f); }

@media (min-width: 1100px) {
  .sl-side { position: sticky; top: 96px; }
}
@media (max-width: 1279px) {
  #admin .admin-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1099px) {
  .sl-side { max-width: none; flex-basis: 100%; padding: 8px; border-radius: 999px; }
  .sl-side-biz { display: none; }
  .sl-side-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .sl-side-nav::-webkit-scrollbar { display: none; }
  .sl-side-nav button { white-space: nowrap; flex: none; }
}
@media (max-width: 560px) {
  .sl-week { padding: 22px; border-radius: 28px; }
  .sl-week-main strong { font-size: 48px; }
}
@media (max-width: 560px) {
  #admin .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  #admin .metrics article { padding: 16px; }
  #admin .metrics strong { font-size: 28px; margin: 8px 0 4px; }
}
#admin .button-orange { background: var(--loop-accent, #d63e1f); color: var(--loop-accent-ink, #ffffff); }

/* =====================================================================
   Armonía en toda la app: botones en píldora, tarjetas blancas
   redondeadas sin borde y el coral de Sellito como acento por defecto.
   ===================================================================== */
.button, .nav-link, .nav-primary { border-radius: 999px; }
.button-orange { background: var(--loop-accent, #d63e1f); color: var(--loop-accent-ink, #ffffff); }
input, select, textarea { border-radius: 14px; }
.panel, .metrics article, .staff-login-card, .platform-cafe-card {
  border: 0;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(26, 35, 64, .07);
}
.auth-card { border: 0; border-radius: 32px; background: #ffffff; box-shadow: 0 12px 36px rgba(26, 35, 64, .08); }
.status { background: var(--loop-accent-soft, #fbe7df); color: var(--loop-accent, #d63e1f); }

/* "← Volver" como botón redondo blanco, igual que en la app */
.back, .loop-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #ffffff;
  color: #1a2340;
  box-shadow: 0 6px 18px rgba(26, 35, 64, .08);
  font-weight: 500;
}
.loop-back[hidden], .back[hidden] { display: none; }

/* Portal del personal */
#personal .app-shell.narrow { max-width: 560px; }
#personal .app-shell > h1 { font-size: clamp(34px, 6vw, 48px); }
#personal .panel { padding: 24px; }
#personal .client-result {
  border-top: 0;
  margin-top: 18px;
  padding: 16px;
  border-radius: 22px;
  background: #f6f7fb;
}
#personal .avatar { background: var(--loop-accent-soft, #fbe7df); color: var(--loop-accent, #d63e1f); }
#personal .share-card { border: 0; border-radius: 22px; background: #f6f7fb; }
.staff-login-card { padding: 28px; }
.staff-lock { background: var(--loop-accent-soft, #fbe7df) !important; color: var(--loop-accent, #d63e1f) !important; border-radius: 50% !important; }

/* Centro de Control */
#superadmin .platform-shell { max-width: 1360px; }
#superadmin .sl-side-brand { background: #ff5b3a; color: #ffffff; }
.platform-hero {
  position: relative;
  overflow: hidden;
  margin: 0 0 18px;
  padding: 30px 34px;
  border-radius: 32px;
  background: #1a2340;
  color: #ffffff;
  align-items: flex-end;
  flex-wrap: wrap;
}
.platform-hero > :not(.sl-hero-dot) { position: relative; }
.platform-hero .sl-hero-dot { color: #ff5b3a; opacity: .5; }
.platform-hero .sl-hero-dot-b { opacity: .3; }
.platform-hero h1 { font-size: clamp(34px, 4vw, 48px) !important; margin: 0 0 8px !important; color: #ffffff; }
.platform-hero .eyebrow { color: #f3b8a5; }
.platform-hero .muted { color: #c3c9d9; }
.platform-hero .button-light { background: #ffffff; color: #1a2340; border-color: #ffffff; }
#superadmin .metrics strong { font-size: 34px; }
#superadmin .metrics small { color: #55607a; letter-spacing: .04em; }
.platform-cafe-card { background: #f4f6fa; box-shadow: none; border-radius: 22px; }
#superadmin .panel { scroll-margin-top: 96px; }
#platform-billing-grid { scroll-margin-top: 96px; }
.platform-hero .button { display: inline-flex !important; }

/* =====================================================================
   Marca nueva: navy #1A2340 · naranja #FF5B3A · dorado #F4B63F (solo premios)
   · blanco frío #F6F7FB. Cada tarjeta lleva el color de su negocio de fondo.
   ===================================================================== */
:root { --sl-navy: #1a2340; --sl-coral: #ff5b3a; --sl-gold: #f4b63f; --sl-gold-soft: #fff3d6; }

/* Fondo teñido del color del negocio, con círculos suaves */
.loop-client, #unirme {
  background:
    radial-gradient(circle at 104% -4%, var(--loop-page-2, #eef0f5) 0 170px, transparent 171px),
    radial-gradient(circle at -12% 46%, var(--loop-page-2, #eef0f5) 0 100px, transparent 101px),
    var(--loop-page, #f6f7fb);
}

/* Barra flotante navy con la pestaña activa en blanco */
.sl-tabbar {
  background: rgba(26, 35, 64, .94);
  border-color: rgba(26, 35, 64, .94);
  box-shadow: 0 12px 30px rgba(26, 35, 64, .32);
}
.sl-tabbar button { color: #ffffff; }
.sl-tabbar button.active { background: #ffffff; color: var(--sl-navy); }
.sl-tabbar button:focus-visible { outline-color: var(--sl-gold); }

/* Botón principal de la tarjeta en navy */
.sl-next .loop-btn-primary, #show-qr { background: var(--sl-navy); color: #ffffff; }

/* Dorado = premio */
.sl-next .loop-reward.ready .loop-reward-icon,
.loop-client .loop-earned .loop-reward-icon { background: var(--sl-gold); color: var(--sl-navy); }
.loop-client .loop-earned .loop-reward { box-shadow: 0 8px 24px rgba(26, 35, 64, .08), 0 0 0 2px var(--sl-gold); }
.sl-next .loop-reward.ready .loop-reward-text small { color: #8a5a00; }
.loop-badge-birthday, .loop-badge.gold, .staff-badge.birthday { background: var(--sl-gold-soft); color: #7a4f00; }
.lp-chip-b { background: var(--sl-gold); color: var(--sl-navy); border-color: var(--sl-gold); }
.lp-chip-b .ui-icon { color: var(--sl-navy); }

/* Centro de Control: navy con naranja y dorado */
.platform-hero { background: var(--sl-navy); }
.platform-hero .sl-hero-dot-a { color: var(--sl-coral); opacity: .9; }
.platform-hero .sl-hero-dot-b { color: var(--sl-gold); opacity: .9; }
.platform-hero .eyebrow { color: #ffb4a3; }
#superadmin .sl-side-brand { background: var(--sl-coral); color: var(--sl-navy); }

/* Botones naranjas con texto navy cuando usan el naranja vivo */
.lp-btn-coral, .lp-cta .lp-btn-primary { background: var(--sl-coral); color: var(--sl-navy); }

/* Ayudante de colores: tu color o tu logo → 3 combinaciones */
.sl-brand-helper {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border-radius: 20px; background: #f4f6fa; margin-bottom: 4px;
}
.sl-brand-title { margin: 0; font-weight: 700; font-size: 15px; color: #1a2340; }
.sl-brand-source { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sl-brand-color, .sl-brand-logo {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; margin: 0; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  background: #ffffff; border: 1px solid #e4e7ef; font-size: 14px; font-weight: 600; color: #1a2340;
}
.sl-brand-color input[type="color"] {
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; flex: none;
}
.sl-brand-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.sl-brand-color input[type="color"]::-webkit-color-swatch { border: 2px solid #ffffff; border-radius: 50%; box-shadow: 0 0 0 1px #e4e7ef; }
.sl-brand-logo { background: #1a2340; border-color: #1a2340; color: #ffffff; }
.sl-brand-logo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.sl-brand-logo:focus-within, .sl-brand-color:focus-within { outline: 3px solid #f4b63f; outline-offset: 2px; }
.sl-brand-status { margin: 0; }
.sl-brand-combos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sl-brand-combos[hidden] { display: none; }
.sl-or { display: block; margin: 8px 0 6px; }
.sl-brand-combos { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
