:root {
  --tw-text: #111;
  --tw-muted: #666;
  --tw-border: #e9e9e9;
  --tw-border-strong: #111;
  --tw-bg: #fff;
}

/* wrapper */
.tw {
  color: var(--tw-text);
}

/* titolo/testo */
.tw__title {
  margin: 0 0 16px;
  text-align: center;
}

.tw__muted {
  color: var(--tw-muted);
  font-size: 13px;
  margin: 0 0 12px;
}

/* riga tabs + calendario (calendario a destra) */
.tw__tabsRow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 8px;
}

.tw__tabsRight {
  margin-left: auto;
  display: flex;
  align-items: center;
}

/* tabs */
.tw__tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0; /* la spaziatura la gestisce tw__tabsRow */
}

.tw__tabs button {
  padding: 8px 10px;
  border: 1px solid var(--tw-border);
  background: var(--tw-bg);
  border-radius: 8px;
  cursor: pointer;
  color: var(--tw-text);
  line-height: 1.2;
}

.tw__tabs button.active {
  border-color: var(--tw-border-strong);
}

/* label periodo (a destra) */
.tw__period {
  text-align: right;
  margin: 0 0 12px;
}

/* table */
.tw__table {
  width: 100%;
  border-collapse: collapse;

  /* Responsive:
     - su schermi piccoli la tabella può scrollare orizzontalmente nel wrapper .table-responsive
     - su schermi grandi NON limitiamo la larghezza */
  min-width: 720px;
}

.tw__table th,
.tw__table td {
  border-bottom: 1px solid var(--tw-border);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.tw__table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tw-muted);
}

/* allinea a destra le colonne numeriche (tutte tranne "Utente") */
.tw__table th:nth-child(n + 2),
.tw__table td:nth-child(n + 2) {
  text-align: right;
}

/* prima colonna più “elastica” (nome utente) */
.tw__table th:first-child,
.tw__table td:first-child {
  white-space: normal;
  min-width: 220px;
}

/* top 3: bold solo sul nome */
.tw__top3 .tw__name {
  font-weight: 600;
}

.tw__badge {
  display: inline-block;
  width: 1.6em;
  text-align: center;
}

/* actions (link telegram) */
.tw__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

/* responsive */
@media (max-width: 768px) {
  .tw__table {
    min-width: 520px;
  }

  .tw__table th,
  .tw__table td {
    padding: 8px;
  }
}