/* Fase 24A - Documentale dinamico definitivo allineato al modello online */
.phase24-documentale-box {
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  margin: 14px 0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
}

.phase24-project-detail-card .phase24-documentale-box {
  margin: 0;
  box-shadow: none;
}

.phase24-documentale-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.phase24-documentale-head h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.phase24-documentale-head p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: .82rem;
}

.phase24-documentale-pill,
.phase24-documentale-card span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}

.phase24-documentale-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.phase24-documentale-context span {
  background: #f1f5f9;
  color: #334155;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: .72rem;
  font-weight: 600;
}

.phase24-documentale-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.phase24-documentale-card {
  min-height: 92px;
  border-radius: 12px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
}

.phase24-documentale-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.phase24-documentale-card strong {
  font-size: .88rem;
  line-height: 1.1;
}

.phase24-documentale-card small,
.phase24-documentale-card em {
  color: #475569;
  font-size: .72rem;
  line-height: 1.25;
}

.phase24-documentale-card em {
  font-style: normal;
  color: #64748b;
  overflow-wrap: anywhere;
}

.phase24-doc-ok,
.phase24-doc-na {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}

.phase24-doc-due {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.phase24-doc-blocked {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.phase24-doc-muted,
.phase24-doc-excluded {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}

.phase24-raw-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 6px 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.phase24-raw-status-grid p {
  margin: 0;
  font-size: .82rem;
  color: #334155;
}

@media (max-width: 900px) {
  .phase24-documentale-head {
    flex-direction: column;
  }
  .phase24-documentale-grid,
  .phase24-raw-status-grid {
    grid-template-columns: 1fr;
  }
}

/* Fase 24B - Pulizia dashboard documentale operativa */
.phase24b-page-head h2 {
  margin-bottom: 4px;
}

.phase24b-eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 10px;
  background: #efe7ff;
  color: #6d28d9;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .02em;
  margin-bottom: 8px;
}

.phase24b-kpis .kpi strong {
  letter-spacing: -.03em;
}

.phase24b-quick-card,
.phase24b-table-card {
  margin-top: 16px;
}

.phase24b-doc-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
}

.phase24b-doc-filter {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  text-decoration: none;
  color: #0f172a;
  display: grid;
  gap: 4px;
  min-height: 98px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .04);
}

.phase24b-doc-filter strong {
  font-size: .88rem;
}

.phase24b-doc-filter span {
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1;
}

.phase24b-doc-filter small {
  color: #64748b;
  font-size: .76rem;
}

.phase24b-doc-filter.is-active {
  border-color: #7c3aed;
  background: #f5f3ff;
  color: #5b21b6;
}

.phase24b-doc-filter.is-empty {
  opacity: .62;
  background: #f8fafc;
}

.phase24b-dashboard-panels {
  margin-top: 16px;
}

.phase24b-state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.phase24b-state-grid-small {
  margin-bottom: 12px;
}

.phase24b-state-card,
.phase24b-gate-row {
  border: 1px solid #e2e8f0;
  border-radius: 13px;
  padding: 10px;
  background: #fff;
}

.phase24b-state-card {
  display: grid;
  gap: 2px;
}

.phase24b-state-card strong {
  font-size: 1.35rem;
  line-height: 1;
}

.phase24b-state-card span,
.phase24b-gate-row small {
  color: #475569;
  font-size: .75rem;
}

.phase24b-gate-list {
  display: grid;
  gap: 8px;
}

.phase24b-gate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.phase24b-gate-row strong {
  display: block;
  font-size: .86rem;
}

.phase24b-gate-row span {
  font-weight: 900;
  font-size: 1.15rem;
}

.phase24b-card-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.phase24b-card-success,
.phase24b-card-muted-green {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}

.phase24b-card-warning {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.phase24b-card-muted {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #334155;
}

.phase24b-pending-list {
  display: grid;
  gap: 8px;
}

.phase24b-pending-group summary {
  padding: 10px 12px;
}

.phase24b-project-row-mini strong {
  font-size: .9rem;
}

.phase24b-more-row {
  margin-top: 10px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #64748b;
  font-size: .82rem;
}

.phase24b-filter-grid {
  align-items: end;
}

.phase24b-chip-toolbar .tag-chip span {
  font-weight: 900;
  margin-left: 4px;
}

.phase24b-chip-empty {
  opacity: .58;
}

.phase24b-active-filter-note {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 14px;
  padding: 10px 12px;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: .84rem;
}

.phase24b-docs-table th,
.phase24b-docs-table td {
  vertical-align: top;
}

.phase24b-id-cell {
  white-space: nowrap;
  font-weight: 700;
}

.phase24b-customer-cell strong,
.phase24b-customer-cell small,
.phase24b-operational-cell small,
.docs-assistance-cell small {
  display: block;
}

.phase24b-customer-cell small,
.phase24b-operational-cell small,
.docs-assistance-cell small {
  color: #64748b;
  line-height: 1.35;
  margin-top: 4px;
}

.phase24b-doc-status-cell {
  min-width: 260px;
}

.phase24b-doc-chip-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(108px, 1fr));
  gap: 6px;
}

.phase24b-doc-status-chip {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 6px 8px;
  display: grid;
  gap: 2px;
  min-height: 48px;
}

.phase24b-doc-status-chip strong {
  font-size: .73rem;
  line-height: 1;
}

.phase24b-doc-status-chip em {
  font-style: normal;
  font-size: .68rem;
  line-height: 1.1;
  color: currentColor;
}

.phase24b-actions-cell {
  white-space: nowrap;
}

@media (max-width: 1280px) {
  .phase24b-doc-filter-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
  .phase24b-doc-status-cell {
    min-width: 220px;
  }
  .phase24b-doc-chip-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .phase24b-doc-filter-grid,
  .phase24b-state-grid {
    grid-template-columns: 1fr 1fr;
  }
  .phase24b-active-filter-note,
  .phase24b-more-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .phase24b-doc-filter-grid,
  .phase24b-state-grid {
    grid-template-columns: 1fr;
  }
}


/* FASE24C: pratiche + documentale completo */
.phase24-documentale-category,
.phase24b-doc-status-chip small {
    display: block;
    font-size: 0.68rem;
    line-height: 1.1;
    opacity: 0.72;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.12rem;
}

.phase24b-doc-status-chip small + strong {
    display: block;
}

.phase24-documentale-box-24c .phase24-documentale-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
