/* Stili CSS per il frontend - Card layout */

:root {
  /* Palette GYM chiara, usata sia in light che in dark mode per il portale */
  color-scheme: light;
  --gym-bg: #f1f2f6;
  --gym-surface: #fbfbfd;
  --gym-surface-alt: #f3f4f8;
  --gym-surface-muted: #e6e8ef;
  --gym-border: #d4d8e5;
  --gym-border-strong: #a6aec4;
  --gym-text: #1a1f2c;
  --gym-text-muted: #4f566b;
  --gym-primary: #4b5ce7;
  --gym-primary-dark: #2c3b9f;
  --gym-primary-soft: rgba(75, 92, 231, 0.15);
  --gym-success: #128f5c;
  --gym-warning: #b45309;
  --gym-danger: #c53030;
  --gym-info: #0a6ad8;
  --gym-card-shadow: 0 12px 30px rgba(17, 23, 42, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Manteniamo il portale TRK-GymBook in tema chiaro anche su dispositivi in dark mode */
    color-scheme: light;
    --gym-bg: #f1f2f6;
    --gym-surface: #fbfbfd;
    --gym-surface-alt: #f3f4f8;
    --gym-surface-muted: #e6e8ef;
    --gym-border: #d4d8e5;
    --gym-border-strong: #a6aec4;
    --gym-text: #1a1f2c;
    --gym-text-muted: #4f566b;
    --gym-primary: #4b5ce7;
    --gym-primary-dark: #2c3b9f;
    --gym-primary-soft: rgba(75, 92, 231, 0.15);
    --gym-success: #128f5c;
    --gym-warning: #b45309;
    --gym-danger: #c53030;
    --gym-info: #0a6ad8;
    --gym-card-shadow: 0 12px 30px rgba(17, 23, 42, 0.08);
  }
}

body.trk-gymbook-frontend {
  background: var(--gym-bg);
  color: var(--gym-text);
}

/* Griglia attività */
.trkgb-activities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin: 30px 0;
}

/* Card attività */
.trkgb-activity-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.trkgb-activity-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* Card header */
.trkgb-card-header {
  background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
  color: white;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.trkgb-activity-name {
  margin: 0;
  font-size: 1.3em;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.trkgb-next-date {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.95em;
  cursor: pointer;
  transition: transform 0.2s;
}

.trkgb-next-date:hover {
  transform: scale(1.05);
}

/* Card body */
.trkgb-card-body {
  padding: 20px;
}

/* Meta info */
.trkgb-activity-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.trkgb-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95em;
}

.trkgb-icon {
  font-size: 1.2em;
}

/* Descrizione */
.trkgb-activity-description {
  color: #444;
  line-height: 1.5;
  margin: 16px 0;
  font-size: 0.95em;
}

/* Link dettagli */
.trkgb-details-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2c5282;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 0;
  transition: color 0.2s;
}

.trkgb-details-link:hover {
  color: #1a365d;
  text-decoration: underline;
}

/* Sezione dettagli */
.trkgb-card-details {
  padding: 10px;
  background-color: #f9f9f9;
  border-top: 1px solid #eee;
}

/* Responsive */
@media (max-width: 768px) {
  .trkgb-activities-grid {
    grid-template-columns: 1fr;
  }

  .trkgb-activity-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .trkgb-activity-card {
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
    margin-bottom: 18px;
  }

  .trkgb-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 12px;
    font-size: 1.08em;
  }

  .trkgb-next-date {
    padding: 5px 10px;
    font-size: 0.98em;
  }

  .trkgb-card-details {
    padding: 8px 6px;
    font-size: 0.98em;
  }

  .trkgb-activity-meta {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .trkgb-activity-name {
    font-size: 1.1em;
  }
}

@media (max-width: 360px) {
  .trkgb-activity-card {
    border-radius: 4px;
  }
}

