/* ============================================================
   PORTAL.CSS — Club Sport Emelec · Sistema de Diseño v2
   Colores oficiales: azul eléctrico #082D7A, blanco #FFFFFF
   NUNCA usar amarillo ni dorado.
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --azul:        #082D7A;
  --azul-medio:  #1565C0;
  --azul-claro:  #1976D2;
  --azul-hover:  #0D47A1;
  --blanco:      #FFFFFF;
  --gris-fondo:  #F1F5F9;
  --gris-borde:  #E2E8F0;
  --gris-texto:  #64748B;
  --texto:       #0F1E3C;
  --verde:       #10B981;
  --rojo:        #EF4444;
  --naranja:     #F59E0B;
  /* Alerta/pendiente — NUNCA amarillo ni dorado */
  --alerta-fondo: #E8EDFF;
  --alerta-texto: #3B4DC4;

  --radius-card: 16px;
  --radius-btn:  50px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.07), 0 8px 24px rgba(8,45,122,0.07);
  --shadow-nav:  0 2px 16px rgba(8,45,122,0.18);

  --font-base: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --nav-height: 64px;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-base);
  font-size: 15px;
  color: var(--texto);
  background: var(--gris-fondo);
  -webkit-font-smoothing: antialiased;
}

body.base { background: var(--gris-fondo); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-base);
  font-weight: 700;
  color: var(--texto);
  margin-bottom: .5rem;
}

a { color: var(--azul-medio); text-decoration: none; }
a:hover { color: var(--azul); }

img { max-width: 100%; }

/* ── Utilidades globales ────────────────────────────────────── */
.text-azul   { color: var(--azul) !important; }
.text-verde  { color: var(--verde) !important; }
.text-rojo   { color: var(--rojo) !important; }
.text-muted  { color: var(--gris-texto) !important; }
.bg-azul     { background: var(--azul) !important; }
.bg-gris     { background: var(--gris-fondo) !important; }

/* ── NAVBAR ─────────────────────────────────────────────────── */
.navbar-portal {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1030;
  height: var(--nav-height);
  background: var(--azul);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  box-shadow: var(--shadow-nav);
}

.navbar-portal .nav-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-portal .nav-brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.navbar-portal .nav-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.navbar-portal .nav-brand-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: .5px;
}

.navbar-portal .nav-brand-text span {
  color: #7BB3FF;
}

.navbar-portal .nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin: 0 auto;
  list-style: none;
  padding: 0;
}

