/* Linear Dark Minimal Modern Theme */
:root {
  --bg-dark: #090a0f;
  --card-bg: #12141c;
  --card-border: #1e2230;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --accent-cyan: #38bdf8;
  --accent-fire: #f97316;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --radius: 12px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(9, 10, 15, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.app-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px;
  position: relative;
  z-index: 1;
}

.hidden { display: none !important; }

/* LOGIN SCREEN */
.login-header {
  text-align: center;
  margin: 40px 0 28px;
}
.logo-badge {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--primary);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.login-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.profile-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.profile-card:hover, .profile-card:active {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}
.profile-card .avatar {
  font-size: 38px;
  display: block;
  margin-bottom: 8px;
}
.profile-card .name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* PIN PAD */
.pin-pad-container {
  margin-top: 30px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  animation: fadeIn 0.25s ease-out;
}
.avatar-large {
  font-size: 48px;
  display: inline-block;
  margin-bottom: 6px;
}
.pin-prompt {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.pin-display {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 24px 0 20px;
}
.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--card-border);
  transition: var(--transition);
}
.pin-dot.filled {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
}
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 76px);
  gap: 12px;
  justify-content: center;
  margin: 0 auto;
}
.pin-btn {
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.pin-btn:active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  transform: scale(0.94);
}
.pin-btn-sub {
  font-size: 13px;
  border-radius: var(--radius);
}
.error-msg {
  color: var(--accent-red);
  font-size: 13px;
  margin-top: 14px;
}

/* DASHBOARD TOP BAR */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--card-border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}
.brand-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.3px;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
}
.btn-icon {
  background: transparent;
  border: none;
  font-size: 15px;
  cursor: pointer;
  opacity: 0.8;
  padding: 2px 4px;
}
.btn-icon:hover { opacity: 1; }

/* QUICK ACTIONS */
.quick-actions {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 16px 0;
  scrollbar-width: none;
}
.quick-actions::-webkit-scrollbar { display: none; }
.btn-action {
  white-space: nowrap;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-action.primary {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-action:hover {
  border-color: var(--primary);
}

/* KPI GRID */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
@media (min-width: 600px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
}
.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.kpi-value {
  font-size: 26px;
  font-weight: 800;
  margin: 6px 0 2px;
  letter-spacing: -0.5px;
}
.kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
}
.highlight-fire { color: var(--accent-fire); }
.highlight-bpm { color: var(--accent-cyan); }

/* TABS */
.tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 18px;
  overflow-x: auto;
}
.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* SECTION HEADERS */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.section-header h3 {
  font-size: 16px;
  font-weight: 700;
}
.badge-count {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--text-muted);
}

