/* ============================================================
   LAYOUT.CSS — Struttura Pagine
   Admin Layout, Sidebar, Header, Home Pubblica
   ============================================================ */

/* ------------------------------------------------------------
   STRUTTURA PRINCIPALE APP
   ------------------------------------------------------------ */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Contenitore globale pagine */
#contenitore-pagine {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Pagina visibile/nascosta */
.pagina {
  display: none;
  flex-direction: column;
  flex: 1;
  animation: fade-in 0.2s ease;
}
.pagina.attiva { display: flex; }

/* ------------------------------------------------------------
   LAYOUT ADMIN — Sidebar + Contenuto
   ------------------------------------------------------------ */
.admin-layout {
  display: flex;
  flex: 1;
  min-height: 100vh;
  background: var(--s1);
}

/* ------------------------------------------------------------
   SIDEBAR ADMIN
   ------------------------------------------------------------ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg);
  border-right: 1px solid var(--bordo);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: width 0.25s ease, transform 0.25s ease;
  overflow: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: var(--header-h);
  border-bottom: 1px solid var(--bordo);
  flex-shrink: 0;
}

.sidebar-logo-immagine {
  width: 32px;
  height: 32px;
  border-radius: var(--raggio);
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-logo-placeholder {
  width: 32px;
  height: 32px;
  border-radius: var(--raggio);
  background: var(--blu);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.875rem;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-logo-testo {
  flex: 1;
  min-width: 0;
}

.sidebar-logo-nome {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--testo);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.sidebar-logo-sub {
  font-size: 0.6875rem;
  color: var(--testo-m);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Barra presenza admin */
.sidebar-presenza {
  padding: 8px 12px;
  border-bottom: 1px solid var(--bordo);
  flex-shrink: 0;
  background: var(--s1);
}

.sidebar-presenza-titolo {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--testo-l);
  margin-bottom: 5px;
}

.sidebar-presenza-lista {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-presenza-admin {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--testo-s);
  font-weight: 500;
}

/* Navigazione principale sidebar */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sidebar-sezione {
  margin-bottom: 4px;
}

.sidebar-sezione-titolo {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--testo-l);
  padding: 10px 16px 4px;
}

/* Voce di navigazione */
.sidebar-voce {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: var(--trans-s);
  border-radius: 0;
  color: var(--testo-s);
  font-size: 0.875rem;
  font-weight: 500;
  position: relative;
  text-decoration: none;
  user-select: none;
}

.sidebar-voce:hover {
  background: var(--s1);
  color: var(--testo);
}

.sidebar-voce.attiva {
  background: var(--blu-l);
  color: var(--blu);
  font-weight: 600;
}

.sidebar-voce.attiva::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--blu);
  border-radius: 0 2px 2px 0;
}

.sidebar-voce-testo {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Indicatore stato voce sidebar */
.sidebar-voce-stato {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Guida contesto sidebar */
.sidebar-guida {
  margin: 4px 8px;
  padding: 8px 10px;
  background: var(--oro-l);
  border: 1px solid var(--oro);
  border-radius: var(--raggio);
  font-size: 0.75rem;
  color: #92610A;
  line-height: 1.4;
  animation: fade-in 0.2s ease;
}

.sidebar-guida-titolo {
  font-weight: 700;
  margin-bottom: 3px;
}

/* Footer sidebar */
.sidebar-footer {
  border-top: 1px solid var(--bordo);
  padding: 10px;
  flex-shrink: 0;
}

.sidebar-utente {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--raggio);
  cursor: pointer;
  transition: var(--trans-s);
}

.sidebar-utente:hover { background: var(--s1); }

.sidebar-utente-info {
  flex: 1;
  min-width: 0;
}

.sidebar-utente-nome {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--testo);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-utente-ruolo {
  font-size: 0.75rem;
  color: var(--testo-m);
  white-space: nowrap;
}

/* ------------------------------------------------------------
   HEADER ADMIN (top bar)
   ------------------------------------------------------------ */
.admin-header {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--bordo);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 90;
  transition: left 0.25s ease;
  gap: 1rem;
}

