/* ============================================================================
   GestioneSquadra PWA - Main Stylesheet
   Touch-first design optimized for iPad
   ============================================================================ */

/* ============================================================================
   CSS Custom Properties
   ============================================================================ */

:root {
  /* ── Token legacy rimappati sul design system (tokens.css) ───────────
     I nomi italiani restano per compatibilità con i 3.000+ usi sparsi
     nei selettori; i valori puntano alle scale ufficiali. */
  --blu:                 var(--navy-700);
  --blu-scuro:           var(--navy-900);
  --blu-chiaro:          var(--navy-600);
  --rosso:               var(--red-600);
  --bianco:              var(--white);
  --nero:                var(--ink-900);
  --grigio-sf:           var(--paper);
  --grigio-card:         var(--paper-2);
  --grigio-bordo:        var(--ink-300);
  --grigio-bordo-soft:   var(--ink-200);
  --campo-bg:            #fbfcff;
  --campo-bg-focus:      var(--white);
  --testo:               var(--ink-900);
  --testo-secondario:    var(--ink-600);
  --verde:               var(--success-600);
  --verde-chiaro:        var(--success-100);
  --arancio:             var(--warning-600);
  --arancio-chiaro:      var(--warning-100);
  --rosso-chiaro:        var(--red-100);
  --giallo:              var(--warning-500);
  --giallo-chiaro:       var(--warning-100);
  --viola:               #7c3aed;
  --viola-chiaro:        #ede9fe;

  /* Shadows: legacy → alias ai token ufficiali */
  --ombra:        var(--sh-md);
  --ombra-card:   var(--sh-sm);
  --ombra-field:  var(--sh-xs);
  --ombra-modal:  var(--sh-lg);
  --focus-ring:   0 0 0 4px rgba(0, 56, 130, 0.12);

  /* Spacing & Layout legacy */
  --radius:         var(--r-md);
  --radius-sm:      var(--r-sm);
  --nav-height:     64px;
  --topbar-height:  56px;

  /* Font stack — ora Inter (body) + Barlow Condensed disponibile come --font-display */
  --font-stack: var(--font-body);
}

/* ============================================================================
   Reset & Base Styles
   ============================================================================ */

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

html,
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
li,
dl,
dt,
dd,
figure {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-stack);
  font-size: 16px;
  line-height: 1.5;
  color: var(--testo);
  background:
    radial-gradient(circle at top, rgba(0, 56, 130, 0.08), transparent 32%),
    var(--grigio-sf);
  min-height: 100vh;
  max-width: 768px;
  margin: 0 auto;
  overflow-y: hidden;
}

/* ============================================================================
   Fascia Blucerchiata (Sampdoria stripe)
   ============================================================================ */

.fascia-samp {
  display: flex;
  height: 5px;
  background: linear-gradient(
    to right,
    var(--blu) 0%,
    var(--blu) 20%,
    var(--bianco) 20%,
    var(--bianco) 40%,
    var(--rosso) 40%,
    var(--rosso) 60%,
    var(--nero) 60%,
    var(--nero) 80%,
    var(--bianco) 80%,
    var(--bianco) 100%
  );
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}

.fascia-samp span {
  flex: 1;
}

/* ============================================================================
   Top Bar
   ============================================================================ */

.topbar {
  position: sticky;
  top: 5px;
  background-color: var(--blu-scuro);
  color: var(--bianco);
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 16px;
  z-index: 500;
  box-shadow: var(--ombra-card);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* topbar-logo defined below in Topbar extras */

.topbar-title {
  font-weight: 600;
  font-size: 16px;
}

/* ============================================================================
   Team Switcher
   ============================================================================ */

.team-switcher {
  display: flex;
  background-color: rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 4px;
  gap: 4px;
  min-height: 36px;
}

.team-switcher-option {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 16px;
  background-color: transparent;
  color: var(--bianco);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-switcher-option.active {
  background-color: var(--bianco);
  color: var(--blu);
  font-weight: 600;
}

.team-switcher-option:active {
  opacity: 0.9;
}

/* ============================================================================
   Main Content Area
   ============================================================================ */

.main-content {
  padding-top: calc(var(--topbar-height) + 5px);
  padding-bottom: var(--nav-height);
  padding-left: 16px;
  padding-right: 16px;
  overflow-y: auto;
  min-height: 100vh;
  -webkit-overflow-scrolling: touch;
}

/* ============================================================================
   Bottom Navigation
   ============================================================================ */

.navbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 768px;
  margin: 0 auto;
  height: var(--nav-height);
  background-color: var(--bianco);
  border-top: 1px solid var(--grigio-bordo);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 400;
  padding-bottom: max(0px, env(safe-area-inset-bottom));
}

.navbar-item {
  flex: 1;
  height: var(--nav-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: var(--testo-secondario);
  transition: color 0.2s ease;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 500;
  padding-bottom: max(0px, env(safe-area-inset-bottom));
}

.navbar-item.active {
  color: var(--blu);
}

.navbar-item-icon {
  font-size: 24px;
  line-height: 1;
}

/* ============================================================================
   Cards
   ============================================================================ */

.card {
  background-color: var(--bianco);
  border-radius: var(--radius);
  box-shadow: var(--ombra-card);
  padding: 16px;
  margin-bottom: 12px;
}

/* ============================================================================
   Player Card
   ============================================================================ */

.player-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--bianco);
  border-radius: 14px;
  box-shadow: var(--ombra-card);
  border: 1px solid rgba(219, 226, 236, 0.75);
  padding: 12px 16px;
  margin-bottom: 8px;
  min-height: 64px;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.player-card:active {
  transform: scale(0.99);
}

@media (hover: hover) {
  .player-card:hover {
    border-color: rgba(0, 56, 130, 0.18);
    box-shadow: 0 6px 18px rgba(0, 31, 77, 0.08);
  }
}

.player-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--blu);
  color: var(--bianco);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

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

.player-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--testo);
  margin-bottom: 2px;
}

.player-role {
  font-size: 12px;
  color: var(--testo-secondario);
}

.player-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ============================================================================
   Badges
   ============================================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
}

.badge-effettivo {
  background-color: var(--blu-chiaro);
  color: var(--bianco);
}

.badge-aggregato {
  background-color: var(--viola);
  color: var(--bianco);
}

.badge-in_prova {
  background-color: var(--arancio);
  color: var(--bianco);
}

.badge-prestato {
  background-color: var(--giallo);
  color: var(--nero);
}

/* ============================================================================
   Presence States
   ============================================================================ */

.stato-presente {
  background-color: var(--verde-chiaro);
  color: var(--verde);
}

.stato-assente-g {
  background-color: var(--rosso-chiaro);
  color: var(--rosso);
}

.stato-assente-ng {
  background-color: var(--rosso);
  color: var(--bianco);
}

.stato-differenziato {
  background-color: var(--arancio-chiaro);
  color: var(--arancio);
}

.stato-palestra {
  background-color: var(--viola-chiaro);
  color: var(--viola);
}

.stato-ritardo {
  background-color: var(--giallo-chiaro);
  color: var(--giallo);
}

.stato-infortunato {
  background-color: var(--rosso);
  color: var(--bianco);
}

.stato-malattia {
  background-color: var(--rosso-chiaro);
  color: var(--rosso);
}

.stato-permesso {
  background-color: var(--giallo-chiaro);
  color: var(--giallo);
}

.stato-convocato {
  background-color: var(--blu-chiaro);
  color: var(--bianco);
}

/* ============================================================================
   Presence Grid
   ============================================================================ */

.presenze-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
}

.presenze-grid-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 12px 16px;
  background-color: var(--bianco);
  border-radius: var(--radius-sm);
  box-shadow: var(--ombra-card);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
}

.presenze-grid-row:active {
  background-color: var(--grigio-sf);
  transform: scale(0.98);
}

.presenze-grid-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--testo);
}

.presenze-grid-stato {
  flex-shrink: 0;
}

/* ============================================================================
   FAB (Floating Action Button)
   ============================================================================ */

.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--rosso);
  color: var(--bianco);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 300;
  box-shadow: var(--ombra);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 300;
  padding: 0;
}

.fab:active {
  transform: scale(0.95);
  box-shadow: 0 4px 12px rgba(0, 56, 130, 0.2);
}

/* ============================================================================
   Modal
   ============================================================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(9, 18, 34, 0.52);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 1000;
  animation: fade-in 0.2s ease;
}

.modal {
  background-color: var(--bianco);
  border-radius: 22px;
  padding: 0;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  max-height: min(88vh, 720px);
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--ombra-modal);
  border: 1px solid rgba(255, 255, 255, 0.75);
  animation: slide-up 0.3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid rgba(200, 208, 220, 0.55);
  background:
    linear-gradient(180deg, rgba(242, 244, 248, 0.85), rgba(255, 255, 255, 0.95));
}

.modal-header h3 {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--testo);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--testo-secondario);
  cursor: pointer;
  padding: 0;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================================
   Form Elements
   ============================================================================ */

.form-group {
  margin-bottom: 17px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 650;
  font-size: 12px;
  color: var(--testo);
  letter-spacing: 0.01em;
}

input,
select,
textarea {
  font-family: var(--font-stack);
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}

input[type='checkbox'] {
  -webkit-appearance: auto;
  appearance: auto;
}

input[type='text'],
input[type='search'],
input[type='email'],
input[type='tel'],
input[type='url'],
input[type='password'],
input[type='number'],
input[type='date'],
input[type='time'],
select,
textarea {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1.5px solid var(--grigio-bordo-soft);
  border-radius: 14px;
  color: var(--testo);
  background-color: var(--campo-bg);
  box-shadow: var(--ombra-field);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

input[type='search'] {
  padding-left: 44px;
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235a6880' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 16px center;
  background-size: 18px 18px;
}

input[type='search']::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

textarea {
  padding: 13px 15px;
  min-height: 100px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--blu);
  background-color: var(--campo-bg-focus);
  box-shadow: var(--focus-ring), var(--ombra-field);
}

input::placeholder {
  color: #8491a6;
}

select {
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, #5a6880 50%),
    linear-gradient(135deg, #5a6880 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 50%,
    calc(100% - 16px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* ============================================================================
   Buttons
   ============================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-stack);
  white-space: nowrap;
  gap: 8px;
}

.btn:focus-visible,
.fab:focus-visible,
.btn-close:focus-visible,
.nav-tab:focus-visible,
.team-pill:focus-visible,
.player-card:focus-visible,
.fab-menu-item:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--blu);
  color: var(--bianco);
  box-shadow: 0 8px 18px rgba(0, 56, 130, 0.18);
}

.btn-primary:hover {
  background-color: var(--blu-chiaro);
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-danger {
  background-color: var(--rosso);
  color: var(--bianco);
}

.btn-danger:hover {
  background-color: #a60824;
}

.btn-ghost {
  background-color: var(--bianco);
  color: var(--blu);
  border: 1.5px solid rgba(0, 56, 130, 0.85);
}

.btn-ghost:hover {
  background-color: rgba(0, 56, 130, 0.05);
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ============================================================================
   Section Headers
   ============================================================================ */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 8px 0;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--testo);
}

.section-action {
  font-size: 13px;
  color: var(--blu);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: none;
  padding: 8px 12px;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
}

