/* =========================================================================
   Pannello Seriana Basket — foglio di stile
   Impostato per la leggibilità: caratteri grandi, aree cliccabili ampie,
   colori della società solo dove servono a orientarsi.
   ========================================================================= */

:root {
  --blu-notte:  #10142C;
  --blu:        #1E306C;
  --blu-medio:  #1260AE;
  --rosso:      #E41836;
  --rosso-cupo: #B21029;
  --verde:      #1B7A44;
  --ambra:      #9A6206;
  --grigio:     #F1F2F5;
  --grigio-med: #D7DAE1;
  --inchiostro: #171A25;
  --tenue:      #596070;
  --bianco:     #FFFFFF;
  --raggio:     6px;
  --testo: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--testo);
  font-size: 16px;
  line-height: 1.55;
  color: var(--inchiostro);
  background: var(--grigio);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blu-medio); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
p { margin: 0 0 1rem; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--rosso); outline-offset: 2px; }

/* --- Impianto ------------------------------------------------------------ */

.guscio {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

.menu {
  background: var(--blu-notte);
  color: rgba(255,255,255,.85);
  padding: 1.25rem 0;
  display: flex;
  flex-direction: column;
}

.menu__logo {
  display: block;
  background: #fff;
  margin: 0 1rem 1.5rem;
  padding: .5rem;
  border-radius: var(--raggio);
}

.menu nav a {
  display: block;
  padding: .7rem 1.25rem;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  border-left: 4px solid transparent;
}
.menu nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.menu nav a.attivo {
  background: rgba(255,255,255,.1);
  border-left-color: var(--rosso);
  color: #fff;
  font-weight: 600;
}

.menu__separatore {
  padding: 1.25rem 1.25rem .35rem;
  font-size: .8125rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.45);
}