.navbar-portal .nav-links a {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  border-radius: 8px;
  color: rgba(255,255,255,0.75);
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.navbar-portal .nav-links a:hover,
.navbar-portal .nav-links a.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.navbar-portal .nav-links a.active {
  background: rgba(255,255,255,0.18);
}

.navbar-portal .nav-right {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}

/* User button */
.nav-user-btn {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  padding: .35rem .9rem .35rem .35rem;
  cursor: pointer;
  transition: background .15s;
  color: #fff;
  font-size: .88rem;
  font-weight: 600;
}

.nav-user-btn:hover { background: rgba(255,255,255,0.2); }

.nav-user-btn .user-initials {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--azul-medio);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-user-btn .chevron { font-size: .7rem; opacity: .7; }

/* Dropdown */
.nav-dropdown { position: relative; }

.nav-dropdown .dropdown-menu {
  border: 1px solid var(--gris-borde);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  padding: .5rem;
  min-width: 200px;
}

.nav-dropdown .dropdown-item {
  border-radius: 8px;
  padding: .55rem 1rem;
  font-size: .88rem;
  color: var(--texto);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.nav-dropdown .dropdown-item:hover {
  background: var(--gris-fondo);
  color: var(--azul);
}

.nav-dropdown .dropdown-divider {
  margin: .35rem 0;
  border-color: var(--gris-borde);
}

/* Hamburger toggler */
.nav-toggler {
  display: none;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  color: #fff;
  padding: .4rem .6rem;
  cursor: pointer;
  font-size: 1.1rem;
}

/* ── HERO / PAGE HEADER ─────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, #082D7A 0%, #1565C0 60%, #1976D2 100%);
  position: relative;
  overflow: hidden;
  padding: calc(var(--nav-height) + 2rem) 0 2.5rem;
}

/* Patrón de cruces */
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* Rayo decorativo */
.page-hero::after {
  content: '⚡';
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  font-size: 8rem;
  opacity: .05;
  pointer-events: none;
  line-height: 1;
}

.page-hero .container { position: relative; z-index: 1; }

/* Hero simple (para páginas internas que no son el perfil) */
.page-hero-simple {
  background: linear-gradient(135deg, #082D7A 0%, #1565C0 100%);
  position: relative;
  overflow: hidden;
  padding: calc(var(--nav-height) + 1.5rem) 0 1.75rem;
}

.page-hero-simple::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.page-hero-simple .container { position: relative; z-index: 1; }

.hero-page-label {
  color: rgba(255,255,255,0.65);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: .35rem;
}

.hero-page-title {
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 .25rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.hero-page-subtitle {
  color: rgba(255,255,255,0.7);
  font-size: .95rem;
  margin: 0;
}

/* ── HERO PERFIL (página principal) ─────────────────────────── */
.hero-profile {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hero-avatar {
  position: relative;
  flex-shrink: 0;
}

.hero-avatar-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.35);
  object-fit: cover;
  background: var(--azul-hover);
}

.hero-avatar-initials {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.35);
  background: var(--azul-medio);
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-avatar-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: var(--azul);
  border: 2px solid #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  color: #fff;
}

.hero-info { flex: 1; min-width: 200px; }

.hero-name {
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 0 0 .2rem;
  line-height: 1.15;
}

.hero-code {
  color: rgba(255,255,255,0.6);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: .75rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .75rem;
}

.badge-hero {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .75rem;
  border-radius: 50px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.badge-activa   { background: rgba(16,185,129,0.2); color: #6EE7B7; border: 1.5px solid rgba(16,185,129,0.4); }
.badge-inactiva { background: rgba(239,68,68,0.2);  color: #FCA5A5; border: 1.5px solid rgba(239,68,68,0.3); }
.badge-plan     { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.9); border: 1.5px solid rgba(255,255,255,0.25); }
.badge-dot      { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.hero-dates {
  color: rgba(255,255,255,0.7);
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.hero-dates strong { color: #fff; font-weight: 700; }

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  flex-shrink: 0;
}

/* ── BODY / CONTENIDO ───────────────────────────────────────── */
.page-body {
  padding: 2rem 0 3rem;
  background: var(--gris-fondo);
  min-height: 100vh;
}

/* ── CARDS ──────────────────────────────────────────────────── */
.card-portal {
  background: #fff;
  border-radius: var(--radius-card);
  border: 1px solid var(--gris-borde);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.card-portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gris-borde);
}

.card-portal-header-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--azul);
  margin: 0;
}

.card-portal-header-title i {
  color: var(--azul-medio);
  font-size: 1rem;
}

.card-portal-header-action {
  font-size: .82rem;
  color: var(--azul-medio);
  font-weight: 600;
  text-decoration: none;
}

.card-portal-header-action:hover { color: var(--azul); }

.card-portal-body { padding: 1.25rem; }

/* ── BOTONES ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--font-base);
  font-weight: 600;
  font-size: .88rem;
  padding: .55rem 1.25rem;
  border-radius: var(--radius-btn);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
  line-height: 1.4;
}

.btn-azul {
  background: var(--azul);
  color: #fff !important;
  border-color: var(--azul);
}
.btn-azul:hover {
  background: var(--azul-hover);
  border-color: var(--azul-hover);
  color: #fff !important;
}

.btn-azul-outline {
  background: transparent;
  color: #fff !important;
  border-color: rgba(255,255,255,0.6);
}
.btn-azul-outline:hover {
  background: rgba(255,255,255,0.12);
  border-color: #fff;
}

.btn-blanco {
  background: #fff;
  color: var(--azul) !important;
  border-color: var(--gris-borde);
}
.btn-blanco:hover {
  background: var(--gris-fondo);
  border-color: var(--azul);
}

.btn-hero-primary {
  background: rgba(255,255,255,0.95);
  color: var(--azul) !important;
  border-color: transparent;
  padding: .55rem 1.25rem;
  font-size: .88rem;
}
.btn-hero-primary:hover {
  background: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.btn-hero-secondary {
  background: rgba(255,255,255,0.1);
  color: #fff !important;
  border-color: rgba(255,255,255,0.35);
  padding: .55rem 1.25rem;
  font-size: .88rem;
}
.btn-hero-secondary:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.6);
}

.btn-full {
  display: flex;
  width: 100%;
  justify-content: center;
  border-radius: 12px;
}

.btn-sm {
  padding: .35rem .85rem;
  font-size: .8rem;
}

.btn-lg {
  padding: .75rem 1.75rem;
  font-size: 1rem;
}

/* Mantener compatibilidad con clases Bootstrap existentes */
.btn-primary {
  background: var(--azul) !important;
  color: #fff !important;
  border-color: var(--azul) !important;
  border-radius: var(--radius-btn);
}
.btn-primary:hover {
  background: var(--azul-hover) !important;
  border-color: var(--azul-hover) !important;
}

.btn-secondary {
  background: var(--azul-medio) !important;
  color: #fff !important;
  border-color: var(--azul-medio) !important;
  border-radius: var(--radius-btn);
}
.btn-secondary:hover {
  background: var(--azul) !important;
  border-color: var(--azul) !important;
}

.btn-outline-primary {
  color: var(--azul) !important;
  border-color: var(--azul) !important;
  border-radius: var(--radius-btn);
  background: #fff !important;
}
.btn-outline-primary:hover {
  background: var(--azul) !important;
  color: #fff !important;
  border-color: var(--azul) !important;
}

.btn-outline-secondary {
  color: var(--gris-texto) !important;
  border-color: var(--gris-borde) !important;
  border-radius: var(--radius-btn);
  background: #fff !important;
}
.btn-outline-secondary:hover {
  background: var(--gris-fondo) !important;
  border-color: var(--azul) !important;
  color: var(--azul) !important;
}

/* ── FAMILIA / CAMBIAR CUENTA ───────────────────────────────── */
.familia-card {
  background: #fff;
  border-radius: var(--radius-card);
  border: 1px solid var(--gris-borde);
  box-shadow: var(--shadow-card);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.familia-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .85rem;
}

.familia-header-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--azul);
  margin: 0;
}

.familia-scroll {
  display: flex;
  gap: .75rem;
  overflow-x: auto;
  padding-bottom: .25rem;
  scrollbar-width: none;
}
.familia-scroll::-webkit-scrollbar { display: none; }

.familia-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .7rem 1rem;
  border-radius: 12px;
  border: 1.5px solid var(--gris-borde);
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
  white-space: nowrap;
  min-width: 140px;
  color: var(--texto);
}