.trkgb-slot-card__name {
  font-weight: 600;
  font-stretch: condensed;
  font-family: system-ui, -apple-system, "Segoe UI", "Roboto Condensed", "Arial Narrow", sans-serif;
  color: var(--gym-text);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

.trkgb-slot-card__time {
  font-size: 0.72rem;
  color: var(--gym-text-muted);
}

.trkgb-slot-card__capacity {
  font-size: 0.7rem;
  color: var(--gym-text-muted);
}

.trkgb-slot-card__status {
  font-size: 0.7rem;
  margin-top: 2px;
  color: var(--gym-success);
}

.trkgb-slot-card__notes {
  font-size: 0.68rem;
  color: var(--gym-text-muted);
}

.trkgb-day-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 2px;
  border-radius: 10px;
  background: var(--gym-surface);
  border: 1px solid var(--gym-border);
  font-size: 0.72rem;
  color: var(--gym-text-muted);
  text-align: center;
}

.trkgb-day-header__date {
  font-size: 0.7rem;
}

@media (max-width: 768px) {
  .trkgb-grid {
    padding: 4px;
  }

  .trkgb-grid__scroll {
    overflow-x: hidden;
  }

  .trkgb-grid__head-row {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1px;
  }

  .trkgb-slot-card {
    font-size: 0.9rem;
    padding: 6px 6px;
  }

  .trkgb-slot-card__name {
    font-size: 0.85rem;
  }

  .trkgb-slot-card__time,
  .trkgb-slot-card__capacity,
  .trkgb-slot-card__status,
  .trkgb-slot-card__notes {
    font-size: 0.75rem;
  }
}

.gym-profile-nav {
  margin: 16px 0;
  background: var(--gym-surface);
  border-radius: 16px;
  border: 1px solid var(--gym-border);
  padding: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--gym-border) transparent;
}

.gym-profile-nav::-webkit-scrollbar {
  height: 4px;
}

.gym-profile-nav::-webkit-scrollbar-track {
  background: transparent;
  margin: 0 8px;
}

.gym-profile-nav::-webkit-scrollbar-thumb {
  background: var(--gym-border);
  border-radius: 10px;
}

.gym-profile-nav::-webkit-scrollbar-thumb:hover {
  background: var(--gym-border-strong);
}

.gym-profile-nav ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: center;
}

.gym-profile-nav li {
  flex: 0 0 auto;
  min-width: fit-content;
  list-style: none;
}

.gym-profile-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  min-height: 52px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gym-text-muted);
  background: var(--gym-surface-alt);
  border: 2px solid transparent;
  border-radius: 12px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.gym-profile-nav a:focus-visible {
  outline: 3px solid var(--gym-primary);
  outline-offset: 2px;
  color: var(--gym-primary-dark);
  border-color: rgba(52, 81, 178, 0.4);
}

.gym-profile-nav a:hover {
  color: var(--gym-primary-dark);
  background: var(--gym-surface);
  border-color: rgba(52, 81, 178, 0.3);
  box-shadow: 0 4px 12px rgba(52, 81, 178, 0.15);
  transform: translateY(-1px);
}

.gym-profile-nav li.is-active a {
  color: var(--gym-primary-dark);
  background: var(--gym-surface);
  border-color: rgba(52, 81, 178, 0.4);
  box-shadow: 0 6px 16px rgba(52, 81, 178, 0.18);
  font-weight: 700;
}

.gym-profile-nav a:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(52, 81, 178, 0.15);
}

/* Stili per le icone SVG nella navigazione */
.gym-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; /* Dimensione icona ottimale per touch */
  height: 32px;
  flex-shrink: 0;
  line-height: 1;
}

.gym-nav-icon svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  /* Le icone originali hanno colori propri definiti nei <defs>, 
     ma se si volesse forzare il colore del tema si potrebbe usare: */
  /* fill: currentColor; */
}

/* Utility per nascondere testo ma mantenerlo accessibile agli screen reader */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important; 
}