.menu__piede {
  margin-top: auto;
  padding: 1.25rem;
  border-top: 1px solid rgba(255,255,255,.15);
  font-size: .9375rem;
}
.menu__piede p { color: #fff; font-weight: 600; margin-bottom: .5rem; }
.menu__piede a { display: block; color: rgba(255,255,255,.8); text-decoration: none; padding: .2rem 0; }
.menu__piede a:hover { color: #fff; text-decoration: underline; }

.corpo { padding: 1.75rem 2rem 4rem; max-width: 1200px; }

.corpo__testa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.corpo__testa h1 { font-size: 1.75rem; margin: 0; color: var(--blu-notte); }

/* --- Avvisi -------------------------------------------------------------- */

.avviso {
  padding: .85rem 1.1rem;
  border-radius: var(--raggio);
  border-left: 5px solid;
  margin-bottom: 1.25rem;
  background: #fff;
}
.avviso ul { margin: .5rem 0 0; padding-left: 1.2rem; list-style: disc; }
.avviso--ok        { border-color: var(--verde); }
.avviso--errore    { border-color: var(--rosso); }
.avviso--attenzione{ border-color: var(--ambra); }

.sommario { color: var(--tenue); margin-bottom: 1.25rem; }
.nota {
  background: #fff;
  border: 1px solid var(--grigio-med);
  border-radius: var(--raggio);
  padding: .85rem 1.1rem;
  color: var(--tenue);
}
.vuoto { color: var(--tenue); padding: 1.5rem 0; }
.tenue { color: var(--tenue); font-size: .875rem; }
.nowrap { white-space: nowrap; }

/* --- Numeri di riepilogo -------------------------------------------------- */

.numeri {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.numeri li {
  background: #fff;
  border: 1px solid var(--grigio-med);
  border-radius: var(--raggio);
  padding: 1rem 1.25rem;
}
.numeri__valore {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--blu-notte);
}
.numeri__voce { color: var(--tenue); font-size: .9375rem; }

/* --- Riquadri e colonne --------------------------------------------------- */

.riquadro {
  background: #fff;
  border: 1px solid var(--grigio-med);
  border-radius: var(--raggio);
  padding: 1.25rem 1.5rem 1.5rem;
  margin-bottom: 1.5rem;
}
.riquadro h2 { font-size: 1.25rem; color: var(--blu-notte); }

.due-colonne {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.elenco-semplice li {
  padding-block: .5rem;
  border-bottom: 1px solid var(--grigio-med);
}
.elenco-semplice li:last-child { border-bottom: 0; }

/* --- Tabelle -------------------------------------------------------------- */

.tabella {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--grigio-med);
  border-radius: var(--raggio);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.tabella th, .tabella td {
  padding: .7rem .85rem;
  text-align: left;
  border-bottom: 1px solid var(--grigio-med);
  vertical-align: top;
}
.tabella thead th {
  background: var(--blu-notte);
  color: #fff;
  font-size: .875rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.tabella tbody tr:last-child td { border-bottom: 0; }
.tabella tbody tr:hover { background: #FAFBFC; }

.azioni { display: flex; flex-wrap: wrap; gap: .35rem .85rem; align-items: center; }

.pillola {
  display: inline-block;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .1rem .45rem;
  border-radius: 3px;
  vertical-align: middle;
}
.pillola--ok    { background: #E4F1E9; color: var(--verde); }
.pillola--bozza { background: #FBF0DA; color: var(--ambra); }

.logo-mini { max-height: 34px; width: auto; }

/* --- Moduli --------------------------------------------------------------- */

.modulo__griglia {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.5rem;
  align-items: start;
}
.modulo--stretto { max-width: 640px; }

.modulo__principale,
.modulo__laterale {
  background: #fff;
  border: 1px solid var(--grigio-med);
  border-radius: var(--raggio);
  padding: 1.25rem 1.5rem 1.5rem;
}

.campo { display: block; margin-bottom: 1.1rem; }
.campo label { display: block; font-weight: 600; margin-bottom: .3rem; }
.campo--corto { max-width: 160px; }

input[type="text"], input[type="url"], input[type="email"], input[type="password"],
input[type="date"], input[type="time"], input[type="number"], input[type="search"],
select, textarea {
  width: 100%;
  font: inherit;
  padding: .55rem .7rem;
  border: 1px solid var(--grigio-med);
  border-radius: 4px;
  background: #fff;
  color: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--blu-medio); }
input[type="checkbox"] { width: auto; margin-right: .4rem; }
input[type="file"] { font: inherit; }
textarea { resize: vertical; }

.aiuto {
  display: block;
  font-size: .875rem;
  color: var(--tenue);
  margin-top: .3rem;
}

.punteggio { width: 4.5rem; display: inline-block; }

.modulo__azioni {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--grigio-med);
}

.anteprima {
  max-height: 150px;
  width: auto;
  border: 1px solid var(--grigio-med);
  border-radius: 4px;
  margin-bottom: .5rem;
}

.miniature {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: .75rem;
}
.miniature li { width: 120px; }
.miniature img {
  width: 120px; height: 90px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--grigio-med);
  margin-bottom: .2rem;
}

/* --- Filtri e righe di inserimento ---------------------------------------- */

.filtri, .riga-inserimento {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}
.filtri > div, .riga-inserimento > div { flex: 0 1 190px; }
.filtri__cerca { flex: 1 1 240px; }
.riga-inserimento--larga > div { flex: 1 1 170px; }
.riga-inserimento .campo { margin-bottom: 0; }

.in-linea { display: inline-flex; gap: .35rem; align-items: center; margin: 0; }

/* --- Bottoni -------------------------------------------------------------- */

.bottone {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: .6rem 1.2rem;
  border: 2px solid var(--rosso);
  border-radius: 4px;
  background: var(--rosso);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
.bottone:hover { background: var(--rosso-cupo); border-color: var(--rosso-cupo); }

.bottone--vuoto {
  background: #fff;
  color: var(--blu-notte);
  border-color: var(--grigio-med);
}
.bottone--vuoto:hover { background: var(--blu-notte); border-color: var(--blu-notte); color: #fff; }

.collegamento {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: var(--blu-medio);
  text-decoration: underline;
  cursor: pointer;
}
.collegamento--pericolo { color: var(--rosso); }

.paginazione { display: flex; flex-wrap: wrap; gap: .35rem; }
.paginazione a {
  display: block;
  padding: .35rem .7rem;
  background: #fff;
  border: 1px solid var(--grigio-med);
  border-radius: 4px;
  text-decoration: none;
}
.paginazione a[aria-current] { background: var(--blu-notte); color: #fff; border-color: var(--blu-notte); }

/* --- Editor di testo ------------------------------------------------------ */

.editor {
  border: 1px solid var(--grigio-med);
  border-radius: 4px;
  overflow: hidden;
}

.editor__barra {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  padding: .4rem;
  background: var(--grigio);
  border-bottom: 1px solid var(--grigio-med);
}
.editor__barra button {
  font: inherit;
  font-size: .9375rem;
  padding: .3rem .7rem;
  background: #fff;
  border: 1px solid var(--grigio-med);
  border-radius: 3px;
  cursor: pointer;
}
.editor__barra button:hover { background: var(--blu-notte); color: #fff; border-color: var(--blu-notte); }

.editor__area {
  min-height: 360px;
  padding: 1rem 1.1rem;
  background: #fff;
  line-height: 1.65;
}
.editor__area:focus { outline: none; box-shadow: inset 0 0 0 2px var(--blu-medio); }
.editor__area img { max-width: 100%; height: auto; margin: .5rem 0; }
.editor__area h2 { font-size: 1.3rem; }

/* --- Pagina di accesso ---------------------------------------------------- */

.pagina-accesso {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: var(--blu-notte);
  padding: 1.5rem;
}

.accesso {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: var(--raggio);
  padding: 1.75rem 2rem 2rem;
}
.accesso__logo { margin: 0 auto 1rem; max-width: 220px; }
.accesso h1 { font-size: 1.4rem; text-align: center; color: var(--blu-notte); }
.accesso label { display: block; font-weight: 600; margin: .85rem 0 .3rem; }
.accesso .bottone { width: 100%; margin-top: 1.25rem; }
.accesso__nota {
  font-size: .875rem;
  color: var(--tenue);
  text-align: center;
  margin: 1rem 0 0;
}

/* --- Schermi piccoli ------------------------------------------------------ */

@media (max-width: 900px) {
  .guscio { grid-template-columns: 1fr; }
  .menu { padding-bottom: .5rem; }
  .menu__logo { max-width: 160px; margin-bottom: 1rem; }
  .menu nav ul { display: flex; flex-wrap: wrap; }
  .menu nav a { border-left: 0; border-bottom: 3px solid transparent; padding: .6rem .9rem; }
  .menu nav a.attivo { border-left: 0; border-bottom-color: var(--rosso); }
  .menu__separatore { width: 100%; padding-top: .5rem; }
  .menu__piede { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
  .menu__piede p { margin: 0; }

  .corpo { padding: 1.25rem 1rem 3rem; }
  .modulo__griglia { grid-template-columns: 1fr; }
  .tabella, .tabella thead, .tabella tbody, .tabella tr, .tabella td { display: block; width: 100%; }
  .tabella thead { display: none; }
  .tabella tr { border-bottom: 2px solid var(--grigio-med); padding: .5rem 0; }
  .tabella td { border-bottom: 0; padding: .35rem .85rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* --- Migrazione: confronto prima/dopo ------------------------------------- */

.confronto {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-block: 1rem;
}
.confronto h4 { margin: 0 0 .4rem; font-size: .9375rem; color: var(--tenue); }

.codice {
  margin: 0;
  padding: .75rem;
  background: #0F1320;
  color: #D8DEE9;
  border-radius: 4px;
  font-size: .8125rem;
  line-height: 1.5;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.resa {
  border: 1px solid var(--grigio-med);
  border-radius: 4px;
  padding: 1rem;
  margin-top: .75rem;
  background: #fff;
  /* Contiene tutto ciò che sta dentro: senza questo, foto grandi o testi
     con float uscivano dal riquadro finendo sotto agli altri elementi. */
  overflow: hidden;
  max-height: 460px;
  overflow-y: auto;
}
/* I float dei vecchi articoli (immagini allineate) restano dentro il box */
.resa::after { content: ''; display: block; clear: both; }
.resa img {
  max-width: 100%;
  height: auto;
  /* Alcuni vecchi articoli hanno width/height fissi in HTML: li annullo */
  width: auto !important;
}
.resa p { margin: 0 0 .75rem; }
.resa p:last-child { margin-bottom: 0; }

.copertina-mini {
  width: 60px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 1px solid var(--grigio-med);
  border-radius: 3px;
}

details summary { cursor: pointer; font-weight: 600; color: var(--blu-medio); }

@media (max-width: 900px) { .confronto { grid-template-columns: 1fr; } }

/* --- Assegnazione squadre agli utenti ------------------------------------ */

.assegnazione {
  border-top: 1px solid var(--grigio-med);
  padding-top: 1rem;
  margin-top: 1rem;
}
.assegnazione h3 { font-size: 1.0625rem; margin-bottom: .5rem; }

.scelte {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.25rem;
  margin-bottom: .85rem;
}
.scelte label { font-weight: normal; cursor: pointer; }

/* --- Avviso dell'editor durante il caricamento foto ----------------------- */

.editor__avviso {
  margin: 0;
  padding: .55rem .9rem;
  font-size: .9375rem;
  border-top: 1px solid var(--grigio-med);
  background: var(--grigio);
}
.editor__avviso--ok      { color: var(--verde); }
.editor__avviso--errore  { color: var(--rosso); }
.editor__avviso--attesa  { color: var(--tenue); }

.editor__area img {
  cursor: pointer;
  border: 2px solid transparent;
}
.editor__area img:hover { border-color: var(--blu-medio); }

.editor__barra button[disabled] { opacity: .5; cursor: default; }

/* --- Pagina "Testi delle pagine" ------------------------------------------ */

.gruppo-testi {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2rem 0 .75rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--blu-medio);
  font-size: 1.25rem;
}
.gruppo-testi:first-of-type { margin-top: .5rem; }

.gruppo-testi__vedi {
  font-size: .875rem;
  font-weight: 400;
  white-space: nowrap;
}

.riquadro--testo { margin-bottom: 1rem; }

.riquadro__dove {
  margin: 0 0 .9rem;
  padding-left: .7rem;
  border-left: 3px solid var(--grigio-med);
  color: var(--tenue);
  font-size: .9375rem;
}

/* La barra di salvataggio resta a portata di mano nelle pagine lunghe */
.azioni--fisse {
  position: sticky;
  bottom: 0;
  padding: 1rem 0;
  background: linear-gradient(to top, var(--bianco) 70%, transparent);
}

/* --- Righe e bottoni pericolosi ------------------------------------------- */

.riquadro--attenzione { border-color: var(--rosso); }
.riquadro--attenzione h2 { color: var(--rosso); }

.bottone--pericolo { background: var(--rosso); border-color: var(--rosso); }
.bottone--pericolo:hover { background: #c4142e; border-color: #c4142e; }

.riga--spenta { opacity: .5; }
.campo--minuscolo { max-width: 6rem; }

.minuscolo { font-size: .75rem; }

/* Anteprima dei loghi sponsor su fondo a scacchi: si vede subito se la
   trasparenza c'è davvero o se è solo bianco. */
.cella-logo {
  background-image:
    linear-gradient(45deg, #d8dce6 25%, transparent 25%, transparent 75%, #d8dce6 75%),
    linear-gradient(45deg, #d8dce6 25%, transparent 25%, transparent 75%, #d8dce6 75%);
  background-size: 14px 14px;
  background-position: 0 0, 7px 7px;
  background-color: #fff;
}
.anteprima-logo { max-height: 54px; max-width: 160px; width: auto; display: block; }

.ritratto-mini {
  width: 44px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: center top;
  border-radius: 3px;
  border: 1px solid var(--grigio-med);
}

/* Scelta rapida della copertina fra le foto già nell'articolo */
.scelta-foto {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .5rem 0 0;
  padding: 0;
  list-style: none;
}

.scelta-foto__voce {
  padding: 0;
  border: 2px solid var(--grigio-med);
  border-radius: 4px;
  background: none;
  cursor: pointer;
  line-height: 0;
  overflow: hidden;
}
.scelta-foto__voce img {
  width: 76px;
  height: 56px;
  object-fit: cover;
  display: block;
}
.scelta-foto__voce:hover { border-color: var(--blu-medio); }
.scelta-foto__voce--scelta { border-color: var(--rosso); }

/* Scelta dei giorni della settimana per gli allenamenti ricorrenti */
.campo--giorni { border: 0; padding: 0; margin-bottom: 1rem; }
.campo--giorni legend {
  padding: 0;
  margin-bottom: .4rem;
  font-weight: 600;
  font-size: .9375rem;
}

.giorno-scelta {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-right: .75rem;
  padding: .35rem .6rem;
  border: 1px solid var(--grigio-med);
  border-radius: var(--raggio);
  cursor: pointer;
  user-select: none;
}
.giorno-scelta:has(input:checked) {
  border-color: var(--blu-medio);
  background: var(--blu-medio);
  color: #fff;
}

.ruolo-scelta { padding: .3rem .5rem; font-size: .875rem; }

/* Miniature nella pagina di ridimensionamento */
.mini-anteprima {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--grigio-med);
  background: var(--grigio);
  vertical-align: middle;
}