.familia-item:hover {
  border-color: var(--azul-medio);
  box-shadow: 0 2px 10px rgba(8,45,122,0.1);
  color: var(--azul);
}

.familia-item.en-uso {
  border-color: var(--azul-medio);
  background: #EEF2FF;
}

.familia-initials {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--azul-medio);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.familia-item-info { flex: 1; min-width: 0; }
.familia-item-relacion {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--gris-texto);
  margin-bottom: .1rem;
}
.familia-item-nombre {
  font-size: .88rem;
  font-weight: 700;
  color: var(--texto);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.familia-item-codigo {
  font-size: .75rem;
  color: var(--gris-texto);
}

.familia-en-uso-badge {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--azul);
  color: #fff;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
}

.familia-add-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  padding: .7rem 1rem;
  border-radius: 12px;
  border: 1.5px dashed var(--gris-borde);
  background: transparent;
  color: var(--gris-texto);
  text-decoration: none;
  font-size: .78rem;
  font-weight: 600;
  min-width: 100px;
  transition: border-color .15s, color .15s;
}
.familia-add-btn:hover {
  border-color: var(--azul-medio);
  color: var(--azul);
}

/* ── STATUS INDICATORS ──────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: .3rem;
}
.status-dot.verde   { background: var(--verde); }
.status-dot.rojo    { background: var(--rojo); }
.status-dot.naranja { background: var(--naranja); }
.status-dot.gris    { background: #94A3B8; }

/* ── LISTAS ─────────────────────────────────────────────────── */
.list-portal {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-portal-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--gris-borde);
  text-decoration: none;
  color: var(--texto);
  transition: background .1s;
}

.list-portal-item:last-child { border-bottom: none; }

.list-portal-item:hover { background: var(--gris-fondo); }

.list-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}

.list-item-info { flex: 1; min-width: 0; }

