/* ═══════════════════════════════════════════════════════════════════════
   CARBÓN REWARDS — app.css
   Arquitectura: Mobile-First → Tablet 768px → Desktop 1024px
   
   LAYOUT SYSTEM:
   ┌─────────────────────────────────────────────┐
   │ MOBILE (≤767px)                             │
   │  .app-wrapper (position:fixed, col)         │
   │  ├─ .client-sidebar  → display:none         │
   │  ├─ .client-main     → flex:1, overflow-y   │
   │  │    └─ [contenido scrollable]             │
   │  └─ #bottom-nav-global → fijo al fondo      │
   └─────────────────────────────────────────────┘
   ┌─────────────────────────────────────────────┐
   │ DESKTOP (≥768px)                            │
   │  body → flex row, centrado                  │
   │  .app-wrapper (flex row, 100vh)             │
   │  ├─ .client-sidebar  → 260px, scroll propio │
   │  └─ .client-main     → flex:1, scroll propio│
   │  #bottom-nav-global  → display:none         │
   └─────────────────────────────────────────────┘
═══════════════════════════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --red:        #cc1f1f;
  --red-deep:   #a81515;
  --red-light:  #e53030;
  --red-pale:   #fff5f5;
  --black:      #111111;
  --charcoal:   #2a2a2a;
  --gray-dark:  #444444;
  --gray-mid:   #888888;
  --gray-light: #e0e0e0;
  --gray-bg:    #f5f5f5;
  --white:      #ffffff;
  --gold:       #c9a84c;
  --success:    #1e8c45;
  --error:      #cc1f1f;
  --sidebar-w:  260px;
  --nav-h:      58px;
  --content-max: 1200px;
  --radius:     12px;
  --radius-lg:  18px;
}

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: 'Source Sans 3', sans-serif;
  background: #fff;
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-enter { animation: fadeUp 0.4s cubic-bezier(0.22,1,0.36,1) both; }


/* ═══════════════════════════════════════════════════════════════════════
   MOBILE-FIRST: ≤ 767px
   Layout: columna fija que ocupa todo el viewport
   Nav: barra inferior fija FUERA del scroll
════════════════════════════════════════════════════════════════════════ */

/* Wrapper: columna que ocupa exactamente el viewport visible */
.app-wrapper {
  position: fixed;
  top:    env(safe-area-inset-top,    0px);
  /* bottom NO incluye el nav — el nav va por su cuenta */
  bottom: 0;
  left:  0;
  right: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--white);
  overflow: hidden;
}

/* Sidebar: oculto en mobile */
.client-sidebar { display: none; }

/* Área de contenido: ocupa todo el espacio,
   con padding-bottom para no quedar tapado por el nav */
.client-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  background: var(--white);
  display: block;
  /* Espacio para el nav fijo al fondo */
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}

/* Nav inferior: FIJO al fondo, independiente del flujo flex.
   Funciona igual en browser y PWA iOS/Android sin excepciones. */
#bottom-nav-global,
.bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left:   0 !important;
  right:  0 !important;
  width:  100% !important;
  min-height: var(--nav-h);
  display: flex;
  background: var(--white);
  border-top: 1.5px solid var(--gray-light);
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 200;
}
.bottom-nav a,
.bottom-nav .bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px 6px;
  text-decoration: none;
  color: var(--gray-mid);
  font-size: 9px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-family: 'Oswald', sans-serif;
  font-weight: 400;
  transition: color 0.15s;
  gap: 3px;
  min-width: 48px;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.bottom-nav a.active,
.bottom-nav a:hover,
.bottom-nav .bottom-nav-item.active,
.bottom-nav .bottom-nav-item:hover { color: var(--red); }
.bottom-nav a svg,
.bottom-nav .bottom-nav-item svg {
  width: 22px; height: 22px;
  flex-shrink: 0; margin-bottom: 1px;
}
.bottom-nav span { display: block; line-height: 1; }

/* PWA iOS: solo top con safe-area.
   bottom: 0 siempre — el nav absorbe el safe-area-inset-bottom
   con su propio padding-bottom. El body debe ser blanco
   para que no haya espacio oscuro visible. */
html.pwa-ios .app-wrapper,
html.pwa-standalone .app-wrapper {
  top:    env(safe-area-inset-top, 0px);
  bottom: 0;
  left:   0;
  right:  0;
}