/* Desktop: layout più compatto */
@media (min-width: 769px) {
  .gym-profile-nav {
    padding: 6px;
    overflow-x: visible;
  }
  
  .gym-profile-nav ul {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  
  .gym-profile-nav a {
    padding: 12px 18px;
    min-height: 48px;
    font-size: 0.9rem;
  }
}

/* Tablet: più spazio ma ancora scroll */
@media (min-width: 481px) and (max-width: 768px) {
  .gym-profile-nav a {
    padding: 14px 18px;
    font-size: 0.93rem;
  }
}

/* Small mobile: compattazione ulteriore */
@media (max-width: 360px) {
  .gym-profile-nav {
    padding: 6px;
    border-radius: 12px;
  }
  
  .gym-profile-nav ul {
    gap: 6px;
  }
  
  .gym-profile-nav a {
    padding: 12px 16px;
    font-size: 0.9rem;
  }
}

.gym-profile-section {
  background: var(--gym-surface);
  border-radius: 20px;
  border: 1px solid rgba(217, 226, 236, 0.7);
  padding: 6px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.1);
  display: grid;
  gap: 18px;
}

.gym-profile-section h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--gym-primary-dark);
}

/* ========================================= */
/* FORM PROFILO - Responsive & WCAG/ARIA    */
/* ========================================= */

.gym-profile-form {
  display: grid;
  gap: 20px;
  width: 100%;
}

.gym-profile-form p {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gym-profile-form label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gym-text);
  cursor: pointer;
}

.gym-profile-form input[type="text"],
.gym-profile-form input[type="email"],
.gym-profile-form input[type="tel"],
.gym-profile-form input[type="password"],
.gym-profile-form input[type="date"],
.gym-profile-form select,
.gym-profile-form textarea {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--gym-text);
  background: var(--gym-surface);
  border: 2px solid var(--gym-border);
  border-radius: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  min-height: 48px;
}

.gym-profile-form input:focus,
.gym-profile-form select:focus,
.gym-profile-form textarea:focus {
  outline: none;
  border-color: var(--gym-primary);
  box-shadow: 0 0 0 3px var(--gym-primary-soft);
}

.gym-profile-form input:focus-visible,
.gym-profile-form select:focus-visible,
.gym-profile-form textarea:focus-visible {
  outline: 3px solid var(--gym-primary);
  outline-offset: 2px;
}

.gym-profile-form input::placeholder,
.gym-profile-form textarea::placeholder {
  color: var(--gym-text-muted);
  opacity: 0.7;
}

.gym-profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 600px) {
  .gym-profile-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.gym-profile-form fieldset {
  border: 1px solid var(--gym-border);
  border-radius: 12px;
  padding: 20px;
  margin: 0;
}

.gym-profile-form fieldset legend {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gym-primary-dark);
  padding: 0 8px;
}

.gym-profile-form .gym-field-help {
  font-size: 0.85rem;
  color: var(--gym-text-muted);
  margin-top: 8px;
  line-height: 1.4;
}

.gym-profile-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 8px;
}

.gym-profile-form button,
.gym-profile-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  min-height: 48px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--gym-primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.gym-profile-form button:hover,
.gym-profile-save:hover {
  background: var(--gym-primary-dark);
  box-shadow: 0 4px 12px rgba(75, 92, 231, 0.3);
}

.gym-profile-form button:focus-visible,
.gym-profile-save:focus-visible {
  outline: 3px solid var(--gym-primary);
  outline-offset: 2px;
}

.gym-profile-form button:active,
.gym-profile-save:active {
  transform: translateY(1px);
}

.gym-profile-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--gym-text);
  cursor: pointer;
}

.gym-profile-remember input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--gym-primary);
  cursor: pointer;
}

.gym-profile-auth__tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--gym-border);
  padding-bottom: 0;
}

