/* CSS Reset & Variables — Frutiger Aero / Liquid Glass ocean palette */
:root {
  --bg-primary: #001428;
  --bg-secondary: #001F2E;
  --bg-glass: rgba(0, 42, 61, 0.60);
  --bg-glass-hover: rgba(0, 55, 80, 0.75);
  --border-glass: rgba(10, 158, 220, 0.14);
  --border-glass-active: rgba(10, 158, 220, 0.38);

  --color-text-main: #E2F1F8;
  --color-text-muted: #6FB0D8;
  --color-text-dark: #4A8BAF;

  /* Accent Colors */
  --color-primary: #0A9EDC;
  --color-primary-glow: rgba(10, 158, 220, 0.35);
  --color-energy: #f97316;
  --color-energy-glow: rgba(249, 115, 22, 0.25);
  --color-success: #10b981;
  --color-success-glow: rgba(16, 185, 129, 0.25);
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-danger-glow: rgba(239, 68, 68, 0.25);
  --color-pink: #ec4899;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #0A9EDC 0%, #004C6D 100%);
  --gradient-success: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  --gradient-danger: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  --gradient-warning: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  --gradient-luxury: linear-gradient(135deg, #A2DFF7 0%, #0A9EDC 50%, #004C6D 100%);

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Shadows */
  --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.70);
  --shadow-neon: 0 0 15px rgba(10, 158, 220, 0.40);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--color-text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Background Decorative Glow Bubbles */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.25;
}

.bg-glow-1 {
  width: 420px;
  height: 420px;
  background-color: #0A9EDC;
  top: -120px;
  left: -70px;
  animation: aero-drift 14s ease-in-out infinite;
}

.bg-glow-2 {
  width: 460px;
  height: 460px;
  background-color: #A2DFF7;
  bottom: -170px;
  right: -70px;
  opacity: 0.10;
  animation: aero-drift 18s ease-in-out infinite reverse;
}

.bg-glow-3 {
  width: 340px;
  height: 340px;
  background-color: #004C6D;
  top: 35%;
  left: 55%;
  opacity: 0.22;
  animation: aero-drift 11s ease-in-out infinite 3s;
}

/* App container */
#app {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Generic Helpers */
.hidden {
  display: none !important;
}

/* Views transition */
.view {
  width: 100%;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.view.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0);
}

/* 1. VIEW: LOGIN CUSTOM DESIGN */
#login-view {
  min-height: 100vh;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-glass);
  backdrop-filter: blur(28px) saturate(1.8);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 40px 32px;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(10, 158, 220, 0.08), inset 0 1px 0 rgba(10, 158, 220, 0.10);
  position: relative;
  overflow: hidden;
}

/* Top accent line */
.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient-luxury);
}

/* Frutiger Aero gloss — top-half shine */
.login-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(162, 223, 247, 0.06) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.login-header {
  margin-bottom: 32px;
}

/* Architectural gym name — left-aligned display type replaces logo badge */
.gym-name-display {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 0;
}

.gym-name-line {
  font-family: var(--font-heading);
  font-size: clamp(30px, 8.5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-transform: uppercase;
  color: var(--color-text-main);
  display: block;
}

.gym-name-accent {
  background: var(--gradient-luxury);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-power-bar {
  height: 3px;
  background: var(--gradient-luxury);
  border-radius: 2px;
  margin: 18px 0 14px;
}

.login-header .subtitle {
  font-size: 12px;
  color: var(--color-text-muted);
  letter-spacing: 0.45px;
  text-transform: uppercase;
  font-weight: 500;
}

/* Input Fields Style */
.input-group {
  margin-bottom: 24px;
}

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  padding-left: 4px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  color: var(--color-text-dark);
  pointer-events: none;
  transition: color 0.3s ease;
}

.input-wrapper input {
  width: 100%;
  height: 52px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 0 48px;
  color: white;
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-wrapper input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.input-wrapper input:focus {
  background: rgba(10, 158, 220, 0.05);
  border-color: var(--color-primary);
  box-shadow: 0 0 12px rgba(10, 158, 220, 0.18);
}

.input-wrapper input:focus + .input-icon {
  color: var(--color-primary);
}

.password-toggle-btn {
  position: absolute;
  right: 16px;
  background: none;
  border: none;
  color: var(--color-text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  outline: none;
}

.password-toggle-btn:hover {
  color: var(--color-text-main);
}

/* Buttons */
.btn {
  height: 52px;
  border-radius: 14px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-neon);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 22px rgba(10, 158, 220, 0.55);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 18px;
  height: 18px;
}

/* Secondary Button with Icon */
.btn-secondary-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--color-text-main);
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 13px;
}