/* ── rw-wrap y pm-wrap (recompensas / promociones) siguen el mismo patrón ── */
.rw-wrap,
.pm-wrap {
  position: fixed;
  top:    env(safe-area-inset-top, 0px);
  bottom: 0;
  left:   0;
  right:  0;
  width:  100%;
  display: flex;
  flex-direction: column;
  background: var(--white);
  overflow: hidden;
}
.rw-main,
.pm-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.rw-scroll,
.pm-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  /* Espacio para el nav fijo al fondo */
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}

/* rw-bottom-nav y pm-bottom-nav */
.rw-bottom-nav {
  flex-shrink: 0; flex-grow: 0;
  min-height: var(--nav-h);
  display: flex;
  background: #fff;
  border-top: 1.5px solid var(--gray-light);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  position: relative; z-index: 100;
}
.rw-bottom-nav a {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 8px 2px 6px; text-decoration: none; color: #aaa;
  font-size: 9px; letter-spacing: .3px; text-transform: uppercase;
  font-family: 'Oswald', sans-serif; font-weight: 400;
  transition: color .2s; gap: 3px;
  min-width: 48px; -webkit-tap-highlight-color: transparent;
}
.rw-bottom-nav a svg { width: 20px; height: 20px; flex-shrink: 0; }
.rw-bottom-nav a.active, .rw-bottom-nav a:hover { color: #cc1f1f; }

/* ── Pantalla pequeña ── */
@media (max-width: 380px) {
  .home-headline { font-size: 24px; }
  .home-hero     { padding: 40px 20px 28px; }
  .form-body     { padding: 22px 16px 40px; }
  .admin-content { padding: 16px 12px 40px; }
  .metric-num    { font-size: 26px; }
  .metric-grid   { gap: 8px; }
  .metric-card   { padding: 12px; }
  .bottom-nav a,
  .bottom-nav .bottom-nav-item { font-size: 8px; padding: 8px 1px 5px; }
  .bottom-nav a svg,
  .bottom-nav .bottom-nav-item svg { width: 18px; height: 18px; }
  .bottom-nav,
  #bottom-nav-global { min-height: 52px; }
}


/* ═══════════════════════════════════════════════════════════════════════
   DESKTOP: ≥ 768px
   Layout: sidebar fijo izquierdo + main scrollable
   Nav inferior: oculto (la sidebar reemplaza la navegación)
════════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {

  html, body {
    height: 100%;
    overflow: hidden;
  }

  body {
    background: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: stretch;
  }

  /* Wrapper: fila horizontal, ocupa la ventana */
  .app-wrapper {
    /* Resetear el position:fixed del mobile */
    position: relative !important;
    top: auto !important; bottom: auto !important;
    left: auto !important; right: auto !important;
    transform: none !important;
    /* Layout desktop */
    width: 90%;
    max-width: 1280px;
    height: 100vh;
    flex-direction: row;
    align-items: stretch;
    overflow: hidden;
    box-shadow: 0 0 80px rgba(0,0,0,0.6);
    flex-shrink: 0;
  }

  /* Nav inferior: oculto en desktop */
  .bottom-nav,
  #bottom-nav-global,
  .rw-bottom-nav { display: none !important; }

  /* En desktop, el client-main no necesita padding del nav */
  .client-main { padding-bottom: 0 !important; }
  .rw-scroll, .pm-scroll { padding-bottom: 0 !important; }

  /* ── Sidebar ── */
  .client-sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    height: 100%;
    background: var(--black);
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.06);
    overflow-y: auto;
    overflow-x: hidden;
  }
  .client-sidebar-logo {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; gap: 10px;
    flex-shrink: 0;
  }
  .client-sidebar-logo img { height: 32px; object-fit: contain; }
  .client-sidebar-logo-txt {
    font-family: 'Oswald', sans-serif; font-size: 13px; font-weight: 700;
    color: var(--white); letter-spacing: 1.5px; text-transform: uppercase; line-height: 1.2;
  }
  .client-sidebar-logo-txt span {
    display: block; font-size: 9px; color: var(--gold);
    letter-spacing: 2px; font-weight: 400;
  }
  .client-sidebar-user {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; gap: 10px;
    flex-shrink: 0;
  }
  .client-sidebar-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--red);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Oswald', sans-serif; font-size: 16px; font-weight: 700; color: var(--white);
    flex-shrink: 0; border: 2px solid rgba(255,255,255,0.1);
  }
  .client-sidebar-name {
    font-family: 'Oswald', sans-serif; font-size: 13px; font-weight: 600;
    color: var(--white); text-transform: uppercase; letter-spacing: 0.5px; line-height: 1.2;
  }
  .client-sidebar-pts { font-size: 11px; color: var(--gold); margin-top: 1px; }
  .client-sidebar-puntos {
    background: rgba(204,31,31,0.15); border: 1px solid rgba(204,31,31,0.25);
    border-radius: 10px; padding: 10px 14px; text-align: center; flex-shrink: 0;
  }
  .client-sidebar-puntos-num {
    font-family: 'Oswald', sans-serif; font-size: 26px; font-weight: 700;
    color: var(--white); line-height: 1;
  }
  .client-sidebar-puntos-label {
    font-size: 9px; letter-spacing: 2px; text-transform: uppercase;
    color: rgba(255,255,255,0.4); margin-top: 2px;
  }
  .client-sidebar-nav {
    flex: 1; padding: 10px 0;
    display: flex; flex-direction: column; gap: 1px;
    overflow-y: auto;
  }
  .client-sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px; text-decoration: none;
    color: rgba(255,255,255,0.5);
    font-family: 'Oswald', sans-serif; font-size: 13px; font-weight: 600;
    letter-spacing: 1px; text-transform: uppercase; transition: all 0.2s;
    border-left: 3px solid transparent;
    border-radius: 0 8px 8px 0; margin-right: 10px; flex-shrink: 0;
  }
  .client-sidebar-nav a svg { width: 16px; height: 16px; stroke: currentColor; flex-shrink: 0; }
  .client-sidebar-nav a:hover {
    color: var(--white); background: rgba(255,255,255,0.06);
    border-left-color: rgba(255,255,255,0.3);
  }
  .client-sidebar-nav a.active {
    color: var(--white); background: rgba(204,31,31,0.2);
    border-left-color: var(--red);
  }
  .client-sidebar-bottom {
    padding: 12px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
  }
  .client-sidebar-bottom a {
    display: flex; align-items: center; gap: 8px;
    color: rgba(255,255,255,0.3);
    font-family: 'Source Sans 3', sans-serif;
    font-size: 12px; text-decoration: none; transition: color 0.2s;
  }
  .client-sidebar-bottom a:hover { color: var(--red); }
  .client-sidebar-bottom a svg { width: 14px; height: 14px; }

  /* ── Main ── */
  .client-main {
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: var(--gray-bg);
    display: block; /* reset del flex-column mobile */
    padding-bottom: 0 !important;
  }

  /* rw-wrap y pm-wrap en desktop: resetear el fixed del mobile */
  .rw-wrap,
  .pm-wrap {
    position: relative !important;
    top: auto !important; bottom: auto !important;
    left: auto !important; right: auto !important;
    flex-direction: row;
    height: 100%;
    max-width: 100%;
    overflow: hidden;
  }
  .rw-main,
  .pm-main {
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow: hidden;
  }
  .rw-scroll,
  .pm-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: var(--gray-bg);
  }

  /* Ocultar elementos solo-mobile */
  .screen-header { display: none !important; }
  .perfil-hero   { display: none !important; }
  .puntos-widget { display: none !important; }
  .qr-widget     { display: none; }

  /* Contenido desktop */
  .perfil-body {
    padding: 28px 36px 48px !important;
    max-width: 100%; flex: 1;
  }

  /* Grids */
  .desktop-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
  .desktop-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; align-items: start; }
  .desktop-col-full { grid-column: 1 / -1; }
  .card { border-radius: 12px; padding: 16px; margin-bottom: 10px; }
  .card-title { font-size: 14px; }

  /* Páginas simples (términos, privacidad) */
  body.page-simple .app-wrapper {
    position: relative !important;
    width: 460px !important; max-width: 460px !important;
    flex-direction: column !important;
    height: auto !important; overflow: visible !important;
  }
  body.page-simple { overflow: auto !important; }

  /* Admin */
  body.page-admin {
    background: var(--gray-bg) !important;
    display: block !important;
    overflow: auto !important;
  }
  body.page-admin .app-wrapper {
    position: relative !important;
    width: 100% !important; max-width: 100% !important;
    box-shadow: none !important; flex-direction: column !important;
    height: auto !important; overflow: visible !important;
  }
}