.gym-profile-auth__tab {
  flex: 1;
  padding: 14px 16px;
  min-height: 48px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gym-text-muted);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  margin-bottom: -2px;
}

.gym-profile-auth__tab:hover {
  color: var(--gym-primary);
}

.gym-profile-auth__tab.is-active {
  color: var(--gym-primary-dark);
  border-bottom-color: var(--gym-primary);
}

.gym-profile-auth__tab:focus-visible {
  outline: 3px solid var(--gym-primary);
  outline-offset: -3px;
}

.gym-profile-auth__switch {
  font-size: 0.9rem;
  color: var(--gym-text-muted);
  text-align: center;
  margin-top: 16px;
}

.gym-profile-auth__switch a {
  color: var(--gym-primary);
  text-decoration: none;
  font-weight: 500;
}

.gym-profile-auth__switch a:hover {
  text-decoration: underline;
}

.gym-profile-empty {
  margin: 0;
  padding: 18px;
  border-radius: 14px;
  border: 1px dashed rgba(82, 96, 109, 0.35);
  list-style: none;
  display: grid;
  gap: 12px;
}

.gym-profile-credit-list li {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  grid-template-areas:
    "name count"
    "expiry count";
  gap: 4px 14px;
  padding: 16px 18px 16px 44px;
  border-radius: 14px;
  border: 1px solid rgba(217, 226, 236, 0.7);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  color: var(--gym-text);
  line-height: 1.3;
}

.gym-profile-credit-list li::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--credit-color, var(--gym-primary));
  box-shadow: 0 0 0 3px rgba(52, 81, 178, 0.18);
}

.gym-profile-credit-list .gym-credit-name {
  grid-area: name;
  font-weight: 700;
  min-width: 0;
}

.gym-profile-credit-list .gym-credit-count {
  grid-area: count;
  justify-self: end;
  align-self: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--credit-color, var(--gym-primary-dark));
}

.gym-profile-credit-list .gym-credit-expiry {
  grid-area: expiry;
  font-size: 0.9rem;
  color: var(--gym-text-muted);
  display: block;
  white-space: normal;
}

.gym-profile-credit-list .gym-credit-expiry--expired {
  color: var(--gym-danger);
  font-weight: 600;
}

@media (min-width: 720px) {
  .gym-profile-credit-list li {
    grid-template-columns: 1fr auto;
    grid-template-areas: "name expiry count";
    grid-template-rows: auto;
    align-items: center;
    padding: 16px 20px 16px 50px;
    gap: 10px 18px;
  }

  .gym-profile-credit-list li::before {
    top: 50%;
    transform: translateY(-50%);
  }

  .gym-profile-credit-list .gym-credit-expiry {
    justify-self: end;
    white-space: nowrap;
  }
}

.gym-profile-activities {
  display: grid;
  gap: 16px;
}

.gym-bookings-list {
  display: grid;
  gap: 18px;
}

.gym-booking-card {
  background: var(--gym-surface);
  border: 2px solid rgba(217, 226, 236, 0.8);
  border-radius: 16px;
  padding: 20px 18px;
  display: grid;
  gap: 16px;
  transition: all 0.2s ease;
  /* Touch optimization */
  -webkit-tap-highlight-color: rgba(0,0,0,0.05);
}

.gym-booking-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.gym-booking-badge {
  padding: 6px 12px;
  border-radius: 20px;
}

.gym-booking-card__info {
  display: grid;
  gap: 8px;
}

.gym-booking-card__info p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gym-text);
  font-size: 0.95rem;
  line-height: 1.5;
}

.gym-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  z-index: 10000;
  min-width: 280px;
  max-width: 90vw;
  padding: 16px 20px;
  border-radius: 14px;
  background: white;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.25);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s ease;
  cursor: pointer;
  /* Touch optimization */
  -webkit-tap-highlight-color: rgba(0,0,0,0.05);
  touch-action: manipulation;
}