.btn-secondary-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-text-muted);
}

/* Tertiary Button */
.btn-tertiary-icon {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.3s;
}

.btn-tertiary-icon:hover {
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

/* Error Banner styling */
.error-banner {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f87171;
  font-size: 13px;
  margin-bottom: 24px;
}

.error-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.login-footer {
  text-align: center;
  margin-top: 32px;
  font-size: 11px;
  color: var(--color-text-dark);
}

/* 2. VIEW: DASHBOARD DESIGN */
#dashboard-view {
  min-height: 100vh;
  padding-bottom: 72px; /* Espacio para el footer flotante */
}

/* Header */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: rgba(0, 20, 40, 0.85);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(10, 158, 220, 0.22);
}

.brand-icon {
  width: 22px;
  height: 22px;
  color: white;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Sync Bar */
.sync-status-container {
  padding: 12px 20px;
  display: flex;
  justify-content: center;
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: all 0.4s ease;
  width: 100%;
  max-width: 600px;
  justify-content: center;
}

.sync-icon {
  width: 14px;
  height: 14px;
}

/* Sync States */
.sync-online {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.sync-offline {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
  animation: pulse-border 2s infinite alternate;
}

.sync-loading {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--color-text-muted);
}

/* === SPOTLIGHT CARD: LIVE TRAINING HERO === */
.spotlight-container {
  padding: 12px 20px 0;
}

.spotlight-card {
  background: rgba(249, 115, 22, 0.04);
  border: 1px solid rgba(249, 115, 22, 0.16);
  border-radius: 20px;
  padding: 20px 22px 22px;
  position: relative;
  overflow: hidden;
}

.spotlight-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #f97316 0%, #fbbf24 100%);
}

.spotlight-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.spotlight-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(249, 115, 22, 0.65);
}

.spotlight-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.28);
  border-radius: 100px;
  padding: 3px 10px 3px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f97316;
}

.pulse-ring {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f97316;
  flex-shrink: 0;
  animation: pulse-energy 1.6s infinite ease-in-out;
}

.spotlight-body {
  line-height: 1;
}

.spotlight-number {
  font-family: var(--font-heading);
  font-size: clamp(68px, 18vw, 92px);
  font-weight: 800;
  color: #f97316;
  letter-spacing: -0.04em;
  line-height: 0.88;
  display: block;
  text-shadow: 0 0 50px rgba(249, 115, 22, 0.18);
}

.spotlight-status {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 12px;
}

@keyframes pulse-energy {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.6);
  }
  70% {
    transform: scale(1.2);
    box-shadow: 0 0 0 6px rgba(249, 115, 22, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
  }
}

