/* =========================================================
   Stili riutilizzabili — tema "sport analytics" scuro
   ========================================================= */

/* Numeri delle tabelle sempre allineati in colonna (leggibilità dati) */
.tabular { font-variant-numeric: tabular-nums; }

/* Card */
.card {
  background: #0f172a;             /* slate-900 */
  border: 1px solid #1e293b;       /* slate-800 */
  border-radius: 0.75rem;
  padding: 1.25rem;
}

/* Link della navbar */
.nav-link {
  padding: 0.4rem 0.7rem;
  border-radius: 0.5rem;
  color: #cbd5e1;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: #1e293b; color: #fff; }

/* Messaggi flash */
.flash { padding: 0.75rem 1rem; border-radius: 0.5rem; font-size: 0.875rem; border: 1px solid; }
.flash-success { background: #052e16; border-color: #166534; color: #86efac; }
.flash-danger  { background: #2e0b0b; border-color: #7f1d1d; color: #fca5a5; }
.flash-warning { background: #2e2005; border-color: #854d0e; color: #fde68a; }
.flash-info    { background: #082f49; border-color: #075985; color: #7dd3fc; }

/* Form */
.form-label { display: block; font-size: 0.875rem; color: #94a3b8; margin-bottom: 0.35rem; }
.form-input {
  width: 100%; padding: 0.6rem 0.75rem;
  background: #1e293b; border: 1px solid #334155; border-radius: 0.5rem;
  color: #e2e8f0; outline: none;
}
.form-input:focus { border-color: #10b981; box-shadow: 0 0 0 2px rgba(16,185,129,.25); }
.form-error { color: #f87171; font-size: 0.8rem; margin-top: 0.25rem; }

.btn-primary {
  padding: 0.65rem 1rem; border-radius: 0.5rem; font-weight: 600;
  background: #10b981; color: #020617; transition: background .15s;
}
.btn-primary:hover { background: #059669; }

/* Tabelle dati */
.data-table { border-collapse: collapse; font-size: 0.875rem; }
.data-table th {
  text-align: left; padding: 0.65rem 1rem;
  background: #1e293b; color: #94a3b8; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.data-table td { padding: 0.65rem 1rem; border-top: 1px solid #1e293b; }
.data-table tbody tr:hover { background: rgba(30,41,59,.5); }

/* Bottoni piccoli (azioni admin) */
.btn-mini { padding: 0.3rem 0.7rem; border-radius: 0.4rem; font-size: 0.78rem; font-weight: 600; }
.btn-mini-green { background: #065f46; color: #a7f3d0; }
.btn-mini-green:hover { background: #047857; }
.btn-mini-red   { background: #7f1d1d; color: #fecaca; }
.btn-mini-red:hover { background: #991b1b; }
.btn-mini-blue  { background: #1e3a8a; color: #bfdbfe; }
.btn-mini-blue:hover { background: #1d4ed8; }

/* Badge ruolo */
.badge-role { padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; }
.badge-admin   { background: #78350f; color: #fcd34d; }
.badge-gold    { background: #713f12; color: #fde68a; }
.badge-premium { background: #1e3a8a; color: #93c5fd; }
.badge-base    { background: #334155; color: #cbd5e1; }

/* ===== Pagina Database: tabella compatta con intestazioni fisse ===== */
/* Allarga la pagina quando è presente la tabella database */
main:has(.db-page) { max-width: 98vw !important; }

.db-wrap {
  overflow: auto;          /* scorrimento orizzontale e verticale */
  max-height: 74vh;
  border: 1px solid #1e293b;
  border-radius: 0.5rem;
}
.db-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
  white-space: nowrap;
  width: 100%;
}
.db-table thead th {
  position: sticky;
  z-index: 20;
  background: #1e293b;
  padding: 3px 8px;
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: 1px solid #334155;
  height: 28px;
  box-sizing: border-box;
  text-align: center;
}
.db-table thead tr:first-child th { top: 0; }
.db-table thead tr:nth-child(2) th { top: 28px; }
.db-table td {
  padding: 3px 8px;
  border-top: 1px solid #16233b;
}
.db-table tbody tr:hover td { background: rgba(30,41,59,.5); }
.db-table a { color: #cbd5e1; }
.db-table a:hover { color: #10b981; }

/* Indicatore stagione precedente (Database Rolling) */
.prev-tag {
  display: inline-block;
  background: #d97706;
  color: #1c1917;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}
.prev-num {
  color: #f59e0b;
  font-weight: 700;
}

/* Indicatore "old" (partite più vecchie di 6 mesi) — Database Rolling arbitri */
.old-tag {
  display: inline-block;
  background: #0284c7;
  color: #f0f9ff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}
.old-num {
  color: #38bdf8;
  font-weight: 700;
}
/* Separatore tra i gruppi di periodo (FT / 1T / 2T) */
.sep-left {
  border-left: 2px solid #64748b;
}

/* Allinea i valori numerici con le intestazioni (Database e Database Rolling) */
.db-table td.tabular {
  text-align: center;
}