.list-item-name {
  font-size: .9rem;
  font-weight: 700;
  color: var(--texto);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-sub {
  font-size: .78rem;
  color: var(--gris-texto);
  margin-top: .1rem;
}

.list-item-chevron {
  color: var(--gris-borde);
  font-size: .9rem;
  flex-shrink: 0;
}

/* ── DATOS (label + valor) ──────────────────────────────────── */
.dato-group { margin-bottom: 1rem; }

.dato-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gris-texto);
  margin-bottom: .3rem;
}

.dato-valor {
  background: var(--gris-fondo);
  border: 1px solid var(--gris-borde);
  border-radius: 10px;
  padding: .65rem 1rem;
  font-size: .95rem;
  color: var(--texto);
}

/* ── CARNET / TARJETA VISUAL ────────────────────────────────── */
.carnet-card {
  background: linear-gradient(135deg, #082D7A 0%, #0D47A1 60%, #1565C0 100%);
  border-radius: 14px;
  padding: 1.25rem 1.25rem 1rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}

/* carnet-card::before eliminado — la imagen de fondo ya incluye el patrón */

.carnet-logo {
  font-size: .9rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: .5px;
  position: relative;
  z-index: 1;
}

.carnet-logo span { color: #7BB3FF; }

.carnet-nfc {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
}

.carnet-numero {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: #fff;
  margin: 1rem 0 .5rem;
  position: relative;
  z-index: 1;
}

.carnet-titular {
  font-size: .7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: .15rem;
}

.carnet-nombre {
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  position: relative;
  z-index: 1;
}

.carnet-estado-badge {
  display: inline-block;
  background: var(--verde);
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: .2rem .65rem;
  border-radius: 20px;
}

/* ── TABS / PESTAÑAS ────────────────────────────────────────── */
.tabs-portal {
  display: flex;
  gap: .25rem;
  background: var(--gris-fondo);
  border-radius: 12px;
  padding: .25rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-portal::-webkit-scrollbar { display: none; }

.tab-portal-item {
  flex: 1;
  text-align: center;
  padding: .55rem 1rem;
  border-radius: 9px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--gris-texto);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
  border: none;
  background: transparent;
}

.tab-portal-item.active {
  background: #fff;
  color: var(--azul);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.tab-portal-item:hover:not(.active) { color: var(--azul); }

/* ── BADGE CONTEO ───────────────────────────────────────────── */
.tab-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--azul);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  padding: 0 5px;
  margin-left: .3rem;
}

/* ── TABLAS ─────────────────────────────────────────────────── */
.table-portal {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

.table-portal thead th {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gris-texto);
  padding: .75rem 1rem;
  border-bottom: 1.5px solid var(--gris-borde);
  background: transparent;
}

.table-portal tbody td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--gris-borde);
  color: var(--texto);
  vertical-align: middle;
}

.table-portal tbody tr:last-child td { border-bottom: none; }

.table-portal tbody tr:hover td { background: var(--gris-fondo); }

