/* Prototipo web VolleyNetwork — tema chiaro coerente con i fogli PDF
   (palette slate: header 30,41,59 · tabelle 51,65,85 · zebra 241,245,249) */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #f8fafc; color: #1e293b; font-size: 14px;
}

/* ── Header ───────────────────────────────────────────────────────── */
.top {
  background: #1e293b; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 30px; }
.top h1 { margin: 0; font-size: 19px; font-weight: 600; }
.top .vn { color: #60a5fa; }
.top .sotto { font-size: 11.5px; color: #cbd5e1; }
.badge {
  background: #f59e0b; color: #1e293b; font-weight: 700; font-size: 11px;
  padding: 4px 10px; border-radius: 99px; letter-spacing: .4px;
}

/* ── Tabs ─────────────────────────────────────────────────────────── */
.tabs {
  background: #334155; display: flex; gap: 2px; padding: 0 12px;
  overflow-x: auto;
}
.tabs button {
  background: none; border: none; color: #cbd5e1; font: inherit;
  padding: 10px 16px; cursor: pointer; border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.tabs button:hover { color: #fff; }
.tabs button.attiva { color: #fff; border-bottom-color: #60a5fa; font-weight: 600; }

main { max-width: 1720px; margin: 0 auto; padding: 16px 14px 40px; }

/* ── Caricamento ──────────────────────────────────────────────────── */
.caricamento { text-align: center; padding: 70px 0; color: #64748b; }
.caricamento .palla { font-size: 46px; animation: rimbalzo 1s infinite alternate ease-in; }
@keyframes rimbalzo { from { transform: translateY(0); } to { transform: translateY(-18px); } }

/* ── Filtri ───────────────────────────────────────────────────────── */
.filtri {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 12px 14px; margin-bottom: 14px;
}
.filtri label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: #64748b; font-weight: 600; }
.filtri select, .filtri input {
  font: inherit; padding: 7px 9px; border: 1px solid #cbd5e1; border-radius: 7px;
  background: #fff; color: #1e293b; min-width: 120px;
}
.filtri input[type=number] { min-width: 80px; width: 90px; }
.filtri input[type=search] { min-width: 260px; }

/* ── Tabelle ──────────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
thead th {
  background: #334155; color: #fff; font-weight: 600; font-size: 12px;
  padding: 8px 9px; text-align: right; position: sticky; top: 0; white-space: nowrap;
}
thead th:first-child, td:first-child { text-align: left; }
thead th.sortable { cursor: pointer; }
thead th.sortable:hover { background: #475569; }
tbody td { padding: 5px 7px; border-bottom: 1px solid #f1f5f9; text-align: right; white-space: nowrap; }
/* Celle testo lunghe (es. elenco squadre): tagliate con ellissi, testo completo nel tooltip */
td.ell { max-width: 250px; overflow: hidden; text-overflow: ellipsis; }
tbody tr:nth-child(even) { background: #f1f5f9; }
tbody tr.cliccabile { cursor: pointer; }
tbody tr.cliccabile:hover { background: #dbeafe; }
tbody tr.totale { background: #cbd5e1 !important; font-weight: 700; }
td.txt, th.txt { text-align: left; }

/* Colori soglie (come ScriviPerc del PDF) */
.ok  { color: #166516; font-weight: 700; }
.mid { color: #854d0e; font-weight: 700; }
.ko  { color: #991b1b; font-weight: 700; }
.na  { color: #94a3b8; }

/* ── Sezioni / banner come i fogli PDF ────────────────────────────── */
.banner {
  background: #1e293b; color: #fff; font-weight: 700; letter-spacing: .5px;
  padding: 9px 14px; border-radius: 9px 9px 0 0; font-size: 14px; margin-top: 22px;
}
.banner small { font-weight: 400; color: #cbd5e1; margin-left: 8px; }
.sezione { background: #fff; border: 1px solid #e2e8f0; border-top: none; border-radius: 0 0 10px 10px; padding: 0; }
.sezione .interno { padding: 12px 14px; }

.titolone { font-size: 26px; font-weight: 700; color: #1e293b; margin: 14px 0 2px; }
.sottotitolo { color: #64748b; font-size: 12.5px; font-style: italic; margin-bottom: 8px; }

/* ── Card giocatori (coni) ────────────────────────────────────────── */
.cards { display: flex; flex-wrap: wrap; gap: 14px; padding: 14px; }
.card {
  border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px;
  background: #fff; flex: 1 1 320px; max-width: 660px;
}
.card h4 { margin: 0 0 2px; font-size: 14px; }
.card .ruolino { color: #64748b; font-size: 11.5px; margin-bottom: 8px; }
svg.coni { width: 100%; height: auto; display: block; }
svg.coni text.et1 { fill: #fff; font-size: 11px; font-weight: 700; }
svg.coni text.et2 { fill: #ebebeb; font-size: 9px; }
svg.coni text.etZona { fill: #fff; font-size: 11px; font-weight: 700; }

/* ── Radar ────────────────────────────────────────────────────────── */
svg.radar { width: 100%; max-width: 420px; height: auto; }
svg.radar text.radLab { fill: #46505f; font-size: 12.5px; font-weight: 700; }

/* ── Profilo atleta ───────────────────────────────────────────────── */
.profilo-top { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.profilo-top > div { flex: 1 1 380px; }
.risultati { list-style: none; margin: 8px 0; padding: 0; background:#fff; border:1px solid #e2e8f0; border-radius:10px; max-height: 420px; overflow:auto; }
.risultati li { padding: 8px 14px; border-bottom: 1px solid #f1f5f9; cursor: pointer; display:flex; justify-content: space-between; gap:10px; }
.risultati li:hover { background: #dbeafe; }
.risultati .cod { color: #94a3b8; font-size: 11.5px; }

.nota {
  background: #fffbeb; border: 1px solid #fde68a; color: #854d0e;
  border-radius: 8px; padding: 9px 12px; font-size: 12.5px; margin: 12px 0;
}
.vuoto { color: #94a3b8; font-style: italic; padding: 12px; }

.fondo {
  text-align: center; color: #94a3b8; font-size: 11.5px; padding: 14px;
  border-top: 1px solid #e2e8f0; margin-top: 30px;
}

@media (max-width: 700px) {
  .filtri input[type=search] { min-width: 150px; }
  .titolone { font-size: 20px; }
  .ub-user { max-width: 120px; }
}

/* ── Barra utente / accesso società (Fase 4) ──────────────────────── */
.top-dx { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.userbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ub-user { color: #e2e8f0; font-size: 12px; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ub-soc { font: inherit; font-size: 12px; padding: 4px 8px; border-radius: 7px; border: 1px solid #475569; background: #0f172a; color: #fff; }
.ub-soc-fissa { color: #60a5fa; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ub-warn { color: #fbbf24; }
.btn-auth {
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  padding: 5px 11px; border-radius: 7px; border: 1px solid #475569;
  background: #334155; color: #fff;
}
.btn-auth:hover { background: #475569; }
.btn-auth.primario {
  background: #2563eb; border-color: #2563eb; width: 100%;
  padding: 9px; font-size: 13px; margin-top: 4px;
}
.btn-auth.primario:hover { background: #1d4ed8; }
.btn-auth.primario:disabled { background: #94a3b8; border-color: #94a3b8; cursor: default; }
.btn-auth.link { background: none; border: none; color: #64748b; padding: 6px 0; width: 100%; text-align: left; }
.btn-auth.link:hover { color: #1e293b; text-decoration: underline; }

/* Overlay login (codice OTP via email) */
.auth-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.62);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.auth-overlay[hidden] { display: none; }
.auth-card {
  position: relative; background: #fff; color: #1e293b; border-radius: 14px;
  padding: 22px 24px; width: 100%; max-width: 380px; box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.auth-card h2 { margin: 0 0 6px; font-size: 19px; }
.auth-sub { color: #64748b; font-size: 12.5px; margin: 0 0 14px; line-height: 1.45; }
.auth-l { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 10px; }
.auth-l input { font: inherit; font-size: 15px; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 8px; }
.auth-l input:focus { outline: 2px solid #60a5fa; border-color: #60a5fa; }
.auth-x { position: absolute; top: 12px; right: 14px; border: none; background: none; font-size: 16px; color: #94a3b8; cursor: pointer; }
.auth-x:hover { color: #1e293b; }
.auth-msg { font-size: 12.5px; color: #64748b; margin-top: 10px; min-height: 16px; }
.auth-msg.err { color: #991b1b; font-weight: 600; }
#authCode { letter-spacing: 6px; font-size: 20px; text-align: center; font-weight: 700; }