/* ============================================================================
   Empty State
   ============================================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  text-align: center;
  color: var(--testo-secondario);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--testo);
}

.empty-state-text {
  font-size: 14px;
  color: var(--testo-secondario);
}

/* ============================================================================
   Counter Bar
   ============================================================================ */

.counter-bar {
  position: sticky;
  top: calc(var(--topbar-height) + 5px);
  background-color: var(--bianco);
  border-bottom: 1px solid var(--grigio-bordo);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 400;
  box-shadow: var(--ombra-card);
}

.counter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.counter-segment {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.counter-text {
  color: var(--testo);
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

.flex {
  display: flex;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.gap-16 {
  gap: 16px;
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-16 {
  margin-bottom: 16px;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--testo-secondario);
}

.hidden {
  display: none;
}

/* ============================================================================
   Animations
   ============================================================================ */

@keyframes flash-green {
  0% {
    background-color: inherit;
  }
  50% {
    background-color: var(--verde-chiaro);
  }
  100% {
    background-color: inherit;
  }
}

@keyframes slide-up {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.flash-green {
  animation: flash-green 0.6s ease;
}

.slide-up {
  animation: slide-up 0.3s ease;
}

.fade-in {
  animation: fade-in 0.3s ease;
}

/* ============================================================================
   Team Pill (alias for team-switcher-option)
   ============================================================================ */

.team-pill {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 16px;
  background-color: transparent;
  color: var(--bianco);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-stack);
  white-space: nowrap;
}

.team-pill.active {
  background-color: var(--bianco);
  color: var(--blu);
  font-weight: 600;
}

.team-pill:active { opacity: 0.9; }

/* ============================================================================
   Topbar extras
   ============================================================================ */

.topbar-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
}

.topbar-logo {
  width: 36px; height: 36px;
  background: var(--rosso);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: white;
  border: 2px solid rgba(255,255,255,0.25);
  flex-shrink: 0;
}

/* ============================================================================
   Nav Tab (bottom navbar items)
   ============================================================================ */

.nav-tab {
  flex: 1;
  height: var(--nav-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: var(--testo-secondario);
  transition: color 0.2s ease;
  border: none;
  background: none;
  font-size: 11px;
  font-weight: 500;
  padding: 0;
  font-family: var(--font-stack);
}

.nav-tab.active { color: var(--blu); }
.nav-tab svg { width: 22px; height: 22px; }

/* ============================================================================
   Avatar
   ============================================================================ */

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--blu), #004aa5);
  color: var(--bianco);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

.avatar-sm {
  width: 32px; height: 32px; font-size: 12px;
}

.avatar-xs {
  width: 26px;
  height: 26px;
  font-size: 10px;
}

/* ============================================================================
   Player List
   ============================================================================ */

.player-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
}

/* ============================================================================
   Filter select
   ============================================================================ */

.filtro-ruolo {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--grigio-bordo);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-stack);
  color: var(--testo);
  background-color: var(--bianco);
}

/* ============================================================================
   Event Card
   ============================================================================ */

.event-filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  margin-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.event-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--grigio-bordo);
  border-radius: 999px;
  background: var(--bianco);
  color: var(--testo);
  font-family: var(--font-stack);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 31, 77, 0.04);
}

.event-filter-chip strong {
  min-width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--grigio-sf);
  color: var(--testo-secondario);
  font-size: 12px;
}

.event-filter-chip.active {
  background: var(--blu);
  border-color: var(--blu);
  color: var(--bianco);
}

.event-filter-chip.active strong {
  background: rgba(255, 255, 255, 0.2);
  color: var(--bianco);
}

.event-list.grouped {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-card { cursor: default; }

.event-group {
  padding: 0;
  overflow: hidden;
}

.event-group-header {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid var(--grigio-bordo);
  background: linear-gradient(180deg, var(--bianco), #f8fbff);
  color: var(--testo);
  font-family: var(--font-stack);
  text-align: left;
  cursor: pointer;
}

.event-group-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--blu-chiaro);
  font-size: 18px;
}

.event-group-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.event-group-title strong {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-group-title small {
  margin-top: 2px;
  color: var(--testo-secondario);
  font-size: 12px;
  font-weight: 600;
}

.event-group-count,
.event-group-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
}

.event-group-count {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  background: var(--grigio-sf);
  color: var(--blu);
  font-size: 13px;
}

.event-group-toggle {
  width: 30px;
  height: 30px;
  background: var(--bianco);
  color: var(--testo-secondario);
  border: 1px solid var(--grigio-bordo);
  font-size: 18px;
  line-height: 1;
}

.event-group-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.event-card-compact {
  padding: 14px;
  border-bottom: 1px solid var(--grigio-bordo);
}

.event-card-compact:last-child {
  border-bottom: none;
}

.event-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.event-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

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

.event-type {
  font-weight: 600;
  font-size: 15px;
  color: var(--testo);
  margin-bottom: 2px;
}

.event-opponent {
  font-size: 14px;
  margin-top: 4px;
}

.event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--grigio-bordo);
}

/* ============================================================================
   Button variants
   ============================================================================ */

.btn-sm {
  min-height: 36px;
  padding: 0 16px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-close {
  background: rgba(90, 104, 128, 0.08);
  border: none;
  border-radius: 999px;
  font-size: 24px;
  color: var(--testo-secondario);
  cursor: pointer;
  padding: 0;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-close:active {
  background: rgba(90, 104, 128, 0.14);
}

/* ============================================================================
   Modal footer
   ============================================================================ */

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 0;
  padding: 16px 22px 18px;
  border-top: 1px solid rgba(200, 208, 220, 0.8);
  background: linear-gradient(180deg, rgba(255,255,255,0.86), var(--bianco));
}

.modal-body {
  max-height: min(62vh, 560px);
  overflow-y: auto;
  padding: 18px 22px 6px;
  -webkit-overflow-scrolling: touch;
}

/* ============================================================================
   Form row (side-by-side fields)
   ============================================================================ */

.form-row {
  display: flex;
  gap: 12px;
}

.form-row > .form-group { flex: 1; min-width: 0; }

.form-row.compact { align-items: center; flex-wrap: wrap; }

.form-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-inline label {
  margin-bottom: 0;
  font-size: 13px;
  white-space: nowrap;
}

.input-sm {
  width: 64px !important;
  min-height: 36px !important;
  padding: 0 8px !important;
  font-size: 14px;
  text-align: center;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  min-height: 44px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 20px; height: 20px;
  accent-color: var(--blu);
}

.checkbox-label.compact {
  min-height: 36px;
  padding: 6px 8px;
  border-radius: 10px;
  background: var(--grigio-sf);
}

.checkbox-label.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px;
}

.optional-details {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--grigio-bordo-soft);
  border-radius: var(--radius-sm);
  background: rgba(242, 244, 248, 0.7);
}

.optional-details summary {
  min-height: 32px;
  cursor: pointer;
  font-weight: 700;
  color: var(--blu);
}

.optional-details[open] summary {
  margin-bottom: 12px;
}

/* ============================================================================
   Presenza row
   ============================================================================ */

.presenza-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 12px;
  background-color: var(--bianco);
  border-radius: var(--radius-sm);
  box-shadow: var(--ombra-card);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
  -webkit-user-select: none;
  user-select: none;
  margin-bottom: 4px;
}

.presenza-row:active {
  background-color: var(--grigio-sf);
  transform: scale(0.98);
}

.presenza-row-note {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  cursor: default;
}

.presenza-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
}

.presence-note-input {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 12px;
  font-size: 13px;
}

.badge-stato {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 28px;
  border-radius: 14px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ============================================================================
   Presenze header & counter
   ============================================================================ */

.presenze-header {
  margin-bottom: 12px;
  padding: 16px;
}

.presence-help {
  margin: 4px 0 0;
  font-size: 13px;
}

.counter-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.counter-num {
  font-weight: 700;
  font-size: 18px;
  color: var(--blu);
}

/* ============================================================================
   Presenze legend
   ============================================================================ */

.presenze-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 12px 0 0;
  margin-top: 12px;
  border-top: 1px solid rgba(219, 226, 236, 0.78);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

/* ============================================================================
   Convocazione (match stats)
   ============================================================================ */

.evento-detail-header {
  margin-bottom: 0;
}

.match-sticky-panel {
  padding: 0 0 12px;
  margin-bottom: 4px;
}

.match-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 12px 14px;
}

.match-sticky-spacer {
  display: none;
}

.match-back-btn {
  white-space: nowrap;
}

.match-summary .event-icon {
  width: 34px;
  font-size: 22px;
}

.match-summary .event-type {
  font-size: 16px;
  font-weight: 800;
}

.match-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 0;
  background: var(--sfondo);
}

.flow-step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(0, 56, 130, 0.12);
  background: var(--bianco);
  color: var(--testo);
  font-family: var(--font-stack);
  text-align: left;
  box-shadow: 0 6px 18px rgba(0, 31, 77, 0.05);
  cursor: pointer;
}

.flow-step.active {
  border-color: rgba(0, 56, 130, 0.34);
  background: var(--bianco);
  box-shadow: 0 10px 24px rgba(0, 31, 77, 0.1);
}

.flow-step.active .flow-copy strong {
  color: var(--blu);
}

.flow-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(0, 56, 130, 0.1);
  color: var(--blu);
  font-weight: 800;
  flex-shrink: 0;
}

.flow-step.active .flow-number {
  background: var(--blu);
  color: var(--bianco);
}

.flow-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.flow-copy strong {
  color: var(--testo);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.12;
}

.flow-copy small {
  color: var(--testo-light);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.15;
}

.flow-status {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin-top: 2px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(200, 16, 46, 0.08);
  color: var(--rosso);
  font-size: 10.5px;
  font-weight: 800;
}

.step-focus {
  border-color: rgba(0, 56, 130, 0.18);
}

#partita-convocati,
#partita-formazione,
#partita-cambi,
#partita-valutazioni {
  scroll-margin-top: 86px;
}

.formation-card {
  overflow: hidden;
}

.formation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.formation-status {
  min-width: 150px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(200, 16, 46, 0.08);
  border: 1px solid rgba(200, 16, 46, 0.16);
  color: var(--rosso);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.formation-status.complete {
  background: rgba(19, 141, 82, 0.1);
  border-color: rgba(19, 141, 82, 0.18);
  color: #0f7a45;
}

.formation-status strong {
  font-size: 13px;
}

.formation-status span {
  font-size: 12px;
  color: var(--testo-light);
}

.formation-head h4,
.change-card h4,
.convocati-card h4 {
  margin-bottom: 2px;
}

.formation-module {
  width: 150px;
  flex-shrink: 0;
  margin-bottom: 0;
}

.pitch {
  position: relative;
  height: min(58vh, 520px);
  min-height: 420px;
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.08) 50%, transparent 50%),
    linear-gradient(180deg, #157a3b, #0f6a34);
  background-size: 80px 80px, auto;
  border: 3px solid rgba(255,255,255,0.86);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.08), 0 14px 34px rgba(0, 31, 77, 0.13);
}

.pitch::before,
.pitch::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.pitch::before {
  top: 50%;
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.5);
}

.pitch::after {
  top: calc(50% - 46px);
  width: 92px;
  height: 92px;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 50%;
}