/* Content Area */
.dashboard-content {
  padding: 10px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Metrics Grid - Grid pattern for 2x2 on small, 4x1 on large */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (min-width: 768px) {
  .metrics-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.metric-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(10, 158, 220, 0.08);
  position: relative;
  overflow: hidden;
}

/* Frutiger Aero gloss — top-half shine */
.metric-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(162, 223, 247, 0.07) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.metric-card > * { position: relative; z-index: 1; }

.metric-card:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glass-active);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-icon-wrapper {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Colors for Card Badges */
.color-indigo { background: rgba(10, 158, 220, 0.15); color: #38BDF8; }
.color-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.color-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.color-fuchsia { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.color-energy { background: rgba(249, 115, 22, 0.13); color: #fb923c; }

.card-icon {
  width: 20px;
  height: 20px;
}

.card-data {
  margin-top: 4px;
}

.card-value {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.card-label {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.card-indicator {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.trend {
  display: inline-flex;
  align-items: center;
}

.trend.positive { color: var(--color-success); }
.trend.neutral { color: var(--color-text-muted); }

/* Live Status Dot animation */
.status-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-success);
}

.pulse-indicator {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background-color: var(--color-success);
  border: 2px solid var(--bg-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-success);
}

.pulse-indicator.active {
  animation: pulse-live 1.6s infinite ease-in-out;
}

/* Columns Section */
.two-column-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 900px) {
  .two-column-layout {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.dashboard-section {
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(10, 158, 220, 0.08);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.dashboard-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(180deg, rgba(162, 223, 247, 0.05) 0%, transparent 100%);
  pointer-events: none;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(10, 158, 220, 0.08);
}

.section-title-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-icon {
  width: 20px;
  height: 20px;
}

.text-pink { color: var(--color-pink); }
.text-violet { color: var(--color-primary); }

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.section-badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-main);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
}

.section-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Responsiveness on lists (cards list for expiring memberships) */
.responsive-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.membership-item-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.membership-item-card:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(3px);
}

.member-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.member-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-main);
}

.member-plan {
  font-size: 11px;
  color: var(--color-text-muted);
}

.urgency-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  text-align: center;
}

.urgency-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.urgency-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.urgency-pink {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.25);
}

.urgency-neutral {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-muted);
  border: 1px solid var(--border-glass);
}

/* Activity Feed (Recent Visits) */
.activity-feed {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 12px;
}

/* Feed line timeline */
.activity-feed::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: rgba(10, 158, 220, 0.12);
}

.feed-item {
  position: relative;
  padding-bottom: 14px;
  padding-left: 14px;
}

.feed-item:last-child {
  padding-bottom: 0;
}

/* Dot on feed line */
.feed-item::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 6px var(--color-primary);
}

.feed-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.feed-name {
  font-size: 13px;
  font-weight: 500;
}

.feed-time {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Empty states and skeletons */
.empty-state {
  text-align: center;
  padding: 30px 20px;
  color: var(--color-text-dark);
}

.empty-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 13px;
}

/* Skeleton loader anim */
.skeleton-item {
  height: 48px;
  background: linear-gradient(90deg, rgba(10, 158, 220, 0.03) 25%, rgba(10, 158, 220, 0.07) 50%, rgba(10, 158, 220, 0.03) 75%);
  background-size: 200% 100%;
  animation: loading-skeleton 1.5s infinite;
  border-radius: 10px;
  margin-bottom: 8px;
}

/* Bottom Nav bar */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 20, 40, 0.92);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-top: 1px solid var(--border-glass);
  padding: 10px 16px;
  text-align: center;
  font-size: 11px;
  color: var(--color-text-dark);
  z-index: 40;
}

.highlight-domain {
  color: var(--color-primary);
  font-weight: 600;
}

/* Animations declarations */
@keyframes aero-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(14px, -10px) scale(1.04); }
  66%       { transform: translate(-8px, 8px) scale(0.97); }
}

@keyframes pulse-live {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1.15);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes pulse-border {
  0% {
    border-color: rgba(239, 68, 68, 0.3);
  }
  100% {
    border-color: rgba(239, 68, 68, 0.8);
  }
}

@keyframes animate-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes loading-skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.animate-spin {
  animation: spin 1.2s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Very small phones: hide logout text, keep icon only */
@media (max-width: 360px) {
  .logout-text { display: none; }
  .btn-secondary-icon { padding: 0 10px; }
}

/* Screen Optimizations for iPhone/Android Touch Gestures */
@media (hover: none) {
  .metric-card:hover {
    transform: none;
    background: var(--bg-glass);
  }
  
  .btn:active {
    opacity: 0.8;
  }
}

/* Finanzas Section */
.text-emerald { color: var(--color-success); }

.section-finance {
  margin-top: 20px;
}

.text-amber { color: var(--color-warning); }

.period-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 100px;
  padding: 3px;
}

