/* ══════════════════════════════════════════════
   AnotherWorld.network — Dashboard CSS
   Estende anotherworld-article.css / anotherworld-home.css.
   Non ridefinisce i token: li eredita.
   ══════════════════════════════════════════════ */

body { background: var(--white); }

/* ── contenitore ── */
.dash-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--g) 5rem;
}

.kicker {
  font-family: var(--mono);
  font-size: clamp(13px, 1.8vw, 15px);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid);
  display: block;
  margin-bottom: 0.9rem;
}

/* ── testata ── */
.dash-header {
  border-bottom: 2px solid var(--black);
  padding: 1.8rem 0 1.2rem;
  margin-bottom: 2rem;
}
.dash-header h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
}
.dash-header .deck {
  font-size: clamp(17px, 2.4vw, 21px);
  font-style: italic;
  color: var(--mid);
  max-width: 68ch;
  margin-bottom: 1.2rem;
}
.dash-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  border-top: 1px solid var(--light);
  padding-top: 0.8rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--mid);
}

/* ── sintesi statica ── */
.dash-summary {
  font-size: clamp(15px, 1.9vw, 17px);
  line-height: 1.7;
  max-width: 82ch;
  margin-bottom: 1.2rem;
}
.dash-summary strong { font-weight: 700; }
.dash-summary__list { list-style: none; margin: 0 0 0.5rem; }
.dash-summary__list li {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--mid);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--light);
}
.dash-summary__list li strong { color: var(--black); font-weight: 500; }

/* ── KPI ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--light);
  border: 1px solid var(--light);
  margin-bottom: 3rem;
}
@media (min-width: 40rem) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 62rem) { .kpi-grid { grid-template-columns: repeat(6, 1fr); } }

.kpi {
  background: var(--white);
  padding: 1.2rem 1rem 1.1rem;
}
.kpi__value {
  font-family: var(--mono);
  font-size: clamp(26px, 4.5vw, 40px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--black);
  font-variant-numeric: lining-nums tabular-nums;
  display: block;
}
.kpi__label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  display: block;
  margin-top: 0.55rem;
}

/* ── sezioni ── */
.dash-section { margin-bottom: 3rem; }
.dash-section__title {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--black);
  border-top: 1px solid var(--black);
  padding-top: 0.7rem;
  margin-bottom: 1.4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.dash-section__title span { color: var(--mid); font-weight: 400; }

/* ── griglia grafici ── */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--light);
  border: 1px solid var(--light);
}
@media (min-width: 48rem) { .chart-grid { grid-template-columns: repeat(2, 1fr); } }

.chart-card {
  background: var(--white);
  padding: 1.2rem 1.2rem 1.4rem;
  min-width: 0;
}
.chart-card--wide { grid-column: 1 / -1; }
.chart-card__title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  letter-spacing: -0.01em;
}
.chart-card__note {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--mid);
  margin-bottom: 1rem;
}
.chart-card__canvas { position: relative; height: 260px; }
.chart-card--wide .chart-card__canvas { height: 320px; }

/* ── mappa ── */
.map-wrap { display: grid; grid-template-columns: 1fr; gap: 1.2rem; }
@media (min-width: 52rem) {
  .map-wrap { grid-template-columns: 2fr 1fr; align-items: start; }
}
.map-svg { width: 100%; height: auto; display: block; }
.map-region { stroke: var(--white); stroke-width: 0.6; cursor: pointer; transition: opacity 0.15s; }
.map-region:hover { opacity: 0.75; }
.map-legend { font-family: var(--mono); font-size: 0.64rem; color: var(--mid); }
.map-legend__row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.map-legend__swatch { width: 14px; height: 14px; display: inline-block; border: 1px solid var(--light); }
.map-legend__name { flex: 1; }
.map-legend__val { font-variant-numeric: tabular-nums; color: var(--black); }

/* ── filtri ── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  align-items: flex-end;
  border: 1px solid var(--light);
  background: var(--white);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.filter-field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.filter-field label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
}
.filter-field select,
.filter-field input {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--black);
  background: var(--white);
  border: 1px solid var(--light);
  padding: 0.45rem 0.5rem;
  min-width: 8rem;
}
.filter-field input[type="search"] { min-width: 14rem; }
.filter-field select:focus-visible,
.filter-field input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.filter-count {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--mid);
  margin-left: auto;
  align-self: center;
}
.filter-count strong { color: var(--black); font-weight: 500; }

/* ── tabella eventi ── */
.events-panel { border: 1px solid var(--light); }
.events-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--light);
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--mid);
}
.events-toolbar button {
  font-family: var(--mono);
  font-size: 0.68rem;
  background: var(--black);
  color: var(--white);
  border: none;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.events-toolbar button:disabled { background: var(--light); cursor: default; }
.events-toolbar button:hover:not(:disabled) { background: var(--mid); }

.dash-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 0.74rem; }
.dash-table thead th {
  text-align: left;
  font-weight: 500;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
  padding: 0.6rem 0.7rem;
  border-bottom: 2px solid var(--black);
  white-space: nowrap;
}
.dash-table tbody td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--light);
  vertical-align: top;
  line-height: 1.35;
}
.dash-table tbody tr { cursor: pointer; }
.dash-table tbody tr:hover { background: #f0ede6; }
.dash-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.src-link {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--black);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.src-link:hover,
.src-link:focus-visible { color: var(--focus); }
.dash-table__title { font-family: var(--serif); font-size: 0.82rem; color: var(--black); }
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--light);
  color: var(--mid);
  padding: 0.12rem 0.4rem;
  white-space: nowrap;
}

/* ── dettaglio evento ── */
.event-detail {
  border: 1px solid var(--black);
  border-top: none;
  padding: 1.2rem 1.2rem 1.4rem;
  background: var(--white);
}
.event-detail h3 {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.event-detail__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--mid);
  margin-bottom: 1rem;
}
.event-detail__facts strong { color: var(--black); font-weight: 500; }
.event-detail__sources a {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--mid);
  text-decoration: none;
  word-break: break-all;
  display: block;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--light);
}
.event-detail__sources a:hover { color: var(--black); }
.event-detail__sources .src-dom { color: var(--black); }

/* ── lista eventi top ── */
.top-events { list-style: none; }
.top-events li {
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--light);
}
.top-events .rank {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--mid);
  min-width: 1.6rem;
}
.top-events .te-title { font-family: var(--serif); font-size: 0.85rem; flex: 1; }
.top-events .te-cov { font-family: var(--mono); font-size: 0.72rem; color: var(--black); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── stati ── */
.dash-note {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--mid);
  padding: 1rem 0;
}
.dash-empty { font-family: var(--mono); font-size: 0.72rem; color: var(--mid); padding: 1.2rem; text-align: center; }

/* ── tabelle semplici (top testate) ── */
.mini-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 0.72rem; }
.mini-table td { padding: 0.4rem 0; border-bottom: 1px solid var(--light); }
.mini-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

@media print {
  .filter-bar, .events-toolbar, .site-nav { display: none; }
}
