/* nova_pg_editor.css — Editor Documenti Qualità (SGQ Laga) cap 07.02 Standard.
   L088 F1a — rev 1.9.23. Stili per ZONA 2 header + ZONA 3 body + ZONA 4 footer.
   Toolbar CMP-008-C usa stili globali `shell_window.css` (.nova-window-bar / .nova-window-action). */

.pg-editor-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  overflow: hidden;
}

/* ═══ Lista documenti (tabella filtrata per sigla famiglia) ═══ */
.pg-list-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  overflow: hidden;
}
.pg-list-header {
  padding: 8px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #64748b;
  flex-shrink: 0;
}
.pg-list-count {
  font-weight: 600;
  color: #1f2937;
}
.pg-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  flex: 1;
  overflow-y: auto;
  display: block;
}
.pg-list-table thead {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
  box-shadow: 0 1px 0 0 #cbd5e1;
}
.pg-list-table thead tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}
.pg-list-table tbody {
  display: table;
  width: 100%;
  table-layout: fixed;
}
.pg-list-table th {
  text-align: left;
  font-weight: 500;
  color: #475569;
  padding: 8px 10px;
  border-bottom: 2px solid #cbd5e1;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: #fff;
}
.pg-list-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #1f2937;
  vertical-align: middle;
}
.pg-list-table tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}
.pg-list-table tbody tr:hover {
  background: #f0f9ff;
}
.pg-list-codice {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 11px;
  color: #0369a1;
  font-weight: 600;
  width: 100px;
}
.pg-list-titolo {
  font-weight: 500;
}

/* ═══ ZONA 2 — Header qualità (logo Laga + ditta + codice/titolo) ═══ */
.pg-header-qualita {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 24px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}
.pg-header-logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pg-header-logo-placeholder {
  width: 48px;
  height: 48px;
  background: #f3f4f6;
  border: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #94a3b8;
  text-align: center;
  border-radius: 4px;
  line-height: 1.2;
}
.pg-header-ragione {
  font-size: 18px;
  color: #0f172a;
  font-weight: 600;
  line-height: 1.1;
}
.pg-header-loc {
  font-size: 10px;
  color: #6b7280;
  font-style: italic;
}
.pg-header-doc-meta {
  text-align: right;
}
.pg-header-codice {
  font-size: 10px;
  color: #6b7280;
  font-family: ui-monospace, "SF Mono", monospace;
}
.pg-header-titolo {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  color: #111827;
}
.pg-header-sub {
  font-size: 11.5px;
  color: #374151;
}