.pitch-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 88px;
  min-height: 54px;
  padding: 6px 7px;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.72);
  background: rgba(255,255,255,0.82);
  color: var(--blu-scuro);
  box-shadow: 0 8px 18px rgba(0,0,0,0.16);
  font-family: var(--font-stack);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.pitch-slot.selected {
  border-color: var(--rosso);
  box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.2), 0 8px 18px rgba(0,0,0,0.16);
}

.pitch-slot.filled {
  background: #ffffff;
}

.slot-role {
  font-size: 10px;
  font-weight: 800;
  color: var(--rosso);
  line-height: 1;
}

.slot-name {
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 750;
}

.slot-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--rosso);
  color: var(--bianco);
  font-size: 16px;
  line-height: 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
}

.formation-panel,
.bench-section {
  margin-top: 14px;
  padding: 12px;
  border-radius: 18px;
  background: var(--grigio-sf);
  border: 1px solid rgba(219, 226, 236, 0.82);
}

.formation-panel {
  margin-top: 0;
  margin-bottom: 12px;
}

.formation-panel-head,
.bench-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.bench-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.picker-search {
  margin-bottom: 10px;
}

.assignment-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}

.assignment-option {
  min-height: 50px;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px solid rgba(0, 56, 130, 0.14);
  background: var(--bianco);
  color: var(--testo);
  font-family: var(--font-stack);
  text-align: left;
  cursor: pointer;
}

.assignment-option:hover,
.assignment-option:focus {
  border-color: rgba(0, 56, 130, 0.34);
  box-shadow: 0 8px 18px rgba(0, 31, 77, 0.08);
  outline: none;
}

.assignment-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 750;
}

.assignment-role {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 56, 130, 0.08);
  color: var(--blu);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.bench-chip {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  border: 1px solid rgba(0, 56, 130, 0.16);
  background: var(--bianco);
  color: var(--testo);
  font-family: var(--font-stack);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.bench-chip.passive {
  cursor: default;
}

.change-card {
  padding: 16px;
}

.change-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 90px auto;
  gap: 10px;
  align-items: end;
}

.change-form .form-group {
  margin-bottom: 0;
}

.change-hint {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  line-height: 1.35;
}

.change-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.change-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--grigio-sf);
  border: 1px solid rgba(219, 226, 236, 0.8);
  font-size: 14px;
}

.formation-summary-card {
  padding: 16px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1fr;
  gap: 12px;
}

.summary-box {
  min-width: 0;
  padding: 12px;
  border-radius: 18px;
  background: var(--grigio-sf);
  border: 1px solid rgba(219, 226, 236, 0.86);
}

.summary-box > strong {
  display: block;
  margin-bottom: 10px;
  color: var(--blu-scuro);
}

.summary-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--bianco);
  border: 1px solid rgba(0, 56, 130, 0.12);
  font-size: 12px;
  font-weight: 650;
  color: var(--testo);
}

.summary-chip b {
  color: var(--rosso);
  font-size: 10px;
}

.summary-chip.warning {
  color: var(--rosso);
  border-color: rgba(200, 16, 46, 0.2);
  background: rgba(200, 16, 46, 0.06);
}

@media (max-width: 700px) {
  .match-summary {
    padding: 12px 14px;
  }

  .match-flow {
    grid-template-columns: repeat(2, 1fr);
  }

  .formation-head,
  .change-form,
  .summons-meta-grid,
  .performance-row {
    grid-template-columns: 1fr;
  }

  .formation-head {
    flex-direction: column;
  }

  .formation-module {
    width: 100%;
  }

  .pitch {
    min-height: 400px;
  }

  .pitch-slot {
    width: 82px;
  }

  .assignment-list {
    grid-template-columns: 1fr;
  }

  .formation-status,
  .summary-grid {
    width: 100%;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .flow-step {
    min-height: 54px;
  }

  .performance-row {
    grid-template-areas:
      "player"
      "minutes"
      "stats"
      "vote"
      "notes";
    align-items: stretch;
  }

  .performance-row .stats-row.compact {
    grid-template-columns: 1fr 1fr;
  }

  .performance-vote {
    max-width: none;
  }

  .performance-notes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .match-flow {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .performance-row .stats-row.compact {
    grid-template-columns: 1fr;
  }

  .flow-step {
    padding: 9px 10px;
  }
}

.convocati-card {
  padding: 16px;
}

.convocati-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.convocati-title p {
  margin: 3px 0 0;
}

.counter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(0, 56, 130, 0.08);
  color: var(--blu);
  font-weight: 750;
  font-size: 13px;
}

.convocazione-row {
  border: 1px solid rgba(219, 226, 236, 0.86);
  border-radius: 16px;
  padding: 0;
  margin-bottom: 10px;
  background: var(--bianco);
  overflow: hidden;
}

.convocazione-row.active {
  border-color: rgba(0, 56, 130, 0.18);
  box-shadow: 0 10px 24px rgba(0, 31, 77, 0.08);
}

.convocazione-row:last-child { margin-bottom: 0; }

.conv-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 10px 12px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.conv-header input[type="checkbox"] {
  width: 22px; height: 22px;
  accent-color: var(--blu);
  flex-shrink: 0;
}

.conv-player {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.conv-player strong {
  font-size: 14px;
}

.conv-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.conv-details {
  padding: 14px 14px 16px;
  background:
    linear-gradient(180deg, rgba(248, 250, 253, 0.96), #ffffff);
  border-top: 1px solid rgba(219, 226, 236, 0.75);
}

.conv-details.compact {
  padding: 10px 12px 12px;
}

.summons-meta-grid {
  display: grid;
  grid-template-columns: 100px minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.summons-meta-grid .form-group {
  margin-bottom: 0;
}

.summons-meta-grid .input-sm {
  width: 100% !important;
}

.conv-details.compact input,
.conv-details.compact select {
  min-height: 40px;
}

.conv-meta-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 100px 100px;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.conv-meta-grid .form-group,
.conv-meta-grid .checkbox-label {
  margin-bottom: 0;
}

.conv-meta-grid .input-sm {
  width: 100% !important;
}

@media (max-width: 520px) {
  .conv-meta-grid {
    grid-template-columns: 1fr 1fr;
  }

  .conv-meta-grid .checkbox-label {
    grid-column: 1 / -1;
  }

  .conv-summary {
    display: none;
  }
}

/* ============================================================================
   Stats row (gol, assist, ammonizioni counters)
   ============================================================================ */

.stats-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.stats-row.compact {
  margin: 0;
  gap: 8px;
}

.stat-counter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 24px 34px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--grigio-sf);
  border: 1px solid rgba(219, 226, 236, 0.75);
}

.stats-row.compact .stat-counter {
  padding: 7px 8px;
  min-width: 0;
}

.stats-row.compact .stat-label {
  min-width: 0;
  max-width: none;
  line-height: 1.1;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--testo-secondario);
  min-width: 36px;
}

.stat-value {
  font-size: 16px;
  font-weight: 800;
  min-width: 24px;
  text-align: center;
}

.btn-counter {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(0, 56, 130, 0.22);
  background: var(--bianco);
  color: var(--blu);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  padding: 0;
  font-family: var(--font-stack);
}

.btn-counter:active {
  background: var(--grigio-sf);
}

/* ============================================================================
   Voto display
   ============================================================================ */

.voto-group {
  margin-bottom: 0;
}

.voto-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.voto-head label {
  margin-bottom: 0;
}

.voto-display {
  font-weight: 800;
  font-size: 18px;
  color: var(--blu);
  min-width: 42px;
  text-align: center;
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(0, 56, 130, 0.08);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--blu);
}

input[type="range"].vote-slider {
  min-height: 22px;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

input[type="range"].vote-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(0, 56, 130, 0.18);
}

input[type="range"].vote-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--blu);
  border: 2px solid #ffffff;
  margin-top: -6px;
  box-shadow: 0 3px 8px rgba(0, 31, 77, 0.2);
}

input[type="range"].vote-slider::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(0, 56, 130, 0.18);
}

input[type="range"].vote-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--blu);
  border: 2px solid #ffffff;
  box-shadow: 0 3px 8px rgba(0, 31, 77, 0.2);
}

.performance-card {
  padding: 16px;
}

.performance-filters {
  margin-bottom: 12px;
}

.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.filter-chip {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 56, 130, 0.16);
  background: var(--bianco);
  color: var(--blu);
  font-family: var(--font-stack);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.filter-chip.active {
  background: var(--blu);
  color: var(--bianco);
  border-color: var(--blu);
}

.performance-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.performance-card,
.performance-list,
.performance-row,
.performance-row > *,
.stat-counter {
  min-width: 0;
  max-width: 100%;
}

.performance-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  grid-template-areas:
    "player minutes"
    "stats stats"
    "vote vote"
    "notes notes";
  gap: 12px;
  align-items: start;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(219, 226, 236, 0.86);
  background: var(--bianco);
}

.performance-row.active {
  border-color: rgba(0, 56, 130, 0.2);
  box-shadow: 0 8px 20px rgba(0, 31, 77, 0.06);
}

.performance-player {
  grid-area: player;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.performance-player > div:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.performance-player strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.performance-minutes label,
.performance-vote label {
  margin-bottom: 5px;
}

.performance-minutes {
  grid-area: minutes;
}

.performance-minutes .input-sm {
  width: 100% !important;
}

.performance-row .stats-row.compact {
  grid-area: stats;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-self: stretch;
  width: 100%;
}

.performance-vote {
  grid-area: vote;
  min-width: 0;
  max-width: none;
}

.performance-notes {
  grid-area: notes;
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(280px, 1.2fr);
  gap: 8px;
  width: 100%;
}

.performance-notes input,
.performance-notes textarea {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 13px;
  width: 100%;
}

.performance-vote .voto-head {
  margin-bottom: 6px;
}

.performance-vote .voto-display {
  min-width: 34px;
  padding: 2px 8px;
  font-size: 14px;
}

/* ============================================================================
   Loading screen
   ============================================================================ */

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 16px;
  color: var(--testo-secondario);
}

/* ============================================================================
   Empty state icon (alias)
   ============================================================================ */

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* ============================================================================
   x-cloak (Alpine.js)
   ============================================================================ */

[x-cloak] { display: none !important; }

/* ============================================================================
   Responsive & Accessibility
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Ensure text is readable and touch targets are adequate */
@media (max-height: 600px) {
  .navbar {
    height: 56px;
  }

  .navbar-item {
    height: 56px;
  }
}

/* Prevent horizontal scrolling on mobile */
html,
body {
  overflow-x: hidden;
}

/* ============================================================================
   Pool / FAB menu
   ============================================================================ */

.fab-wrap {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  right: 16px;
  z-index: 300;
}

.fab-wrap .fab {
  position: static;
}

.fab-menu {
  position: absolute;
  bottom: 64px;
  right: 0;
  min-width: 200px;
  background: var(--bianco);
  border-radius: var(--radius);
  box-shadow: var(--ombra);
  overflow: hidden;
}

.fab-menu-item {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: none;
  background: none;
  text-align: left;
  font-family: var(--font-stack);
  font-size: 15px;
  color: var(--testo);
  cursor: pointer;
  border-bottom: 1px solid var(--grigio-bordo);
}

.fab-menu-item:last-child {
  border-bottom: none;
}

