/* Stili per vista (matrice consuntivo, dettagli a schede, ricerca) */

/* ---- Matrice consuntivo ----
   Il mockup abbandona la griglia a celle: righe separate da una sola linea,
   numeri tabulari a destra, una riga verticale prima delle colonne di totale. */
table.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
table.matrix th {
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: none;
}
table.matrix td {
  padding: 7px 10px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--border);
}
table.matrix tbody tr { transition: background var(--t-fast) var(--ease); }
table.matrix tbody tr:hover { background: var(--row-hover); }
table.matrix th:first-child, table.matrix td:first-child { padding-left: 16px; }
table.matrix th:last-child, table.matrix td:last-child { padding-right: 16px; }
table.matrix td.rowhead, table.matrix th.rowhead {
  text-align: left;
  font-weight: 500;
  white-space: nowrap;
}
/* colonne di totale: stacco verticale invece del bordo su ogni cella */
table.matrix td.tot, table.matrix th.tot {
  font-weight: 600;
  border-left: 1px solid var(--border);
}
table.matrix tr.totrow td {
  font-weight: 600;
  background: var(--surface2);
  border-bottom: none;
}
table.matrix tr.totrow:hover td { background: var(--surface2); }
/* mese non consolidato: provvisorio */
table.matrix .prov { color: var(--warn); }

/* ---- Dettaglio a schede ---- */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .detail-grid { grid-template-columns: 1fr; } }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 7px 12px; font-size: 12.5px; }
.kv dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text3);
  align-self: center;
}
.kv dd { font-weight: 500; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 8px; } }

/* ---- Ricerca globale ---- */
.search-modal .modal-body { padding: 0; }
.search-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 14px 16px;
  outline: none;
}
.search-input::placeholder { color: var(--text3); }
.search-results { max-height: 50vh; overflow-y: auto; padding: 8px; }
.search-group-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 10px 10px 4px;
}
.search-hit {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  transition: background var(--t-fast) var(--ease);
}
.search-hit:hover, .search-hit.sel { background: var(--accent-soft); color: var(--accent); }
.search-hit .mono { color: var(--text3); font-size: 11.5px; }
.search-hit:hover .mono, .search-hit.sel .mono { color: var(--accent); }

/* ---- Login/util ---- */
.pw-reveal {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  background: var(--surface2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 15px;
  text-align: center;
  user-select: all;
}