.admin-header-sinistra {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.admin-header-titolo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--testo);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-header-destra {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Pulsante hamburger mobile */
.btn-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 10px;
  cursor: pointer;
  border: none;
  background: none;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--raggio);
  transition: background var(--trans);
}
.btn-hamburger:hover { background: var(--s1); }
.btn-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--testo);
  border-radius: 2px;
  transition: var(--trans);
}

/* Indicatore aggiornamento */
.indicatore-aggiornamento {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--testo-l);
  font-weight: 500;
}

.indicatore-aggiornamento.aggiornato { color: var(--verde-d); }

/* Notifiche badge */
.notifica-badge {
  position: relative;
}
.notifica-contatore {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  background: var(--rosso);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 800;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 1.5px solid var(--bg);
}

/* Pannello notifiche */
.pannello-notifiche {
  position: absolute;
  top: calc(var(--header-h) - 4px);
  right: 1rem;
  width: 360px;
  max-height: 480px;
  background: var(--bg);
  border: 1px solid var(--bordo);
  border-radius: var(--raggio-l);
  box-shadow: var(--ombra-l);
  overflow: hidden;
  z-index: 200;
  display: none;
}
.pannello-notifiche.attivo { display: flex; flex-direction: column; }

.pannello-notifiche-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--bordo);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pannello-notifiche-lista {
  overflow-y: auto;
  flex: 1;
}

.notifica-riga {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bordo);
  cursor: pointer;
  transition: var(--trans-s);
}
.notifica-riga:hover { background: var(--s1); }
.notifica-riga.non-letta { background: var(--blu-l); }
.notifica-riga:last-child { border-bottom: none; }

.notifica-testo { flex: 1; font-size: 0.875rem; }
.notifica-titolo { font-weight: 600; color: var(--testo); margin-bottom: 2px; }
.notifica-desc { color: var(--testo-m); font-size: 0.8125rem; }
.notifica-ora { font-size: 0.75rem; color: var(--testo-l); flex-shrink: 0; }

/* ------------------------------------------------------------
   CONTENUTO PRINCIPALE ADMIN
   ------------------------------------------------------------ */
.admin-contenuto {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-h));
  transition: margin-left 0.25s ease;
}

.admin-sezione {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
  flex: 1;
  animation: fade-in 0.2s ease;
}

.admin-sezione.attiva { display: flex; }