.fab-menu-item:active {
  background: var(--grigio-sf);
}

.search-bar {
  margin-bottom: 12px;
}

.search-bar input {
  width: 100%;
}

.modal .form-group:has(input[type='search']) {
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(242, 244, 248, 0.9), rgba(248, 250, 253, 0.72));
  border: 1px solid rgba(219, 226, 236, 0.8);
}

.modal .form-group:has(input[type='search']) label {
  margin-bottom: 8px;
  color: var(--testo-secondario);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.modal .form-group:has(input[type='search']) input {
  background-color: var(--bianco);
}

.alloc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.badge-squadra {
  background: var(--grigio-card);
  color: var(--blu);
  font-size: 11px;
  font-weight: 500;
}

.badge-soft {
  background: rgba(0, 56, 130, 0.08);
  color: var(--blu);
  border: 1px solid rgba(0, 56, 130, 0.12);
}

.field-hint {
  margin-top: 7px;
  font-size: 12px;
  color: var(--testo-secondario);
}

.dashboard-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dashboard-stack .card {
  margin-bottom: 0;
  border: 1px solid rgba(219, 226, 236, 0.72);
  border-radius: 22px;
  box-shadow: 0 10px 28px rgba(0, 31, 77, 0.06);
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-kpis.compact {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.kpi-card {
  min-width: 0;
  padding: 14px;
  border-radius: 18px;
  background: var(--bianco);
  border: 1px solid rgba(0, 56, 130, 0.08);
  box-shadow: var(--ombra-card);
}

.kpi-card span,
.kpi-card small {
  display: block;
  color: var(--testo-secondario);
  font-size: 12px;
}

.kpi-card strong {
  display: block;
  margin: 4px 0;
  color: var(--blu-scuro);
  font-size: 26px;
  line-height: 1;
}

.dashboard-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dashboard-card-head h3 {
  margin-bottom: 2px;
}

.dashboard-card-head select,
.dashboard-card-head input[type="month"] {
  max-width: 220px;
}

.evaluation-list,
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.evaluation-row {
  padding: 12px;
  border-radius: 16px;
  background: var(--grigio-sf);
  border: 1px solid var(--grigio-bordo-soft);
}

.evaluation-player,
.profile-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.evaluation-player > div {
  flex: 1;
  min-width: 0;
}

.evaluation-player span.text-muted {
  display: block;
}

.evaluation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.evaluation-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 650;
  color: var(--testo-secondario);
}

.evaluation-field input {
  min-height: 38px;
  padding: 6px 8px;
}

.evaluation-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.profile-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.profile-columns h4 {
  margin-bottom: 8px;
}

.history-row {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 4px 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--grigio-sf);
  border: 1px solid var(--grigio-bordo-soft);
  font-size: 13px;
}

.history-row small {
  grid-column: 2;
  color: var(--testo-secondario);
}

.dashboard-titlebar {
  align-items: flex-start;
  margin-bottom: 12px;
}

.dashboard-titlebar h2 {
  font-size: 26px;
  letter-spacing: -0.02em;
}

.month-control {
  max-width: 180px;
  min-height: 40px;
  border-radius: 999px;
  background: var(--bianco);
  border-color: rgba(0, 56, 130, 0.16);
  box-shadow: var(--ombra-card);
}

.month-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(0, 56, 130, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 22px rgba(0, 31, 77, 0.08);
}

.month-step {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 56, 130, 0.08);
  color: var(--blu-scuro);
  cursor: pointer;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.month-display {
  position: relative;
  min-width: 132px;
  margin: 0;
  padding: 0 10px;
  color: var(--blu-scuro);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-align: center;
  cursor: pointer;
}

.month-display input {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: auto;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.dashboard-overview {
  display: grid;
  grid-template-columns: minmax(280px, 1.12fr) minmax(260px, 0.88fr);
  gap: 12px;
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  min-height: 154px;
  padding: 22px;
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.18), transparent 24%),
    linear-gradient(135deg, #001f4d 0%, #003882 62%, #0b4ea2 100%);
  color: var(--bianco);
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  right: -54px;
  bottom: -76px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  border: 30px solid rgba(255, 255, 255, 0.08);
}

.dashboard-hero .text-muted {
  color: rgba(255, 255, 255, 0.78);
}

.dashboard-hero h3 {
  margin-bottom: 8px;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero-date {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.92);
}

.eyebrow {
  display: block;
  margin-bottom: 14px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dashboard-mini-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-kpi {
  min-height: 72px;
  padding: 13px 14px;
  border-radius: 20px;
  background: var(--bianco);
  border: 1px solid rgba(219, 226, 236, 0.74);
  box-shadow: 0 8px 20px rgba(0, 31, 77, 0.045);
}

.mini-kpi span {
  display: block;
  color: var(--testo-secondario);
  font-size: 12px;
}

.mini-kpi strong {
  display: block;
  margin-top: 4px;
  color: var(--blu-scuro);
  font-size: 25px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.insight-card,
.recent-card,
.evaluations-card,
.player-profile-card {
  padding: 20px;
}

.dashboard-card-head {
  margin-bottom: 16px;
}

.dashboard-card-head h3 {
  color: var(--blu-scuro);
  font-size: 20px;
  letter-spacing: -0.015em;
}

.dashboard-card-head .text-muted {
  margin-top: 3px;
  font-size: 14px;
}

.alert-list,
.attention-list,
.evaluation-compact-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.alert-row,
.attention-row {
  position: relative;
  padding: 11px 13px 11px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff, #f3f6fb);
  border: 1px solid rgba(203, 213, 225, 0.82);
}

.attention-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.alert-row::before,
.attention-row::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 4px;
  border-radius: 999px;
  background: var(--blu);
}

.alert-row:nth-child(2)::before {
  background: var(--arancio);
}

.attention-row::before {
  background: var(--rosso);
}

.attention-list {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--grigio-bordo-soft);
}

.evaluation-progress {
  min-width: 88px;
  padding: 9px 13px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff, #eef4ff);
  border: 1px solid rgba(0, 56, 130, 0.1);
  text-align: right;
}

.evaluation-progress strong {
  display: block;
  color: var(--blu-scuro);
  font-size: 20px;
  line-height: 1;
}

.evaluation-progress span {
  color: var(--testo-secondario);
  font-size: 12px;
}

.evaluation-compact-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 62px;
  padding: 11px 13px;
  border: 1px solid rgba(219, 226, 236, 0.86);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

@media (hover: hover) {
  .evaluation-compact-row:hover {
    border-color: rgba(0, 56, 130, 0.22);
    box-shadow: 0 8px 20px rgba(0, 31, 77, 0.06);
    transform: translateY(-1px);
  }
}

.evaluation-compact-row strong,
.evaluation-compact-row span.text-muted {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill,
.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-completa {
  background: var(--verde-chiaro);
  color: var(--verde);
}

.status-parziale {
  background: var(--giallo-chiaro);
  color: #8a5a00;
}

.status-da_fare {
  background: var(--grigio-card);
  color: var(--testo-secondario);
}

.score-pill {
  min-width: 42px;
  background: rgba(0, 56, 130, 0.08);
  color: var(--blu);
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.profile-metrics span {
  padding: 10px 11px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff, #f3f6fb);
  border: 1px solid rgba(219, 226, 236, 0.8);
  color: var(--testo-secondario);
  font-size: 12px;
}

.profile-metrics strong {
  display: block;
  color: var(--blu-scuro);
  font-size: 18px;
}

.history-list.compact .history-row {
  grid-template-columns: 78px 1fr;
}

.history-list.compact {
  position: relative;
}

.history-list.compact .history-row {
  position: relative;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 9px 0 12px 18px;
  border-left: 2px solid var(--grigio-bordo-soft);
}

.history-list.compact .history-row::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 15px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blu);
  box-shadow: 0 0 0 4px #eef4ff;
}

@media (max-width: 700px) {
  .dashboard-kpis,
  .dashboard-kpis.compact,
  .evaluation-grid,
  .profile-columns,
  .dashboard-overview,
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-card-head {
    flex-direction: column;
  }

  .dashboard-card-head select,
  .dashboard-card-head input[type="month"] {
    max-width: none;
    width: 100%;
  }

  .dashboard-overview,
  .dashboard-grid,
  .profile-columns {
    grid-template-columns: 1fr;
  }

  .evaluation-compact-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
  }

  .score-pill {
    display: none;
  }

  .profile-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pool-picker-list {
  max-height: 40vh;
  overflow-y: auto;
  padding: 2px;
  margin: 0 -2px;
  border-radius: 16px;
}

.pool-picker-item.selected {
  border-color: rgba(0, 56, 130, 0.35);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 0 0 3px rgba(0, 56, 130, 0.1), var(--ombra-card);
}

.empty-state-compact {
  padding: 16px 0;
}

.empty-state-compact .empty-icon {
  display: none;
}

.topbar-stagione-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.topbar-stagione-btn:hover {
  color: var(--bianco);
}

.section-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.comp-hint {
  font-size: 14px;
  margin-bottom: 12px;
}

.comp-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #f8faff, var(--grigio-sf));
  border-radius: var(--radius-sm);
  border: 1px solid rgba(219, 226, 236, 0.75);
}

.comp-row > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.comp-row-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.comp-form-card {
  margin-top: 16px;
  padding: 16px;
}

.comp-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.stagioni-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stagione-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: var(--grigio-sf);
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
}

.stagione-row.active {
  border-color: var(--blu);
  background: var(--verde-chiaro);
}

.badge-attiva {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--blu);
  color: var(--bianco);
  font-size: 11px;
  font-weight: 600;
}

/* ============================================================================
   Professional polish layer
   ============================================================================ */

:root {
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --surface-muted: #eef3f9;
  --line-soft: rgba(148, 163, 184, 0.22);
  --line-strong: rgba(0, 56, 130, 0.18);
  --shadow-soft: 0 8px 24px rgba(0, 31, 77, 0.055);
  --shadow-lift: 0 14px 34px rgba(0, 31, 77, 0.09);
  --radius-lg: 22px;
  --radius-md: 16px;
}

body {
  background:
    radial-gradient(circle at 50% -10%, rgba(0, 56, 130, 0.12), transparent 34%),
    linear-gradient(180deg, #eef3f9 0%, #f7f9fc 46%, #eef3f9 100%);
}

.main-content {
  padding-left: 18px;
  padding-right: 18px;
}

.card,
.player-card,
.event-group,
.convocazione-row,
.performance-row,
.summary-box,
.evaluation-compact-row,
.mini-kpi {
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-soft);
}

.card {
  border-radius: var(--radius-lg);
}

.section-header {
  margin-bottom: 16px;
  padding: 10px 0 6px;
}

.section-header h2 {
  color: var(--blu-scuro);
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.section-header .text-muted {
  font-size: 14px;
  font-weight: 500;
}

.topbar {
  height: 68px;
  padding: 8px 18px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.14), transparent 26%),
    linear-gradient(135deg, #001b43, #003882);
  box-shadow: 0 12px 28px rgba(0, 31, 77, 0.22);
}

.topbar-left {
  min-width: 0;
}

.topbar-logo {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 8px 18px rgba(0, 0, 0, 0.18);
}

