/* ====== FIX SOLO PER MODALE vs NAVBAR ====== */
/* Altezze e z-index in variabili (fallback sicuri) */
:root {
  --app-nav-h: 56px;          /* altezza tipica navbar mobile, fallback */
  --z-navbar: 1030;           /* z-index navbar Bootstrap tipico */
  --z-modal: 2005;            /* > navbar */
  --z-backdrop: 2000;         /* appena sotto la modale */
}

/* (opzionale) se vuoi forzare lo z-index navbar qui */
.navbar { z-index: var(--z-navbar); }

/* La modale deve stare sopra la navbar */
.modal { z-index: var(--z-modal); }
.modal-backdrop { z-index: var(--z-backdrop); }

/* In mobile aggiungi un margine-top così la modale non "tocca" la navbar */
@media (max-width: 576px) {
  .modal.show .modal-dialog {
    margin-top: calc(var(--app-nav-h) + .5rem);
  }
}




.step { display: none; }
.step.active { display: block; }


/* ====== TUO CSS ORIGINALE (immutato) ====== */
.no-navbar .app-content { 
  padding-top: 0; 
}
.app-content { 
  padding-top: 40px; /* altezza reale navbar */
}
th.sortable { 
    cursor:pointer; 
    user-select:none; 
    white-space:nowrap; 
}
/* la colonna attrezzi NON si prende tutto lo spazio residuo */
td.td-attrezzi{ 
  width: 1%; 
  white-space: nowrap; 
  padding-right: .25rem; /* o 0 se vuoi proprio zero */
}
/* Nasconde visivamente il checkbox ma lo lascia accessibile */
.cat-card .card-chk{ 
  position: absolute; 
  opacity: 0; 
  width: 1px; 
  height: 1px; 
  pointer-events: none; 
}
/* Feedback visivo */
.cat-card { cursor: pointer; } 
.cat-card.selected{ 
  outline: 2px solid #0d6efd; 
  box-shadow: 0 0 0 .2rem rgba(13,110,253,.15); 
}
/* === UTENTI: CARD VIEW (allineata alle cat-card) === */
/* Nasconde visivamente il checkbox ma lo lascia accessibile */
.user-card .card-chk{ 
  position: absolute; 
  opacity: 0; 
  width: 1px; 
  height: 1px; 
  pointer-events: none; 
}
/* Feedback visivo + affordance click */
.user-card { cursor: pointer; } 
.user-card.selected{ 
  outline: 2px solid #0d6efd; /* come cat-card.selected */ 
  box-shadow: 0 0 0 .2rem rgba(13,110,253,.15); 
}
/* Dettagli piccoli di leggibilità nelle card utente */
.user-card .card-header .badge { 
  font-size: .7rem; 
}
.user-card .card-body .small i { 
  opacity: .7; 
}
/* === SOCIETA: CARD VIEW (allineata a cat-card / user-card) === */
.soc-card .card-chk{ 
  position: absolute; 
  opacity: 0; 
  width: 1px; 
  height: 1px; 
  pointer-events: none; 
}
.soc-card { cursor: pointer; } 
.soc-card.selected{ 
  outline: 2px solid #0d6efd; 
  box-shadow: 0 0 0 .2rem rgba(13,110,253,.15); 
}
.soc-card .card-header .badge { 
  font-size: .7rem; 
}
/* === GARE: CARD VIEW (allineata a cat-card / user-card / soc-card) === */
.gara-card .card-chk{ 
  position: absolute; 
  opacity: 0; 
  width: 1px; 
  height: 1px; 
  pointer-events: none; 
}
.gara-card { cursor: pointer; } 
.gara-card.selected{ 
  outline: 2px solid #0d6efd; 
  box-shadow: 0 0 0 .2rem rgba(13,110,253,.15); 
}
/* opzionale, in linea con .user-card */
.gara-card .card-header .badge { font-size: .7rem; } 
.gara-card .card-body .small i { opacity: .7; }


/* Forza lo scroll interno nelle modali scrollable (Bootstrap 5) */
.modal-dialog.modal-dialog-scrollable .modal-content { 
  max-height: calc(100vh - var(--bs-modal-margin) * 2); 
}
.modal-dialog.modal-dialog-scrollable .modal-body { 
  overflow-y: auto; 
}
/* "Scudo" opzionale, se qualche stile esterno sovrascrive overflow */
.modal-body[data-enforce-scroll] { 
  overflow-y: auto !important; 
}