/* ── BADGES ESTADO ──────────────────────────────────────────── */
.badge-estado {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .25rem .7rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.badge-pagada   { background: #DCFCE7; color: #15803D; }
.badge-pendiente { background: var(--alerta-fondo); color: var(--alerta-texto); }
.badge-vencida  { background: #FEE2E2; color: #B91C1C; }

/* ── TOTAL / RESALTADO ──────────────────────────────────────── */
.total-strip {
  background: var(--azul);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1rem 0;
}

.total-strip-label {
  color: rgba(255,255,255,0.8);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.total-strip-valor {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
}

/* ── FORMULARIOS ────────────────────────────────────────────── */
.form-label-portal {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gris-texto);
  margin-bottom: .3rem;
  display: block;
}

.form-control-portal {
  width: 100%;
  background: var(--gris-fondo);
  border: 1.5px solid var(--gris-borde);
  border-radius: 10px;
  padding: .65rem 1rem;
  font-size: .95rem;
  color: var(--texto);
  font-family: var(--font-base);
  transition: border-color .15s, box-shadow .15s;
}

.form-control-portal:focus {
  outline: none;
  border-color: var(--azul-medio);
  box-shadow: 0 0 0 3px rgba(21,101,192,0.12);
}

/* Mantener compatibilidad */
.form-control {
  border-radius: 10px !important;
  border-color: var(--gris-borde) !important;
  font-family: var(--font-base) !important;
}
.form-control:focus {
  border-color: var(--azul-medio) !important;
  box-shadow: 0 0 0 3px rgba(21,101,192,0.12) !important;
}

select.form-control { background-color: #fff !important; }

/* ── MODALES ────────────────────────────────────────────────── */
.modal-content {
  border-radius: var(--radius-card) !important;
  border: none !important;
  box-shadow: 0 8px 48px rgba(0,0,0,0.2) !important;
  overflow: hidden !important;
}

.modal-header {
  background: var(--azul) !important;
  color: #fff !important;
  border-bottom: none !important;
  padding: 1rem 1.25rem !important;
}

.modal-title { color: #fff !important; font-weight: 700 !important; }

.btn-close { filter: invert(1) !important; }

.modal-body { padding: 1.25rem !important; }

.modal-footer {
  border-top: 1px solid var(--gris-borde) !important;
  padding: .75rem 1.25rem !important;
}

/* ── ALERTAS ────────────────────────────────────────────────── */
.alert {
  border-radius: 10px !important;
  border: none !important;
  font-size: .88rem;
}

.alert-info    { background: #EEF2FF !important; color: var(--azul) !important; }
.alert-success { background: #DCFCE7 !important; color: #15803D !important; }
.alert-warning { background: var(--alerta-fondo) !important; color: var(--alerta-texto) !important; }
.alert-danger  { background: #FEE2E2 !important; color: #B91C1C !important; }
.alert-primary { background: #EEF2FF !important; color: var(--azul) !important; }

/* ── MAIN CONTENT WRAPPER ───────────────────────────────────── */
.main-wrapper {
  padding-top: var(--nav-height);
}

/* Ocultar menú mobile por defecto en todas las resoluciones */
.nav-collapse { display: none; }

/* ── COLORES DE AVATAR ALEATORIOS ───────────────────────────── */
.av-azul    { background: #1565C0; }
.av-verde   { background: #059669; }
.av-violeta { background: #7C3AED; }
.av-rosa    { background: #DB2777; }
.av-naranja { background: #EA580C; }
.av-teal    { background: #0891B2; }

/* ── SECCIÓN CONTACTO ───────────────────────────────────────── */
.contacto-item {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--gris-borde);
}
.contacto-item:last-child { border-bottom: none; }

.contacto-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--gris-fondo);
  color: var(--azul);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  flex-shrink: 0;
}

.contacto-label {
  font-size: .72rem;
  color: var(--gris-texto);
  font-weight: 600;
  margin-bottom: .1rem;
}

.contacto-valor {
  font-size: .9rem;
  font-weight: 700;
  color: var(--texto);
}

.contacto-valor a { color: var(--azul-medio); }
.contacto-valor a:hover { color: var(--azul); }

/* ── DROPDOWN CAMBIAR CUENTA (herencia del antiguo) ─────────── */
.circular-image-select {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: .5rem;
  flex-shrink: 0;
}
.circular-image-select img { width: 100%; height: 100%; object-fit: cover; }

/* ── DROPDOWN BOOTSTRAP OVERRIDE ───────────────────────────── */
.dropdown-menu {
  border: 1px solid var(--gris-borde) !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12) !important;
  padding: .5rem !important;
}

.dropdown-item {
  border-radius: 8px !important;
  font-size: .88rem !important;
  padding: .55rem 1rem !important;
}

.dropdown-item:hover {
  background: var(--gris-fondo) !important;
  color: var(--azul) !important;
}

.dropdown-divider { border-color: var(--gris-borde) !important; }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .nav-links { display: none; }

  .nav-toggler { display: flex; align-items: center; }

  .navbar-portal {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--nav-height);
    padding: .75rem 1rem;
  }

  .nav-collapse {
    display: none;
    width: 100%;
    flex-direction: column;
    padding: .75rem 0 .25rem;
    gap: .25rem;
  }

  .nav-collapse.show { display: flex; }

  .nav-collapse .nav-link-mobile {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: rgba(255,255,255,0.8);
    padding: .65rem 1rem;
    border-radius: 10px;
    font-size: .92rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, color .15s;
  }

  .nav-collapse .nav-link-mobile:hover,
  .nav-collapse .nav-link-mobile.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
  }

  .hero-name { font-size: 1.5rem; }
  .hero-actions { flex-direction: row; flex-wrap: wrap; }
  .hero-profile { gap: 1rem; }
  .hero-page-title { font-size: 1.6rem; }

  .page-hero { padding: calc(var(--nav-height) + 1.25rem) 0 1.75rem; }
}

@media (max-width: 575.98px) {
  /* Hero avatar más pequeño */
  .hero-avatar-img,
  .hero-avatar-initials { width: 68px; height: 68px; font-size: 1.4rem; }
  .hero-name { font-size: 1.1rem; }
  .hero-page-title { font-size: 1.4rem; }
  .hero-dates { font-size: .78rem; flex-wrap: wrap; }
  /* Familia scroll */
  .familia-scroll { gap: .5rem; }
  .familia-item { min-width: 115px; padding: .55rem .75rem; }
  /* Acciones hero: horizontal */
  .hero-actions { flex-direction: row; flex-wrap: wrap; }
  .hero-actions .btn { font-size: .8rem; padding: .45rem 1rem; }
  /* Cards más compactas */
  .card-portal-body { padding: .9rem; }
  /* Username oculto en navbar */
  .nav-user-btn .nav-username { display: none; }
  /* Tabla: scroll horizontal */
  .table-portal { font-size: .8rem; }
  .table-portal thead th,
  .table-portal tbody td { padding: .6rem .75rem; }
  /* Tabs: scroll horizontal */
  .tabs-portal { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs-portal::-webkit-scrollbar { display: none; }
  .tab-portal-item { flex-shrink: 0; font-size: .8rem; padding: .45rem .75rem; }
  /* Botones full-width en móvil */
  .btn-pagar-boletos { font-size: .9rem; }
  /* Dato-valor legible */
  .dato-valor { font-size: .88rem; }
}

/* ── ANIMACIONES ────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  animation: fadeInUp .3s ease both;
}

/* ── SPINNER / LOADING ──────────────────────────────────────── */
.spinner-portal {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── OCULTAR FONDO ANTERIOR ─────────────────────────────────── */
body.base.dashboard {
  background: var(--gris-fondo) !important;
  background-image: none !important;
}

/* Eliminar cualquier imagen de fondo que haya en el body */
body.membresia-abonado,
body.membresia-legend,
body.membresia-azul,
body.membresia-internacional,
body.membresia-bombillo-jr,
body.emelec-id {
  background-image: none !important;
  background: var(--gris-fondo) !important;
}

/* Sobrescribir estilos de MDB que interfieren */
.navbar-light { background: var(--azul) !important; }

/* Quitar padding-top que ponía el antiguo navbar */
.container.pt-5 { padding-top: 0 !important; }

/* ── SECTORES ZAPPING ───────────────────────────────────────── */
.zapping-card .zapp-code {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--azul);
  letter-spacing: 2px;
}

/* ── TIMER / ALERTA BADGE ───────────────────────────────────── */
.timer-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--alerta-fondo);
  color: var(--alerta-texto);
  padding: .4rem .85rem;
  border-radius: 50px;
  font-size: .82rem;
  font-weight: 700;
}

/* ── PAGO — TAB PANES ──────────────────────────────────────── */
.tab-pane-portal { display: none; }
.tab-pane-portal.active { display: block; }

/* ── BOLETOS — LOCALIDADES (tabs pills) ─────────────────────── */
.nav-localidades {
  display: flex !important;
  flex-wrap: wrap;
  gap: .5rem;
  list-style: none;
  padding: 1rem 0;
  margin: 0 auto;
  justify-content: center;
}

.btn-localidad {
  border-radius: 50px !important;
  overflow: hidden;
}

.btn-localidad a,
.btn-localidad > a:first-child {
  display: inline-flex !important;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.1rem !important;
  border-radius: 50px !important;
  border: 1.5px solid var(--gris-borde);
  background: #fff;
  color: var(--texto) !important;
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
}

.btn-localidad a:hover {
  border-color: var(--azul);
  background: #EEF2FF;
  color: var(--azul) !important;
}

.btn-localidad.active a,
.btn-localidad a.active {
  background: var(--azul) !important;
  color: #fff !important;
  border-color: var(--azul) !important;
}

/* ── BOLETOS — EVENTO CARD ──────────────────────────────────── */
.card.evento {
  background: #fff !important;
  border-radius: var(--radius-card) !important;
  border: 1px solid var(--gris-borde) !important;
  box-shadow: var(--shadow-card) !important;
  color: var(--texto) !important;
  padding: 1.5rem !important;
}

.card.evento .versus { color: var(--azul); font-weight: 900; }

/* ── BOLETOS — CARRITO / VENTA ──────────────────────────────── */
.carrito .localidades {
  background: transparent !important;
}

/* Mapa estadio container */
#div_loca_estadio {
  border-radius: var(--radius-card);
  overflow: hidden;
}

/* Panel de selección/compra */
.carrito .row > .col-md-4,
.carrito .row > .col-lg-5 {
  padding-left: 1rem;
}

/* Total a pagar strip en venta */
.total-venta-strip {
  background: var(--azul);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  margin: 1rem 0;
}
.total-venta-strip .label {
  color: rgba(255,255,255,.7);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: .35rem;
}
.total-venta-strip .monto {
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
}

/* Botón proceder al pago */
.btn-pagar-boletos {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  padding: .9rem 1.5rem;
  background: var(--azul);
  color: #fff !important;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}
.btn-pagar-boletos:hover { background: var(--azul-hover); color: #fff !important; }

/* Contador boletos */
.bole-counter {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: .75rem 0 1rem;
}
.bole-counter-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1.5px solid var(--gris-borde);
  background: #fff;
  color: var(--azul);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.bole-counter-btn:hover { border-color: var(--azul); background: #EEF2FF; }
.bole-counter-num {
  min-width: 48px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--texto);
}

/* ══════════════════════════════════════════════════════════════
   VENTA BOLETOS — SELECCIÓN DE LOCALIDAD
   ══════════════════════════════════════════════════════════════ */

/* ── Tabs localidades: fila única deslizable ─────────────────── */
.nav-localidades {
  display: flex !important;
  flex-wrap: nowrap !important;          /* nunca wrappear */
  overflow-x: auto !important;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  gap: .5rem !important;
  padding: .5rem .25rem .75rem !important;
  margin: 0 !important;
  list-style: none;
  scrollbar-width: none;
  justify-content: flex-start !important;
}
.nav-localidades::-webkit-scrollbar { display: none; }

@media (min-width: 768px) {
  .nav-localidades {
    justify-content: center !important;
    flex-wrap: wrap !important;
    overflow-x: visible !important;
  }
  .btn-localidad > a:first-child {
    font-size: 1rem;
    padding: .7rem 1.5rem !important;
  }
}

/* Cada pill no se comprime */
.btn-localidad {
  flex-shrink: 0 !important;
  border-radius: 50px !important;
}

/* Primera <a> = pill real; ocultar la segunda (bug duplicado PALCO) */
.btn-localidad > a:nth-child(2) { display: none !important; }

/* Pill link */
.btn-localidad > a:first-child {
  display: inline-flex !important;
  align-items: center;
  gap: .3rem;
  padding: .5rem 1.1rem !important;
  border-radius: 50px !important;
  border: 1.5px solid var(--gris-borde);
  background: #fff;
  color: var(--texto) !important;
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap !important;         /* nombre completo, nunca cortar */
  transition: all .15s;
}
.btn-localidad > a:first-child:hover {
  border-color: var(--azul);
  background: #EEF2FF;
  color: var(--azul) !important;
}
.btn-localidad.active > a:first-child,
.btn-localidad > a:first-child.active {
  background: var(--azul) !important;
  color: #fff !important;
  border-color: var(--azul) !important;
}

/* Ocultar íconos dentro de pills */
.btn-localidad a img { display: none !important; }
.btn-localidad p, .btn-localidad a p { margin: 0; }

/* Layout mapa + panel: grid 2 columnas */
#div_loca_estadio .container > .d-flex,
#div_loca_estadio .container > .d-flex.justify-content-center {
  display: grid !important;
  grid-template-columns: 3fr 2fr !important;
  gap: 1.5rem !important;
  align-items: start !important;
  flex-direction: unset !important;
  flex-wrap: unset !important;
}

/* Mapa - card izquierda */
.localidad {
  background: #fff;
  border-radius: var(--radius-card) !important;
  border: 1px solid var(--gris-borde);
  box-shadow: var(--shadow-card);
  padding: 1rem !important;
  overflow: hidden;
}
.localidad img {
  width: 100%;
  border-radius: 10px;
  display: block;
}

/* Panel derecho */
.quote {
  background: #fff;
  border-radius: var(--radius-card) !important;
  border: 1px solid var(--gris-borde);
  box-shadow: var(--shadow-card);
  padding: 1.5rem !important;
  min-width: 0;
}

/* Labels de sección */
.divider-with-text {
  font-size: .72rem !important;
  font-weight: 700 !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  color: #94A3B8 !important;
  border: none !important;
  padding: 0 !important;
  margin-bottom: .4rem !important;
  display: flex;
  align-items: center;
  gap: .3rem;
}

/* Nombre localidad seleccionada */
.quote h1.s_title {
  font-size: 1.5rem !important;
  font-weight: 800 !important;
  color: var(--azul) !important;
  text-transform: none !important;
  font-family: var(--font-base) !important;
  line-height: 1.2 !important;
  margin-bottom: 1.25rem !important;
}

/* Form del pedido: columna vertical */
.quote .pedido form > .d-flex {
  flex-direction: column !important;
  gap: 0 !important;
}

/* Espaciador horizontal: ocultar */
.quote .pedido form > .d-flex > .p-4 { display: none !important; }

/* Labels de cantidad y total */
.quantity,
.total { margin-bottom: .75rem; }

.quantity > label,
.total > label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .9px;
  text-transform: uppercase;
  color: #94A3B8;
  display: block;
  margin-bottom: .5rem;
}

/* Input de cantidad — ocultar spinners nativos */
.cantidad-boletos {
  width: 64px !important;
  height: 44px !important;
  text-align: center !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  border: 1.5px solid var(--gris-borde) !important;
  border-radius: 10px !important;
  color: var(--texto) !important;
  background: #fff !important;
  -moz-appearance: textfield !important;
}
.cantidad-boletos::-webkit-outer-spin-button,
.cantidad-boletos::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Botones +/- del counter (inyectados por JS) */
.bole-qty-wrap {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .25rem;
}
.bole-qty-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid var(--gris-borde);
  background: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--azul);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  line-height: 1;
}
.bole-qty-btn:hover {
  border-color: var(--azul);
  background: #EEF2FF;
}

/* Strip Total a Pagar (inyectado por JS) */
.bole-total-strip {
  background: var(--azul);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  text-align: center;
  margin: 1rem 0;
}
.bole-total-label {
  color: rgba(255,255,255,.7);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: .35rem;
}
.bole-total-amount {
  color: rgba(255,255,255,.85);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

/* Botón Confirmar compra */
.quote .btn-primary,
.quote .btn-xl {
  width: 100%;
  border-radius: 12px !important;
  padding: .9rem 1.5rem !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
}

/* Mensaje promo */
.quote #cant_bole_promo .alert {
  font-size: .82rem;
}

/* ── Responsive boletos ───────────────────────────────────────── */
@media (max-width: 991px) {
  /* Columnas apiladas en tablet y móvil */
  #div_loca_estadio .container > .d-flex,
  #div_loca_estadio .container > .d-flex.justify-content-center {
    grid-template-columns: 1fr !important;
  }
  /* Mapa ocupa ancho completo y altura razonable */
  .localidad img { max-height: 260px; object-fit: contain; }
  /* Panel sin margen excesivo */
  .quote { padding: 1.1rem !important; }
  .quote h1.s_title { font-size: 1.2rem !important; }
  /* Strip total más compacto */
  .bole-total-amount { font-size: 1.6rem !important; }
  /* Counter: evitar que desborde */
  .bole-qty-wrap { justify-content: flex-start; }
}

@media (max-width: 575px) {
  /* Tabs localidades: horizontal scroll en vez de wrap */
  .nav-localidades {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    justify-content: flex-start !important;
    padding-bottom: .25rem;
    scrollbar-width: none;
  }
  .nav-localidades::-webkit-scrollbar { display: none; }
  .btn-localidad a { white-space: nowrap; }

  /* Panel más pequeño en móvil */
  .quote { padding: 1rem !important; }
  .quote h1.s_title { font-size: 1.1rem !important; margin-bottom: .85rem !important; }
  .bole-total-strip { padding: .85rem 1rem; }
  .bole-total-amount { font-size: 1.5rem !important; }
}
