/* Top Homes Dashboard — stile sobrio, coerente con la richiesta di Enrico
   (niente font decorativo, niente badge a timbro, sfondo pulito). Tutte le
   classi hanno prefisso thd__ per non entrare in conflitto col tema WordPress. */

/* Il tema (Twenty Seventeen) incornicia il contenuto in una colonna stretta
   (~936px utili, meno della larghezza minima della tabella) — la dashboard
   "rompe" quella colonna e usa tutta la larghezza della finestra, con un
   margine laterale che cresce con lo schermo invece di andare bordo a bordo. */
.thd {
  font-family: inherit; color: inherit; line-height: 1.5;
  box-sizing: border-box;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding: 0 clamp(16px, 5vw, 96px);
}
body:has(.thd) { overflow-x: hidden; }

.thd__stats { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 18px; }
.thd__stat { display: flex; flex-direction: column; gap: 2px; }
.thd__n { font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; }
.thd__n--critical { color: #C0392B; }
.thd__l { font-size: 12px; opacity: 0.7; }

/* Invito al livello Plus al posto delle tessere perizie/criticita' (26/08/2026) */
.thd__stat--upsell { max-width: 320px; }
.thd__stat--upsell .thd__l { opacity: 1; font-size: 13px; line-height: 1.4; }
.thd__upsell-link { font-size: 13px; font-weight: 600; color: #00a99d; text-decoration: none; }
.thd__upsell-link:hover { text-decoration: underline; }

.thd__filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px;
  padding: 10px 0; border-top: 1px solid rgba(0,0,0,0.1); border-bottom: 1px solid rgba(0,0,0,0.1);
}
.thd__filters input[type="text"], .thd__filters select {
  font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.2); background: #fff; color: #1a1a1a;
}
.thd__filters input[type="text"] { min-width: 190px; }
.thd__filters label { font-size: 13px; opacity: 0.75; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.thd__count { margin-left: auto; font-size: 12.5px; opacity: 0.6; }
.thd__reset-btn {
  font: inherit; font-size: 13px; background: none;
  border: 1px solid rgba(0,0,0,0.2); border-radius: 3px; padding: 6px 10px; cursor: pointer;
}
.thd__reset-btn:hover { background: rgba(0,0,0,0.04); }

.thd__table-wrap { overflow-x: auto; border: 1px solid rgba(0,0,0,0.15); }
.thd__table { border-collapse: collapse; width: 100%; min-width: 980px; table-layout: fixed; }
.thd__table th:nth-child(1), .thd__table td:nth-child(1) { width: 13%; }
.thd__table th:nth-child(2), .thd__table td:nth-child(2) { width: 17%; }
.thd__table th:nth-child(3), .thd__table td:nth-child(3) { width: 12%; }
.thd__table th:nth-child(4), .thd__table td:nth-child(4) { width: 15%; }
.thd__table th:nth-child(5), .thd__table td:nth-child(5) { width: 12%; }
.thd__table th:nth-child(6), .thd__table td:nth-child(6) { width: 12%; }
.thd__table th:nth-child(7), .thd__table td:nth-child(7) { width: 10%; }
.thd__table th:nth-child(8), .thd__table td:nth-child(8) { width: 9%; }
.thd__table thead th {
  text-align: left; font-size: 12px; font-weight: 600; opacity: 0.75;
  padding: 8px 10px; border-bottom: 1px solid rgba(0,0,0,0.15); cursor: pointer;
  user-select: none; white-space: nowrap; background: rgba(0,0,0,0.03);
}
.thd__table thead th:hover { opacity: 1; }
.thd__arrow { opacity: 0.5; font-size: 10px; margin-left: 3px; }
.thd__table thead th.thd--active .thd__arrow { opacity: 1; }
.thd__table tbody td { padding: 9px 10px; border-bottom: 1px solid rgba(0,0,0,0.1); font-size: 13px; vertical-align: top; }
.thd__table tbody tr:last-child td { border-bottom: none; }
.thd__table tbody tr:hover { background: rgba(0,0,0,0.03); }

.thd__addr .thd__via { font-weight: 600; }
.thd__mono { font-variant-numeric: tabular-nums; }
.thd__price { font-weight: 700; }
.thd__price-sub { display: block; opacity: 0.6; font-size: 11px; margin-top: 1px; }

.thd__perizia-cell { vertical-align: top; }
.thd__perizia-toggle {
  display: flex; align-items: center; gap: 3px; margin-top: 3px;
  background: none; border: none; cursor: pointer; padding: 0;
  font-size: 11px; font-weight: 600; color: #0B5FCC;
}
.thd__perizia-toggle .thd__arrow-ico { font-size: 9px; transition: transform 0.15s ease; }
.thd__perizia-toggle[aria-expanded="true"] .thd__arrow-ico { transform: rotate(180deg); }

.thd__detail-row { display: none; }
.thd__detail-row.thd--open { display: table-row; }
.thd__detail-row td { background: rgba(0,0,0,0.03); padding: 12px 20px; }
.thd__detail-row ul { margin: 0; padding-left: 18px; columns: 2; column-gap: 32px; font-size: 12.5px; opacity: 0.85; line-height: 1.6; }
.thd__detail-row ul li { margin-bottom: 5px; break-inside: avoid; }
@media (max-width: 780px) { .thd__detail-row ul { columns: 1; } }

.thd__chip { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: 12px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.thd__chip--good { color: #1E7A34; background: #EAF5EC; }
.thd__chip--warn { color: #A15E00; background: #FBF1E1; }
.thd__chip--critical { color: #C0392B; background: #FBEAE8; }
.thd__chip--neutral { opacity: 0.6; background: rgba(0,0,0,0.05); font-weight: 400; }
/* Invito al livello Plus (26/08/2026) — oro, per farlo leggere subito come
   qualcosa di premium, distinto dai chip semantici (buono/attenzione/critico). */
.thd__chip--plus { color: #8A6D00; background: #FFF1C2; border: 1px solid #E6C555; cursor: pointer; }
.thd__chip--plus:hover { background: #FFE79E; border-color: #D6AE2E; }
/* Link all'annuncio (29/08/2026, richiesta di Enrico) — stessa forma del chip
   Plus ma in grigio: e' un'azione (porta fuori dal sito), non un dato come gli
   altri chip, quindi resta un tono neutro invece che semantico. */
.thd__chip--go { color: #495057; background: #EEF0F2; border: 1px solid #D7DAE0; cursor: pointer; }
.thd__chip--go:hover { background: #E3E6EA; border-color: #C2C6CE; }
.thd__credito-badge {
  display: inline-block; margin-top: 3px; font-size: 10px; font-weight: 700;
  letter-spacing: 0.03em; color: #0B5FCC; border: 1px solid #0B5FCC; border-radius: 2px; padding: 1px 5px;
}
.thd__footnote { margin-top: 20px; font-size: 12.5px; opacity: 0.6; max-width: 76ch; line-height: 1.6; }

.thd__gate { padding: 24px; text-align: center; border: 1px solid rgba(0,0,0,0.15); border-radius: 4px; }
.thd__gate__cta { display: inline-block; margin-top: 8px; font-weight: 600; }
.thd__error { padding: 16px; border: 1px solid rgba(192,57,43,0.4); background: #FBEAE8; color: #C0392B; border-radius: 4px; }

@media (max-width: 640px) {
  .thd__filters { flex-direction: column; align-items: stretch; }
  .thd__count { margin-left: 0; }
}