.topbar-title {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.topbar-stagione-btn {
  margin-top: 2px;
  text-decoration: none;
  opacity: 0.9;
}

.topbar-stagione-btn::after {
  content: "  ▾";
  font-size: 10px;
  opacity: 0.75;
}

.team-switcher {
  max-width: 52%;
  overflow-x: auto;
  padding: 4px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  scrollbar-width: none;
}

.team-switcher::-webkit-scrollbar {
  display: none;
}

.team-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 13px;
  min-height: 36px;
  color: rgba(255, 255, 255, 0.86);
}

.team-pill.active {
  background: var(--bianco);
  color: var(--blu-scuro);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.navbar {
  height: 72px;
  border-top: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 -12px 28px rgba(0, 31, 77, 0.06);
}

.nav-tab {
  position: relative;
  border-radius: 18px;
  margin: 6px 4px;
  min-height: 56px;
  transition: color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.nav-tab.active {
  background: rgba(0, 56, 130, 0.08);
  color: var(--blu-scuro);
}

.nav-tab.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--rosso);
  transform: translateX(-50%);
}

.btn {
  border-radius: 999px;
  font-weight: 700;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blu), var(--blu-chiaro));
}

.btn-ghost {
  border-color: rgba(0, 56, 130, 0.16);
  background: rgba(255, 255, 255, 0.74);
}

.badge,
.filter-chip,
.event-filter-chip,
.role-chip,
.summary-chip,
.status-pill,
.score-pill {
  letter-spacing: -0.005em;
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.player-card {
  margin-bottom: 0;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  padding: 13px 15px;
}

.player-card .avatar {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.player-name {
  color: var(--blu-scuro);
  font-size: 15px;
  font-weight: 760;
}

.role-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 56, 130, 0.07);
  color: var(--blu);
  font-size: 11px;
  font-weight: 700;
}

.badge-squadra,
.badge-soft {
  border-radius: 999px;
}

.fab {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--rosso), #e53e58);
  box-shadow: 0 18px 32px rgba(200, 16, 46, 0.24);
}

.fab-menu {
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  box-shadow: var(--shadow-lift);
}

.modal {
  border-radius: 26px;
}

.modal-header {
  background: linear-gradient(180deg, #f8fbff, #ffffff);
}

.optional-details {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border-color: var(--line-soft);
}

.checkbox-label.compact {
  border: 1px solid var(--line-soft);
  background: var(--surface-soft);
}

.event-filter-bar {
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.event-filter-bar::-webkit-scrollbar {
  display: none;
}

.event-filter-chip {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.event-filter-chip.active {
  background: var(--blu-scuro);
  border-color: var(--blu-scuro);
  color: var(--bianco);
}

.event-group {
  overflow: hidden;
  border-radius: 22px;
  position: relative;
  border-color: rgba(148, 163, 184, 0.28);
}

.event-group-header {
  border-bottom-color: rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.event-group-icon {
  background: rgba(0, 56, 130, 0.08);
  border-radius: 16px;
}

.event-group::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: rgba(0, 56, 130, 0.28);
}

.event-group-upcoming-match {
  border-color: rgba(0, 56, 130, 0.32);
  background: #ffffff;
}

.event-group-upcoming-match::before {
  background: var(--blu);
}

.event-group-upcoming-match .event-group-header {
  background:
    linear-gradient(90deg, rgba(0, 56, 130, 0.08), transparent 42%),
    linear-gradient(180deg, #ffffff, #f8fbff);
}

.event-group-upcoming-match .event-group-icon,
.event-group-upcoming-match .event-group-count {
  background: rgba(0, 56, 130, 0.11);
  color: var(--blu-scuro);
}

.event-group-archived-match::before {
  background: rgba(90, 104, 128, 0.34);
}

.event-group-archived-match .event-group-header {
  background: linear-gradient(180deg, #ffffff, #f3f6fa);
}

.event-group-upcoming-activity::before {
  background: var(--verde);
}

.event-group-upcoming-activity .event-group-header {
  background:
    linear-gradient(90deg, rgba(22, 163, 74, 0.08), transparent 42%),
    linear-gradient(180deg, #ffffff, #f8fbff);
}

.event-group-upcoming-activity .event-group-icon,
.event-group-upcoming-activity .event-group-count {
  background: rgba(22, 163, 74, 0.1);
  color: #116534;
}

.event-group-archived-activity::before {
  background: rgba(124, 58, 237, 0.32);
}

.event-group-archived-activity .event-group-icon,
.event-group-archived-activity .event-group-count {
  background: rgba(124, 58, 237, 0.08);
  color: var(--viola);
}

.event-group-kicker {
  width: fit-content;
  margin-bottom: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 31, 77, 0.06);
  color: var(--testo-secondario);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.event-card-compact {
  border-radius: 18px;
  background: var(--surface-soft);
}

.event-actions {
  gap: 7px;
  flex-wrap: wrap;
}

.presenze-header,
.convocati-card,
.formation-card,
.change-card,
.performance-card,
.formation-summary-card {
  border-radius: 22px;
}

.presenza-row {
  border: 1px solid var(--line-soft);
  border-radius: 18px;
}

.badge-stato,
.legend-item {
  border-radius: 999px;
}

.match-sticky-panel {
  border-radius: 0 0 24px 24px;
}

.flow-step {
  border-radius: 18px;
}

.flow-step.active {
  box-shadow: 0 12px 24px rgba(0, 56, 130, 0.13);
}

.pitch {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 50%, transparent 50%),
    linear-gradient(180deg, #1f8f51, #187a44);
  background-size: 52px 52px, auto;
  border: 8px solid rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.42), var(--shadow-soft);
}

.pitch-slot {
  border-radius: 18px;
  border-color: rgba(255, 255, 255, 0.76);
  box-shadow: 0 10px 22px rgba(0, 31, 77, 0.14);
}

.pitch-slot.filled {
  background: linear-gradient(180deg, #ffffff, #eef4ff);
}

.stat-counter {
  border-radius: 16px;
}

.performance-notes input,
.performance-notes textarea,
.presence-note-input {
  background: #ffffff;
}

.dashboard-stack .card:not(.dashboard-hero) {
  background: linear-gradient(180deg, #ffffff, #fbfcff);
}

.dashboard-hero {
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.18), transparent 24%),
    linear-gradient(135deg, #001f4d 0%, #003882 62%, #0b4ea2 100%);
  color: var(--bianco);
  box-shadow: 0 18px 34px rgba(0, 31, 77, 0.16);
}

.dashboard-hero .eyebrow,
.dashboard-hero h3,
.dashboard-hero .hero-date,
.dashboard-hero .text-muted {
  position: relative;
  z-index: 1;
}

.dashboard-hero .eyebrow {
  color: rgba(255, 255, 255, 0.82);
}

.dashboard-hero .text-muted {
  color: rgba(255, 255, 255, 0.82);
}

.evaluation-status-filters {
  margin: -4px 0 14px;
}

.profile-columns {
  gap: 16px;
}

.profile-timeline-panel {
  margin-top: 16px;
}

.profile-timeline-panel h4 {
  margin-bottom: 10px;
  color: var(--blu-scuro);
}

.profile-timeline {
  position: relative;
  display: grid;
  gap: 8px;
}

.timeline-row {
  position: relative;
  padding-left: 18px;
}

.timeline-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--blu);
  box-shadow: 0 0 0 4px rgba(0, 56, 130, 0.08);
}

.empty-state {
  margin-top: 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px dashed rgba(148, 163, 184, 0.42);
}

.empty-icon,
.empty-state-icon {
  opacity: 0.72;
}

.loading-screen {
  background:
    radial-gradient(circle at 50% 20%, rgba(0, 56, 130, 0.12), transparent 34%),
    var(--surface-soft);
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-height) + 18px);
  z-index: 1200;
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(0, 31, 77, 0.94);
  color: var(--bianco);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 16px 34px rgba(0, 31, 77, 0.2);
  transform: translateX(-50%);
}

.app-toast.toast-error {
  background: rgba(200, 16, 46, 0.94);
}

@media (max-width: 620px) {
  .topbar {
    height: auto;
    min-height: 78px;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .team-switcher {
    max-width: 100%;
    width: 100%;
  }

  .main-content {
    padding-top: calc(92px + 5px);
  }
}

/* ============================================================================
   FASE B — Identità federale (Claude Design handoff)
   Override mirati su topbar, crest, navbar e titoli — additivi, non
   distruttivi rispetto agli stili sopra.
   ============================================================================ */

/* Body: tipografia Inter, smoothing crisp, scrollbar discreta */
body {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Fascia identità superiore (Sampdoria) — invariata come marker brand */

/* ── Topbar federale: gradient navy + texture diagonale + accent rosso ── */
.topbar {
  background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-700) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: sticky;
  isolation: isolate;
}
.topbar::before {
  /* Trama diagonale 2.5% white — feel "federale" senza rumore */
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(135deg,
    transparent 0,
    transparent 14px,
    rgba(255, 255, 255, 0.025) 14px,
    rgba(255, 255, 255, 0.025) 15px);
  pointer-events: none;
  z-index: 0;
}
.topbar::after {
  /* Linea accento 3px rosso 60% + navy 40% sul bordo superiore della topbar */
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--red-600) 0%,
    var(--red-600) 60%,
    var(--navy-500) 60%,
    var(--navy-500) 100%);
  pointer-events: none;
  z-index: 1;
}
.topbar > * { position: relative; z-index: 2; }

/* ── Crest GS: sfera rossa con luce radiale, ombra interna, bordo bianco ── */
.topbar-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%,
    #e8424a 0%,
    var(--red-600) 50%,
    var(--red-700) 100%);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: var(--white);
  letter-spacing: 0.02em;
  border: 2px solid var(--white);
  box-shadow:
    0 4px 12px rgba(220, 38, 38, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -2px 4px rgba(0, 0, 0, 0.22);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

/* ── Titolo: Barlow Condensed maiuscolo, condensato ── */
.topbar-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar-sub {
  font-size: 12px;
  opacity: 0.85;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
}

.topbar-stagione-btn {
  padding: 2px 8px 2px 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
}
.topbar-stagione-btn::after {
  content: '  ▾';
  font-size: 10px;
  opacity: 0.7;
}

/* ── Team switcher: dark overlay su topbar, pill bianca per attivo ── */
.team-switcher {
  background: rgba(0, 20, 50, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-pill);
  padding: 3px;
}
.team-pill {
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.78);
  border-radius: var(--r-pill);
  transition: all 0.15s ease;
}
.team-pill.active {
  background: var(--white);
  color: var(--navy-800);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ── Bottom navbar: blur soft, pill navy-50 attivo, barra rossa indicatore ── */
.navbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--ink-200);
  box-shadow: 0 -2px 12px rgba(0, 30, 80, 0.04);
}

.nav-tab,
.navbar-item {
  position: relative;
  color: var(--ink-500);
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 12px;
}
.nav-tab.active,
.navbar-item.active {
  color: var(--navy-700);
}
.nav-tab.active::after,
.navbar-item.active::after {
  /* Indicatore rosso 22×3 sotto la voce attiva (design Claude Design) */
  content: '';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: var(--red-600);
}

/* ── Card: bordi sottili ink, ombra sm coerente coi token ── */
.card {
  border: 1px solid var(--ink-100);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}