.gym-toast--show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.gym-toast__icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  display: inline-block;
}

.gym-toast__text {
  flex: 1;
  line-height: 1.4;
}

.gym-toast--success {
  border-left: 4px solid var(--gym-success);
  color: var(--gym-success);
}

.gym-toast--error {
  border-left: 4px solid var(--gym-danger);
  color: var(--gym-danger);
}

.gym-toast--info {
  border-left: 4px solid var(--gym-primary);
  color: var(--gym-primary);
}

/* Responsive ottimizzazioni */
@media (max-width: 480px) {
  .gym-activity-card__header {
    flex-direction: column;
    gap: 8px;
  }

  .gym-activity-badge--capacity {
    align-self: flex-start;
  }

  .gym-btn {
    font-size: 1.05rem;
    padding: 16px 24px;
    min-height: 52px; /* Più grande su mobile */
  }

  /* Pulsanti portale più grandi su mobile */
  .gym-profile-form button,
  .gym-profile-save,
  .gym-profile-logout {
    font-size: 1.05rem;
    padding: 16px 24px;
    min-height: 52px; /* Apple HIG smartphone */
  }

  /* Navigation tabs più touch-friendly */
  .gym-profile-nav a {
    padding: 16px;
    min-height: 52px;
    font-size: 1rem;
  }

  /* Icone SVG responsive su mobile */
  .gym-nav-icon {
    width: 28px;
    height: 28px;
  }

  /* Auth tabs più grandi */
  .gym-profile-auth__tab {
    padding: 16px;
    min-height: 52px;
  }

  /* Form inputs più comodi su mobile */
  .gym-profile-form input,
  .gym-profile-form select,
  .gym-profile-form textarea {
    padding: 16px;
    min-height: 52px;
    font-size: 1.05rem;
  }

  .gym-toast {
    min-width: calc(100vw - 40px);
    top: 16px;
  }
}

@media (max-width: 360px) {
  .gym-booking-date-input,
  .gym-availability-badge {
    font-size: 0.9rem;
    padding: 12px 14px;
  }

  .gym-btn {
    font-size: 1rem;
    padding: 14px 20px;
  }

  /* Icone SVG ancora più piccole su schermi molto piccoli */
  .gym-nav-icon {
    width: 24px;
    height: 24px;
  }
}

/* Animazioni responsive performance */
@media (prefers-reduced-motion: reduce) {
  .gym-btn,
  .gym-booking-card,
  .gym-availability-badge,
  .gym-toast,
  .gym-profile-nav a {
    transition: none;
    animation: none;
  }
}

/* Dark mode: il portale mantiene la palette chiara definita su :root (nessun override aggiuntivo qui) */

/* ========================================================= */
/*  GRIGLIA SETTIMANALE ATTIVITÀ (FRONTEND) - 6 COLONNE      */
/*  Layout compatto ma leggibile, pensato per mobile first   */
/* ========================================================= */

.trkgb-grid {
  position: relative;
  max-width: 100%;
  box-sizing: border-box;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--gym-border);
  background: #ffffff;
}

.trkgb-grid__header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.trkgb-grid__credits {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 8px;
  border: 1px solid var(--gym-border);
  flex-wrap: wrap;
}

.trkgb-credits__label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gym-text);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.trkgb-credits__label svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.trkgb-credits__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.trkgb-credit-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: white;
  border-radius: 20px;
  border: 2px solid var(--credit-color, #4b6cb7);
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.15s ease;
}