.period-pill {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-radius: 100px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.period-pill:hover {
  color: var(--color-text-main);
}

.period-pill.active {
  background: var(--color-success);
  color: #001428;
  box-shadow: 0 2px 8px var(--color-success-glow);
}

.finance-summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(10, 158, 220, 0.08);
}

.finance-total-label {
  font-size: 12px;
  color: var(--color-text-muted);
  display: block;
}

.finance-total-value {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  color: var(--color-success);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.finance-total-count {
  font-size: 11px;
  color: var(--color-text-muted);
}

.finance-method-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.finance-method-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 100px;
  padding: 5px 12px;
  font-size: 11px;
  color: var(--color-text-main);
}

.finance-method-chip .chip-amount {
  font-weight: 700;
  color: var(--color-success);
  margin-left: 4px;
}

.finance-subheading {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

.plan-item-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.plan-item-card .plan-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-main);
}

.plan-item-card .plan-count {
  font-size: 12px;
  font-weight: 700;
  color: #38BDF8;
  background: rgba(10, 158, 220, 0.15);
  padding: 3px 10px;
  border-radius: 100px;
}

/* Finanzas: fila de estadísticas (ingreso + visitas) */
.finance-stats-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.finance-visits-value {
  color: var(--color-primary);
}

/* Miembros Section */
.text-indigo { color: #38BDF8; }

.members-search-wrapper {
  position: relative;
  margin-bottom: 14px;
}

.members-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.members-search-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-text-main);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 100px;
  padding: 10px 14px 10px 36px;
}

.members-search-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.members-search-input::placeholder {
  color: var(--color-text-muted);
}

.member-payment-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 100px;
  padding: 4px 10px;
  text-align: center;
  white-space: nowrap;
}

.member-dates {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

/* Historial de Pagos: rango de fechas */
.payments-history-date-range {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 14px;
}

.payments-history-date-input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-text-main);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 8px 10px;
  color-scheme: dark;
}

.payments-history-date-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.payments-history-date-separator {
  color: var(--color-text-muted);
  font-size: 12px;
}

/* Historial de Pagos: botón "Cargar más" */
.btn-load-more {
  width: 100%;
  margin-top: 14px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--color-text-main);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-load-more:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-text-muted);
}

/* --- Accesos: aperturas del botón físico con foto de seguridad --- */

/* El rango de fechas reusa la regla del historial de pagos en vez de
   duplicarla; esta clase solo existe para engancharse a esos selectores. */
.access-date-input {
  color-scheme: dark;
}

.access-item-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
}

.access-thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.3s;
}

.access-thumb:hover {
  border-color: var(--border-glass-active);
}

.access-thumb-empty {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px dashed var(--border-glass);
  color: var(--color-text-dark);
}

.access-thumb-empty i {
  width: 20px;
  height: 20px;
}

.access-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.access-time {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-main);
}

.access-photo-note {
  font-size: 11px;
  color: var(--color-text-dark);
}

.access-badge {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.access-badge-visit {
  color: var(--color-success);
  background: var(--color-success-glow);
  border-color: var(--color-success);
}

.access-badge-info {
  color: var(--color-warning);
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--color-warning);
}

.access-badge-dismissed {
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-glass);
}

.access-badge-pending {
  color: var(--color-energy);
  background: var(--color-energy-glow);
  border-color: var(--color-energy);
}

.access-delete-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.3s;
}

.access-delete-btn:hover {
  color: var(--color-danger);
  border-color: var(--color-danger);
  background: var(--color-danger-glow);
}

.access-delete-btn i {
  width: 16px;
  height: 16px;
}

/* Visor a pantalla completa */
.access-viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
  background: rgba(0, 10, 20, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.access-viewer.hidden {
  display: none;
}

.access-viewer-img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}

.access-viewer-caption {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
}

.access-viewer-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--color-text-main);
  cursor: pointer;
}

.access-viewer-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* Bloquea el scroll de fondo mientras el visor está abierto */
body.viewer-open {
  overflow: hidden;
}
