:root {
  --bg: #0f1115;
  --bg-alt: #181b21;
  --border: #333844;
  --text: #f5f5f5;
  --text-dim: #b7bdc9;
  --accent: #4da3ff;
  --ok: #3ecf7a;
  --warn: #e8b93f;
  --bad: #f05a5a;
  font-size: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 1.5rem;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-weight: 500;
}

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0;
}

a { color: var(--accent); }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.btn, button {
  background: var(--accent);
  color: #08131f;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.toolbar-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.btn-secondary {
  background: var(--bg-alt);
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-hub {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
  opacity: 0.7;
  font-size: 0.9rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.filters input,
.filters select,
select,
input[type="text"],
input[type="number"] {
  background: var(--bg-alt);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font-size: 1rem;
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--bg-alt);
  text-align: left;
  padding: 0.85rem 0.9rem;
  font-weight: 700;
  border-bottom: 2px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
}

tbody td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

tbody tr:hover { background: var(--bg-alt); }

.num { text-align: right; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

td.nome { font-weight: 700; font-size: 1.05rem; }

.stato-select {
  min-width: 9.5rem;
}

.stato-da_prendere { color: var(--ok); }
.stato-interessante { color: var(--warn); }
.stato-evitare { color: var(--bad); }

.nota-input { width: 14rem; }
.prezzo-input { width: 5.5rem; }

.flash {
  background: var(--bg-alt);
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin-bottom: 1.25rem;
  font-weight: 700;
}

.upload-page {
  max-width: 50rem;
  margin: 2rem auto;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-top: 1.5rem;
}

.upload-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 700;
}

.import-report {
  margin-top: 2rem;
  border-top: 2px solid var(--border);
  padding-top: 1.5rem;
}

.import-report h2 {
  font-size: 1.2rem;
  margin: 0 0 1.25rem;
}

.report-col {
  margin-bottom: 1.5rem;
}

.report-col h3 {
  font-size: 1.05rem;
  margin: 0 0 0.6rem;
}

.report-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 20rem;
  overflow-y: auto;
}

.report-list li {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  font-weight: 600;
}

.report-empty {
  color: var(--text-dim);
  font-weight: 600;
}

.empty-msg {
  margin-top: 1.5rem;
  font-weight: 600;
  color: var(--text-dim);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

.checkbox-label input {
  width: 1.2rem;
  height: 1.2rem;
}

.budget-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.budget-chip {
  background: var(--bg-alt);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.budget-ruolo {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.budget-valori {
  font-weight: 700;
  font-size: 1.05rem;
}

.budget-dim {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.fascia-badge {
  display: inline-block;
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.fascia-top { background: var(--ok); color: #08131f; }
.fascia-valore { background: var(--warn); color: #08131f; }
.fascia-outsider { background: var(--border); color: var(--text); }
.fascia-nd { background: var(--border); color: var(--text-dim); }

.rosa-intro {
  color: var(--text-dim);
  font-weight: 600;
  max-width: 60rem;
  margin-bottom: 1.5rem;
}

.rosa-ruolo {
  margin-bottom: 2.5rem;
}

.rosa-ruolo h2 {
  font-size: 1.35rem;
  font-weight: 700;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.rosa-ruolo h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dim);
  margin: 1.25rem 0 0.6rem;
}

.rosa-ruolo .table-wrap {
  margin-bottom: 0.5rem;
}

.squadra-search {
  margin-bottom: 1.5rem;
}

.squadra-search-input {
  width: 100%;
  max-width: 30rem;
}

.squadra-search-box {
  margin-top: 0.75rem;
  max-width: 30rem;
}

.squadra-search-results li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.btn-aggiungi {
  background: var(--ok);
  color: #08131f;
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn-rimuovi {
  background: var(--bad);
  color: #08131f;
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.badge-gerarchia {
  display: inline-block;
  background: var(--bg-alt);
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  margin-right: 0.4rem;
  vertical-align: middle;
}

.badge-nuovo {
  display: inline-block;
  background: var(--accent);
  color: #08131f;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
  margin-left: 0.4rem;
  vertical-align: middle;
  white-space: nowrap;
}