/* Intestazione sezione */
.sezione-intestazione {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.sezione-titolo { font-size: 1.25rem; font-weight: 700; }
.sezione-desc   { font-size: 0.875rem; color: var(--testo-m); margin-top: 3px; }

.sezione-azioni {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   HOME PUBBLICA
   ------------------------------------------------------------ */
.pub-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

/* Header pubblico */
.pub-header {
  background: #111;
  border-bottom: none;
  padding: 0 1.25rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 16px rgba(0,0,0,0.2);
  flex-shrink: 0;
}

.pub-header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.pub-header-logo-img {
  width: 36px;
  height: 36px;
  border-radius: var(--raggio);
  object-fit: contain;
  flex-shrink: 0;
}

.pub-header-logo-placeholder {
  width: 36px;
  height: 36px;
  border-radius: var(--raggio);
  background: var(--oro);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: #111;
  flex-shrink: 0;
}

.pub-header-nome {
  font-size: 1.125rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.pub-header-destra {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Switch lingua */
.switch-lingua {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
}

.switch-lingua-btn {
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: var(--trans-s);
  border: none;
  background: transparent;
}

.switch-lingua-btn.attivo {
  background: #fff;
  color: #111;
}

/* Contenuto pubblico */
.pub-contenuto {
  flex: 1;
  padding-top: 8px;
}

.pub-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

/* Hero torneo */
.pub-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 0 1rem;
  text-align: center;
  gap: 0.5rem;
}

.pub-hero-logo {
  width: 88px;
  height: 88px;
  border-radius: var(--raggio-l);
  border: 3px solid var(--bordo);
  object-fit: contain;
  margin-bottom: 0.25rem;
}

.pub-hero-logo-placeholder {
  width: 88px;
  height: 88px;
  border-radius: var(--raggio-l);
  border: 3px solid var(--bordo);
  background: var(--s2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--testo-l);
  margin-bottom: 0.25rem;
}

.pub-hero-nome {
  font-size: 1.625rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--testo);
}

.pub-hero-sub {
  font-size: 0.875rem;
  color: var(--testo-m);
}

/* Navigazione pubblica — bottoni sezione */
.pub-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
}

.pub-nav-btn {
  background: var(--bg);
  border: 1.5px solid var(--bordo);
  border-radius: var(--raggio-l);
  padding: 0.625rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: var(--trans);
  min-height: 56px;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.pub-nav-btn:hover {
  background: var(--s1);
  border-color: var(--bordo-f);
}
.pub-nav-btn.attivo {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #ffffff !important;
}

.pub-nav-btn-live {
  border-color: var(--rosso) !important;
  background: var(--rosso-l);
}

.pub-nav-btn-live:hover {
  background: #fcd5dc;
  box-shadow: 0 2px 8px var(--rosso-glow);
}

.pub-nav-etichetta {
  font-size: 0.6875rem;
  font-weight: 700;
  color: inherit;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

/* Pannello sezione pubblica */
.pub-pannello {
  display: none;
  animation: fade-in 0.2s ease;
}
.pub-pannello.attivo { display: block; }

.pub-pannello-titolo {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--testo);
  margin-bottom: 0.25rem;
}

.pub-pannello-sub {
  font-size: 0.8125rem;
  color: var(--testo-m);
  margin-bottom: 1rem;
}

/* Hint cliccabile */
.pub-hint-clic {
  font-size: 0.75rem;
  color: var(--testo-l);
  text-align: center;
  padding: 4px 0;
  margin-bottom: 0.75rem;
  font-style: italic;
}

/* Barra aggiornamento */
.pub-barra-aggiornamento {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--bordo);
}

.pub-ultimo-aggiornamento {
  font-size: 0.75rem;
  color: var(--testo-l);
}

/* Partita live card (pubblica) */
.pub-partita-live {
  border: 1.5px solid var(--bordo);
  border-radius: var(--raggio-l);
  overflow: hidden;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: var(--trans);
}

.pub-partita-live:hover {
  border-color: var(--blu);
  box-shadow: var(--ombra-m);
}

.pub-partita-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  background: var(--s1);
  border-bottom: 1px solid var(--bordo);
  font-size: 0.75rem;
  color: var(--testo-m);
  font-weight: 500;
}

.pub-partita-corpo {
  padding: 10px 12px;
}

.pub-partita-squadre {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pub-partita-sq {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  font-weight: 600;
  font-size: 0.9375rem;
}

.pub-partita-sq.destra {
  flex-direction: row-reverse;
  text-align: right;
}

.pub-partita-punteggio {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: var(--s1);
  border-radius: var(--raggio);
}

.pub-partita-gol {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--testo);
  min-width: 24px;
  text-align: center;
}

.pub-partita-div {
  color: var(--testo-l);
  font-weight: 300;
}

/* Hint voto */
.pub-hint-voto {
  font-size: 0.75rem;
  color: var(--blu);
  font-weight: 600;
  padding: 4px 12px;
  text-align: center;
  border-top: 1px solid var(--bordo);
}

/* Footer pubblico */
.pub-footer {
  background: var(--s1);
  border-top: 1px solid var(--bordo);
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--testo-m);
}

/* ------------------------------------------------------------
   SCHERMATE SPECIALI (Login, Errore)
   ------------------------------------------------------------ */
.schermata-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  background: var(--s1);
}

.login-card {
  background: var(--bg);
  border: 1px solid var(--bordo);
  border-radius: var(--raggio-xl);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--ombra-m);
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.login-logo-img {
  width: 72px;
  height: 72px;
  border-radius: var(--raggio-l);
  object-fit: contain;
}

.login-titolo {
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.3px;
}

.login-sub {
  font-size: 0.875rem;
  color: var(--testo-m);
  text-align: center;
}

/* Selettore ruolo login */
.login-ruoli {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 1.5rem;
}

.login-ruolo-btn {
  padding: 10px 8px;
  border: 1.5px solid var(--bordo);
  border-radius: var(--raggio);
  cursor: pointer;
  transition: var(--trans-s);
  text-align: center;
  background: var(--bg);
}