.trkgb-credit-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.trkgb-credit-badge__name {
  color: var(--gym-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.trkgb-credit-badge__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--credit-color, #4b6cb7);
  color: white;
  border-radius: 11px;
  font-weight: 700;
  font-size: 0.75rem;
}

.trkgb-credits__empty,
.trkgb-credits__error {
  font-size: 0.8rem;
  color: var(--gym-text-muted);
  font-style: italic;
}

.trkgb-grid__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trkgb-grid__head-row {
  display: block;
}

.trkgb-grid__time-col-header {
  display: none;
}

.trkgb-grid__days-header {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2px;
}

.trkgb-day-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 3px 2px;
  border-radius: 6px;
  background: var(--gym-surface);
  border: 1px solid var(--gym-border);
  font-size: 0.7rem;
  color: var(--gym-text-muted);
  text-align: center;
}

.trkgb-day-header__date {
  font-size: 0.68rem;
}

.trkgb-grid__scroll {
  overflow-x: hidden;
}

.trkgb-row {
  margin-top: 2px;
}

.trkgb-row__label {
  display: none; /* Nasconde "Mattino 1/2" per guadagnare spazio */
}

.trkgb-row__cells {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2px;
}

.trkgb-cell {
  min-height: 40px;
  padding: 1px;
  box-sizing: border-box;
}

.trkgb-slot-card {
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #f9fafb;
  padding: 3px 4px;
  font-size: 0.78rem;
  border-left: 4px solid var(--trkgb-activity-color, #4b6cb7);
}

.trkgb-slot-card__name {
  font-weight: 600;
  font-stretch: condensed;
  font-family: system-ui, -apple-system, "Segoe UI", "Roboto Condensed", "Arial Narrow", sans-serif;
  color: var(--gym-text);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

.trkgb-slot-card__time {
  display: block;
  font-size: 0.7rem;
  white-space: pre-line;
}

.trkgb-slot-card__status,
.trkgb-slot-card__notes {
  display: block;
  font-size: 0.7rem;
}

.trkgb-slot-card__status-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.trkgb-status-badge--booked {
  background: #22c55e;
  border-color: #16a34a;
}

.trkgb-status-badge--waiting {
  background: #fbbf24;
  border-color: #f59e0b;
}

.trkgb-status-badge--full {
  background: #ef4444;
  border-color: #dc2626;
}

.trkgb-status-badge--available {
  background: #ffffff;
  border-color: #d1d5db;
}

.trkgb-slot-card__capacity {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.trkgb-capacity-icon {
  font-size: 0.7rem;
  line-height: 1;
}

.trkgb-capacity-text {
  font-size: 0.7rem;
}

.trkgb-slot-card--selected {
  background: rgba(75, 92, 231, 0.15);
  border-color: var(--gym-primary);
}

/* Stati slot card */
.trkgb-slot-card--past {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--gym-surface-alt, #f5f5f5);
}

.trkgb-slot-card--no-credits {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--gym-surface-alt, #f5f5f5);
}

.trkgb-slot-card--disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--gym-surface-alt, #f5f5f5);
}

.trkgb-slot-card--already-booked {
  opacity: 0.7;
  cursor: default;
  background: rgba(34, 139, 34, 0.1);
}

.trkgb-slot-card--cannot-cancel {
  cursor: not-allowed;
  opacity: 0.6;
}

.trkgb-slot-card--booked {
  opacity: 0.7;
  background: rgba(34, 139, 34, 0.1);
}

.trkgb-slot-card--waiting {
  opacity: 0.7;
  background: rgba(255, 165, 0, 0.1);
}

.trkgb-slot-card--full {
  background: rgba(220, 38, 38, 0.05);
}

.trkgb-slot-card--almost-full {
  background: rgba(255, 165, 0, 0.05);
}

/* Dark mode support per gli stati */
@media (prefers-color-scheme: dark) {
  .trkgb-slot-card--past,
  .trkgb-slot-card--no-credits,
  .trkgb-slot-card--disabled {
    background: rgba(255, 255, 255, 0.05);
  }

  .trkgb-slot-card--already-booked,
  .trkgb-slot-card--booked {
    background: rgba(34, 139, 34, 0.15);
  }

  .trkgb-slot-card--waiting {
    background: rgba(255, 165, 0, 0.15);
  }

  .trkgb-slot-card--full {
    background: rgba(220, 38, 38, 0.1);
  }

  .trkgb-slot-card--almost-full {
    background: rgba(255, 165, 0, 0.1);
  }
}

/* Etichetta settimana centrata */
.trkgb-grid__week-label {
  text-align: center;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--gym-text);
  margin: 0 auto;
  width: 100%;
}

/* Data iscrizione nel tab profilo */
.gym-profile-registration {
  margin: 0 0 20px 0;
  padding: 12px 16px;
  background: var(--gym-surface);
  border-radius: 8px;
  border: 1px solid var(--gym-border);
  font-size: 0.9rem;
  color: var(--gym-text);
}

.gym-profile-registration strong {
  color: var(--gym-primary);
  font-weight: 600;
}

/* Sezione logout nel tab profilo */
.gym-profile-logout-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid var(--gym-border);
  text-align: center;
}

