/*
 * Foglio d'ordine storico per cluster (append-only come gli xlsx operativi del buyer):
 * blocchi per data d'ordine con decisione, ordine Ergon e venduto del periodo.
 * Regole design system: una property per riga.
 */

.sheet-cluster-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

.sheet-cluster-select {
  min-width: 18rem;
}

.sheet-block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1rem;
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.sheet-table th,
.sheet-table td {
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

.sheet-table th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-text);
}

.sheet-table th.col-product,
.sheet-table td.col-product {
  text-align: left;
}

.sheet-note {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--gray-text);
}

/* Obiettivo corretto dal buyer al salvataggio: stessa semantica gialla della proposta. */
.sheet-target.is-overridden {
  padding: 0.1rem 0.4rem;
  background: #fdf3d7;
  border-radius: 4px;
  font-weight: 700;
}

/* Ordine app e ordine Ergon distanti oltre soglia: va visto a colpo d'occhio. */
.sheet-table td.sheet-diff {
  background: #fdeae2;
  font-weight: 600;
}

/* Venduto oltre l'obiettivo a copertura conclusa: rottura probabile a posteriori. */
.sheet-sold.sheet-overrun {
  font-weight: 700;
  color: #b3402a;
}

.sheet-older {
  margin-top: 1rem;
}
