/* ============================================================
   VF SUMMER CAMP — Admin Panel (tema dark, coerente con l'app)
   ============================================================ */

/* Metropolis (stesso font dell'app pubblica), ospitato in locale */
@font-face { font-family:'Metropolis'; font-style:normal; font-weight:300; font-display:swap; src:url('/fonts/metropolis-300.woff2') format('woff2'); }
@font-face { font-family:'Metropolis'; font-style:normal; font-weight:400; font-display:swap; src:url('/fonts/metropolis-400.woff2') format('woff2'); }
@font-face { font-family:'Metropolis'; font-style:normal; font-weight:600; font-display:swap; src:url('/fonts/metropolis-600.woff2') format('woff2'); }
@font-face { font-family:'Metropolis'; font-style:normal; font-weight:700; font-display:swap; src:url('/fonts/metropolis-700.woff2') format('woff2'); }
@font-face { font-family:'Metropolis'; font-style:normal; font-weight:800; font-display:swap; src:url('/fonts/metropolis-800.woff2') format('woff2'); }
@font-face { font-family:'Metropolis'; font-style:normal; font-weight:900; font-display:swap; src:url('/fonts/metropolis-900.woff2') format('woff2'); }

:root {
  --bg:        #12152a;
  --bg2:       #1B1E34;
  --card:      #232744;
  --card2:     #2b3053;
  --sidebar:   #171a2e;
  --nero:      #10121f;
  --primary:   #ED037D;
  --primary-l: #FF6BB0;
  --primary-d: #BE0264;
  --blu:       #0076A3;
  --azzurro:   #0095CD;
  --text:      #FAFAFA;
  --grigio-t:  #9aa2c4;
  --grigio-d:  rgba(255,255,255,0.09);
  --linea:     rgba(255,255,255,0.09);
  --rosso:     #E05252;
  --verde:     #3FBF7F;
  --arancio:   #E0A052;
  --radius:    18px;
  --radius-sm: 12px;
  --shadow:    0 10px 30px rgba(0,0,0,0.45);
  --font:      'Metropolis', system-ui, -apple-system, sans-serif;
  --font-d:    'Metropolis', system-ui, -apple-system, sans-serif;
}

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

/* hidden deve avere sempre la meglio sulle regole con display esplicito */
[hidden] { display: none !important; }

body {
  font-family: var(--font);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--font); border: none; cursor: pointer; }
code { background: rgba(255,255,255,0.07); padding: 1px 6px; border-radius: 5px; font-size: 0.9em; }

/* ══════════════════════════════
   LOGIN
══════════════════════════════ */
.login-screen {
  min-height: 100vh; padding: 24px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 0%, #3d1140 0%, var(--bg) 60%);
}
.login-box {
  width: 100%; max-width: 400px; text-align: center;
  background: var(--bg2); border: 1px solid rgba(237,3,125,0.28);
  border-radius: 26px; padding: 42px 34px; box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.login-logo { width: 190px; margin: 0 auto 20px; display: block; }
.login-box h1 { font-family: var(--font-d); font-size: 1.9rem; font-weight: 700; }
.login-box > p { color: var(--grigio-t); font-size: 0.82rem; margin-bottom: 28px; }

/* ══════════════════════════════
   FORM
══════════════════════════════ */
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; margin-bottom: 16px; }
.field label {
  font-size: 0.7rem; font-weight: 700; color: var(--grigio-t);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.field input, .field select, .field textarea {
  background: var(--card2); border: 1.5px solid var(--linea); border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 0.9rem; color: var(--text); font-family: var(--font);
  transition: border-color 0.15s;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary);
}
.field input::placeholder, .field textarea::placeholder { color: #666; }
input[type="date"] { color-scheme: dark; }

/* ══════════════════════════════
   BOTTONI
══════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 700; transition: filter 0.15s, transform 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary, .btn-oro { background: var(--primary); color: #fff; }
.btn-primary:hover, .btn-oro:hover { filter: brightness(1.08); }
.btn-ghost { background: rgba(255,255,255,0.07); color: var(--grigio-t); }
.btn-danger { background: rgba(224,82,82,0.15); color: var(--rosso); }
.btn-reset { background: transparent; color: var(--rosso); border: 1.5px solid rgba(224,82,82,0.5); }
.btn-reset:hover { background: rgba(224,82,82,0.12); border-color: var(--rosso); }
.pt-azioni { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 10px; font-size: 0.75rem; border-radius: 8px; }

/* ══════════════════════════════
   LAYOUT
══════════════════════════════ */
.admin-layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }

.admin-sidebar {
  background: var(--sidebar); border-right: 1px solid var(--linea);
  padding: 24px 16px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-logo { text-align: center; padding-bottom: 20px; border-bottom: 1px solid var(--linea); margin-bottom: 18px; }
.sidebar-logo img { width: 150px; margin-bottom: 8px; }
.sidebar-logo span {
  display: block; font-size: 0.62rem; color: var(--primary);
  letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700;
}
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sidebar-section-label {
  font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.18em;
  color: #5f5f5f; margin: 18px 0 6px 12px;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 600; color: var(--grigio-t);
  transition: background 0.15s, color 0.15s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.sidebar-nav a.active { background: rgba(237,3,125,0.15); color: var(--primary); }
.nav-icon { font-size: 1rem; }
.nav-alert { margin-left: auto; font-size: 0.9rem; line-height: 1; animation: navAlert 1.1s ease-in-out infinite; }
@keyframes navAlert { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(1.15); } }
.nav-alert[hidden] { display: none !important; }

.sidebar-user {
  border-top: 1px solid var(--linea); padding-top: 16px; margin-top: 16px;
  display: flex; flex-direction: column; gap: 10px;
  font-size: 0.75rem; color: var(--grigio-t); word-break: break-all;
}
.sidebar-user button {
  background: rgba(255,255,255,0.07); color: var(--grigio-t);
  border-radius: 8px; padding: 8px; font-size: 0.75rem; font-weight: 700;
}

.admin-main { padding: 32px; max-width: 1400px; }
.admin-page { display: none; animation: fade 0.25s ease; }
.admin-page.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }

.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 26px;
}
.page-header h1 { font-family: var(--font-d); font-size: 2.2rem; font-weight: 700; line-height: 1.1; }
.page-header h1 em { color: var(--primary); font-style: italic; }
.page-header p { color: var(--grigio-t); font-size: 0.85rem; margin-top: 4px; }

/* ══════════════════════════════
   CARD & STAT
══════════════════════════════ */
.card {
  background: var(--card); border: 1px solid var(--linea);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-title {
  font-size: 0.95rem; font-weight: 800; margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--card); border: 1px solid var(--linea); border-top: 3px solid var(--primary);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.stat-val { font-family: var(--font-d); font-size: 2.4rem; font-weight: 700; line-height: 1; color: var(--primary); }
.stat-label { font-size: 0.7rem; color: var(--grigio-t); text-transform: uppercase; letter-spacing: 0.12em; margin-top: 6px; font-weight: 700; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }

/* ══════════════════════════════
   TABELLA PUNTEGGI
══════════════════════════════ */
.punteggi-table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--linea); }
.punteggi-table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.punteggi-table-wrap th {
  background: var(--card2); padding: 10px 8px; text-align: center;
  font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--grigio-t); white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
/* intestazioni e colonna squadra sempre visibili: l'angolo resta sopra a tutto */
.punteggi-table-wrap th:first-child { text-align: left; left: 0; z-index: 3; }
.punteggi-table-wrap td { padding: 4px 8px; border-top: 1px solid var(--linea); }
.squadra-cell {
  font-weight: 700; white-space: nowrap;
  position: sticky; left: 0; z-index: 1; background: var(--card);
}
.punti-cell { text-align: center; }
/* riga evidenziata mentre la compili → non si perde il segno scorrendo */
.punteggi-table-wrap tbody tr:hover        > td { background: rgba(237,3,125,0.05); }
.punteggi-table-wrap tbody tr:focus-within > td { background: rgba(237,3,125,0.10); }
.punteggi-table-wrap tbody tr:hover        .squadra-cell,
.punteggi-table-wrap tbody tr:focus-within .squadra-cell { background: var(--card2); }
.punto-input {
  width: 46px; text-align: center; background: var(--card2);
  border: 1.5px solid var(--linea); border-radius: 8px; padding: 6px 4px;
  color: var(--text); font-family: var(--font); font-weight: 700; font-size: 0.9rem;
}
.punto-input:focus { outline: none; border-color: var(--primary); }
.punto-input::-webkit-outer-spin-button, .punto-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ══════════════════════════════
   BONUS / MALUS