/* ═══ ZONA 3 — Body composabile (placeholder F1a, drawio embed in F2) ═══ */
.pg-body-composable {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 24px;
  gap: 10px;
  overflow: hidden;
  min-height: 0;
}
.pg-body-mode-tabs {
  display: flex;
  gap: 6px;
  padding: 5px 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  font-size: 11px;
  align-items: center;
  flex-shrink: 0;
}
.pg-body-mode-label {
  color: #374151;
  font-weight: 600;
}
.pg-body-mode-tab {
  padding: 4px 10px;
  border-radius: 4px;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.pg-body-mode-tab--active {
  background: #7c3aed;
  color: #fff;
}
.pg-body-mode-tab-sigle {
  font-size: 9px;
  opacity: 0.7;
}
.pg-drawio-frame {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
}

.pg-body-canvas-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(45deg, #fafafa, #fafafa 10px, #f3f4f6 10px, #f3f4f6 11px);
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  color: #94a3b8;
  font-style: italic;
  font-size: 13px;
  text-align: center;
  padding: 20px;
}
.pg-body-canvas-placeholder > div {
  max-width: 580px;
}
.pg-body-canvas-placeholder h4 {
  color: #475569;
  font-style: normal;
  font-size: 14px;
  margin-bottom: 8px;
  font-weight: 600;
}
.pg-body-canvas-placeholder p {
  margin-bottom: 6px;
  font-style: normal;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}
.pg-body-canvas-note {
  color: #7c3aed !important;
  font-size: 11.5px !important;
  margin-top: 8px !important;
}

/* ═══ ZONA 4 — Footer cornice CMP-042 (2 righe piccole, al limite stampa) ═══ */
.pg-footer-qualita {
  background: #fafafa;
  border-top: 1px solid #e5e7eb;
  padding: 5px 18px 4px;
  color: #1f2937;
  font-size: 8.5px;
  line-height: 1.3;
  flex-shrink: 0;
}
.pg-footer-row1 {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
}
.pg-footer-row1 b {
  font-weight: 700;
  color: #1f2937;
}
.pg-footer-emesso {
  font-size: 8.5px;
  color: #1f2937;
  white-space: nowrap;
  flex-shrink: 0;
}
.pg-footer-stati-track {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
}
.pg-stato-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 11px;
  font-size: 8px;
  line-height: 1.2;
  border: 1px solid #e5e7eb;
  background: #fff;
  white-space: nowrap;
}
.pg-stato-cell--todo {
  color: #cbd5e1;
  border-style: dashed;
}
/* rev 1.9.38 (L090) — celle stato cliccabili (transizione CMP-040) */
.pg-stato-cell--clickable {
  cursor: pointer;
}
.pg-stato-cell--clickable:hover {
  outline: 1px solid #0ea5e9;
  outline-offset: 1px;
}
.pg-stato-cell--done.pg-stato-cell--bozza {
  color: #374151;
  background: #f3f4f6;
}
.pg-stato-cell--done.pg-stato-cell--controllato {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}
.pg-stato-cell--done.pg-stato-cell--approvato {
  color: #065f46;
  background: #d1fae5;
  border-color: #a7f3d0;
}
.pg-stato-cell--done.pg-stato-cell--distribuito {
  color: #1e3a8a;
  background: #dbeafe;
  border-color: #bfdbfe;
}
.pg-stato-cell--done.pg-stato-cell--superato {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fca5a5;
}
.pg-stato-check {
  font-size: 9px;
  font-weight: 700;
}
.pg-stato-label {
  font-weight: 600;
}
.pg-stato-meta {
  color: inherit;
  opacity: 0.85;
  font-weight: 400;
}
.pg-footer-row2 {
  font-size: 7.5px;
  color: #374151;
  font-style: italic;
  text-align: center;
  margin-top: 3px;
  border-top: 1px dotted #e5e7eb;
  padding-top: 2px;
}


/* -------------------------------------------------------------------------
   rev 3.7.26 - EDITOR DI TESTO (ZONA 3): il documento qualita si scrive.
   Il foglio e bianco e stretto come un A4 perche e quello che l'utente vedra
   stampato dentro la cornice CMP-042: intestazione e piede li mette Nova, qui
   dentro c'e solo il contenuto. La cornice e UNA SOLA.
   ------------------------------------------------------------------------- */
.pg-testo-barra {
  display: flex; align-items: center; gap: 4px;
  padding: 5px 8px; background: #f8fafc; border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}
.pg-testo-barra button {
  min-width: 28px; padding: 3px 8px; font-size: 12.5px; cursor: pointer;
  border: 1px solid #cbd5e1; background: #fff; border-radius: 5px; color: #0f172a;
}
.pg-testo-barra button:hover { background: #eef2f6; border-color: #94a3b8; }
.pg-testo-nota { margin-left: auto; font-size: 11.5px; color: #64748b; }

.pg-testo-foglio {
  flex: 1; min-height: 0; overflow: auto; background: #e9e6e1; padding: 14px 0;
}
.pg-testo-corpo {
  width: min(760px, 92%); margin: 0 auto; background: #fff; padding: 26px 32px;
  border: 1px solid #d6d3ce; box-shadow: 0 1px 4px rgba(15,23,42,.08);
  font: 13px/1.55 Tahoma, system-ui, -apple-system, sans-serif; color: #1f2937;
  min-height: 60vh; outline: none;
}
.pg-testo-corpo:focus { border-color: #94a3b8; }
.pg-testo-corpo h2 { font-size: 15px; margin: 14px 0 6px; }
.pg-testo-corpo h3 { font-size: 13.5px; margin: 12px 0 5px; }
.pg-testo-corpo p { margin: 0 0 7px; }
.pg-testo-corpo table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.pg-testo-corpo td, .pg-testo-corpo th {
  border: 1px solid #cbd5e1; padding: 4px 7px; vertical-align: top; font-size: 12.5px;
}