.gym-profile-logout-section .gym-profile-logout {
  display: inline-block;
  padding: 12px 32px;
  background: var(--gym-danger);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

.gym-profile-logout-section .gym-profile-logout:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Footer griglia */
.trkgb-grid__footer {
  margin-top: 16px;
  padding: 12px;
  background: var(--gym-surface);
  border-radius: 8px;
  border: 1px solid var(--gym-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trkgb-grid__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.trkgb-grid__summary {
  font-size: 0.9rem;
  color: var(--gym-text);
  text-align: center;
  font-weight: 500;
  flex: 1;
  min-width: 120px;
  padding: 0 8px;
}

.trkgb-grid__actions .trkgb-btn[data-action="prev-week"],
.trkgb-grid__actions .trkgb-btn[data-action="next-week"] {
  min-width: 48px;
  height: 48px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.trkgb-grid__actions .trkgb-btn[data-action="prev-week"]:hover,
.trkgb-grid__actions .trkgb-btn[data-action="next-week"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.trkgb-grid__actions .trkgb-btn[data-action="prev-week"]:focus,
.trkgb-grid__actions .trkgb-btn[data-action="next-week"]:focus {
  outline: 2px solid var(--gym-primary);
  outline-offset: 2px;
}

#trkgb-confirm-bookings {
  flex: 2;
  max-width: 200px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--gym-primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(75, 92, 231, 0.3);
}

#trkgb-confirm-bookings:hover:not(:disabled) {
  background: var(--gym-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(75, 92, 231, 0.4);
}

#trkgb-confirm-bookings:active:not(:disabled) {
  transform: translateY(0);
}

#trkgb-confirm-bookings:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .trkgb-grid {
    padding: 4px;
  }

  .trkgb-grid__header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }
  
  .trkgb-grid__credits {
    padding: 6px 10px;
  }
  
  .trkgb-credits__label {
    font-size: 0.95rem;
  }
  
  .trkgb-credit-badge {
    font-size: 0.75rem;
    padding: 3px 8px;
  }
  
  .trkgb-credit-badge__name {
    max-width: 100px;
  }
  
  .trkgb-credit-badge__count {
    min-width: 20px;
    height: 20px;
    font-size: 0.7rem;
  }

  .trkgb-grid__week-nav {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 4px;
  }

  /* Footer actions responsive - mantiene layout desktop */
  .trkgb-grid__actions {
    gap: 8px;
    padding: 0 4px;
  }

  .trkgb-grid__actions .trkgb-btn[data-action="prev-week"],
  .trkgb-grid__actions .trkgb-btn[data-action="next-week"] {
    min-width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  #trkgb-confirm-bookings {
    flex: 2;
    max-width: 160px;
    font-size: 0.9rem;
    padding: 10px 16px;
  }

  .trkgb-grid__summary {
    font-size: 0.85rem;
    padding: 0 4px;
  }
}

/* ========================================= */
/* NOTIFICHE - Notification Cards           */
/* ========================================= */