.login-ruolo-btn:hover { border-color: var(--blu); background: var(--blu-l); }
.login-ruolo-btn.selezionato { border-color: var(--blu); background: var(--blu-l); }

.login-ruolo-nome {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--testo);
}

.login-ruolo-desc {
  font-size: 0.75rem;
  color: var(--testo-m);
  margin-top: 2px;
}

/* Pulsante Google */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 20px;
  border: 1.5px solid var(--bordo);
  border-radius: var(--raggio);
  background: var(--bg);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--testo);
  cursor: pointer;
  transition: var(--trans);
}

.btn-google:hover {
  background: var(--s1);
  border-color: var(--bordo-f);
  box-shadow: var(--ombra-s);
}

.btn-google-logo {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   CODA APPROVAZIONE GOAL (admin)
   ------------------------------------------------------------ */
.coda-goal-panel {
  position: fixed;
  top: var(--header-h);
  right: 0;
  width: 380px;
  max-height: calc(100vh - var(--header-h));
  background: var(--bg);
  border-left: 1px solid var(--bordo);
  box-shadow: var(--ombra-l);
  z-index: 95;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.coda-goal-panel.attivo { transform: translateX(0); }

.coda-goal-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--bordo);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.coda-goal-lista {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

/* ------------------------------------------------------------
   MOBILE OPERATIVI (Responsabile Campo, Addetto Goal)
   ------------------------------------------------------------ */
.mobile-op-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--s1);
}

