/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--color-slate-50);
  color: var(--color-slate-900);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== LAYOUT ===== */
.page-wrapper {
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
}

.page-content-container {
  width: 100%;
  max-width: 100%;  height: 100%;
  overflow-y: auto;  overflow-x: hidden;


  padding: var(--space-small);
  padding-top: 0;
  box-sizing: border-box;


}

/* ===== PAGE TITLE ===== */
.page-title {
  font-size: 1.75rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-slate-900);
  margin-bottom: var(--space-medium);
  margin-top: var(--space-medium);
}

/* ===== CONTENT SECTIONS ===== */
.content-section-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  box-sizing: border-box;
  background: var(--color-white);
  border-radius: var(--radius-large);
  padding: var(--space-medium);
  box-shadow: var(--shadow-small);
  border: 1px solid var(--color-slate-200);
}

.content-section-container:not(:last-child) {
  margin-bottom: var(--space-large);
}

.content-section-container > h6 {
  margin-bottom: var(--space-medium);
  font-weight: var(--font-weight-semibold);
  font-size: 1.125rem;
  color: var(--color-slate-900);
  letter-spacing: -0.025em;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-extra-small);
  padding: var(--space-extra-small) var(--space-medium);
  border: 1px solid var(--primary-color);
  border-radius: var(--radius-medium);
  background: var(--primary-color);
  color: var(--color-white);
  font-size: 0.875rem;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-small);
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-small);
}

.btn:focus {
  outline: none;
  box-shadow: var(--shadow-medium), 0 0 0 3px var(--primary-alpha);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn--secondary {
  background: var(--color-white);
  color: var(--primary-color);
  border-color: var(--color-slate-300);
}

.btn--secondary:hover:not(:disabled) {
  background: var(--color-slate-100);
  border-color: var(--primary-color);
}

.btn--logout {
  width: 100%;
  background: var(--color-red);
  border-color: var(--color-red);
}

.btn--logout:hover:not(:disabled) {
  background: #dc2626;
  border-color: #dc2626;
}

/* ===== FORM ELEMENTS ===== */
select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"] {
  border-radius: var(--radius-medium);
  padding: var(--space-small) var(--space-medium);
  border: 1px solid var(--color-slate-200);
  background: var(--color-white);
  color: var(--color-slate-900);
  width: 100%;
  font-size: 0.875rem;
  font-weight: var(--font-weight-normal);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-small);
}

select:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: var(--shadow-medium), 0 0 0 3px var(--primary-alpha);
}

select:hover,
input:hover {
  border-color: var(--color-slate-300);
}

select::placeholder,
input::placeholder {
  color: var(--color-slate-500);
}

/* ===== TABLES (Mobile First) ===== */
table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--color-white);
  border-radius: var(--radius-large);
  overflow: hidden;
  box-shadow: var(--shadow-small);
}

table th,
table td {
  padding: 0.25rem 0.125rem;
  text-align: left;
  border-bottom: 1px solid var(--color-slate-200);
  vertical-align: middle;
  font-size: 1rem;
  line-height: 1.15;
}

table.centered-values th,
table.centered-values td {
  text-align: center;
}

/* Larghezze fisse delle colonne per mobile */
.ranking-table th:nth-child(1),
.ranking-table td:nth-child(1) {
  width: 15%;
}

.ranking-table th:nth-child(2),
.ranking-table td:nth-child(2) {
  width: 60%;
}

.ranking-table th:nth-child(3),
.ranking-table td:nth-child(3) {
  width: 25%;
}

th {
  background-color: var(--color-slate-100);
  font-weight: var(--font-weight-semibold);
  color: var(--color-slate-900);
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

tr {
  transition: background-color var(--transition-fast);
}

tbody tr:hover {
  background-color: var(--color-slate-50);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ===== CARDS ===== */
.card {
  background: var(--color-white);
  border-radius: var(--radius-large);
  padding: var(--space-medium);
  text-align: center;
  box-shadow: var(--shadow-medium);
  border: 1px solid var(--color-slate-200);
  transition: all var(--transition-normal);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-large);
  border-color: var(--color-slate-300);
}

.card-title {
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-extra-small);
  color: var(--primary-color);
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--color-slate-600);
  font-weight: var(--font-weight-medium);
}

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
  .page-content-container {
    padding: var(--space-medium);
    padding-top: 0;
  }
  
  .content-section-container {
    padding: var(--space-large);
  }

  table {
    table-layout: auto;
  }
  
  .btn {
    padding: var(--space-small) var(--space-large);
  }
  
  .page-title {
    font-size: 2rem;
  }
  
  .card-title {
    font-size: 1.75rem;
  }
}

@media (min-width: 1024px) {
  .page-wrapper {
    display: grid;
    grid-template-columns: 250px 1fr;
  }

  .content-section-container {
    padding: var(--space-extra-large);
  }

  .page-title {
    font-size: 2.25rem;
  }
  
  .card-title {
    font-size: 2rem;
  }
}