/* ── Avatar: gradient base (override Fase C, colore per famiglia di ruolo) ── */
.player-avatar {
  font-family: var(--font-body);
  letter-spacing: 0.02em;
}

/* ============================================================================
   FASE C — Avatar per famiglia di ruolo
   Identità immediata a colpo d'occhio: portiere ottone, difesa navy,
   centrocampo indaco, attacco rosso scuro. Mappatura ruolo → famiglia
   fatta direttamente nel CSS via selettori [data-ruolo=…] — niente
   chiamate JS in template, ogni famiglia raggruppa più ruoli.
   ============================================================================ */

.avatar,
.player-avatar {
  font-family: var(--font-body);
  letter-spacing: 0.02em;
  font-weight: 700;
  /* default: navy (difesa) per ruoli non mappati */
  background: linear-gradient(135deg, var(--role-dif-from) 0%, var(--role-dif-to) 100%);
  color: var(--white);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

/* Portiere — ottone */
.avatar[data-ruolo="Portiere"],
.player-avatar[data-ruolo="Portiere"] {
  background: linear-gradient(135deg, var(--role-por-from) 0%, var(--role-por-to) 100%);
}

/* Difesa — navy (default, esplicitati per chiarezza) */
.avatar[data-ruolo="Difensore centrale"],
.avatar[data-ruolo="Terzino destro"],
.avatar[data-ruolo="Terzino sinistro"],
.player-avatar[data-ruolo="Difensore centrale"],
.player-avatar[data-ruolo="Terzino destro"],
.player-avatar[data-ruolo="Terzino sinistro"] {
  background: linear-gradient(135deg, var(--role-dif-from) 0%, var(--role-dif-to) 100%);
}

/* Centrocampo — indaco */
.avatar[data-ruolo="Mediano"],
.avatar[data-ruolo="Mezzala"],
.avatar[data-ruolo="Trequartista"],
.player-avatar[data-ruolo="Mediano"],
.player-avatar[data-ruolo="Mezzala"],
.player-avatar[data-ruolo="Trequartista"] {
  background: linear-gradient(135deg, var(--role-cen-from) 0%, var(--role-cen-to) 100%);
}

/* Attacco — rosso scuro */
.avatar[data-ruolo="Esterno destro"],
.avatar[data-ruolo="Esterno sinistro"],
.avatar[data-ruolo="Ala destra"],
.avatar[data-ruolo="Ala sinistra"],
.avatar[data-ruolo="Punta centrale"],
.avatar[data-ruolo="Seconda punta"],
.player-avatar[data-ruolo="Esterno destro"],
.player-avatar[data-ruolo="Esterno sinistro"],
.player-avatar[data-ruolo="Ala destra"],
.player-avatar[data-ruolo="Ala sinistra"],
.player-avatar[data-ruolo="Punta centrale"],
.player-avatar[data-ruolo="Seconda punta"] {
  background: linear-gradient(135deg, var(--role-att-from) 0%, var(--role-att-to) 100%);
}

/* ============================================================================
   FASE C — EventCard v2 con date-strip
   Colonna data a sinistra (giorno grande, mese, weekday + pill OGGI/DOMANI
   arancione). Icona casa/trasferta accanto a "vs Avversario".
   Layout grid: 64px (strip) + auto (contenuto).
   ============================================================================ */

.event-card-v2 {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4) var(--sp-3) var(--sp-3);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: var(--sh-sm);
  margin-bottom: var(--sp-2);
  overflow: hidden;
  align-items: stretch;
}

.event-date-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: var(--paper);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-1);
  gap: 2px;
  border: 1px solid var(--ink-200);
  position: relative;
  min-height: 84px;
}

.event-rel-pill {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: var(--sh-xs);
}
/* OGGI / DOMANI / "tra N gg" → arancione (warning) */
.event-rel-today,
.event-rel-tomorrow,
.event-rel-soon {
  background: var(--warning-600);
  color: var(--white);
}
/* IERI / passato → grigio neutro */
.event-rel-past {
  background: var(--ink-200);
  color: var(--ink-700);
}

.event-date-day {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  line-height: 1;
  color: var(--ink-900);
  letter-spacing: -0.01em;
  margin-top: var(--sp-2);
}

.event-date-month {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--navy-700);
  text-transform: uppercase;
}

.event-date-weekday {
  font-size: 10px;
  color: var(--ink-500);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.event-card-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--sp-2);
}

/* Icona casa / trasferta colorata accanto a "vs avversario" */
.event-ha {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  font-size: 12px;
  margin-right: 6px;
  vertical-align: middle;
}
.event-ha-casa       { background: var(--success-100); color: var(--success-700); }
.event-ha-trasferta  { background: var(--warning-100); color: var(--warning-700); }
.event-ha-neutro     { background: var(--ink-100);     color: var(--ink-600); }

/* Meta riga (ora · luogo): font monospace per leggibilità su tablet */
.event-card-v2 .event-meta { font-variant-numeric: tabular-nums; font-size: 13px; }

/* Bordo sinistro colorato per evidenziare gli eventi imminenti */
.event-card-v2[data-relative="today"]    { border-left: 3px solid var(--warning-600); }
.event-card-v2[data-relative="tomorrow"] { border-left: 3px solid var(--warning-500); }
.event-card-v2[data-relative="soon"]     { border-left: 3px solid var(--warning-100); }
.event-card-v2[data-relative="past"]     { opacity: 0.92; }

/* ============================================================================
   FASE C — Section header in Barlow Condensed maiuscolo
   Allinea i titoli di vista al sistema federale (display font, line-height
   stretto, "(N)" come count più tenue accanto).
   ============================================================================ */

.section-header {
  padding: var(--sp-4) 0 var(--sp-2);
  margin-bottom: var(--sp-3);
}

.section-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.0;
  letter-spacing: 0.01em;
  color: var(--ink-900);
  text-transform: uppercase;
}

.section-header h2 .text-muted {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: 0;
  color: var(--ink-400);
  text-transform: none;
  margin-left: 8px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ink-900);
}

/* ============================================================================
   FASE D — Stepper Partita: wizard a cerchi con linea connettiva
   4 step (Convocati · Formazione · Cambi · Voti). Cerchio verde con
   spunta = step già fatto (i < activeIndex), cerchio navy pieno =
   step attivo, cerchio outlined = step futuro. La linea fra cerchi
   diventa verde sui segmenti già percorsi.
   ============================================================================ */

.match-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: var(--sp-4) var(--sp-2) var(--sp-3);
  background: transparent;
  box-shadow: none;
  border: none;
  position: relative;
}

.match-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-2);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: center;
  min-height: auto;
  box-shadow: none;
}

/* Linea connettiva: ::before su ogni step tranne il primo, va dal centro
   dello step precedente al centro dello step corrente (z-index 0). */
.match-step + .match-step::before {
  content: '';
  position: absolute;
  top: 18px; /* ~ centro verticale del cerchio (36/2) */
  left: -50%;
  right: 50%;
  height: 3px;
  background: var(--ink-200);
  z-index: 0;
  border-radius: 2px;
}
/* Verde sulla linea che precede uno step già fatto o quello attivo */
.match-step + .match-step.done::before,
.match-step + .match-step.active::before {
  background: var(--success-600);
}

.match-step-circle {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 2px solid var(--ink-200);
  color: var(--ink-400);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  transition: all 0.15s ease;
}

.match-step.active .match-step-circle {
  background: var(--navy-700);
  border-color: var(--navy-700);
  color: var(--white);
  box-shadow: 0 0 0 4px rgba(0, 56, 130, 0.12),
              0 4px 10px rgba(0, 56, 130, 0.22);
}

.match-step.done .match-step-circle {
  background: var(--success-600);
  border-color: var(--success-600);
  color: var(--white);
}

.match-step-label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--ink-700);
  line-height: 1.1;
}
.match-step.active .match-step-label { color: var(--ink-900); }
.match-step.done   .match-step-label { color: var(--ink-700); }

.match-step-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-500);
  letter-spacing: 0.01em;
  line-height: 1.1;
}
/* Tono: alert = rosso ("Mancano N"), ok = verde, default = grigio */
.match-step-sub-alert { color: var(--red-600); font-weight: 700; }
.match-step-sub-ok    { color: var(--success-600); font-weight: 700; }

/* ============================================================================
   FASE D-2 — Partita complete: pitch tattico + pedine colorate + slot TOCCA
              + slider voto gradient + maglia con bordo color-reparto
   Override del look "strisce d'erba" verso una lavagnetta tattica;
   le pedine prendono il colore del role-family del loro slot, lo slot
   vuoto invita all'azione invece di gridare "Vuoto".
   ============================================================================ */

/* --- Pitch: verde piatto, bande sottili, linee bianche 0.3 -------------- */
.pitch {
  background:
    repeating-linear-gradient(0deg,
      transparent 0,
      transparent 58px,
      rgba(255, 255, 255, 0.045) 58px,
      rgba(255, 255, 255, 0.045) 60px),
    linear-gradient(180deg, var(--pitch-mid) 0%, var(--pitch-dark) 100%);
  background-size: auto, auto;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--r-2xl);
  box-shadow: 0 14px 34px rgba(0, 31, 77, 0.10);
}

.pitch::before {
  background: rgba(255, 255, 255, 0.3);
  height: 1px;
}
.pitch::after {
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* --- Pitch slot: colorate per ruolo del slot ---------------------------- */
.pitch-slot {
  /* default: stato vuoto, neutro */
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  color: var(--ink-700);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

/* Slot pieno → background = gradient role-family + testo bianco */
.pitch-slot.filled {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, var(--role-dif-from) 0%, var(--role-dif-to) 100%);
}
.pitch-slot.filled[data-ruolo="Portiere"] {
  background: linear-gradient(135deg, var(--role-por-from) 0%, var(--role-por-to) 100%);
}
.pitch-slot.filled[data-ruolo="Difensore centrale"],
.pitch-slot.filled[data-ruolo="Terzino destro"],
.pitch-slot.filled[data-ruolo="Terzino sinistro"] {
  background: linear-gradient(135deg, var(--role-dif-from) 0%, var(--role-dif-to) 100%);
}
.pitch-slot.filled[data-ruolo="Mediano"],
.pitch-slot.filled[data-ruolo="Mezzala"],
.pitch-slot.filled[data-ruolo="Trequartista"] {
  background: linear-gradient(135deg, var(--role-cen-from) 0%, var(--role-cen-to) 100%);
}
.pitch-slot.filled[data-ruolo="Esterno destro"],
.pitch-slot.filled[data-ruolo="Esterno sinistro"],
.pitch-slot.filled[data-ruolo="Ala destra"],
.pitch-slot.filled[data-ruolo="Ala sinistra"],
.pitch-slot.filled[data-ruolo="Punta centrale"],
.pitch-slot.filled[data-ruolo="Seconda punta"] {
  background: linear-gradient(135deg, var(--role-att-from) 0%, var(--role-att-to) 100%);
}

/* Slot selezionato: ring blu più morbido (sostituisce il rosso fisso) */
.pitch-slot.selected {
  border-color: var(--white);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.7),
    0 0 0 5px var(--navy-700),
    0 6px 14px rgba(0, 0, 0, 0.22);
}