.mobile-op-header {
  background: #111;
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.mobile-op-titolo {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.mobile-op-ruolo {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  margin-top: 1px;
}

.mobile-op-contenuto {
  flex: 1;
  padding: 1rem;
}

/* Selezione campo (operativi) */
.selezione-campo {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.campo-btn {
  background: var(--bg);
  border: 1.5px solid var(--bordo);
  border-radius: var(--raggio-l);
  padding: 0.875rem;
  cursor: pointer;
  transition: var(--trans);
  text-align: center;
}

.campo-btn:hover { border-color: var(--blu); }
.campo-btn.selezionato { border-color: var(--blu); background: var(--blu-l); }

.campo-nome {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--testo);
}

.campo-tipo {
  font-size: 0.75rem;
  color: var(--testo-m);
  margin-top: 2px;
}

/* Partita in corso (operativi mobile) */
.partita-in-corso-card {
  background: var(--bg);
  border: 2px solid var(--blu);
  border-radius: var(--raggio-xl);
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: var(--ombra-m);
}

.partita-in-corso-header {
  background: var(--blu);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.partita-in-corso-titolo {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.partita-in-corso-orario {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.8);
}

.partita-in-corso-corpo {
  padding: 1rem;
}

/* Score display mobile */
.score-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.score-sq {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.score-sq-nome {
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
  color: var(--testo);
}

.score-numero {
  font-size: 3rem;
  font-weight: 900;
  color: var(--blu);
  line-height: 1;
}

.score-separatore {
  font-size: 1.5rem;
  color: var(--testo-l);
  font-weight: 300;
}

/* Lista marcatori mobile */
.lista-marcatori {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.marcatore-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--s1);
  border: 1.5px solid var(--bordo);
  border-radius: var(--raggio);
  cursor: pointer;
  transition: var(--trans-s);
  font-size: 0.875rem;
}

.marcatore-btn:hover { border-color: var(--verde); background: var(--verde-l); }

.marcatore-numero {
  font-weight: 800;
  font-size: 1rem;
  color: var(--blu);
  min-width: 24px;
}

.marcatore-nome {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--testo);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Pulsante autorete */
.btn-autorete {
  width: 100%;
  margin-top: 0.5rem;
  padding: 8px;
  background: var(--rosso-l);
  border: 1.5px solid var(--rosso);
  border-radius: var(--raggio);
  color: var(--rosso);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--trans-s);
}
.btn-autorete:hover { background: var(--rosso); color: #fff; }

/* ------------------------------------------------------------
   STAMPA
   ------------------------------------------------------------ */
@media print {
  .sidebar,
  .admin-header,
  .btn,
  .pub-header,
  .pub-nav,
  .pub-barra-aggiornamento,
  .carosello-wrap { display: none !important; }

  .admin-contenuto {
    margin-left: 0 !important;
    margin-top: 0 !important;
  }

  body { background: #fff; font-size: 12pt; }

  .lista-gara-stampa {
    page-break-after: always;
  }
}

/* ------------------------------------------------------------
   RESPONSIVE LAYOUT
   ------------------------------------------------------------ */
@media (max-width: 1024px) {
  :root { --sidebar-w: var(--sidebar-w-min); }

  .sidebar-logo-testo,
  .sidebar-sezione-titolo,
  .sidebar-voce-testo,
  .sidebar-voce-stato,
  .sidebar-presenza,
  .sidebar-utente-info { display: none; }

  .sidebar-voce { justify-content: center; padding: 10px; }
  .sidebar-voce.attiva::before { top: 50%; transform: translateY(-50%); bottom: auto; height: 20px; }

  .sidebar-logo { justify-content: center; padding: 0 12px; }
  .sidebar-logo-placeholder { width: 28px; height: 28px; }

  .sidebar-footer { padding: 6px; }
  .sidebar-utente { justify-content: center; padding: 8px; }

  .admin-header { left: var(--sidebar-w-min); }
  .admin-contenuto { margin-left: var(--sidebar-w-min); }
}

@media (max-width: 640px) {
  /* Sidebar nascosta su mobile, appare come drawer */
  .sidebar {
    transform: translateX(-100%);
    width: min(280px, 85vw);
    z-index: 300;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    overflow-y: auto;
  }

  .sidebar.mobile-aperta {
    transform: translateX(0);
    box-shadow: var(--ombra-l);
  }

  /* Ripristina testi nella sidebar mobile */
  .sidebar-logo-testo,
  .sidebar-sezione-titolo,
  .sidebar-voce-testo,
  .sidebar-voce-stato,
  .sidebar-utente-info { display: block; }

  .sidebar-presenza { display: flex; }

  .sidebar-voce { justify-content: flex-start; padding: 10px 16px; min-height: 44px; }
  .sidebar-voce.attiva::before { top: 50%; transform: translateY(-50%); bottom: auto; height: 24px; }
  .sidebar-logo { justify-content: flex-start; padding: 0 16px; }

  /* Header compatto su mobile */
  .admin-header {
    left: 0;
    padding: 0 0.75rem;
    gap: 6px;
  }

  .admin-contenuto { margin-left: 0; }

  /* Hamburger visibile */
  .btn-hamburger { display: flex; }

  /* Nascondi elementi non essenziali nell'header su mobile */
  .indicatore-aggiornamento { display: none; }
  .admin-header-destra .btn-neutro { display: none; }

  /* Overlay per chiudere sidebar */
  .overlay-sidebar {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 299;
  }
  .overlay-sidebar.attivo { display: block; }

  /* Griglia pubblica */
  .pub-nav { grid-template-columns: repeat(2, 1fr); }

  /* Pannello goal su mobile */
  .coda-goal-panel {
    width: 100%;
    max-height: 75vh;
    top: auto;
    bottom: 0;
    border-radius: var(--raggio-xl) var(--raggio-xl) 0 0;
    border-left: none;
    border-top: 1px solid var(--bordo);
  }

  /* Sezioni admin più compatte */
  .admin-sezione { padding: 0.875rem; gap: 0.875rem; }

  /* Tabelle scorrevoli su mobile */
  .tabella-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Modali a tutto schermo su mobile */
  .modal-contenuto {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: var(--raggio-xl) var(--raggio-xl) 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 92vh;
    overflow-y: auto;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  /* Form griglia: 1 colonna su mobile */
  .form-griglia-2 { grid-template-columns: 1fr; }

  /* Card stat in riga */
  .griglia-statistiche { grid-template-columns: repeat(2, 1fr); }
}

/* Tablet: sidebar ridotta ma visibile */
@media (min-width: 641px) and (max-width: 1024px) {
  .admin-header { padding: 0 1rem; gap: 8px; }
  .indicatore-aggiornamento { display: none; }
}

/* ============================================================
   OTTIMIZZAZIONI MOBILE COMPLETE
   @media (max-width: 640px)
   ============================================================ */

@media (max-width: 640px) {

  /* ----------------------------------------------------------
     HOME PUBBLICA
     ---------------------------------------------------------- */

  /* Header pubblico compatto */
  .pub-header {
    padding: 0.625rem 0.875rem;
    gap: 0.5rem;
  }
  .pub-header-nome { font-size: 1rem; }
  .pub-header-destra { gap: 6px; }

  /* Navigazione pubblica: 3 per riga invece di 5 */
  .pub-nav {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 0.5rem;
  }
  .pub-nav-btn {
    padding: 8px 4px;
    font-size: 0.6875rem;
    min-height: 52px;
  }
  .pub-nav-etichetta { font-size: 0.625rem; }

  /* Hero pubblico compatto */
  .pub-hero { padding: 1rem; }
  .pub-hero-nome { font-size: 1.25rem; }
  .pub-hero-sub { font-size: 0.8125rem; }

  /* Pannello pubblico */
  .pub-pannello { padding: 0; }
  .pub-pannello-titolo { font-size: 1rem; padding: 0.875rem 0.875rem 0; }

  /* Barra aggiornamento */
  .pub-barra-aggiornamento { padding: 6px 0.875rem; }

  /* ----------------------------------------------------------
     PARTITE LIVE (home pubblica)
     ---------------------------------------------------------- */
  .pub-partita-sq { font-size: 0.875rem; }
  .pub-partita-gol { font-size: 1.25rem; }
  .pub-partita-punteggio { padding: 3px 8px; }

  /* ----------------------------------------------------------
     CLASSIFICA — tabella compatta su mobile
     Nasconde colonne meno importanti
     ---------------------------------------------------------- */
  .tabella-classifica th:nth-child(3),  /* PG */
  .tabella-classifica td:nth-child(3),
  .tabella-classifica th:nth-child(6),  /* GF */
  .tabella-classifica td:nth-child(6),
  .tabella-classifica th:nth-child(7),  /* GS */
  .tabella-classifica td:nth-child(7) {
    display: none;
  }

  .tabella-classifica .col-punti {
    font-size: 1rem;
    font-weight: 900;
  }

  /* ----------------------------------------------------------
     CALENDARIO — tabella scorrevole con colonne prioritizzate
     ---------------------------------------------------------- */
  .tabella th:nth-child(5), /* Ospite duplicato in risultato */
  .tabella td:nth-child(5) { display: none; }

  /* Nasconde colonna Stato nel calendario su mobile */
  .tabella th:nth-child(7),
  .tabella td:nth-child(7) { display: none; }

  /* ----------------------------------------------------------
     RISULTATI partita — card orizzontale
     ---------------------------------------------------------- */
  .risultato-partita {
    padding: 8px 0;
    gap: 4px;
  }
  .risultato-squadra { font-size: 0.8125rem; }
  .risultato-punteggio { font-size: 0.875rem; }
  .risultato-gol { font-size: 1rem; font-weight: 900; }

  /* ----------------------------------------------------------
     TABELLONE ELIMINATORIE — lista verticale su mobile
     ---------------------------------------------------------- */
  .tabellone-bracket {
    display: none; /* Nasconde la vista bracket */
  }
  .tabellone-lista-mobile {
    display: block; /* Mostra lista verticale */
  }

  /* ----------------------------------------------------------
     CAPOCANNONIERI — tabella compatta
     ---------------------------------------------------------- */
  .tabella-cannonieri th:nth-child(3), /* Squadra */
  .tabella-cannonieri td:nth-child(3),
  .tabella-cannonieri th:nth-child(4), /* Maglia */
  .tabella-cannonieri td:nth-child(4) {
    display: none;
  }

  /* ----------------------------------------------------------
     CARD STAT (statistiche squadra)
     ---------------------------------------------------------- */
  .card-stat { padding: 8px; }
  .card-stat-numero { font-size: 1.5rem; }
  .card-stat-label { font-size: 0.6875rem; }

  /* ----------------------------------------------------------
     SEZIONE AZIONI nei pannelli admin
     ---------------------------------------------------------- */
  .sezione-azioni {
    gap: 6px;
  }
  .sezione-azioni .btn { font-size: 0.8125rem; padding: 7px 10px; }

  /* ----------------------------------------------------------
     SIDEBAR VOCI — dimensioni touch-friendly
     ---------------------------------------------------------- */
  .sidebar-voce { min-height: 44px; }
  .sidebar-voce-testo { font-size: 0.875rem; }

  /* ----------------------------------------------------------
     MODAL — ottimizzazioni aggiuntive
     ---------------------------------------------------------- */
  .modal-titolo { font-size: 1rem; }
  .modal-sottotitolo { font-size: 0.8125rem; }
  .modal-piede { padding: 0.875rem 1rem; gap: 8px; }
  .modal-piede .btn { flex: 1; justify-content: center; }

  /* ----------------------------------------------------------
     OPERATIVI MOBILE (Responsabile, Coach, Addetto)
     ---------------------------------------------------------- */
  .mobile-op-header { padding: 0.75rem 1rem; }
  .mobile-op-titolo { font-size: 1.125rem; }
  .mobile-op-contenuto { padding: 0.875rem; }

  /* Card partita in corso operativo */
  .partita-in-corso { padding: 0.875rem; }
  .squadra-nome-operativo { font-size: 1rem; }
  .punteggio-display { font-size: 2.5rem; }

  /* ----------------------------------------------------------
     AVATAR e LOGO
     ---------------------------------------------------------- */
  .avatar { width: 36px; height: 36px; font-size: 0.875rem; }
  .avatar-lg { width: 48px; height: 48px; font-size: 1.125rem; }

  /* ----------------------------------------------------------
     GIRONI — card squadre compatte
     ---------------------------------------------------------- */
  .chip-squadra { font-size: 0.75rem; padding: 3px 8px; }

  /* ----------------------------------------------------------
     PRESENZA ADMIN (sidebar)
     ---------------------------------------------------------- */
  .indicatore-presenza { display: none; }

  /* ----------------------------------------------------------
     NOTIFICHE — pannello full width
     ---------------------------------------------------------- */
  .notifiche-pannello {
    width: 100vw;
    right: -0.75rem;
    border-radius: var(--raggio-l) var(--raggio-l) 0 0;
  }

  /* ----------------------------------------------------------
     LOGIN — ottimizzato
     ---------------------------------------------------------- */
  .login-card { padding: 1.5rem 1.25rem; }
  .login-ruoli { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .login-ruolo-btn { padding: 8px 6px; }
  .login-ruolo-nome { font-size: 0.8125rem; }

  /* ----------------------------------------------------------
     CAROUSEL BANNER
     ---------------------------------------------------------- */
  .banner-carousel { height: 50px; }
  .banner-img { max-height: 40px; }

  /* ----------------------------------------------------------
     FOOTER PUBBLICO
     ---------------------------------------------------------- */
  .pub-footer { padding: 1rem; font-size: 0.75rem; }
}

/* ============================================================
   TABLET (641px - 1024px)
   ============================================================ */
@media (min-width: 641px) and (max-width: 1024px) {

  /* Navigazione pubblica: 4 per riga */
  .pub-nav { grid-template-columns: repeat(4, 1fr); }

  /* Header pubblico */
  .pub-header { padding: 0.75rem 1rem; }

  /* Tabella classifica: mantieni tutte le colonne */
  .tabella-classifica th, .tabella-classifica td { padding: 6px 8px; }

  /* Modal centrato ma più largo */
  .modal-contenuto { width: min(560px, 92vw); }

  /* Sezione azioni in riga */
  .sezione-intestazione { flex-wrap: wrap; gap: 0.75rem; }
}

/* ============================================================
   TOUCH DEVICE — rimuovi hover effects
   ============================================================ */
@media (hover: none) {
  .btn:hover { background: inherit; }
  .card-cliccabile:hover { transform: none; box-shadow: inherit; }
  .sidebar-voce:hover { background: inherit; }
  .pub-nav-btn:hover { background: inherit; border-color: inherit; }
  .pub-partita-live:hover { border-color: var(--bordo); box-shadow: none; }
}