.modal .modal-header { position: static !important; top: auto !important; }



/* === MIGLIORIA SEMPLICE TABELLA GARE === */
.table-view {
  font-size: 0.92rem;
}

/* Header più leggibile */
.table-view thead th {
  background: #f7f7f7;
  font-weight: 600;
  border-bottom: 2px solid #e2e2e2 !important;
  white-space: nowrap;
}

/* Righe alternate più chiare */
.table-view tbody tr:nth-child(odd) {
  background: #fafafa;
}

/* Hover morbido */
.table-view tbody tr:hover {
  background: #e8f0ff;
}

/* Riduce padding per vista più compatta */
.table-view td,
.table-view th {
  padding-top: .4rem !important;
  padding-bottom: .4rem !important;
}

/* Colonne numeriche a destra */
.table-view .col-id,
.table-view .col-date {
  text-align: right;
}

/* Testo lungo ellissi */
.table-view td span.text-truncate-1 {
  max-width: 220px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Badge piccoli (stato, fase, prova) */
.table-view .badge {
  font-size: .72rem;
  padding: .2em .45em;
}


/* === MIGLIORIA SEMPLICE TABELLA GARE === */
.table-view {
  font-size: 0.92rem;
}

/* Header più leggibile */
.table-view thead th {
  background: #f7f7f7;
  font-weight: 600;
  border-bottom: 2px solid #0b0563 !important;
  white-space: nowrap;
}

/* Righe alternate più chiare */
.table-view tbody tr:nth-child(odd) {
  background: #140361;
}

/* Hover morbido */
.table-view tbody tr:hover {
  background: #e8f0ff;
}

/* Riduce padding per vista più compatta */
.table-gare td,
.table-gare th {
  padding-top: .4rem !important;
  padding-bottom: .4rem !important;
}

/* Colonne numeriche a destra */
.table-view .col-id,
.table-view .col-date {
  text-align: right;
}

/* Testo lungo ellissi */
.table-view td span.text-truncate-1 {
  max-width: 220px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Badge piccoli (stato, fase, prova) */
.table-view .badge {
  font-size: .72rem;
  padding: .2em .45em;
}


/* Colonna STATO più larga */
.table-view .col-stato {
  width: 150px;     /* aumenta la larghezza */
  min-width: 150px; /* impedisce che si stringa */
  white-space: nowrap;
}

.table-view .col-societa {
  width: 250px;     /* aumenta la larghezza */

  white-space: nowrap;
}

.table-view .col-cognomenome {
  width: 250px;     /* aumenta la larghezza */

  white-space: nowrap;
}


.table-view .col-note {
  width: 250px;     /* aumenta la larghezza */

  white-space: nowrap;
}

.table-view .col-nome_gara {
  width: 350px;     /* aumenta la larghezza */
  min-width: 150px; /* impedisce che si stringa */
  white-space: nowrap;
}

.table-view .col-regione {
  width: 350px;     /* aumenta la larghezza */
  min-width: 150px; /* impedisce che si stringa */
  white-space: nowrap;
}

/* Header tabella fisso (sticky) */
.table-view .thead-sticky th {
  position: sticky;
  top: 0;
  z-index: 2;                 /* sopra il body della tabella */
  background: #fff;           /* sfondo pieno per coprire le righe sotto */
  box-shadow: inset 0 -1px 0 #e9ecef, 0 2px 4px rgba(0,0,0,.03); /* filo + ombra leggera */
}


/* Prima colonna fissa a sinistra */
.table-view td.sticky-col,
.table-view th.sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;               /* sopra alle altre celle; > header row */
  background: #fff;         /* copre il contenuto dietro quando scorri */
  box-shadow: 1px 0 0 #e9ecef;  /* leggero separatore verticale */
}





/* === GINNASTI: CARD VIEW — versione compatta === */


.ginn-card .card-chk{ 
  position: absolute; 
  opacity: 0; 
  width: 1px; 
  height: 1px; 
  pointer-events: none; 
}


.ginnasta-card { cursor:pointer; }
.ginnasta-card.selected{
  outline:2px solid #0d6efd;
  box-shadow:0 0 0 .16rem rgba(13,110,253,.15);
}

/* Compattezza: meno padding e gap */
.ginnasta-card .card-body {
  padding: .6rem .65rem;              /* default ~1rem -> più compatta */
}
.ginnasta-card .fw-semibold {
  font-size: .98rem;                  /* leggermente più piccolo */
  line-height: 1.15;
}
.ginnasta-card .small { font-size: .78rem; }  /* testi descrittivi più piccoli */
.ginnasta-card .badge { 
  font-size: .68rem; 
  padding: .18em .4em; 
}
.ginnasta-card .d-flex.gap-2 { gap: .25rem !important; } /* override locale */

/* Riduci margini verticali “superflui” */
.ginnasta-card .meta-block + .meta-block { 
  margin-top: .15rem; 
}

/* Opzionale: ombra più leggera per densità alta */
.ginnasta-card.shadow-sm { box-shadow: 0 .1rem .25rem rgba(0,0,0,.07)!important; }


.ginn-card.selected { outline: 2px solid #0d6efd; }
.ginn-card .card-body { padding-top: .5rem; padding-bottom: .5rem; }
.ginn-card .card-header { padding-top: .35rem; padding-bottom: .35rem; }



.th-mapped {
  background-color: #d1e7dd !important; /* verde Bootstrap */
}


/* =========================================================
   HOME (index.php) — box riepilogo + lista iscrizioni
   ========================================================= */

/* Header utente */
.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e9ecef, #dee2e6);
  flex: 0 0 auto;
}

/* Badge ruolo (coerenti con Bootstrap) */
.role-badge { font-weight: 600; }
.role-admin { background: #0d6efd; }
.role-segretario { background: #6f42c1; }
.role-tecnico { background: #198754; }

/* Box statistiche */
.stat-card {
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: transform .08s ease, box-shadow .08s ease;
  cursor: pointer;
  height: 100%;
}
.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}
.stat-title {
  font-size: .95rem;
  margin: 0;
  color: #6c757d;
  font-weight: 600;
}
.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  margin-top: 6px;
  line-height: 1;
}

/* Lista gare/iscrizioni */
.gara-item { cursor: pointer; }
.gara-item:hover { background: rgba(13,110,253,.04); }

/* Stato gara */
.gara-stato {
  display: inline-block;
  padding: .22rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  background: #e9ecef;
  color: #495057;
  white-space: nowrap;
}
.gara-stato-aperta { background: #d1e7dd; color: #057a43; }
.gara-stato-chiusa { background: #f8d7da; color: #842029; }


/* IN CORSO (blu) */
.gara-stato-in-corso{
  background:#cfe2ff;
  color:#084298;
}

/* CHIUSA (rosso) */
.gara-stato-chiusa{
  background:#f8d7da;
  color:#842029;
}

/* ANNULLATA (grigio scuro) */
.gara-stato-annullata{
  background:#e2e3e5;
  color:#41464b;
  text-decoration: line-through;
}

/* IN ATTESA (giallo) */
.gara-stato-in-attesa{
  background:#fff3cd;
  color:#664d03;
}



/* Fase gara */
.gara-fase {
  display: inline-block;
  padding: .18rem .45rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  background: #f1f3f5;
  color: #495057;
  white-space: nowrap;
}

/* Pill scadenza (verde/arancio/rosso) */
.tempo-pill {
  display: inline-block;
  padding: .18rem .5rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid rgba(0,0,0,.06);
}
.tempo-pill--verde { background: #d1e7dd; color: #075e35; }
.tempo-pill--arancione { background: #fff3cd; color: #664d03; }
.tempo-pill--rosso { background: #f8d7da; color: #842029; }
.tempo-pill--neutro { background: #e9ecef; color: #495057; }

/* Badge numero ginnasti a destra */
.gara-badge {
  min-width: 36px;
  text-align: center;
  font-weight: 800;
  background: #0d6efd;
  color: #fff;
  border-radius: 999px;
  padding: .15rem .55rem;
  font-size: .78rem;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #f1f3f5 25%, #e9ecef 37%, #f1f3f5 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border-radius: 12px;
  height: 86px;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}