/* Etichette dentro lo slot: role piccolo, name leggibile */
.pitch-slot .slot-role {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-500);          /* vuoto: grigio */
  line-height: 1;
}
.pitch-slot.filled .slot-role {
  color: rgba(255, 255, 255, 0.78); /* pieno: bianco semi-trasp */
}

.pitch-slot .slot-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty slot CTA: "TOCCA" in display font, invita l'azione */
.pitch-slot .slot-cta {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-400);
  text-transform: uppercase;
  line-height: 1;
  margin-top: 2px;
}

/* Slot remove ×: dimming meno aggressivo */
.pitch-slot .slot-remove {
  position: absolute;
  top: 2px;
  right: 4px;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
}

/* --- Maglia in conv-summary: cerchio bianco bordo color-reparto -------- */
.maglia-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--ink-300); /* default difesa-like */
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-900);
  letter-spacing: 0;
}
.maglia-circle[data-ruolo="Portiere"] {
  border-color: var(--role-por-from);
}
.maglia-circle[data-ruolo="Difensore centrale"],
.maglia-circle[data-ruolo="Terzino destro"],
.maglia-circle[data-ruolo="Terzino sinistro"] {
  border-color: var(--role-dif-from);
}
.maglia-circle[data-ruolo="Mediano"],
.maglia-circle[data-ruolo="Mezzala"],
.maglia-circle[data-ruolo="Trequartista"] {
  border-color: var(--role-cen-from);
}
.maglia-circle[data-ruolo="Esterno destro"],
.maglia-circle[data-ruolo="Esterno sinistro"],
.maglia-circle[data-ruolo="Ala destra"],
.maglia-circle[data-ruolo="Ala sinistra"],
.maglia-circle[data-ruolo="Punta centrale"],
.maglia-circle[data-ruolo="Seconda punta"] {
  border-color: var(--role-att-from);
}

/* --- Slider voto 1-10: gradient rosso→arancio→verde + thumb navy ------- */
input[type="range"].vote-slider::-webkit-slider-runnable-track,
input[type="range"].vote-slider::-moz-range-track {
  height: 8px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg,
    var(--red-500) 0%,
    var(--warning-500) 50%,
    var(--success-600) 100%);
  border: 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}
input[type="range"].vote-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--navy-700);
  box-shadow: 0 3px 8px rgba(0, 56, 130, 0.32);
  margin-top: -7px;
  cursor: pointer;
}
input[type="range"].vote-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--navy-700);
  box-shadow: 0 3px 8px rgba(0, 56, 130, 0.32);
  cursor: pointer;
}

/* Voto display: pill leggera, font display per il numero */
.voto-display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--navy-700);
  background: var(--navy-50);
  border: 1px solid var(--navy-100);
}

/* ============================================================================
   BLOCCO 3 — Pool hero mini-stat
   Banner di 4 contatori in cima alla sezione Anagrafica: identità
   immediata di cosa contiene la sezione (totale · effettivi ·
   aggregati · senza squadra). Numeri in Barlow Condensed.
   ============================================================================ */

.pool-hero {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-2);
  padding: var(--sp-3);
  margin-bottom: var(--sp-3);
  background: var(--white);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}

.pool-hero-stat {
  text-align: center;
  padding: var(--sp-2) 0;
  border-right: 1px solid var(--ink-100);
}
.pool-hero-stat:last-child { border-right: 0; }

.pool-hero-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  color: var(--ink-900);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
.pool-hero-num-effettivo { color: var(--navy-700); }
.pool-hero-num-aggregato { color: var(--warning-600); }
.pool-hero-num-orfano    { color: var(--ink-400); }

.pool-hero-lab {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-500);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ============================================================================
   BLOCCO 4 — Rosa raggruppata per reparto
   Sezioni Portieri/Difesa/Centrocampo/Attacco con header colorato dal
   role-family. Le sezioni vuote sono nascoste a livello di markup;
   il filtro ruolo esistente resta ortogonale (filtra prima, suddivide poi).
   ============================================================================ */

.rosa-reparti {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.reparto-section {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.reparto-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
}

.reparto-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-300);
  flex-shrink: 0;
}
.reparto-section[data-reparto="portiere"]    .reparto-bullet { background: var(--role-por-from); }
.reparto-section[data-reparto="difesa"]      .reparto-bullet { background: var(--role-dif-from); }
.reparto-section[data-reparto="centrocampo"] .reparto-bullet { background: var(--role-cen-from); }
.reparto-section[data-reparto="attacco"]     .reparto-bullet { background: var(--role-att-from); }

.reparto-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-700);
  line-height: 1;
  margin: 0;
}

.reparto-count {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-500);
  background: var(--ink-100);
  border-radius: var(--r-pill);
  padding: 2px 8px;
  min-width: 22px;
  text-align: center;
}

.reparto-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

/* ============================================================================
   BLOCCO 5 — Dashboard KPI con sparkline + delta
   4 tile (Rosa, Presenza, Partite, Voto medio): Presenza e Voto medio
   hanno una sparkline SVG inline + delta (verde se sale, rosso se scende).
   Rosa e Partite mostrano un valore + sotto-label neutra (no sparkline
   perché non hanno una serie temporale sensata in questa fase).
   ============================================================================ */

.dashboard-kpis-v2 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-2);
}

.kpi-card {
  background: var(--white);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-height: 96px;
  position: relative;
}

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-500);
}

.kpi-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  color: var(--ink-900);
  letter-spacing: -0.01em;
}

/* Sparkline: ~22px alta, ottimizzata per leggibilità a colpo d'occhio */
.kpi-spark {
  width: 100%;
  height: 22px;
  display: block;
  margin-top: 2px;
}
.kpi-spark-line.kpi-spark-navy    { stroke: var(--navy-600); }
.kpi-spark-area.kpi-spark-navy    { fill: rgba(10, 79, 180, 0.12); }
.kpi-spark-line.kpi-spark-success { stroke: var(--success-600); }
.kpi-spark-area.kpi-spark-success { fill: rgba(22, 163, 74, 0.12); }
.kpi-spark-line.kpi-spark-warning { stroke: var(--warning-600); }
.kpi-spark-area.kpi-spark-warning { fill: rgba(217, 119, 6, 0.12); }
.kpi-spark-line.kpi-spark-red     { stroke: var(--red-600); }
.kpi-spark-area.kpi-spark-red     { fill: rgba(220, 38, 38, 0.12); }

.kpi-foot {
  margin-top: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-500);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.02em;
}

/* Delta pill: verde = trend in salita, rosso = in discesa, grigio = piatto */
.kpi-delta {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.kpi-delta-up      { background: var(--success-100); color: var(--success-700); }
.kpi-delta-down    { background: var(--red-100);     color: var(--red-700); }
.kpi-delta-neutral { background: var(--ink-100);     color: var(--ink-600); }

/* Responsive: su schermi stretti passa a 2×2 */
@media (max-width: 640px) {
  .dashboard-kpis-v2 { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================================
   WIZARD NAV — Partita uno step alla volta
   Footer con bottoni "Indietro" / "Avanti — <label>" / "Chiudi e salva".
   La sezione attiva è la sola visibile (x-show su ciascuna card); questo
   footer è l'unico altro elemento mostrato sotto allo stepper.
   ============================================================================ */

.match-step-nav {
  display: flex;
  gap: var(--sp-3);
  justify-content: space-between;
  align-items: stretch;
  padding: var(--sp-4) 0 var(--sp-6);
  margin-top: var(--sp-3);
}

.match-step-nav .btn {
  min-height: 48px;
  padding: 0 var(--sp-5);
  font-size: 14px;
  font-weight: 700;
}

.match-step-nav .btn-primary {
  flex: 1;
  background: var(--navy-700);
  color: var(--white);
  border: 1px solid var(--navy-700);
  box-shadow: var(--sh-navy);
}

.match-step-nav .btn-ghost {
  background: var(--white);
  border: 1px solid var(--ink-200);
  color: var(--ink-700);
  box-shadow: var(--sh-xs);
  min-width: 130px;
}

/* Spaziatore lasciato quando "Indietro" è nascosto: tiene il primary
   incolonnato sulla destra anziché farlo saltare a sinistra. */
.match-step-nav-spacer {
  min-width: 130px;
  display: inline-block;
}

/* ============================================================================
   STEP VOTI — lista accordion (riga compatta + dettaglio inline)
   Sostituisce la vecchia .performance-list che apriva TUTTI i campi di
   TUTTI i giocatori contemporaneamente. Ora una riga sola alla volta è
   espansa; le altre mostrano un summary leggibile con stato + voto.
   ============================================================================ */

.voti-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.voti-row {
  border: 1px solid var(--ink-100);
  border-radius: var(--r-md);
  background: var(--white);
  box-shadow: var(--sh-xs);
  transition: box-shadow 0.12s ease, border-color 0.12s ease;
  overflow: hidden;
}
.voti-row.expanded {
  box-shadow: var(--sh-md);
  border-color: var(--navy-200);
}
.voti-row.compilato {
  border-left: 3px solid var(--success-600);
}

/* Riga compatta: 6 colonne — stato · avatar · player · chips · voto · chevron */
.voti-row-summary {
  display: grid;
  grid-template-columns: 10px 40px 1fr auto auto 20px;
  gap: var(--sp-3);
  align-items: center;
  width: 100%;
  padding: var(--sp-3);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  min-height: 56px;
}

.voti-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.voti-status-done    { background: var(--success-600); box-shadow: 0 0 0 3px var(--success-100); }
.voti-status-partial { background: var(--warning-500); box-shadow: 0 0 0 3px var(--warning-100); }
.voti-status-todo    { background: var(--ink-300); }

.voti-player strong {
  font-weight: 700;
  font-size: 14px;
  display: block;
  line-height: 1.15;
  color: var(--ink-900);
}
.voti-player .text-muted {
  font-size: 12px;
  font-weight: 500;
}

.voti-mini-chips {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  max-width: 200px;
  overflow: hidden;
}
.voti-mini-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--ink-100);
  color: var(--ink-700);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.voti-pill {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  min-width: 42px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  background: var(--ink-100);
  color: var(--ink-500);
  letter-spacing: 0.02em;
}
.voti-pill-low  { background: var(--red-100);     color: var(--red-700); }
.voti-pill-mid  { background: var(--warning-100); color: var(--warning-700); }
.voti-pill-high { background: var(--success-100); color: var(--success-700); }
.voti-pill-na   { background: var(--ink-100);     color: var(--ink-400); }

.voti-chevron {
  color: var(--ink-400);
  transition: transform 0.15s ease, color 0.12s ease;
}
.voti-row.expanded .voti-chevron {
  transform: rotate(180deg);
  color: var(--navy-700);
}

/* Dettaglio inline: il vecchio form completo viene mostrato qui */
.voti-row-detail {
  border-top: 1px solid var(--ink-100);
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  background: var(--paper);
}

.voti-row-actions {
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--ink-200);
}
.voti-row-actions .btn-primary {
  background: var(--navy-700);
  color: var(--white);
  border: 1px solid var(--navy-700);
  box-shadow: var(--sh-navy);
}
.voti-row-actions .btn-ghost {
  background: var(--white);
  border: 1px solid var(--ink-200);
  color: var(--ink-700);
}

/* Responsive: su schermi stretti nascondi i mini-chip (resta voto+stato) */
@media (max-width: 540px) {
  .voti-row-summary { grid-template-columns: 10px 36px 1fr auto 20px; }
  .voti-mini-chips { display: none; }
}

/* ============================================================================
   RIEPILOGO FORMAZIONE COMPATTO — step Formazione
   Sostituisce la vecchia .formation-summary-card a 3 colonne con le liste
   complete dei nomi (ridondante con il pitch + panchina sopra). Ora a
   pill su una riga, con accent rosso se ci sono slot ancora da assegnare.
   ============================================================================ */

.formation-recap-compact {
  margin-top: var(--sp-3);
}

.formation-recap-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
.formation-recap-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-800);
}
.formation-recap-head .text-muted {
  font-size: 12px;
}