/* WORKOUT CARD */
.workout-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  transition: var(--transition);
}
.workout-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.discipline-title {
  font-size: 16px;
  font-weight: 700;
}
.workout-date {
  font-size: 12px;
  color: var(--text-muted);
}
.workout-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.workout-meta strong {
  color: var(--text-main);
}
.zones-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  margin-bottom: 12px;
  background: #1a1d28;
  position: relative;
}
.zone-pointer {
  position: absolute;
  top: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #3b82f6;
  box-shadow: 0 0 14px #3b82f6, 0 0 6px #ffffff;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
}
.zone-seg { height: 100%; }
.z1 { background: #64748b; }
.z2 { background: #38bdf8; }
.z3 { background: #22c55e; }
.z4 { background: #f97316; }
.z5 { background: #ef4444; }
.workout-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

/* LEADERBOARD */
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.lb-rank {
  font-size: 18px;
  font-weight: 800;
  width: 28px;
  color: var(--text-muted);
}
.lb-rank.gold { color: #f59e0b; }
.lb-rank.silver { color: #94a3b8; }
.lb-rank.bronze { color: #b45309; }
.lb-avatar { font-size: 24px; }
.lb-info { flex: 1; }
.lb-name { font-weight: 600; font-size: 14px; }
.lb-sub { font-size: 12px; color: var(--text-muted); }
.lb-score { text-align: right; }
.lb-cal { font-weight: 700; color: var(--accent-fire); font-size: 16px; }
.lb-score-sub { font-size: 11px; color: var(--text-muted); }

/* BADGES GRID */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.badge-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
}
.badge-card.locked { opacity: 0.35; filter: grayscale(1); }
.badge-icon { font-size: 32px; margin-bottom: 8px; display: block; }
.badge-name { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.badge-desc { font-size: 11px; color: var(--text-muted); }

/* MODALS */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}
.modal-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  padding: 24px;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}
.form-group { margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.form-control {
  width: 100%;
  background: #090a0f;
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.form-control:focus { outline: none; border-color: var(--primary); }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.btn-primary {
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
}
.security-banner {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #86efac;
  font-size: 12px;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  line-height: 1.4;
}
.code-box {
  background: #090a0f;
  border: 1px solid var(--card-border);
  padding: 10px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 16px;
}
.code-box code { font-size: 12px; color: var(--accent-cyan); word-break: break-all; }
.copy-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 8px;
}
.guide-list { padding-left: 20px; font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.file-drop-zone {
  border: 2px dashed var(--card-border);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
}
.drop-icon { font-size: 38px; display: block; margin-bottom: 10px; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* REV 1.1 - Wizard Onboarding Guidato a Tessere */
.wizard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.wizard-tile {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.wizard-tile:hover, .wizard-tile.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.12);
  transform: translateY(-2px);
}
.wizard-tile-icon { font-size: 24px; }
.wizard-tile-name { font-size: 11px; font-weight: 600; color: var(--text-main); }
.wizard-tile-sub { font-size: 9px; color: var(--text-muted); }

.wizard-panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  display: none;
  animation: fadeIn 0.25s ease;
}
.wizard-panel.active { display: block; }
.wizard-step-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wizard-steps-list {
  padding-left: 20px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.wizard-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.btn-ping-test {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-ping-test:hover {
  background: var(--accent-cyan);
  color: #090a0f;
}
.ping-status-box {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
  display: none;
}
.ping-status-box.success {
  display: block;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid var(--accent-green);
  color: #86efac;
}
.ping-status-box.error {
  display: block;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--accent-red);
  color: #fca5a5;
}

/* REV 2.0 - Biometria Avanzata & Performance Engine */
.pill-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.pill-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}
.pill-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.biometric-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  color: var(--text-main);
}
.biometric-badge.eff {
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.06);
}
.biometric-badge.hrr {
  color: var(--accent-green);
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.06);
}
.biometric-badge.hrr.eccellente {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.4);
}
.biometric-badge.hrr.buono {
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.4);
}
.biometric-badge.hrr.nella_norma {
  color: #fde047;
  border-color: rgba(234, 179, 8, 0.4);
}
.biometric-badge.hrr.basso {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-curve {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-curve:hover {
  background: rgba(99, 102, 241, 0.25);
  color: #fff;
  border-color: var(--primary);
}

/* ==========================================================================
   MOBILE-FIRST RESPONSIVE OPTIMIZATIONS (iOS & Android)
   ========================================================================== */

/* Miglioramenti Base Modali per Touch e Mobile */
.modal {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-card {
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.close-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-main);
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.close-btn:hover, .close-btn:active {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.05);
}

@media (max-width: 640px) {
  body {
    padding-bottom: 24px;
  }

  .app-container {
    padding: 10px;
  }

  /* Modali su Mobile */
  .modal {
    padding: 10px 8px;
    align-items: center;
  }

  .modal-card {
    padding: 16px 14px;
    border-radius: 16px;
    max-height: 92vh;
    max-height: 92dvh;
  }

  .modal-header {
    position: sticky;
    top: -16px;
    background: var(--card-bg);
    z-index: 15;
    padding-top: 4px;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .modal-header h3 {
    font-size: 16px;
    line-height: 1.3;
  }

  /* Wizard Dispositivi a Tessere Swipeable */
  .wizard-grid {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 6px;
    margin-bottom: 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .wizard-grid::-webkit-scrollbar { display: none; }

  .wizard-tile {
    flex: 0 0 96px;
    min-width: 96px;
    padding: 10px 6px;
    border-radius: 10px;
    gap: 2px;
  }
  .wizard-tile-icon { font-size: 20px; }
  .wizard-tile-name { font-size: 11px; }
  .wizard-tile-sub { font-size: 8px; }

  /* Box Webhook URL Mobile */
  .code-box {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
    margin: 8px 0 12px;
  }

  .code-box code {
    word-break: break-all;
    font-size: 11px;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px;
    border-radius: 6px;
    max-height: 60px;
    overflow-y: auto;
  }

  .copy-btn {
    width: 100%;
    margin-left: 0;
    padding: 10px 12px;
    text-align: center;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    border-radius: 8px;
    font-size: 13px;
  }

  /* Istruzioni e Steps */
  .wizard-panel {
    padding: 12px;
    margin-bottom: 12px;
  }

  .wizard-step-title {
    font-size: 13px;
    line-height: 1.4;
  }

  .wizard-steps-list {
    padding-left: 18px;
    font-size: 12px;
    line-height: 1.5;
  }

  .wizard-steps-list li {
    margin-bottom: 10px;
  }

  .wizard-btn-row {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .wizard-btn-row .btn-primary,
  .wizard-btn-row .btn-ping-test,
  .wizard-btn-row .btn-secondary {
    width: 100%;
    height: 42px;
    justify-content: center;
    font-size: 13px;
    border-radius: 10px;
  }

  /* Griglia KPI su Mobile (2 Colonne Compatte) */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
  }

  .kpi-card {
    padding: 12px;
  }

  .kpi-value {
    font-size: 20px;
  }

  .kpi-label {
    font-size: 10px;
  }

  /* Quick Actions Bar su Mobile */
  .quick-actions {
    padding: 10px 0;
    gap: 6px;
  }

  .btn-action {
    padding: 8px 14px;
    font-size: 12px;
  }

  /* Barra Tab Orizzontale Swipeable */
  .tabs-nav {
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
    margin-bottom: 14px;
  }
  .tabs-nav::-webkit-scrollbar { display: none; }

  .tab-btn {
    padding: 8px 10px;
    font-size: 13px;
  }

  /* Workout Card su Mobile */
  .workout-card {
    padding: 14px;
    margin-bottom: 10px;
  }

  .discipline-title {
    font-size: 15px;
  }

  .workout-meta {
    font-size: 12px;
    gap: 10px;
  }

  .workout-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .workout-footer div {
    width: 100%;
    display: flex;
    gap: 6px;
  }

  .workout-footer button {
    flex: 1;
    text-align: center;
    justify-content: center;
  }
}

.detailed-guide-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  margin-top: 10px;
  margin-bottom: 6px;
  transition: var(--transition);
}
.detailed-guide-link:hover, .detailed-guide-link:active {
  background: rgba(99, 102, 241, 0.25);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
}


/* ==========================================================
   PALINSESTO LIVE & INTERACTIVE BOOKING (ONE-CLICK)
   ========================================================== */
.palinsesto-date-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 2px 14px 2px;
  -webkit-overflow-scrolling: touch;
}
.palinsesto-date-pill {
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.palinsesto-date-pill:hover {
  border-color: var(--primary-light);
  color: var(--text-main);
}
.palinsesto-date-pill.active {
  background: var(--primary);
  border-color: var(--primary-light);
  color: #fff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.class-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  transition: transform 0.15s, border-color 0.15s;
}
.class-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
}
.class-card.booked {
  border-color: rgba(34, 197, 94, 0.5);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.05), var(--bg-card));
}
.class-info {
  flex: 1;
  min-width: 200px;
}
.class-time {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}
.class-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}
.class-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.class-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-book {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-book:hover {
  opacity: 0.9;
}
.btn-unbook {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #f87171;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-unbook:hover {
  background: rgba(239, 68, 68, 0.25);
}
.btn-full {
  background: #374151;
  color: #9ca3af;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Station Picker Grid */
.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
  gap: 10px;
  margin: 16px 0;
  max-height: 50vh;
  overflow-y: auto;
  padding: 4px;
}
.station-item {
  padding: 12px 6px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid var(--border-color);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.station-item.free {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #86efac;
}
.station-item.free:hover {
  background: rgba(34, 197, 94, 0.25);
  border-color: #22c55e;
}
.station-item.instructor {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  cursor: not-allowed;
  opacity: 0.85;
}
.station-item.occupied {
  background: #1f2937;
  border-color: #374151;
  color: #6b7280;
  cursor: not-allowed;
  opacity: 0.6;
}
.station-item.selected {
  background: #22c55e;
  border-color: #86efac;
  color: #000;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
}


/* MODALITÀ ATTIVAZIONE TECHNOGYM: TUTTO GRIGIO TRANNE IL TASTO */
.dashboard-locked-overlay {
  opacity: 0.35;
  filter: grayscale(100%);
  pointer-events: none !important;
  user-select: none;
  transition: all 0.3s ease;
}

.onboarding-banner-urgent {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(239, 68, 68, 0.25));
  border: 2px solid #f59e0b;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.35);
  border-radius: 14px;
  padding: 22px 18px;
  margin: 18px 0 24px;
  text-align: center;
  animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 15px rgba(245, 158, 11, 0.3); }
  100% { box-shadow: 0 0 30px rgba(239, 68, 68, 0.5); }
}

.btn-urgent-connect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
  margin-top: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-urgent-connect:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.6);
}

.badge-unbook-locked {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
