/* Libreria e dati: spazio all'editor, comandi comuni agli altri strumenti. */
.tabelle #left { padding: 0; gap: 0; }
.tabelle .tabelle-ricerca { padding: 14px; }
.tabelle input[type="search"] { width: 100%; background: var(--surf3); border: 1px solid var(--border); color: var(--text); border-radius: 5px; padding: 8px 9px; font: 14px var(--font-ui); min-height: 36px; }
.tabelle #lista { padding: 0 14px 14px; }
.tabelle button.litem { display: block; width: 100%; text-align: left; color: var(--text); font: inherit; }
.tabelle .litem-name, .tabelle .litem-desc { display: block; }
.tabelle .litem-meta { flex-wrap: wrap; font-size: 12px; color: var(--text2); }
.tabelle #numero-tabelle { color: var(--text2); font-weight: 400; }
.tabelle #editor { min-width: 0; max-width: none; padding: 24px; gap: 20px; }
.tabelle .tabelle-sezione { width: 100%; max-width: 1120px; padding: 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--surf); }
.tabelle .tabelle-sezione h2, .tabelle .tabelle-sezione summary { font: 600 15px/1.5 var(--font-ui); margin-bottom: 14px; }
.tabelle .tabelle-sezione > div + div { margin-top: 14px; }
.tabelle .tabelle-sezione summary { cursor: pointer; margin-bottom: 0; }
.tabelle .tabelle-sezione[open] summary { margin-bottom: 16px; }
.tabelle .g3 { grid-template-columns: minmax(200px, 2fr) minmax(160px, 1fr); gap: 16px; }
.tabelle .tabelle-unita { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 16px; }
.tabelle #dati { min-height: 240px; font: 14px/1.7 var(--font-dati); tab-size: 4; }
.tabelle .tabelle-dati-preview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.tabelle .tabelle-dati-preview > div { min-width: 0; }
.tabelle .hint { font-size: 13px; color: var(--text2); opacity: 1; line-height: 1.6; }
.tabelle #errori { font-size: 13px; line-height: 1.6; }
.tabelle #errori:not(:empty) { background: #ff475710; border-left: 3px solid var(--red); padding: 10px 14px; }
.tabelle #box-anteprima { overflow-x: auto; }
.tabelle #anteprima { display: block; min-width: 480px; max-width: 760px !important; }
.tabelle #tabella-stato { font-size: 13px; color: var(--text2); }
.tabelle #tabella-stato[data-stato="salvata"] { color: var(--accent3); }
.tabelle #tabella-stato[data-stato="modificata"] { color: #ffd866; }
.tabelle #tabella-stato[data-stato="errore"] { color: #ff8791; }
.tabelle .tabelle-vuota { margin: auto; max-width: 500px; text-align: center; }
.tabelle .tabelle-vuota h2 { font-size: 22px; margin-bottom: 12px; }
.tabelle .tabelle-vuota p { color: var(--text2); line-height: 1.7; margin-bottom: 20px; }
@media (max-width: 1200px) {
  .tabelle .tabelle-dati-preview { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .tabelle #editor { padding: 16px; }
  .tabelle .g3 { grid-template-columns: 1fr; }
  .tabelle .tabelle-unita { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .tabelle #editor { padding: 12px; }
  .tabelle .tabelle-sezione { padding: 14px; }
  .tabelle .tabelle-unita { grid-template-columns: 1fr; }
  .tabelle .editor-document { max-width: 100%; overflow-wrap: anywhere; }
}