.formation-recap-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.formation-recap-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--white);
  border: 1px solid var(--ink-200);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-700);
}
.formation-recap-pill strong {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink-900);
  font-size: 14px;
  letter-spacing: 0;
}
.formation-recap-pill.ok {
  background: var(--success-100);
  border-color: var(--success-100);
  color: var(--success-700);
}
.formation-recap-pill.ok strong { color: var(--success-700); }
.formation-recap-pill.alert {
  background: var(--red-50);
  border-color: var(--red-100);
  color: var(--red-700);
}
.formation-recap-pill.alert strong { color: var(--red-700); }

.formation-recap-empty-slots {
  margin-top: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px dashed var(--ink-200);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.formation-recap-empty-slots .text-muted {
  font-size: 12px;
  margin-right: 4px;
}
.recap-empty-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--red-100);
  color: var(--red-700);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ── Titoli grandi delle viste in Barlow Condensed, se hanno la classe display ── */
.display,
.section-title.display,
h1.display,
h2.display {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

/* ============================================================================
   Player Modal � anagrafica a 3 tab
   ============================================================================ */

.player-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.player-modal-sheet {
  width: 100%;
  max-width: 768px;
  height: min(90vh, 860px);
  background: var(--paper);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -14px 54px rgba(9, 18, 34, 0.34);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slide-up 0.24s ease;
}

.player-modal-handle {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: var(--ink-300);
  margin: 10px auto 4px;
  flex-shrink: 0;
}

.player-modal-header {
  position: relative;
  padding: 12px 20px 16px;
  border-bottom: 1px solid var(--ink-100);
  background: linear-gradient(180deg, var(--white), rgba(255, 255, 255, 0.78));
  flex-shrink: 0;
}

.player-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--ink-200);
  box-shadow: var(--sh-xs);
  z-index: 2;
}

.player-modal-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 42px;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 20px;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.5), var(--sh-sm);
}

.player-modal-title-wrap {
  min-width: 0;
  flex: 1;
}

.player-modal-title {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.02;
  color: var(--ink-900);
  letter-spacing: 0.01em;
  margin-top: 2px;
}

.player-tab-nav {
  display: flex;
  gap: 4px;
  margin-top: 14px;
  padding: 4px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--ink-200);
}

.player-tab-btn {
  flex: 1;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 800;
}

.player-tab-btn.active {
  background: var(--navy-700);
  color: var(--white);
  box-shadow: var(--sh-xs);
}

.player-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 22px;
  -webkit-overflow-scrolling: touch;
}

.player-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.player-info-tile {
  background: var(--white);
  border: 1px solid var(--ink-100);
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
}

.player-info-tile span,
.player-info-tile small {
  display: block;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 700;
}

.player-info-tile span {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.player-info-tile strong {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  color: var(--ink-900);
}

.player-section-card {
  margin-bottom: 12px;
  padding: 14px;
}

.player-note-info {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--navy-50);
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 600;
}

.player-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.player-score {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--navy-700);
  line-height: 1;
}

.player-eval-list {
  display: grid;
  gap: 7px;
}

.player-eval-row {
  display: grid;
  grid-template-columns: 105px 1fr 34px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-700);
}

.player-eval-row strong {
  text-align: right;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}

.player-eval-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--ink-100);
  overflow: hidden;
}

.player-eval-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.player-eval-bar .tone-good { background: var(--success-600); }
.player-eval-bar .tone-ok { background: var(--navy-600); }
.player-eval-bar .tone-attention { background: var(--warning-600); }
.player-eval-bar .tone-neutral { background: var(--ink-300); }

.player-match-recap {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.player-match-recap strong,
.player-match-recap span {
  display: block;
}

.player-match-recap span {
  color: var(--ink-500);
  font-size: 12px;
  font-weight: 600;
}

.player-match-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.player-match-stats span,
.player-match-stats strong {
  padding: 8px 6px;
  border-radius: 10px;
  background: var(--paper);
  text-align: center;
  color: var(--ink-700);
  font-weight: 800;
}

.btn-block {
  width: 100%;
}

.segmented-control {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--ink-200);
  border-radius: 12px;
  background: var(--white);
}

.segmented-control button {
  flex: 1;
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 800;
}

.segmented-control button.active {
  background: var(--navy-700);
  color: var(--white);
}

.player-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.player-role-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink-800);
  text-align: left;
  font-size: 12px;
  font-weight: 750;
}

.player-role-option::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--ink-300);
  background: var(--white);
  flex-shrink: 0;
}

.player-role-option.active {
  border-color: var(--navy-500);
  background: var(--navy-50);
}

.player-role-option.active::before {
  background: var(--navy-700);
  border-color: var(--navy-700);
  box-shadow: inset 0 0 0 4px var(--white);
}

.player-role-option.disabled {
  opacity: 0.55;
  background: var(--ink-100);
}

.player-role-option span {
  flex: 1;
}

.player-role-option small {
  margin-left: auto;
  color: var(--ink-500);
}

.presence-breakdown-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--ink-100);
  margin: 10px 0;
}

.presence-breakdown-bar i {
  min-width: 6px;
}

.presence-breakdown-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.presence-breakdown-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 750;
  color: var(--ink-700);
}

.presence-breakdown-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.presence-breakdown-legend em {
  color: var(--ink-500);
  font-style: normal;
}

.player-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1.2fr;
  gap: 8px;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(242, 244, 248, 0), var(--paper) 28%);
  border-top: 1px solid rgba(200, 208, 220, 0.45);
  flex-shrink: 0;
}

.btn-danger {
  background: var(--red-600);
  color: var(--white);
  border-color: var(--red-600);
}

.attention-row-button,
.profile-summary-button {
  width: 100%;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.attention-row-button:active,
.profile-summary-button:active {
  transform: scale(0.99);
}

/* ============================================================================
   STORICO GIOCATORE — rifinitura visiva
   Tab Storico della scheda giocatore: header sezione marcato, barra
   presenze più leggibile, legenda con label estesa, liste dedicate per
   "ultime partite" e "ultimi allenamenti" (sostituiscono la timeline
   piatta mista che era poco leggibile).
   ============================================================================ */

.storico-section-eyebrow {
  margin: var(--sp-2) 2px var(--sp-2);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-500);
  font-weight: 700;
  text-transform: uppercase;
}

.storico-summary-grid {
  margin-bottom: var(--sp-3);
}

.storico-card {
  margin-bottom: var(--sp-3);
}

.storico-section-meta {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-500);
  background: var(--ink-100);
  padding: 2px 9px;
  border-radius: var(--r-pill);
  letter-spacing: 0.02em;
}

.storico-empty {
  font-size: 13px;
  margin: var(--sp-2) 0 0;
  padding: var(--sp-3);
  background: var(--paper);
  border-radius: var(--r-md);
  border: 1px dashed var(--ink-200);
  text-align: center;
}

/* Barra stacked presenze: più alta, segmenti più visibili */
.storico-presence-bar {
  height: 12px;
  border-radius: var(--r-pill);
  overflow: hidden;
  display: flex;
  margin: var(--sp-3) 0 var(--sp-3);
  background: var(--ink-100);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}
.storico-presence-bar i {
  display: block;
  height: 100%;
}

/* Legenda: chip per ogni stato con label estesa + count */
.storico-presence-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-1);
}
.storico-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--paper);
  border: 1px solid var(--ink-100);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-700);
}
.storico-legend-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.storico-legend-label {
  letter-spacing: 0.01em;
}
.storico-legend-chip em {
  font-style: normal;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--ink-900);
  margin-left: 2px;
}

/* Ultime partite: lista ricca */
.storico-match-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}
.storico-match-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--paper);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-md);
  transition: background 0.12s ease;
}
.storico-match-row:hover { background: var(--ink-100); }

.storico-match-date {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--navy-700);
  letter-spacing: 0;
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  padding: 4px 8px;
  text-align: center;
}

.storico-match-main {
  min-width: 0;
}
.storico-match-main strong {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-900);
  line-height: 1.2;
}
.storico-match-main .text-muted {
  font-size: 12px;
  font-weight: 500;
}

.storico-match-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.storico-match-min {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-600);
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-pill);
  padding: 2px 8px;
}
.storico-match-voto {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  min-width: 40px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
}

/* Ultimi allenamenti: lista compatta con badge stato */
.storico-allen-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: var(--sp-2);
}
.storico-allen-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--white);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-md);
}
.storico-allen-date {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-700);
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 3px 6px;
  text-align: center;
}
.storico-allen-tipo {
  font-size: 13px;
  color: var(--ink-700);
  font-weight: 600;
}
.storico-allen-stato {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Responsive: su schermi stretti compatta il layout della riga partita */
@media (max-width: 540px) {
  .storico-match-row { grid-template-columns: 44px 1fr auto; gap: var(--sp-2); }
  .storico-match-date { font-size: 12px; padding: 3px 5px; }
  .storico-allen-row { grid-template-columns: 44px 1fr auto; gap: var(--sp-2); }
  .storico-legend-chip { font-size: 11px; padding: 3px 8px; }
}

/* ============================================================================
   FEEDBACK FAB + MODALE
   Pulsante flottante sempre visibile in basso a sinistra (lato opposto
   ai FAB primari di Rosa/Pool/Eventi che stanno a destra). Apre una
   modale piccola con categoria + testo; submit costruisce un mailto:
   pre-popolato verso Guglielmo.
   ============================================================================ */

.feedback-fab {
  position: fixed;
  left: 16px;
  bottom: calc(var(--nav-height, 64px) + 16px + max(0px, env(safe-area-inset-bottom)));
  z-index: 600;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--navy-700);
  color: var(--white);
  border: 2px solid var(--white);
  box-shadow: var(--sh-navy), 0 2px 6px rgba(0,0,0,0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.feedback-fab:hover  { transform: translateY(-1px); }
.feedback-fab:active { transform: scale(0.96); }

.feedback-modal {
  max-width: 520px;
}

.feedback-intro {
  font-size: 13px;
  margin: 0 0 var(--sp-3) 0;
}

.feedback-cat-strip {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}
.feedback-cat-chip {
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--white);
  border: 1px solid var(--ink-200);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-700);
  letter-spacing: 0.02em;
  cursor: pointer;
}
.feedback-cat-chip.active {
  background: var(--navy-700);
  border-color: var(--navy-700);
  color: var(--white);
  box-shadow: var(--sh-navy);
}

.feedback-foot {
  font-size: 12px;
  margin-top: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--navy-50);
  border: 1px solid var(--navy-100);
  border-radius: var(--r-md);
  color: var(--navy-700);
  line-height: 1.4;
}