══════════════════════════════ */
.bm-list { display: flex; flex-direction: column; max-height: 460px; overflow-y: auto; }
.bm-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linea); }
.bm-badge {
  flex: 0 0 auto; min-width: 58px; text-align: center;
  border-radius: 50px; padding: 4px 10px; font-size: 0.75rem; font-weight: 800;
}
.bm-bonus { background: rgba(63,191,127,0.15); color: var(--verde); }
.bm-malus { background: rgba(224,82,82,0.15); color: var(--rosso); }
.bm-info { flex: 1; min-width: 0; }
.bm-squadra { font-weight: 700; font-size: 0.88rem; }
.bm-nota { font-size: 0.75rem; color: var(--grigio-t); overflow: hidden; text-overflow: ellipsis; }

/* ══════════════════════════════
   LISTE GENERICHE (post, sponsor)
══════════════════════════════ */
.admin-list { display: flex; flex-direction: column; max-height: 480px; overflow-y: auto; }
.admin-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--linea);
}
.admin-list-item .thumb {
  width: 54px; height: 40px; border-radius: 8px; background: #fff;
  object-fit: contain; padding: 3px; flex: 0 0 auto;
}
.admin-list-item .emoji { font-size: 1.5rem; }
.admin-list-item .body { flex: 1; min-width: 0; }
.admin-list-item .t { font-weight: 700; font-size: 0.88rem; }
.admin-list-item .s { font-size: 0.75rem; color: var(--grigio-t); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-msg { color: var(--grigio-t); font-size: 0.85rem; padding: 8px 0; }

/* Storico invii push */
.storico-gruppo { margin-bottom: 18px; }
.storico-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  font-weight: 800; font-size: 0.9rem; color: var(--primary);
  padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--linea);
}
.storico-head .sh-tot { font-size: 0.68rem; font-weight: 600; color: var(--grigio-t); }
.storico-riga { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--linea); }
.sr-thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; background: rgba(255,255,255,0.06); }
.sr-corpo { flex: 1; min-width: 0; }
.sr-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.sr-titolo { font-weight: 700; font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-azioni { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.sr-data { font-size: 0.68rem; color: var(--grigio-t); flex: 0 0 auto; }
.sr-del {
  background: none; border: none; cursor: pointer; font-size: 0.9rem; line-height: 1;
  opacity: 0.6; padding: 2px 4px; border-radius: 6px;
}
.sr-del:hover { opacity: 1; background: rgba(224,82,82,0.15); }
.sr-metriche { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 5px; font-size: 0.74rem; color: var(--grigio-t); }
.sr-metriche span { white-space: nowrap; }

/* Vista FEED della bacheca (moderazione post + commenti) */
/* niente altezza limitata qui: le card sono alte e i pulsanti in fondo
   verrebbero tagliati dallo scroll interno di .admin-list */
#post-list-admin { max-height: none; overflow: visible; }
.fp-card { background: var(--card); border: 1px solid var(--linea); border-radius: 16px; overflow: hidden; margin-bottom: 14px; }
.fp-img { display: block; width: 100%; height: 170px; object-fit: cover; background: var(--card2); }
.fp-noimg { display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.fp-body { padding: 12px 14px 14px; }
.fp-tag { display: inline-block; background: rgba(237,3,125,0.15); color: var(--primary-l); font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; padding: 3px 9px; border-radius: 50px; margin-bottom: 8px; }
.fp-title { font-weight: 800; font-size: 0.95rem; line-height: 1.2; margin-bottom: 5px; }
.fp-text { font-size: 0.82rem; color: #dfe2f2; line-height: 1.5; white-space: pre-line; }
.fp-meta { font-size: 0.68rem; color: var(--grigio-t); margin-top: 8px; }
.fp-actions { display: flex; gap: 8px; margin-top: 12px; }
.fp-actions .btn { flex: 1; }
.fp-comments { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--linea); display: flex; flex-direction: column; gap: 8px; }
.fp-com-label { font-size: 0.6rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--grigio-t); }
.fp-com { display: flex; align-items: flex-start; gap: 8px; }
.fp-com-b { flex: 1; min-width: 0; background: var(--bg2); border: 1px solid var(--linea); border-radius: 10px; padding: 7px 10px; font-size: 0.78rem; line-height: 1.4; }
.fp-com-n { font-weight: 800; color: var(--primary-l); margin-right: 6px; }
.fp-com-t { color: #e7e9f6; }
.fp-com-del { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 7px; border: 1px solid rgba(224,82,82,0.4); background: rgba(224,82,82,0.12); color: #ffb3b3; cursor: pointer; font-size: 0.75rem; }
.fp-com-del:hover { background: rgba(224,82,82,0.25); }

/* Galleria anteprime nel form post (multi-foto) */
.post-gallery { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pg-thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--linea); flex: 0 0 auto; }
.pg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-del {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 6px; z-index: 2;
  background: rgba(224,82,82,0.9); color: #fff; border: none; cursor: pointer; font-size: 0.7rem;
  display: flex; align-items: center; justify-content: center;
}
.pg-cover { position: absolute; top: 3px; left: 3px; z-index: 2; background: rgba(237,3,125,0.9); color: #fff; font-size: 0.7rem; line-height: 1; padding: 3px 4px; border-radius: 6px; }
.pg-move { position: absolute; left: 0; right: 0; bottom: 0; display: flex; }
.pg-mv {
  flex: 1; background: rgba(0,0,0,0.55); color: #fff; border: none; border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 1rem; font-weight: 800; line-height: 1; padding: 3px 0; cursor: pointer;
}
.pg-mv + .pg-mv { border-left: 1px solid rgba(255,255,255,0.15); }
.pg-mv:disabled { opacity: 0.3; cursor: default; }
.pg-mv:not(:disabled):active { background: rgba(237,3,125,0.7); }

/* Badge "N foto" nella vista feed di moderazione */
.fp-imgwrap { position: relative; }
.fp-multi { position: absolute; top: 10px; right: 10px; background: rgba(9,10,20,0.65); color: #fff; font-size: 0.66rem; font-weight: 800; padding: 3px 9px; border-radius: 50px; backdrop-filter: blur(4px); }

/* ══════════════════════════════
   UPLOAD LOGO SPONSOR
══════════════════════════════ */
.hint { font-size: 0.72rem; color: var(--grigio-t); line-height: 1.5; }
.hint.ok { color: var(--verde); }
.hint.ko { color: var(--rosso); }

/* Registrazione vocale */
.audio-scelta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.audio-oppure { font-size: 0.72rem; color: var(--grigio-t); }
.audio-scelta input[type=file] { flex: 1 1 140px; min-width: 0; }
#notif-rec-btn.rec {
  background: var(--rosso); color: #fff; border-color: var(--rosso);
  animation: recPulse 1s ease-in-out infinite;
}
@keyframes recPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

.field input[type="file"] {
  padding: 9px 12px; font-size: 0.82rem; cursor: pointer;
}
.field input[type="file"]::file-selector-button {
  background: var(--primary); color: #fff; border: none; cursor: pointer;
  border-radius: 8px; padding: 6px 12px; margin-right: 12px;
  font-family: var(--font); font-weight: 700; font-size: 0.78rem;
}

.logo-preview {
  display: flex; align-items: center; gap: 14px; margin-bottom: 16px;
  background: #fff; border-radius: var(--radius-sm); padding: 12px;
}
.logo-preview img { max-height: 60px; max-width: 190px; object-fit: contain; flex: 1; }

.foto-preview {
  position: relative; margin-bottom: 16px;
  border-radius: var(--radius-sm); overflow: hidden; background: var(--card2);
}
.foto-preview img { width: 100%; max-height: 260px; object-fit: cover; display: block; }
.foto-preview .btn { position: absolute; top: 10px; right: 10px; }

.destinatari { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dest {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--card2); color: var(--grigio-t); font-family: var(--font);
  border: 1px solid var(--linea); border-radius: var(--radius-sm);
  padding: 12px 8px; font-size: 0.82rem; font-weight: 700;
}
.dest span { font-size: 0.68rem; opacity: 0.8; font-weight: 600; }
.dest.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.switch-riga {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px;
  background: var(--card2); border-radius: var(--radius-sm); padding: 12px 14px;
}
.switch-riga input[type="checkbox"] {
  width: 20px; height: 20px; flex: 0 0 auto; margin-top: 2px;
  accent-color: var(--primary); cursor: pointer;
}
.switch-riga label { cursor: pointer; }
.switch-riga strong { display: block; font-size: 0.88rem; }
.switch-riga span   { font-size: 0.74rem; color: var(--grigio-t); }

.field input[type="range"] {
  accent-color: var(--primary); padding: 0; border: none;
  background: transparent; height: 26px; cursor: pointer;
}

/* ══════════════════════════════
   ANTEPRIME
══════════════════════════════ */
.notifiche-preview {
  display: none; background: var(--card2); border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm); padding: 14px; font-size: 0.85rem; color: var(--grigio-t);
}
.notifiche-preview.show { display: block; }
.notifiche-preview strong { display: block; color: var(--text); margin-bottom: 3px; }

/* anteprima flash alert (come appare nell'app) */
.alert-preview {
  background: var(--bg2); border: 1px solid rgba(237,3,125,0.3);
  border-radius: 20px; padding: 22px; text-align: center;
}
.alert-preview .badge {
  display: inline-block; background: rgba(224,82,82,0.15); color: var(--rosso);
  border-radius: 50px; padding: 4px 12px; margin-bottom: 12px;
  font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em;
}
.alert-preview h3 { font-family: var(--font-d); font-size: 1.6rem; margin-bottom: 8px; }
.alert-preview p { font-size: 0.85rem; color: var(--grigio-t); line-height: 1.6; }
.alert-preview img { max-width: 100%; max-height: 160px; border-radius: 12px; margin: 10px 0; object-fit: contain; }
.alert-preview .fake-btn {
  margin-top: 14px; background: var(--primary); color: var(--nero);
  border-radius: 12px; padding: 11px; font-weight: 800; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* ══════════════════════════════
   FEEDBACK
══════════════════════════════ */
.feedback-msg {
  display: none; margin-top: 12px; padding: 11px 14px;
  border-radius: var(--radius-sm); font-size: 0.82rem; font-weight: 600;
}
.feedback-msg.show { display: block; }
.feedback-ok    { background: rgba(63,191,127,0.13); color: var(--verde); }
.feedback-error { background: rgba(224,82,82,0.13); color: var(--rosso); }

.info-note {
  margin-top: 16px; padding: 13px 16px; background: var(--card2);
  border-radius: var(--radius-sm); font-size: 0.78rem; color: var(--grigio-t); line-height: 1.6;
}
.info-note strong { color: var(--text); }

/* ══════════════════════════════
   INSERIMENTO PUNTEGGI DA TELEFONO
   Tabella 12×7 impossibile da usare al tatto: su mobile si sceglie
   la squadra e si assegnano i punti con quattro bottoni grandi.
══════════════════════════════ */
/* ── Scelta rapida del giorno del turno (7 pulsanti) ── */
.pt-giorni {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 18px;
  scrollbar-width: none;
}
.pt-giorni::-webkit-scrollbar { display: none; }
.pt-giorno {
  flex: 0 0 auto; min-width: 96px; display: flex; flex-direction: column; gap: 2px;
  align-items: flex-start; text-align: left; cursor: pointer; position: relative;
  background: var(--card2); color: var(--grigio-t);
  border: 1px solid var(--linea); border-radius: 14px; padding: 10px 14px;
  font-family: var(--font); transition: transform .08s, border-color .12s, background .12s;
}
.pt-giorno:hover { border-color: var(--primary-l); }
.pt-giorno:active { transform: scale(.97); }
.pt-gnum  { font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.pt-gdata { font-size: 0.92rem; font-weight: 700; color: var(--text); text-transform: capitalize; }
.pt-giorno.attivo {
  background: var(--primary); border-color: var(--primary);
}
.pt-giorno.attivo .pt-gnum,
.pt-giorno.attivo .pt-gdata { color: #fff; }
.pt-giorno.oggi:not(.attivo) { border-color: var(--verde); }
.pt-goggi {
  position: absolute; top: -8px; right: 8px;
  background: var(--verde); color: #fff; font-size: 0.55rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 50px;
}
.pt-giorno.attivo .pt-goggi { background: #fff; color: var(--primary); }
.pt-giorni-vuoto {
  color: var(--grigio-t); font-size: 0.82rem; margin: 0 0 18px;
  padding: 12px 14px; background: var(--card2); border-radius: var(--radius-sm);
}

/* ── Badge turno in questione (header pagina) ── */
.pt-turno-badge {
  flex: 0 0 auto; align-self: center;
  background: rgba(237,3,125,0.14); color: var(--primary-l);
  border: 1px solid rgba(237,3,125,0.35); border-radius: 50px;
  padding: 8px 16px; font-size: 0.78rem; font-weight: 800;
  white-space: nowrap; text-transform: capitalize;
}

/* ── Storico inserimenti punteggi ── */
.pt-storico-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pt-storico-head h2 { font-family: var(--font-d); font-size: 1.3rem; font-weight: 700; }
.pt-storico-turno {
  background: var(--card2); color: var(--grigio-t); border: 1px solid var(--linea);
  border-radius: 50px; padding: 5px 13px; font-size: 0.72rem; font-weight: 800;
  white-space: nowrap; text-transform: capitalize;
}
.pt-storico-sub { color: var(--grigio-t); font-size: 0.8rem; margin: 6px 0 16px; }
.pt-storico-vuoto {
  color: var(--grigio-t); font-size: 0.85rem; text-align: center;
  padding: 22px 14px; background: var(--card2); border-radius: var(--radius-sm);
}
.pt-st-riga {
  display: flex; align-items: center; gap: 12px; width: 100%; cursor: pointer;
  background: var(--card2); border: 1px solid var(--linea); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px; text-align: left; font-family: var(--font);
  transition: border-color .12s, transform .08s;
}
.pt-st-riga:hover  { border-color: var(--primary); }
.pt-st-riga:active { transform: scale(.99); }
.pt-st-data {
  flex: 1 1 auto; min-width: 0; font-weight: 700; font-size: 0.9rem; color: var(--text);
  text-transform: capitalize; display: flex; align-items: center; gap: 8px;
}
.pt-st-oggi {
  background: var(--verde); color: #fff; font-size: 0.55rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 50px;
}
.pt-st-stato { flex: 0 0 auto; font-size: 0.72rem; font-weight: 700; }
.pt-st-ok   { color: var(--verde); }
.pt-st-parz { color: var(--grigio-t); }
.pt-st-tot {
  flex: 0 0 auto; font-family: var(--font-d); font-size: 1.25rem; font-weight: 700; color: var(--primary);
}
.pt-st-tot small { font-family: var(--font); font-size: 0.6rem; color: var(--grigio-t); font-weight: 700; }
.pt-st-apri { flex: 0 0 auto; font-size: 0.72rem; font-weight: 800; color: var(--grigio-t); }

.punteggi-mobile { display: none; }

.pm-squadre {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 14px;
  scrollbar-width: none;
}
.pm-squadre::-webkit-scrollbar { display: none; }
.pm-squadra {
  flex: 0 0 auto; background: var(--card2); color: var(--grigio-t);
  border: 1px solid var(--linea); border-radius: 50px; padding: 9px 16px;
  font-size: 0.85rem; font-weight: 800; font-family: var(--font); position: relative;
}
.pm-squadra.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pm-squadra.completa::after {
  content: '✓'; position: absolute; top: -3px; right: -3px;
  background: var(--verde); color: #fff; border-radius: 50%;
  width: 16px; height: 16px; font-size: 0.6rem; line-height: 16px; text-align: center;
}

.pm-disciplina {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--linea);
}
.pm-nome { font-size: 0.88rem; font-weight: 600; flex: 1; min-width: 0; }
.pm-voti { display: flex; gap: 6px; }
.pm-voto {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--card2); color: var(--grigio-t); border: 1px solid var(--linea);
  font-size: 1rem; font-weight: 800; font-family: var(--font);
}
.pm-voto.scelto { background: var(--primary); color: #fff; border-color: var(--primary); }
/* 0 = azzera: aspetto neutro/reset, distinto dai punteggi 1–4 */
.pm-voto.zero { color: var(--grigio-t); border-style: dashed; }
.pm-voto.zero.scelto { background: var(--rosso); border-color: var(--rosso); border-style: solid; color: #fff; }
.pm-totale {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--card2); font-size: 0.85rem; font-weight: 700;
}
.pm-totale span { color: var(--primary); font-size: 1.1rem; }

/* ══════════════════════════════
   BARRA MOBILE + DRAWER
══════════════════════════════ */
.admin-topbar, .drawer-backdrop { display: none; }

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */
@media (max-width: 1000px) {
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .admin-layout { grid-template-columns: 1fr; }

  /* barra fissa in alto con menu a scomparsa */
  .admin-topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 60;
    display: flex; align-items: center; gap: 12px;
    height: 58px; padding: 0 14px;
    background: var(--sidebar); border-bottom: 1px solid var(--linea);
  }
  .admin-topbar img { height: 22px; }
  .burger {
    background: transparent; color: var(--text); font-size: 1.5rem;
    line-height: 1; padding: 4px 6px;
  }
  .topbar-page {
    margin-left: auto; font-size: 0.72rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.1em; color: var(--primary);
  }

  .drawer-backdrop {
    position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,0.6);
  }
  .drawer-backdrop.open { display: block; }

  .admin-sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 80;
    width: 260px; height: 100vh; transform: translateX(-100%);
    transition: transform 0.25s ease; border-right: 1px solid var(--linea);
  }
  .admin-sidebar.open { transform: translateX(0); }

  .admin-main {
    padding: 74px 14px 30px;
    /* .admin-main è una cella di grid: senza min-width:0 si allarga fino al
       contenuto più largo (le strisce giorni/squadre) e la pagina scorre di lato.
       min-width:0 la fa stare nella colonna del viewport; clip è la rete di sicurezza. */
    min-width: 0;
    overflow-x: clip;
  }
  .page-header { margin-bottom: 18px; }
  .page-header h1 { font-size: 1.6rem; }
  .card { padding: 18px 14px; border-radius: 14px; }

  /* su telefono si usa l'inserimento a tocchi, non la tabella */
  .punteggi-mobile { display: block; }
  .punteggi-table-wrap { display: none; }

  /* il tasto Salva resta agganciato in basso mentre si scorre */
  #btn-salva-punteggi {
    position: sticky; bottom: 10px; width: 100%;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5); z-index: 20;
  }
  #form-punteggi > div:first-child { flex-direction: column; align-items: stretch; }
  .pt-azioni { flex-direction: column; }
  .pt-azioni .btn { width: 100%; }

  /* ── PUNTEGGI: tutto in una schermata, niente scroll a rimbalzo ──
     Le 7 discipline devono starci tutte insieme al selettore squadra,
     così tra una squadra e l'altra lo schermo non si sposta. */
  .pt-giorni { gap: 6px; margin-bottom: 12px; padding-bottom: 6px; }
  .pt-giorno { min-width: 84px; padding: 8px 12px; border-radius: 12px; }
  .pt-gdata { font-size: 0.85rem; }

  /* selettore squadra agganciato in alto: resta visibile mentre si assegnano i voti */
  .punteggi-mobile .pm-squadre {
    position: sticky; top: 58px; z-index: 15;
    background: var(--card); margin: 0 0 12px; padding: 8px 0;
    border-bottom: 1px solid var(--linea); max-width: 100%;
  }

  /* righe e bottoni più bassi (ma sempre tappabili) per far entrare tutte le discipline */
  .pm-disciplina { padding: 7px 0; }
  .pm-nome  { font-size: 0.82rem; }
  .pm-voti  { gap: 5px; }
  .pm-voto  { width: 42px; height: 40px; border-radius: 10px; font-size: 0.95rem; }
  .pm-totale { margin-top: 10px; padding: 10px 14px; }
  /* spazio in fondo così il tasto Salva agganciato non copre il totale */
  .punteggi-mobile { padding-bottom: 8px; }

  /* storico: righe più strette su telefono */
  .pt-st-apri { display: none; }
  .pt-st-riga { gap: 10px; padding: 11px 12px; }

  /* 16px evita che iOS ingrandisca la pagina al tocco sui campi */
  .field input, .field select, .field textarea { font-size: 16px; }
  .btn { padding: 13px 20px; }
  .stats-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-val { font-size: 1.9rem; }
  .admin-list-item { padding: 14px 0; }
  .admin-list-item .btn-sm { padding: 9px 12px; }
}