.gym-notifications-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--gym-surface);
  border: 2px solid var(--gym-border);
  border-radius: 12px;
  flex-wrap: wrap;
}

.gym-btn--small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.gym-notifications-toolbar .gym-btn,
.gym-notification-card__actions .gym-btn {
  border-radius: 10px;
  border: 2px solid transparent;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.gym-notifications-toolbar .gym-btn:hover:not(:disabled),
.gym-notification-card__actions .gym-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

.gym-btn--secondary {
  background: var(--gym-surface);
  color: var(--gym-primary-dark);
  border-color: var(--gym-border-strong);
}

.gym-btn--secondary:hover:not(:disabled) {
  background: var(--gym-primary-soft);
  border-color: var(--gym-primary);
  color: var(--gym-primary-dark);
}

.gym-btn--secondary:focus-visible,
.gym-btn--danger:focus-visible,
.gym-btn--primary:focus-visible {
  outline: 2px solid var(--gym-primary);
  outline-offset: 2px;
}

.gym-notifications-toolbar .gym-btn:disabled,
.gym-notification-card__actions .gym-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.gym-btn--danger {
  background: var(--gym-danger);
  color: white;
  border: 2px solid var(--gym-danger);
}

.gym-btn--danger:hover:not(:disabled) {
  background: #b91c1c;
  border-color: #b91c1c;
}

.gym-notifications-list__inner {
  display: grid;
  gap: 16px;
}

.gym-notification-card {
  background: var(--gym-surface);
  border: 2px solid var(--gym-border);
  border-radius: 16px;
  padding: 20px;
  display: grid;
  gap: 14px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.gym-notification-card:hover {
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  border-color: var(--gym-border-strong);
}

.gym-notification-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gym-notification-card__header h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gym-primary-dark);
  line-height: 1.3;
}

.gym-notification-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 12px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gym-notification-badge--unread {
  background: var(--gym-primary-soft);
  color: var(--gym-primary-dark);
  border: 1px solid var(--gym-primary);
}

.gym-notification-badge--read {
  background: var(--gym-surface-muted);
  color: var(--gym-text-muted);
  border: 1px solid var(--gym-border);
}

.gym-notification-card__body {
  display: grid;
  gap: 10px;
}

.gym-notification-card__body p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--gym-text);
}

.gym-notification-card__meta {
  font-size: 0.85rem !important;
  color: var(--gym-text-muted) !important;
  font-style: italic;
}

.gym-notification-card__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

/* Stili specifici per tipo di notifica */
.gym-notification-card[data-type="BOOKING_CONFIRMED"] {
  border-left: 4px solid var(--gym-success);
}

.gym-notification-card[data-type="QUEUE_ADDED"] {
  border-left: 4px solid var(--gym-warning);
}

.gym-notification-card[data-type="QUEUE_SLOT_AVAILABLE"] {
  border-left: 4px solid var(--gym-info);
  background: linear-gradient(to right, rgba(10, 106, 216, 0.03), var(--gym-surface));
}

.gym-notification-card[data-type="QUEUE_PROMOTED"] {
  border-left: 4px solid var(--gym-success);
  background: linear-gradient(to right, rgba(18, 143, 92, 0.05), var(--gym-surface));
}

.gym-notification-card[data-type="BOOKING_CANCELLED"] {
  border-left: 4px solid var(--gym-danger);
}

.gym-notification-card[data-type="SESSION_REMINDER"] {
  border-left: 4px solid var(--gym-primary);
}

/* Responsive notifiche */
@media (max-width: 480px) {
  .gym-notification-card {
    padding: 16px;
  }

  .gym-notification-card__header h4 {
    font-size: 0.95rem;
  }

  .gym-notification-badge {
    font-size: 0.7rem;
    padding: 4px 10px;
  }

  .gym-notification-card__body p {
    font-size: 0.9rem;
  }
}