/* Project-only layout: no effects on commercial document rows or printed output. */
.project-page,
.project-list {
  min-width: 0;
  color: var(--ink);
}
.project-breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.project-breadcrumb span {
  font-size: 12px;
  color: var(--muted);
}
.project-surface.card {
  padding: 16px;
  box-shadow: none;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.project-heading > div:first-child {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.project-heading h1 {
  font-size: 20px;
  line-height: 1.3;
  margin: 0;
  font-weight: 750;
}
.project-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 0;
  color: var(--ink);
  font-size: 12px;
}
.project-meta > span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.project-meta svg,
.project-icon-line svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.project-meta > .btn {
  margin-left: auto;
}
.project-navigation {
  border-top: 1px solid var(--line);
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.project-navigation [role="tablist"] {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
/* Match the shared inventory tabs while retaining the project palette. */
.project-navigation [role="tab"] {
  min-height: 36px;
  padding: 9px 13px;
  font-size: 12.5px;
}
.project-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.project-summary > div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  line-height: 1.6;
}
.project-summary > div > b {
  font-size: 12px;
  white-space: nowrap;
}
.project-alert-count {
  margin-left: auto;
  white-space: nowrap;
}
.project-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}
.project-overview.has-detail {
  grid-template-columns: minmax(0, 1.8fr) minmax(270px, 1fr);
}
.project-plan-column,
.project-stacked {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}
.project-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px;
  min-width: 0;
  background: var(--surface);
  box-shadow: none;
}
.project-box h2,
.project-box h3,
.project-box summary {
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.4;
  font-weight: 750;
  color: var(--ink);
  letter-spacing: normal;
  text-transform: none;
  margin: 0 0 9px;
}
.project-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.project-section-head h2 {
  margin: 0;
}
.project-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.project-table-scroll {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  max-width: 100%;
}
.project-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  min-width: 490px;
  font-size: 11px;
  margin: 0;
}
.project-table th,
.project-table td {
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 8px 9px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
}
.project-table tr:last-child td {
  border-bottom: 0;
}
.project-table th {
  font-weight: 650;
  color: var(--ink);
  background: var(--surface);
}
.project-table td:last-child,
.project-table th:last-child {
  text-align: right;
}
.project-table .linkbtn {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: left;
  vertical-align: middle;
}
.project-table .selected td {
  background: var(--accent-soft, #e4f3fb);
}
.project-table small {
  display: block;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-list .project-list-title {
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.project-list .project-table .inventory-row-description {
  margin-top: 0;
  color: var(--ink-faint);
}
.project-table td input {
  width: 100%;
  min-width: 65px;
}
.project-empty {
  padding: 20px;
  color: var(--muted);
  font-size: 12px;
  text-align: center !important;
  white-space: normal !important;
}
.project-gantt-scroll {
  overflow: auto;
  max-width: 100%;
}
.project-gantt {
  min-width: 570px;
  font-size: 11px;
  padding: 2px 0 4px;
}
.project-gantt-heading {
  display: grid;
  grid-template-columns: 125px repeat(var(--project-days), minmax(42px, 1fr));
  align-items: center;
  min-height: 32px;
  border-bottom: 1px solid var(--line);
}
.project-gantt-heading > span {
  text-align: center;
  font-weight: 650;
}
.project-gantt-row {
  display: grid;
  grid-template-columns: 125px minmax(0, 1fr);
  min-height: 34px;
  border-bottom: 1px solid var(--line);
}
.project-gantt-row:last-child {
  border-bottom: 0;
}
.project-gantt-row > .linkbtn {
  font-size: 11px;
  font-weight: 650;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding-right: 8px;
}
.project-gantt-track {
  display: grid;
  grid-template-columns: repeat(var(--project-days), minmax(42px, 1fr));
  align-items: center;
  position: relative;
}
.project-gantt-track > i {
  height: 100%;
  grid-row: 1;
  border-left: 1px solid var(--line);
}
.project-gantt .weekend {
  background: var(--bg, #f6f8fa);
}
.project-gantt-bar {
  grid-row: 1;
  z-index: 1;
  height: 19px;
  margin: 0 4px;
  border: 0;
  border-radius: 5px;
  background: #73b3e4;
  cursor: pointer;
}
.project-gantt-bar.rental {
  background: #86b9b6;
}
.project-gantt-bar.done {
  background: #8bbba0;
}
.project-detail {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.project-detail .close-x {
  font-size: 20px;
  line-height: 1;
  width: 26px;
  height: 26px;
  padding: 0;
}
.project-icon-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin: 5px 0;
}
.project-detail section {
  border-top: 1px solid var(--line);
  padding-top: 11px;
  margin-top: 11px;
}
.project-detail footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 11px;
  text-align: right;
}
.project-person {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 9px 0;
}
.project-person img,
.project-person-fallback {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
  display: grid;
  place-items: center;
}
.project-person-fallback svg {
  width: 22px;
  height: 22px;
}
.project-person b {
  font-size: 12px;
}
.project-person small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.project-notice {
  font-size: 11px;
  line-height: 1.5;
  margin: 7px 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.project-notice.warning {
  background: #fff5df;
  border-color: #e9cc8c;
  color: #88520c;
}
.project-list-filters {
  display: flex;
  gap: 12px;
  padding: 12px !important;
  margin-bottom: 10px;
}
.project-list-filters label:first-child {
  flex: 1;
  max-width: 560px;
}
.project-list-filters label:last-child {
  width: 155px;
}
.project-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.project-field {
  min-width: 0;
  flex: 0 1 220px;
}
.project-field.wide {
  flex-basis: 100%;
}
.project-field:has(select[multiple]) {
  flex-basis: 100%;
}
.project-field:has(input[type="date"]),
.project-field:has(input[type="time"]),
.project-field:has(input[type="number"]) {
  max-width: 190px;
  flex-basis: 170px;
}
.project-field:has(input[name="currency"]) { flex-basis: 90px; }
.project-field:has(select[name="managerId"]),
.project-field:has(select[name="leaderId"]),
.project-field:has(select[name="employeeId"]),
.project-field:has(select[name="supplierId"]) { flex-basis: 280px; }
.project-field label {
  display: block;
  font-size: 12px;
  margin-bottom: 5px;
}
.project-field input,
.project-field select,
.project-field textarea {
  width: 100%;
  box-sizing: border-box;
}
.project-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
}
.project-field select[multiple] {
  min-height: 95px;
}
.project-field small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}
.project-form-error {
  color: var(--danger, #a02828);
  font-size: 12px;
}
.project-legacy-slot {
  min-width: 0;
  margin-top: 10px;
}
.project-legacy-slot > .card {
  box-shadow: none;
  margin: 0;
}
.project-box > summary {
  cursor: pointer;
  margin: 0;
}
@media (max-width: 1100px) {
  .project-overview.has-detail {
    grid-template-columns: minmax(0, 1.5fr) minmax(245px, 1fr);
  }
  .project-navigation {
    flex-wrap: wrap;
  }
  .project-summary {
    gap: 10px;
  }
  .project-table {
    font-size: 11px;
  }
  .project-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .project-field.wide,
  .project-field:has(select[multiple]) {
    grid-column: span 2;
  }
}
@media (max-width: 800px) {
  .project-overview.has-detail {
    grid-template-columns: minmax(0, 1fr);
  }
  .project-detail {
    order: 2;
  }
  .project-navigation [role="tablist"] {
    gap: 5px;
  }
  .project-surface.card {
    padding: 10px;
  }
  .project-heading h1 {
    font-size: 17px;
  }
  .project-meta {
    gap: 8px;
  }
  .project-breadcrumb span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .project-summary > div {
    flex: 1 1 140px;
  }
  .project-alert-count {
    margin-left: 0;
  }
  .project-list-filters {
    flex-wrap: wrap;
  }
  .project-list-filters label:first-child {
    flex-basis: 100%;
  }
  .project-meta > .btn {
    margin-left: 0;
  }
  .project-section-head {
    flex-wrap: wrap;
  }
}
@media (max-width: 460px) {
  .project-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .project-field.wide,
  .project-field:has(select[multiple]) {
    grid-column: span 1;
  }
  .project-field:has(input[type="date"]),
  .project-field:has(input[type="time"]),
  .project-field:has(input[type="number"]) {
    max-width: none;
  }
}
.project-meta svg,
.project-icon-line svg,
.project-person-fallback svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.project-overview .project-table th:nth-child(1) {
  width: 20%;
}
.project-overview .project-table th:nth-child(2) {
  width: 34%;
}
.project-overview .project-table th:nth-child(3) {
  width: 21%;
}
.project-overview .project-table th:nth-child(4) {
  width: 25%;
}
.project-table,
.project-table .linkbtn,
.project-gantt,
.project-gantt-row > .linkbtn {
  font-size: 12px;
}
.project-field[hidden] {
  display: none;
}
.project-editor .project-box {
  margin-top: 10px;
}
.workspace-editor-inner:has(.project-editor) .modal-foot > [data-action="save-project-record"] {
  background: #008dc5;
  border-color: #008dc5;
  color: #fff;
}

.project-editor[data-kind="availabilityRequest"] textarea[name="message"] {
  min-height: 180px;
  resize: vertical;
}
.project-linked-documents td:last-child > button + button {
  margin-left: 8px;
}
.project-editor [data-project-allocations] .project-table td input[type="number"] {
  width: 120px;
  max-width: 100%;
  margin-left: auto;
  display: block;
  text-align: right;
}

/* Palette and presentation for the project workspace. */
.project-page {
  --project-border: #cbdced;
  --project-ink: #10213b;
  --project-blue: #008dc5;
  --project-pale: #eef7fc;
  color: var(--project-ink);
}
.project-page .project-breadcrumb,
.project-page .project-surface.card,
.project-page .project-box,
.project-page .project-table-scroll {
  border-color: var(--project-border);
}
.project-page .project-surface.card {
  background: #fbfdff;
  padding: 18px;
}
.project-page .project-breadcrumb .btn {
  background: #e0f3fc;
  color: #0078bd;
  border: 0;
  box-shadow: none;
}
.project-page .project-heading h1 {
  color: #101d34;
}
.project-page .project-heading .badge {
  background: #dcf1ff;
  color: #0076bd;
  border: 1px solid #c2e6fb;
}
.project-page .project-meta {
  gap: 0;
  color: #263b5c;
}
.project-page .project-meta > span {
  padding: 0 16px;
  border-left: 1px solid var(--project-border);
}
.project-page .project-meta > span:first-child {
  padding-left: 0;
  border-left: 0;
}
.project-page .project-meta svg,
.project-page .project-icon-line svg,
.project-page .project-detail-line svg,
.project-page .project-trip svg,
.project-page .project-summary-icon svg {
  color: #45618b;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.project-page .project-navigation {
  border-color: #d9e5f0;
}
.project-page .project-navigation .btn {
  box-shadow: none;
  border-color: var(--project-border);
}
.project-page .project-navigation .btn:not(.secondary) {
  color: #fff;
  background: var(--project-blue);
  border-color: var(--project-blue);
}
.project-page .project-summary {
  background: var(--project-pale);
  border-color: #bedcf1;
  gap: 12px;
  padding: 12px 16px;
}
.project-page .project-summary-icon svg {
  color: #008cd0;
  width: 22px;
  height: 22px;
}
.project-page .project-summary > div {
  color: #182d49;
  font-size: 12px;
}
.project-page .project-summary > div > b {
  color: #0e2038;
}
.project-page .project-alert-count {
  border-left: 1px solid #bad6eb;
  padding-left: 16px;
  color: #007ebd;
}
.project-page .project-box {
  background: #fff;
  padding: 12px;
}
.project-page .project-gantt-heading,
.project-page .project-gantt-row,
.project-page .project-gantt-track > i,
.project-page .project-detail section,
.project-page .project-detail footer {
  border-color: #d7e3ef;
}
.project-page .project-gantt-row > .linkbtn,
.project-page .project-intervention-title {
  color: var(--project-ink);
  font-weight: 650;
  text-decoration: none;
}
.project-page .project-intervention-title {
  max-width: 100%;
  border: 0;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.project-page .project-gantt .weekend {
  background: #f7fafd;
}
.project-page .project-gantt-bar {
  background: #75b8ed;
}
.project-page .project-gantt-bar.rental {
  background: #89c4c0;
}
.project-page .project-table th,
.project-editor .project-table th {
  background: #f3f7fb;
  color: #243956;
  text-transform: none;
  letter-spacing: normal;
}
.project-page .project-table .selected td {
  background: #dff1fb;
}
.project-page .project-table .badge,
.project-page .project-trip .badge {
  background: #e8f5ff;
  border: 1px solid #a8d8fa;
  color: #173c60;
  font-weight: 600;
}
.project-page .project-table .badge.fatto,
.project-page .project-trip .badge.fatto {
  background: #e3f6ef;
  border-color: #a8dcc7;
  color: #16694d;
}
.project-page .project-detail {
  color: var(--project-ink);
}
.project-page .project-detail-line,
.project-page .project-trip {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 8px 0;
  font-size: 12px;
}
.project-page .project-trip span:not(.badge) {
  min-width: 0;
  flex: 1;
}
.project-page .project-detail-secondary {
  margin-left: 28px;
  color: #536983;
  font-size: 11.5px;
}
.project-page .project-detail .linkbtn {
  color: #0082c5;
}
.project-page .project-detail .project-notice.warning {
  background: #fff5da;
  border-color: #ffd27b;
  color: #895000;
}
.project-page .project-person-fallback {
  color: #45618b;
  background: #edf5fc;
}
@media (max-width: 800px) {
  .project-page .project-meta {
    gap: 8px;
  }
  .project-page .project-meta > span {
    padding: 0;
    border: 0;
  }
  .project-page .project-alert-count {
    border: 0;
    padding-left: 0;
  }
}

/* Shared project workspace proportions, independent of the active tab. */
.project-page .project-overview {
  gap: 15px;
}
.project-page .project-box,
.project-editor .project-box {
  padding: 16px;
}
.project-page .project-section-head,
.project-editor .project-section-head {
  margin-bottom: 12px;
}
.project-page .project-overview .project-gantt-heading {
  grid-template-columns: 150px repeat(var(--project-days), minmax(42px, 1fr));
}
.project-page .project-overview .project-gantt-row {
  grid-template-columns: 150px minmax(0, 1fr);
  min-height: 37px;
}
.project-page .project-overview .project-gantt,
.project-page .project-overview .project-gantt-row > .linkbtn {
  font-size: 12.5px;
}
.project-page .project-overview .project-detail,
.project-page .project-overview .project-icon-line,
.project-page .project-overview .project-detail-line,
.project-page .project-overview .project-trip {
  font-size: 13px;
}
.project-page .project-overview .project-person b {
  font-size: 13.5px;
}
.project-page .project-overview .project-person small {
  font-size: 12px;
}
.project-page .project-team-count {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 8px 0;
  font-size: 13px;
}
.project-page .project-team-count svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  fill: none;
  stroke: #45618b;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (max-width: 800px) {
  .project-page .project-surface.card {
    padding: 10px;
  }
  .project-page .project-box,
  .project-editor .project-box {
    padding: 12px;
  }
}


/* Compact groups grow only when their contents have usable room. */
.project-page [data-project-content] {
  container-type: inline-size;
}
.project-pair,
.project-coordination-tables,
.project-task-layout,
.project-history-layout {
  display: grid;
  gap: 10px;
  min-width: 0;
  align-items: start;
}
.project-pair > *,
.project-task-layout > *,
.project-history-layout > *,
.project-finance-layout > *,
.project-documents-layout > * {
  min-width: 0;
}
@container (min-width: 1060px) {
  .project-pair-coordination:has(> :nth-child(2)) {
    grid-template-columns: minmax(300px, 1fr) minmax(700px, 2fr);
  }
  .project-task-layout {
    grid-template-columns: minmax(300px, 1fr) minmax(0, 2fr);
  }
  .project-history-layout {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .project-history-layout > details[open] {
    grid-column: 1 / -1;
  }
  .project-finance-layout {
    grid-template-columns: minmax(340px, 1fr) minmax(700px, 2fr);
    align-items: start;
  }
  .project-finance-layout > :nth-child(1) { grid-column: 1; grid-row: 1; }
  .project-finance-layout > :nth-child(2) { grid-column: 2; grid-row: 1; }
  .project-finance-layout > :nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
  .project-finance-layout > :nth-child(4) { grid-column: 1 / -1; grid-row: 3; }
  .project-finance-layout > :nth-child(5) { grid-column: 1 / -1; grid-row: 4; }
}
@container (min-width: 1080px) {
  .project-documents-layout {
    grid-template-columns: minmax(660px, 1.6fr) minmax(410px, 1fr);
    align-items: start;
  }
  .project-documents-layout > :first-child { grid-column: 1 / -1; }
}
@container (min-width: 1500px) {
  .project-pair-availability:has(> :nth-child(2)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.project-finance-layout > :first-child .project-table {
  min-width: 0;
}

@container (min-width: 1060px) {
  .project-pair-coordination,
  .project-finance-layout {
    align-items: stretch;
  }
}
@container (min-width: 1080px) {
  .project-documents-layout {
    align-items: stretch;
  }
}
@container (min-width: 1500px) {
  .project-pair-availability {
    align-items: stretch;
  }
}


.project-sections { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 12px; align-items: start; min-width: 0; }
.project-section-nav { position: sticky; top: 64px; display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.project-section-nav h2 { margin: 0 0 8px; font-size: 12.5px; font-weight: 750; line-height: 1.4; }
.project-section-link { box-sizing: border-box; display: grid; grid-template-columns: 14px minmax(0, 1fr); align-items: center; gap: 7px; width: 100%; min-width: 0; min-height: 36px; padding: 6px 8px; border: 0; border-radius: 5px; background: transparent; color: var(--ink-soft); text-align: left; font: inherit; font-size: 12.5px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; cursor: pointer; }
.project-section-link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.project-section-link:hover { background: var(--paper); }
.project-section-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 750; }
.project-section-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.project-section-content, .project-section-content > * { min-width: 0; }
.project-section-content > [hidden] { display: none !important; }
@container (max-width: 900px) {
  .project-sections { display: flex; flex-direction: column; gap: 10px; }
  .project-section-nav { position: static; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 8px; }
  .project-section-nav h2 { grid-column: 1 / -1; margin-bottom: 4px; }
  .project-section-content { width: 100%; }
}
@container (max-width: 240px) { .project-section-nav { grid-template-columns: minmax(0, 1fr); } }

/* Ciclo di lavoro del progetto: i pannelli mantengono i componenti esistenti. */
.project-page .project-phase-title { margin: 0 0 12px; font-size: 18px; line-height: 1.35; }
.project-phase-disclosure { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.project-phase-disclosure > summary { padding: 11px 14px; font-size: 12.5px; line-height: 1.4; font-weight: 750; cursor: pointer; }
.project-phase-disclosure:has(> .project-phase-actions) > summary { padding-right: 255px; min-height: 40px; box-sizing: border-box; }
.project-phase-actions { position: absolute; right: 10px; top: 5px; }
.project-phase-disclosure > summary small { color: var(--ink-soft); font-size: inherit; font-weight: 400; }
.project-phase-body { display: grid; gap: 8px; min-width: 0; padding: 0 14px 12px; }
.project-phase-body > .project-box { padding: 0; border: 0; background: transparent; }
.project-phase-body > .project-box > .project-section-head h2 { display: none; }
.project-phase-body > .project-box > .project-section-head:has(.project-actions:empty) { display: none; }
.project-phase-body > .project-box > .project-section-head { justify-content: flex-end; }
.project-phase-body > .project-box > summary { font-weight: 750; }
.project-phase-disclosure:focus-within > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.project-sections { align-items: stretch; }
.project-section-nav { position: static; align-self: stretch; }
@media (max-width: 650px) { .project-phase-disclosure:has(> .project-phase-actions) > summary { padding-right: 14px; } .project-phase-actions { position: static; padding: 0 14px 8px; flex-wrap: wrap; } }

/* Elenchi operativi: informazioni raggruppate senza intestazioni di tabella. */
.project-page .project-navigation { justify-content: flex-start; }
.project-page .project-section-head { justify-content: flex-start; flex-wrap: wrap; }
.project-page .project-phase-disclosure:has(> .project-phase-actions) > summary { padding-right: 14px; min-height: 0; }
.project-page .project-phase-actions { position: static; padding: 0 14px 8px; }
.project-page .project-phase-body > .project-box > .project-section-head { justify-content: flex-start; }
:is(.project-page, .project-site-assignment) .project-entries { display: grid; gap: 7px; min-width: 0; }
:is(.project-page, .project-site-assignment) .project-entry { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px 11px; border: 1px solid var(--project-border); border-radius: 7px; background: var(--surface); }
:is(.project-page, .project-site-assignment) .project-entry-icon { display: grid; place-items: center; flex: 0 0 24px; color: #45618b; }
:is(.project-page, .project-site-assignment) .project-entry-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
:is(.project-page, .project-site-assignment) .project-entry-icon img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
:is(.project-page, .project-site-assignment) .project-entry-content { flex: 1; display: flex; align-items: center; gap: 14px; min-width: 0; }
:is(.project-page, .project-site-assignment) .project-entry-title { flex: 1 1 145px; min-width: 0; font-weight: 650; overflow-wrap: anywhere; }
:is(.project-page, .project-site-assignment) .project-entry-fields { flex: 3 1 350px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
:is(.project-page, .project-site-assignment) .project-entry-fields > div { flex: 1 1 110px; min-width: 0; overflow-wrap: anywhere; }
:is(.project-page, .project-site-assignment) .project-entry-fields small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 2px; }
:is(.project-page, .project-site-assignment) .project-entry-action { flex: 0 0 auto; }
@container (max-width: 600px) {
  :is(.project-page, .project-site-assignment) .project-entry-content { flex-direction: column; align-items: stretch; gap: 6px; }
  :is(.project-page, .project-site-assignment) .project-entry-title, :is(.project-page, .project-site-assignment) .project-entry-fields { flex: initial; }
  :is(.project-page, .project-site-assignment) .project-entry-fields { gap: 7px 12px; }
}
.project-page .project-operational-cards { display: grid; gap: 7px; min-width: 0; }
.project-page .project-operational-card { min-width: 0; padding: 10px 12px; border: 1px solid var(--project-border); border-radius: 7px; background: var(--surface); }
.project-page .project-operational-card > header { display: flex; align-items: center; gap: 9px; min-width: 0; }
.project-page .project-card-heading { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.project-page .project-card-heading > div { min-width: 0; overflow-wrap: anywhere; }
.project-page .project-card-heading svg { width: 19px; height: 19px; flex: 0 0 19px; fill: none; stroke: #45618b; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.project-page .project-card-heading small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.project-page .project-card-members > small, .project-page .project-card-metrics small { display: block; color: var(--muted); font-size: 11px; }
.project-page .project-card-members > div { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.project-page .project-card-members span { padding: 3px 8px; border-radius: 12px; background: #edf5fc; }
.project-page .project-card-metrics { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 10px; }
.project-page .project-card-metrics > div { min-width: 75px; }
.project-page .project-card-metrics strong { display: block; font-size: 14px; margin-top: 2px; }
.project-page .project-card-details { display: flex; flex-wrap: wrap; gap: 5px 16px; margin-top: 8px; color: var(--ink-soft); font-size: 11.5px; }
:is(.project-page, .project-site-assignment) .project-entry .list-action-icons .icon-btn, .project-page .project-operational-card .list-action-icons .icon-btn { box-sizing: border-box; width: 26px; height: 26px; padding: 5px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
:is(.project-page, .project-site-assignment) .project-entry .list-action-icons .icon-kind-edit, .project-page .project-operational-card .list-action-icons .icon-kind-edit { border-color: #CDDDF7; background: #EEF4FD; color: #3C70C7; }
:is(.project-page, .project-site-assignment) .project-entry .list-action-icons .icon-btn svg, .project-page .project-operational-card .list-action-icons .icon-btn svg { width: 14px; height: 14px; }
.project-page .job-section-head { justify-content: flex-start; flex-wrap: wrap; }
.project-page .job-section-head > button { margin-left: 0; }
.project-page .project-task-list .todo-list-empty { min-height: 0; padding: 12px; }
.project-page .project-task-list .todo-list-empty p { margin: 4px 0 0; }

.project-page .project-team-cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); align-items: stretch; }
@container (max-width: 600px) {
  .project-page .project-operational-card > header { flex-wrap: wrap; }
  .project-page .project-card-heading { flex: 1 0 100%; }
}

.project-editor .project-site-assignment { flex-basis: 100%; margin: 0; }
.project-site-assignment [data-project-site-picker] { width: min(280px, 100%); }
.project-site-assignment [data-project-site-picker] select { width: 100%; }
.project-editor .project-field:has(input[name="endDateUndefined"]) { flex-basis: 150px; align-self: center; }

.project-editor .project-site-assignment .project-section-head { justify-content: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.project-site-assignment .project-empty { padding: 4px 0; text-align: left !important; }

.modal.modal-wide.workspace-overlay-dialog.project-creation-dialog {
  display: flex;
  flex-direction: column;
  max-width: min(948px, 92vw);
  max-height: calc(100dvh / var(--interface-scale-factor, 1) - 48px);
}
.project-creation-dialog > .modal-head,
.project-creation-dialog > .modal-foot { flex-shrink: 0; }
.project-creation-dialog > .modal-body { min-height: 0; max-height: none; }

/* Explicit rows keep related fields together without expanding the form across the page. */
.project-editor[data-kind="project"] { container-type: inline-size; }
.project-editor[data-kind="project"] .project-fields {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px 12px;
  max-width: 900px;
}
.project-editor[data-kind="project"] .project-field:has(input[name="title"]) { grid-area: 1 / 1 / auto / span 6; }
.project-editor[data-kind="project"] .project-field:has(input[name="code"]) { grid-area: 1 / 7 / auto / span 3; }
.project-editor[data-kind="project"] .project-field:has(select[name="mode"]) { grid-area: 1 / 10 / auto / span 3; }
.project-editor[data-kind="project"] .project-field:has(select[name="clientId"]) { grid-area: 2 / 1 / auto / span 6; }
.project-editor[data-kind="project"] .project-field:has(select[name="managerId"]) { grid-area: 2 / 7 / auto / span 4; }
.project-editor[data-kind="project"] .project-field:has(input[name="currency"]) { grid-area: 2 / 11 / auto / span 2; max-width: 90px; }
.project-editor[data-kind="project"] .project-field:has(input[name="startDate"]) { grid-area: 3 / 1 / auto / span 3; }
.project-editor[data-kind="project"] .project-field:has(input[name="endDate"]) { grid-area: 3 / 4 / auto / span 3; }
.project-editor[data-kind="project"] .project-field:has(input[name="endDateUndefined"]) { grid-area: 3 / 7 / auto / span 3; }
.project-editor[data-kind="project"] .project-field:has(select[name="status"]) { grid-area: 3 / 10 / auto / span 3; }
.project-editor[data-kind="project"] .project-field:has(textarea[name="description"]) { grid-area: 4 / 1 / auto / span 6; }
.project-editor[data-kind="project"] .project-field:has(textarea[name="notes"]) { grid-area: 4 / 7 / auto / span 6; }
.project-editor[data-kind="project"] .project-site-assignment { grid-area: 5 / 1 / auto / span 12; }
.project-editor[data-kind="project"] .project-field:has(input[name="manualContractNet"]),
.project-editor[data-kind="project"] .project-field:has(input[name="archived"]) { grid-column: span 4; }
.project-editor[data-kind="project"] .project-field:has(input[name="manualContractNet"]) { max-width: 260px; }
.project-editor[data-kind="project"] .project-field:has(textarea[name="description"]) textarea,
.project-editor[data-kind="project"] .project-field:has(textarea[name="notes"]) textarea { height: 68px; }
.project-editor[data-kind="project"] .project-field { max-width: 100%; }
#projectEditorForm[data-kind="project"] input[name="endDate"]:disabled { background: var(--paper-deep); border-color: var(--line); color: var(--ink-soft); cursor: not-allowed; }
@container (max-width: 720px) {
  .project-editor[data-kind="project"] .project-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
  .project-editor[data-kind="project"] .project-field:has(input[name="title"]) { grid-area: 1 / 1 / auto / span 2; }
  .project-editor[data-kind="project"] .project-field:has(input[name="code"]) { grid-area: 2 / 1; }
  .project-editor[data-kind="project"] .project-field:has(select[name="mode"]) { grid-area: 2 / 2; }
  .project-editor[data-kind="project"] .project-field:has(select[name="clientId"]) { grid-area: 3 / 1; }
  .project-editor[data-kind="project"] .project-field:has(select[name="managerId"]) { grid-area: 3 / 2; }
  .project-editor[data-kind="project"] .project-field:has(input[name="startDate"]) { grid-area: 4 / 1; }
  .project-editor[data-kind="project"] .project-field:has(input[name="endDate"]) { grid-area: 4 / 2; }
  .project-editor[data-kind="project"] .project-field:has(input[name="endDateUndefined"]) { grid-area: 5 / 2; }
  .project-editor[data-kind="project"] .project-field:has(input[name="currency"]) { grid-area: 5 / 1; }
  .project-editor[data-kind="project"] .project-field:has(select[name="status"]) { grid-area: 6 / 1; }
  .project-editor[data-kind="project"] .project-field:has(textarea[name="description"]) { grid-area: 7 / 1; }
  .project-editor[data-kind="project"] .project-field:has(textarea[name="notes"]) { grid-area: 7 / 2; }
  .project-editor[data-kind="project"] .project-site-assignment { grid-area: 8 / 1 / auto / span 2; }
  .project-editor[data-kind="project"]:not(:has(select[name="status"])) .project-field:has(textarea[name="description"]) { grid-row: 6; }
  .project-editor[data-kind="project"]:not(:has(select[name="status"])) .project-field:has(textarea[name="notes"]) { grid-row: 6; }
  .project-editor[data-kind="project"]:not(:has(select[name="status"])) .project-site-assignment { grid-row: 7; }
  .project-editor[data-kind="project"] .project-field:has(input[name="manualContractNet"]),
  .project-editor[data-kind="project"] .project-field:has(input[name="archived"]) { grid-column: span 1; }
}
@container (max-width: 400px) {
  .project-editor[data-kind="project"] .project-fields { display: flex; flex-direction: column; }
  .project-editor[data-kind="project"] .project-field { flex: none; width: 100%; }
  .project-editor[data-kind="project"] .project-field:has(input[name="endDateUndefined"]) { flex: none; align-self: stretch; }
}

/* Grafica approvata per Progetti: palette e composizione locali alla sezione. */
.project-page, .project-list, .project-editor {
  --project-border: #d8e0e6;
  --project-ink: #25313d;
  --project-blue: #397baa;
  --project-pale: #f7f9fb;
  color: var(--project-ink);
}
.project-page .project-breadcrumb,
.project-page .project-surface.card,
.project-page .project-box,
.project-page .project-table-scroll,
.project-page .project-phase-disclosure,
.project-list .project-table-scroll { border-color: var(--project-border); }
.project-page .project-surface.card { background: #fff; padding: 20px; border-radius: 8px; }
.project-page .project-breadcrumb { border-radius: 8px; padding: 6px 10px; }
.project-page .project-breadcrumb .btn { color: var(--project-blue); background: transparent; }
.project-page .project-heading h1 { color: var(--project-ink); font-size: 19px; }
.project-page .project-heading .badge { background: #edf0f5; color: var(--project-blue); border: 0; }
.project-page .project-meta { color: #687789; gap: 0; }
.project-page .project-meta > span { border-color: var(--project-border); }
.project-page .project-meta svg { width: 15px; height: 15px; flex-basis: 15px; color: #687789; }
.project-page .project-navigation { justify-content: space-between; border-color: var(--project-border); }
.project-page .project-navigation [role="tab"] { min-height: 32px; padding: 7px 12px; }
.project-page .project-navigation .btn:not(.secondary) { background: var(--project-blue); border-color: var(--project-blue); }
.project-page .project-summary { display: flex; background: #f7f9fb; border-color: var(--project-border); padding: 10px 14px; gap: 12px 20px; }
.project-page .project-summary-icon { display: none; }
.project-page .project-summary > div { flex: 1 1 120px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; color: #687789; font-size: 10px; line-height: 1.4; }
.project-page .project-summary > div > b { color: var(--project-ink); font-size: 13px; }
.project-page .project-alert-count { border: 0; padding: 0; color: var(--project-blue); }
.project-page .project-box, .project-editor .project-box { padding: 14px; border-radius: 8px; }
.project-page .project-section-head, .project-editor .project-section-head { justify-content: space-between; }
.project-page .project-section-head .project-actions { margin-left: auto; }
.project-page .project-table th, .project-editor .project-table th { background: #f7f9fb; color: #687789; }
.project-page .project-table .selected td { background: #eaf3f8; }
.project-page .project-gantt-row > .linkbtn, .project-page .project-intervention-title,
.project-list .project-list-title { color: var(--project-blue); }
.project-page .project-gantt-bar { background: #88b7de; }
.project-page .project-gantt-bar.rental { background: #a0c9c5; }
.project-page .project-section-nav { background: #f7f9fb; border-color: var(--project-border); padding: 10px; }
.project-page .project-section-link { display: block; min-height: 38px; padding: 9px 14px; color: #687789; }
.project-page .project-section-link svg { display: none; }
.project-page .project-section-link.active { background: #eaf3f8; color: var(--project-blue); }
.project-page .project-phase-title { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.project-page .project-phase-disclosure { border-color: var(--project-border); border-radius: 8px; }
.project-page .project-phase-disclosure:has(> .project-phase-actions) > summary { padding-right: 255px; min-height: 42px; }
.project-page .project-phase-actions { position: absolute; right: 14px; top: 8px; padding: 0; }
.project-page .project-phase-body { padding: 0 14px 14px; }
.project-page .project-phase-body > .project-box { padding: 0; }
.project-page .project-operational-card,
.project-page .project-entry { background: #f7f9fb; border-color: var(--project-border); }
.project-list .project-list-filters { border-color: var(--project-border); border-radius: 8px; }
.project-list [data-project-list] { padding: 14px; border: 1px solid var(--project-border); border-radius: 8px; background: var(--surface); }
.project-economy-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: stretch; }
.project-economy-layout > :last-child { grid-column: 1 / -1; }
.project-economy-layout > * { min-width: 0; }
.project-economy-layout > :first-child .project-table { min-width: 350px; }
@container (max-width: 760px) {
  .project-economy-layout { grid-template-columns: minmax(0, 1fr); }
  .project-economy-layout > :last-child { grid-column: auto; }
}
@container (max-width: 600px) {
  .project-page .project-phase-disclosure:has(> .project-phase-actions) > summary { padding-right: 14px; min-height: 0; }
  .project-page .project-phase-actions { position: static; padding: 0 14px 8px; }
}
@media (max-width: 800px) {
  .project-page .project-surface.card { padding: 12px; }
  .project-page .project-meta { gap: 8px 12px; }
  .project-page .project-meta > span { padding: 0; border: 0; }
  .project-page .project-summary > div { flex-basis: calc(50% - 20px); }
  .project-page .project-alert-count { margin-left: 0; }
  .project-page .project-navigation [role="tablist"] { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-list [data-project-list] { padding: 10px; }
}
.project-page .project-gantt-bar.done { background: #8bbba0; }
.project-list .project-table th { background: #f7f9fb; color: #687789; text-transform: none; letter-spacing: normal; }
.project-list [data-action="project-edit-record"][data-kind="project"],
.workspace-editor-inner:has(.project-editor) .modal-foot > [data-action="save-project-record"],
.project-creation-dialog .modal-foot > [data-action="save-project-record"] {
  background: #397baa; border-color: #397baa; color: #fff; box-shadow: none;
}
.project-page .btn, .project-list .btn,
.workspace-editor-inner:has(.project-editor) .modal-foot .btn,
.project-creation-dialog .modal-foot .btn { box-shadow: none; }
.project-page .project-table td.project-empty,
.project-list .project-table td.project-empty,
.project-editor .project-table td.project-empty { text-align: left !important; }