/* ═══════════════════════════════════════════════════════════════════════
   BOTONES
════════════════════════════════════════════════════════════════════════ */
.btn-home-primary {
  width: 100%; height: 54px; background: var(--white); border: none;
  border-radius: 10px; color: var(--red);
  font-family: 'Oswald', sans-serif; font-size: 17px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer;
  transition: all 0.2s; box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  display: flex; align-items: center; justify-content: center; text-decoration: none;
}
.btn-home-primary:hover { background: var(--black); color: var(--white); transform: translateY(-2px); }
.btn-home-outline {
  width: 100%; height: 54px; background: transparent;
  border: 2px solid rgba(255,255,255,0.6); border-radius: 10px;
  color: var(--white); font-family: 'Oswald', sans-serif;
  font-size: 17px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; text-decoration: none;
}
.btn-home-outline:hover { background: rgba(255,255,255,0.12); transform: translateY(-2px); }
.btn-primary {
  width: 100%; height: 52px; background: var(--red); border: none;
  border-radius: 10px; color: var(--white);
  font-family: 'Oswald', sans-serif; font-size: 17px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.2s; box-shadow: 0 4px 16px rgba(204,31,31,0.28);
  margin-top: 8px; text-decoration: none;
}
.btn-primary:hover  { background: var(--red-light); transform: translateY(-2px); }
.btn-primary:active { background: var(--red-deep); transform: translateY(0); }
.btn-outline-black {
  width: 100%; height: 52px; background: transparent;
  border: 2px solid var(--black); border-radius: 10px; color: var(--black);
  font-family: 'Oswald', sans-serif; font-size: 17px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer;
  transition: all 0.2s; margin-top: 6px;
  display: flex; align-items: center; justify-content: center; text-decoration: none;
}
.btn-outline-black:hover { background: var(--black); color: var(--white); transform: translateY(-2px); }
.btn-secondary {
  height: 44px; padding: 0 20px;
  background: var(--gray-bg); border: 1.5px solid var(--gray-light);
  border-radius: 8px; color: var(--charcoal);
  font-family: 'Source Sans 3', sans-serif; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-secondary:hover { border-color: var(--red); color: var(--red); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 7px; }

/* ═══════════════════════════════════════════════════════════════════════
   HOME
════════════════════════════════════════════════════════════════════════ */
.home-hero {
  width: 100%; background: var(--white);
  padding: 52px 32px 32px;
  display: flex; flex-direction: column; align-items: center;
  border-bottom: 3px solid var(--red);
}
.hero-logo    { width: min(280px, 82%); object-fit: contain; }
.hero-tagline {
  font-family: 'Oswald', sans-serif; font-size: 11px; font-weight: 400;
  letter-spacing: 3.5px; text-transform: uppercase;
  color: var(--gray-mid); margin-top: 14px;
}
.home-body {
  width: 100%; background: var(--red);
  padding: 40px 28px 52px;
  display: flex; flex-direction: column; align-items: center; flex: 1;
}
.home-body::before {
  content: ''; display: block;
  width: calc(100% + 56px); height: 32px;
  background: var(--white); clip-path: polygon(0 0, 100% 0, 100% 100%);
  margin: -40px -28px 28px; position: relative;
}
.home-headline {
  font-family: 'Oswald', sans-serif; font-size: 30px; font-weight: 700;
  color: var(--white); text-align: center; line-height: 1.15;
  margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px;
}
.home-desc {
  font-size: 14px; color: rgba(255,255,255,0.75);
  text-align: center; line-height: 1.7; margin-bottom: 36px; max-width: 300px;
}
.home-actions { width: 100%; display: flex; flex-direction: column; gap: 12px; }

/* ═══════════════════════════════════════════════════════════════════════
   HEADER PANTALLAS INTERNAS
════════════════════════════════════════════════════════════════════════ */
.screen-header {
  width: 100%; background: var(--white);
  padding: 18px 20px 16px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--gray-light);
  position: sticky; top: 0; z-index: 50;
}
.header-logo-sm { height: 34px; object-fit: contain; }
.header-title {
  font-family: 'Oswald', sans-serif; font-size: 19px; font-weight: 700;
  color: var(--black); letter-spacing: 1px; text-transform: uppercase; flex: 1;
}
.header-back {
  background: none; border: none; color: var(--gray-dark); cursor: pointer;
  display: flex; align-items: center; padding: 4px;
  border-radius: 6px; transition: color 0.2s; text-decoration: none;
}
.header-back:hover { color: var(--red); }
.progress-bar  { width: 100%; height: 4px; background: var(--gray-light); }
.progress-fill { height: 100%; background: var(--red); transition: width 0.4s ease; }

/* ═══════════════════════════════════════════════════════════════════════
   FORMULARIOS
════════════════════════════════════════════════════════════════════════ */
.form-body { width: 100%; padding: 28px 24px 48px; }
.form-section-title {
  font-family: 'Oswald', sans-serif; font-size: 12px; font-weight: 600;
  letter-spacing: 2.5px; text-transform: uppercase; color: var(--red);
  margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
}
.form-section-title::after { content: ''; flex: 1; height: 1px; background: var(--gray-light); }
.field-group { display: flex; flex-direction: column; gap: 14px; margin-bottom: 26px; }
.field       { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--charcoal); }
.field-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-wrap  { position: relative; }
.input-icon  {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--gray-mid); display: flex; align-items: center;
  pointer-events: none; transition: color 0.2s;
}
.field input, .field select, .field textarea {
  width: 100%; height: 48px;
  background: var(--gray-bg); border: 1.5px solid var(--gray-light);
  border-radius: 9px; color: var(--black);
  font-family: 'Source Sans 3', sans-serif; font-size: 14px;
  padding: 0 14px 0 42px; transition: all 0.2s; outline: none;
  -webkit-appearance: none; appearance: none;
}
.field textarea { height: auto; padding: 12px 14px 12px 42px; resize: vertical; min-height: 80px; }
.field input::placeholder, .field textarea::placeholder { color: var(--gray-mid); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--red); background: var(--white); box-shadow: 0 0 0 3px rgba(204,31,31,0.07);
}
.input-wrap:focus-within .input-icon { color: var(--red); }
.field input.no-icon, .field select.no-icon { padding-left: 14px; }
.location-btn {
  width: 100%; height: 48px; background: var(--gray-bg);
  border: 1.5px dashed var(--gray-light); border-radius: 9px;
  color: var(--charcoal); font-family: 'Source Sans 3', sans-serif;
  font-size: 14px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 9px; transition: all 0.25s;
}
.location-btn:hover    { border-color: var(--red); color: var(--red); background: var(--red-pale); }
.location-btn.captured { border-style: solid; border-color: var(--success); color: var(--success); background: #f0faf4; }
.field-error { font-size: 11px; color: var(--error); display: none; }
.field.has-error input, .field.has-error select { border-color: var(--error); background: #fff5f5; }
.field.has-error .field-error { display: block; }

/* ═══════════════════════════════════════════════════════════════════════
   ALERTAS / BADGES / CARDS
════════════════════════════════════════════════════════════════════════ */
.alert-error   { background: #fff5f5; border-left: 4px solid var(--red); border-radius: 8px; padding: 12px 16px; font-size: 13px; color: var(--red); margin-bottom: 18px; line-height: 1.5; }
.alert-success { background: #f0faf4; border-left: 4px solid var(--success); border-radius: 8px; padding: 12px 16px; font-size: 13px; color: var(--success); margin-bottom: 18px; line-height: 1.5; }
.alert-info    { background: #f0f7ff; border-left: 4px solid #2980b9; border-radius: 8px; padding: 12px 16px; font-size: 13px; color: #2980b9; margin-bottom: 18px; line-height: 1.5; }
.divider      { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.divider-line { flex: 1; height: 1px; background: var(--gray-light); }
.divider-text { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--gray-mid); }
.back-link { text-align: center; margin-top: 18px; font-size: 13px; color: var(--gray-dark); }
.back-link a, .back-link button {
  color: var(--red); font-family: 'Source Sans 3', sans-serif;
  font-size: 13px; font-weight: 600; cursor: pointer;
  text-decoration: underline; background: none; border: none; transition: color 0.2s;
}
.back-link a:hover, .back-link button:hover { color: var(--red-deep); }
.card          { background: var(--white); border: 1.5px solid var(--gray-light); border-radius: 14px; padding: 18px; margin-bottom: 14px; }
.card-title    { font-family: 'Oswald', sans-serif; font-size: 16px; font-weight: 600; color: var(--black); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.card-subtitle { font-size: 13px; color: var(--gray-dark); line-height: 1.5; }
.card-meta     { font-size: 11px; color: var(--gray-mid); margin-top: 8px; }
.badge-puntos  { display: inline-flex; align-items: center; gap: 4px; background: var(--red-pale); color: var(--red); border-radius: 20px; padding: 4px 10px; font-size: 12px; font-weight: 600; font-family: 'Oswald', sans-serif; letter-spacing: 0.5px; }
.badge         { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
.badge-success { background: #e8f8ef; color: var(--success); }
.badge-warning { background: #fff8e6; color: #d4820a; }
.badge-error   { background: var(--red-pale); color: var(--red); }
.badge-gray    { background: var(--gray-bg); color: var(--gray-mid); }
.section-title { font-family: 'Oswald', sans-serif; font-size: 18px; font-weight: 700; color: var(--black); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }

/* ═══════════════════════════════════════════════════════════════════════
   ÉXITO / PERFIL
════════════════════════════════════════════════════════════════════════ */
.success-hero {
  width: 100%; background: var(--red); padding: 52px 28px 44px;
  display: flex; flex-direction: column; align-items: center; position: relative;
}
.success-hero::after {
  content: ''; position: absolute; bottom: -1px; left: 0; right: 0;
  height: 36px; background: var(--white); clip-path: polygon(0 100%, 100% 0, 100% 100%);
}
.success-check { width: 72px; height: 72px; border-radius: 50%; background: var(--white); display: flex; align-items: center; justify-content: center; margin-bottom: 20px; box-shadow: 0 0 0 8px rgba(255,255,255,0.2); }
.success-title { font-family: 'Oswald', sans-serif; font-size: 32px; font-weight: 700; color: var(--white); text-transform: uppercase; letter-spacing: 1px; }
.success-sub   { font-size: 13px; color: rgba(255,255,255,0.65); margin-top: 6px; letter-spacing: 1.5px; text-transform: uppercase; }
.success-body  { width: 100%; padding: 36px 24px 52px; display: flex; flex-direction: column; align-items: center; }
.points-card         { width: 100%; border: 2px solid var(--black); border-radius: 14px; overflow: hidden; margin-bottom: 28px; }
.points-card-top     { background: var(--black); padding: 20px; text-align: center; }
.points-num          { font-family: 'Oswald', sans-serif; font-size: 56px; font-weight: 700; color: var(--white); line-height: 1; }
.points-label        { font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--red); margin-top: 4px; }
.points-card-bottom  { background: var(--white); padding: 14px 20px; text-align: center; border-top: 1px solid var(--gray-light); }
.points-desc         { font-size: 13px; color: var(--gray-dark); line-height: 1.6; }
.perfil-hero {
  width: 100%; background: var(--black); padding: 32px 24px 28px;
  display: flex; flex-direction: column; align-items: center; position: relative;
}
.perfil-hero::after {
  content: ''; position: absolute; bottom: -1px; left: 0; right: 0;
  height: 28px; background: var(--white); clip-path: polygon(0 100%, 100% 0, 100% 100%);
}
.perfil-avatar {
  width: 64px; height: 64px; border-radius: 50%; background: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Oswald', sans-serif; font-size: 26px; font-weight: 700; color: var(--white);
  margin-bottom: 12px; border: 3px solid rgba(255,255,255,0.15);
}
.perfil-nombre { font-family: 'Oswald', sans-serif; font-size: 22px; font-weight: 700; color: var(--white); text-transform: uppercase; }
.perfil-correo { font-size: 12px; color: rgba(255,255,255,0.45); margin-top: 2px; }
.perfil-body   { width: 100%; padding: 28px 20px 24px; }
.puntos-widget {
  background: var(--red); border-radius: 16px; padding: 22px;
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px;
}
.puntos-widget-num   { font-family: 'Oswald', sans-serif; font-size: 48px; font-weight: 700; color: var(--white); line-height: 1; }
.puntos-widget-label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,0.65); margin-top: 4px; }
.qr-widget     { background: var(--white); border: 2px solid var(--gray-light); border-radius: 16px; padding: 20px; text-align: center; margin-bottom: 24px; }
.qr-widget img { width: 180px; height: 180px; border: 3px solid var(--black); border-radius: 8px; padding: 6px; }
.qr-label      { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--gray-mid); margin-top: 10px; }

/* ═══════════════════════════════════════════════════════════════════════
   ADMIN
════════════════════════════════════════════════════════════════════════ */
.admin-layout { width: 100%; min-height: 100vh; display: flex; flex-direction: column; background: var(--gray-bg); }
.admin-topbar {
  width: 100%; background: var(--black); padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 200;
}
.admin-topbar-logo  { height: 30px; object-fit: contain; filter: brightness(0) invert(1); }
.admin-topbar-title { font-family: 'Oswald', sans-serif; font-size: 16px; font-weight: 700; color: var(--white); letter-spacing: 1px; text-transform: uppercase; }
.admin-topbar-right { display: flex; align-items: center; gap: 12px; }
.admin-user-badge   { font-size: 12px; color: rgba(255,255,255,0.6); }
.admin-logout       { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: 6px; color: var(--white); font-size: 12px; padding: 6px 12px; cursor: pointer; text-decoration: none; transition: background 0.2s; }
.admin-logout:hover { background: rgba(255,255,255,0.2); }
.admin-nav-mobile {
  width: 100%; background: var(--white); border-bottom: 2px solid var(--gray-light);
  display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.admin-nav-mobile::-webkit-scrollbar { display: none; }
.admin-nav-mobile a {
  flex-shrink: 0; padding: 14px 18px;
  font-family: 'Oswald', sans-serif; font-size: 13px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase; color: var(--gray-mid);
  text-decoration: none; border-bottom: 3px solid transparent;
  margin-bottom: -2px; transition: all 0.2s; white-space: nowrap;
}
.admin-nav-mobile a:hover,
.admin-nav-mobile a.active { color: var(--red); border-bottom-color: var(--red); }
.admin-sidebar { display: none; }
.admin-content,
.admin-main {
  width: 100%;
  padding: 20px 16px 48px;
  max-width: var(--content-max);
  margin: 0 auto;
  /* Scroll propio — no depender del body */
  overflow-y: auto;
  overflow-x: hidden;
}
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.metric-card { background: var(--white); border: 1.5px solid var(--gray-light); border-radius: var(--radius); padding: 16px; text-align: center; }
.metric-card.red   { background: var(--red); border-color: var(--red); }
.metric-card.black { background: var(--black); border-color: var(--black); }
.metric-num    { font-family: 'Oswald', sans-serif; font-size: 32px; font-weight: 700; color: var(--black); line-height: 1; }
.metric-card.red .metric-num, .metric-card.black .metric-num { color: var(--white); }
.metric-label  { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gray-mid); margin-top: 4px; }
.metric-card.red .metric-label, .metric-card.black .metric-label { color: rgba(255,255,255,0.6); }
.metric-change { font-size: 11px; margin-top: 4px; color: var(--success); font-weight: 600; }
.table-wrap  { width: 100%; overflow-x: auto; border-radius: var(--radius); border: 1.5px solid var(--gray-light); background: var(--white); margin-bottom: 20px; }
.data-table  { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 500px; }
.data-table th { background: var(--gray-bg); padding: 11px 14px; text-align: left; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gray-mid); font-weight: 600; border-bottom: 1px solid var(--gray-light); white-space: nowrap; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--gray-light); color: var(--charcoal); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td      { background: #fafafa; }
.scanner-area  { width: 100%; background: var(--black); min-height: 300px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.scanner-frame { width: 200px; height: 200px; border: 3px solid var(--red); border-radius: 12px; position: relative; }
.scanner-frame::before, .scanner-frame::after { content: ''; position: absolute; width: 24px; height: 24px; border-color: var(--white); border-style: solid; }
.scanner-frame::before { top: -3px; left: -3px; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.scanner-frame::after  { bottom: -3px; right: -3px; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }
.scan-result         { background: var(--white); border-radius: 16px; padding: 24px; text-align: center; margin: 20px; border: 2px solid var(--gray-light); }
.scan-result.success { border-color: var(--success); }
.scan-result.error   { border-color: var(--red); }
.spinner      { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.4); border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; display: none; }
.spinner-dark { border-color: rgba(0,0,0,0.15); border-top-color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Admin desktop ── */
@media (min-width: 768px) {
  .admin-layout     { flex-direction: row; min-height: 100vh; }
  .admin-nav-mobile { display: none; }
  .admin-topbar     { position: fixed; top: 0; left: 0; right: 0; height: 60px; z-index: 300; padding: 0 24px; }
  .admin-sidebar {
    display: flex; flex-direction: column;
    width: var(--sidebar-width, 240px); min-height: 100vh;
    background: var(--white); border-right: 1px solid var(--gray-light);
    position: fixed; top: 60px; left: 0; bottom: 0;
    overflow-y: auto; z-index: 100; padding: 24px 0;
  }
  .sidebar-logo     { padding: 0 20px 24px; border-bottom: 1px solid var(--gray-light); margin-bottom: 16px; }
  .sidebar-logo img { width: 140px; object-fit: contain; }
  .sidebar-sucursal { padding: 0 20px 20px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--gray-mid); border-bottom: 1px solid var(--gray-light); margin-bottom: 8px; }
  .sidebar-sucursal strong { display: block; font-family: 'Oswald', sans-serif; font-size: 14px; color: var(--black); margin-top: 2px; }
  .admin-sidebar a {
    display: flex; align-items: center; gap: 10px; padding: 12px 20px;
    text-decoration: none; color: var(--gray-dark);
    font-family: 'Oswald', sans-serif; font-size: 14px; font-weight: 600;
    letter-spacing: 0.8px; text-transform: uppercase; transition: all 0.2s;
    border-left: 3px solid transparent;
  }
  .admin-sidebar a svg       { width: 18px; height: 18px; color: var(--gray-mid); flex-shrink: 0; transition: color 0.2s; }
  .admin-sidebar a:hover     { color: var(--red); background: var(--red-pale); border-left-color: var(--red); }
  .admin-sidebar a:hover svg { color: var(--red); }
  .admin-sidebar a.active     { color: var(--red); background: var(--red-pale); border-left-color: var(--red); }
  .sidebar-group-label {
    font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase;
    color: rgba(255,255,255,.35); font-weight: 700; font-family: 'Oswald', sans-serif;
    padding: 16px 20px 4px; margin-top: 4px; border-top: 1px solid rgba(255,255,255,.07);
  }
  .sidebar-group-label:first-of-type { border-top: none; margin-top: 0; }
  .admin-sidebar a.active svg { color: var(--red); }
  .sidebar-bottom { margin-top: auto; padding: 16px 20px; border-top: 1px solid var(--gray-light); }
  .sidebar-bottom a { color: var(--gray-mid); font-size: 13px; display: flex; align-items: center; gap: 8px; text-decoration: none; transition: color 0.2s; font-family: 'Source Sans 3', sans-serif; text-transform: none; letter-spacing: 0; border-left: none; padding: 8px 0; }
  .sidebar-bottom a:hover { color: var(--red); background: none; }
  .admin-content,
  .admin-main    { margin-left: 240px; margin-top: 60px; padding: 36px 40px 60px; width: calc(100% - 240px); }
  .metric-grid      { grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
  .metric-card      { padding: 20px; border-radius: 14px; }
  .metric-num       { font-size: 40px; }
  .admin-grid       { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
  .admin-grid-3     { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
  .data-table th    { padding: 13px 16px; font-size: 11px; }
  .data-table td    { padding: 14px 16px; font-size: 14px; }
  .section-title    { font-size: 22px; margin-bottom: 18px; }
  .form-body        { max-width: 560px; margin: 0 auto; padding: 36px 0 60px; }
  .field-group      { gap: 16px; }
}
@media (min-width: 1280px) {
  .admin-sidebar  { width: 260px; }
  .admin-content,
  .admin-main  { margin-left: 260px; width: calc(100% - 260px); padding: 40px 56px 80px; }
  .metric-grid    { gap: 24px; }
  .metric-card    { padding: 24px; }
  .metric-num     { font-size: 44px; }
  .app-wrapper    { width: 80%; max-width: 1200px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   CAMPANA / BELL
════════════════════════════════════════════════════════════════════════ */
.bell-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.07); border: 1.5px solid rgba(255,255,255,0.12);
  cursor: pointer; text-decoration: none; color: rgba(255,255,255,0.75);
  flex-shrink: 0; transition: background .2s;
}
.bell-btn:hover { background: rgba(255,255,255,0.14); }
.bell-badge {
  display: none; position: absolute; top: -3px; right: -3px;
  min-width: 17px; height: 17px; background: #cc1f1f; color: #fff;
  border-radius: 10px; font-size: 10px; font-weight: 700; line-height: 17px;
  text-align: center; padding: 0 4px; border: 2px solid #111;
  box-sizing: border-box; font-family: 'Source Sans 3', sans-serif;
}
.bell-badge.visible { display: block; }
.screen-header-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; }
@media (min-width: 768px) {
  .screen-header .bell-btn { display: none; }
  .client-sidebar-nav a[href="/alertas"] { position: relative; }
}
