:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --line: #d8e0ea;
  --text: #213547;
  --muted: #6b7a8b;
  --brand: #0f62fe;
  --danger: #c62828;
  --danger-bg: #ffe1e1;
  --success: #176a2e;
  --success-bg: #dff5e5;
  --warn: #996b00;
  --warn-bg: #fff0c8;
  --info: #0f62fe;
  --info-bg: #e1edff;
  --docs: #6941c6;
  --docs-bg: #efe7ff;
  --slate-bg: #e8eef5;
  --shadow: 0 4px 16px rgba(15, 34, 56, 0.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--brand); text-decoration: none; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

.topbar {
  background: #132238;
  color: white;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.topbar h1 { margin: 0; font-size: 28px; }
.topbar h1 a { color: white; }
.topbar p { margin: 4px 0 0; color: #d7e1ec; }

.nav {
  display: flex;
  gap: 14px;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.nav a {
  padding: 8px 12px;
  border-radius: 999px;
}

.nav a:hover {
  background: #eff5ff;
}

.container { padding: 24px; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}

.page-head-stack {
  align-items: flex-start;
}

.page-head h2 { margin: 0; }
.page-subtitle { margin: 6px 0 0; color: var(--muted); }
.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi {
  position: relative;
  overflow: hidden;
}

.kpi span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi strong {
  font-size: 30px;
  line-height: 1.05;
}

.kpi small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.kpi-blue { border-left: 6px solid var(--info); }
.kpi-red { border-left: 6px solid var(--danger); }
.kpi-green { border-left: 6px solid var(--success); }
.kpi-amber { border-left: 6px solid var(--warn); }
.kpi-slate { border-left: 6px solid #5a6d84; }
.kpi-docs { border-left: 6px solid var(--docs); }
.kpi-moduli, .kpi-inverter, .kpi-ottimizzatori, .kpi-storage,
.kpi-meter, .kpi-ta, .kpi-wallbox, .kpi-accessori {
  border-left: 6px solid #40576f;
}

.dashboard-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.dashboard-panels-2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.dashboard-panels-4 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.panel-red { border-top: 5px solid var(--danger); }
.panel-green { border-top: 5px solid var(--success); }
.panel-blue { border-top: 5px solid var(--info); }
.panel-docs { border-top: 5px solid var(--docs); }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head-wrap {
  flex-wrap: wrap;
}

.panel-head-minor {
  margin-bottom: 8px;
}

.panel-head h3, .panel-head h4 { margin: 0; }
.panel-foot-link { margin-top: 12px; }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill-red { background: var(--danger-bg); color: var(--danger); }
.pill-green { background: var(--success-bg); color: var(--success); }
.pill-blue { background: var(--info-bg); color: var(--info); }
.pill-docs { background: var(--docs-bg); color: var(--docs); }
.pill-slate { background: var(--slate-bg); color: #3d556d; }

.mini-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mini-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fbff;
  border: 1px solid #e2e9f3;
}

.mini-item strong { display: block; color: var(--text); }
.mini-item small { color: var(--muted); }

.mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.mini-badge.danger { background: var(--danger-bg); color: var(--danger); }
.mini-badge.warn { background: var(--warn-bg); color: var(--warn); }
.mini-badge.success { background: var(--success-bg); color: var(--success); }
.mini-badge.info { background: var(--info-bg); color: var(--info); }
.mini-badge.neutral { background: var(--slate-bg); color: #3d556d; }

.empty-copy { color: var(--muted); margin: 0; }

.search-inline {
  display: flex;
  gap: 10px;
  align-items: center;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

thead th {
  white-space: nowrap;
}

thead a {
  color: inherit;
}

.status-row.row-late { background: #fff8f8; }
.status-row.row-ready { background: #f7fff8; }
.status-row.row-warning { background: #fffdf4; }
.status-row.row-working { background: #fbfcff; }
.status-row.row-docs { background: #f7f2ff; }
.status-row.row-closed { opacity: 0.72; }

input, select, textarea, button {
  font: inherit;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cfd7e2;
  border-radius: 10px;
  box-sizing: border-box;
  background: white;
}

textarea {
  resize: vertical;
}

.form-control:focus {
  outline: none;
  border-color: #5d8fff;
  box-shadow: 0 0 0 3px rgba(15, 98, 254, 0.12);
}

.form-control.tone-danger {
  border-color: #efb4b4;
  background: #fff4f4;
}

.form-control.tone-warn {
  border-color: #f0d28a;
  background: #fff8e4;
}

.form-control.tone-good {
  border-color: #b7e0c0;
  background: #f0fbf3;
}

.form-control.tone-info {
  border-color: #cfddff;
  background: #eef5ff;
}

.form-control.tone-neutral {
  border-color: #cfd7e2;
  background: #f8fbff;
}

.form-control.tone-empty {
  background: #ffffff;
}

.form-control.auto-locked {
  border-style: dashed;
  background: #eef6ff;
}

.btn {
  display: inline-block;
  padding: 10px 14px;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.btn:hover {
  opacity: 0.94;
}

.btn-light {
  background: white;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-danger { background: var(--danger); }
.btn-small { padding: 6px 10px; font-size: 12px; }

.editor-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-chip {
  border-radius: 14px;
  padding: 14px;
  border: 1px solid transparent;
}

.summary-chip span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.summary-chip strong {
  display: block;
  font-size: 16px;
}

.chip-blue { background: var(--info-bg); color: var(--info); border-color: #c8dcff; }
.chip-red { background: var(--danger-bg); color: var(--danger); border-color: #f3c3c3; }
.chip-green { background: var(--success-bg); color: var(--success); border-color: #c7e7cf; }
.chip-amber { background: var(--warn-bg); color: var(--warn); border-color: #f2dfab; }
.chip-slate { background: var(--slate-bg); color: #40576f; border-color: #d1dbe7; }
.chip-docs { background: var(--docs-bg); color: var(--docs); border-color: #dfd0ff; }

.project-form { display: flex; flex-direction: column; gap: 4px; }

.section-card {
  overflow: hidden;
  padding-top: 0;
}

.section-head {
  margin: 0 -18px 16px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.section-head h3 { margin: 0; }
.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.section-customer .section-head { background: #eef6ff; }
.section-planning .section-head { background: #f1f7ff; }
.section-workflow .section-head { background: #fff6e8; }
.section-technical .section-head { background: #eefaf1; }
.section-final .section-head { background: #eef7f6; }
.section-notes .section-head { background: #f7f1ff; }
.section-materials-advanced .section-head { background: #fff8ef; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  grid-column: span 3;
}

.field-wide {
  grid-column: span 6;
}

.field label {
  font-weight: 700;
  font-size: 13px;
}

.help-text {
  color: var(--muted);
  font-size: 12px;
}

.actions { grid-column: 1 / -1; }

.sticky-actions {
  position: sticky;
  bottom: 12px;
  z-index: 5;
}

.sticky-actions-inner {
  position: static;
  padding: 0;
  border: 0;
  box-shadow: none;
  margin-top: 18px;
  background: transparent;
}

.actions-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.actions-copy strong {
  display: block;
  margin-bottom: 4px;
}

.actions-copy span {
  color: var(--muted);
  font-size: 14px;
}

.side-card h3 { margin-top: 0; }
.side-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}
.side-list li { margin-bottom: 10px; }
.compact-list li { margin-bottom: 8px; }

.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}
.dot-red { background: var(--danger); }
.dot-amber { background: #d19a00; }
.dot-green { background: var(--success); }
.dot-slate { background: #5a6d84; }
.dot-docs { background: var(--docs); }

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-1 { background: #ffd8d8; color: #8a1414; }
.badge-2 { background: #d9f2dd; color: #0e5c1e; }
.badge-3 { background: #efe7ff; color: #5d2db5; }
.badge-4, .badge-5 { background: #fff2cc; color: #8b6508; }
.badge-6, .badge-99 { background: #e5edf6; color: #3d556d; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.calendar-head {
  font-weight: 700;
  text-align: center;
  padding: 10px;
}

.calendar-cell {
  min-height: 130px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
}

.calendar-muted { opacity: 0.5; }
.calendar-date { font-weight: 700; margin-bottom: 8px; }

.calendar-item {
  display: block;
  padding: 6px 8px;
  border-radius: 10px;
  margin-bottom: 6px;
  color: #1a1a1a;
  font-size: 12px;
}

.calendar-item.badge-1 { background: #ffd8d8; }
.calendar-item.badge-2 { background: #d9f2dd; }
.calendar-item.badge-3 { background: #efe7ff; }
.calendar-item.badge-4,
.calendar-item.badge-5,
.calendar-item.badge-6,
.calendar-item.badge-99 { background: #e5edf6; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.detail-grid-wide {
  margin-bottom: 16px;
}

.detail-material-group + .detail-material-group {
  margin-top: 18px;
}

.auth-box { max-width: 460px; margin: 40px auto; }

.message {
  background: #d9f2dd;
  border: 1px solid #b7ddbd;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.error-box {
  background: #fff4f4;
  border-color: #f3c3c3;
}

.error { color: var(--danger); }

.userbox {
  display: flex;
  gap: 12px;
  align-items: center;
}

.filter-card {
  margin-bottom: 12px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.filter-grid-projects .field-wide {
  grid-column: span 6;
}

.filter-field {
  grid-column: span 2;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.chip-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud-inline {
  margin-bottom: 14px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: #eef5ff;
  color: #2f4d7a;
  padding: 7px 11px;
  font-size: 12px;
  border: 1px solid #d6e2f3;
}

.tag-chip-label {
  background: #f6f8fb;
  color: var(--muted);
}

.tag-chip-brand {
  background: #eefaf1;
  border-color: #d6eadb;
  color: #1d6b35;
}

.tag-chip-warn {
  background: var(--warn-bg);
  border-color: #f3e0a9;
  color: #916800;
}

.tag-chip-active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.material-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.material-table-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.2fr 0.7fr 0.7fr 1fr 1.3fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.material-table-head {
  font-weight: 700;
  background: #f1f6fc;
}

.material-form-row-auto {
  background: #f2f8ff;
}

.material-row-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.material-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.is-hidden {
  display: none;
}

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

.actions-cell a + a {
  margin-left: 8px;
}

.pagination-bar {
  display: flex;
  justify-content: center;
}

.pagination-links {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.pagination-copy {
  color: var(--muted);
  font-weight: 700;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.config-card {
  color: inherit;
  display: block;
}

.config-card:hover {
  border-color: #b9cbe4;
}

.config-copy {
  color: var(--muted);
  margin-top: 0;
}

.quick-choice-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 0.6fr 1fr 0.5fr 0.5fr;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.quick-choice-grid-head {
  font-weight: 700;
  color: var(--muted);
}

.quick-choice-row:last-of-type {
  border-bottom: 0;
}

.toggle-cell {
  display: flex;
  justify-content: center;
}

.toggle-box {
  width: 20px;
  height: 20px;
}

@media (max-width: 1180px) {
  .editor-shell {
    grid-template-columns: 1fr;
  }
  .filter-field {
    grid-column: span 3;
  }
}

@media (max-width: 980px) {
  .field { grid-column: span 6; }
  .field-wide { grid-column: span 12; }
  .filter-field, .filter-grid-projects .field-wide {
    grid-column: span 6;
  }
  .actions-inner, .page-head, .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .material-table-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quick-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .nav { gap: 10px; }
  .calendar-grid { grid-template-columns: 1fr; }
  .field, .field-wide, .filter-field, .filter-grid-projects .field-wide { grid-column: span 12; }
  .search-inline {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .material-table-head {
    display: none;
  }
  .material-table-row {
    grid-template-columns: 1fr;
  }
  .quick-choice-grid, .quick-choice-grid-head {
    grid-template-columns: 1fr;
  }
}

.product-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.4fr 0.7fr 0.7fr 0.7fr 0.8fr 0.6fr 0.6fr 0.5fr 0.5fr 0.5fr 1.4fr;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.product-grid-head { font-weight: 700; color: var(--muted); }
.product-row:last-of-type { border-bottom: 0; }
.material-table-row-v2 { grid-template-columns: 0.9fr 1.4fr 1fr 1.3fr 0.6fr 0.6fr 0.9fr 1.3fr 1.2fr 0.7fr; }
.material-table-v2 .material-form-row { align-items: start; }
.spec-box { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; background: #f7fafc; min-height: 60px; }
.spec-box strong { display: block; margin-bottom: 4px; }
.spec-box small { color: var(--muted); line-height: 1.4; display: block; }
.spec-box-active { border-style: solid; background: #eef6ff; }
.sticky-actions-inner { margin-top: 16px; }
@media (max-width: 1180px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .material-table-row-v2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .product-grid, .product-grid-head { grid-template-columns: 1fr; }
  .material-table-row-v2 { grid-template-columns: 1fr; }
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.procurement-create-grid .field-wide,
.procurement-meta-grid .field-wide {
  grid-column: span 5;
}

.procurement-toolbar {
  margin: 14px 0 12px;
}

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

.procurement-table input[type="text"],
.procurement-table input[type="number"],
.procurement-table select,
.procurement-table textarea {
  width: 100%;
}

.procurement-item-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.procurement-manual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.procurement-source-row td {
  background: #fbfdff;
  border-bottom-style: dashed;
}

.procurement-manual-row {
  background: #fffaf0;
}

.delete-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.mini-list-tight {
  max-height: 420px;
  overflow: auto;
}

.procurement-lines-card {
  overflow: hidden;
}

@media (max-width: 980px) {
  .procurement-manual-grid {
    grid-template-columns: 1fr;
  }
}

.procurement-pagination {
  margin-top: 14px;
}

.procurement-brand-card {
  margin-top: 18px;
}

.procurement-brand-groups {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.procurement-brand-box {
  border: 1px solid var(--line);
  background: #fbfdff;
}

.procurement-brand-table th,
.procurement-brand-table td {
  vertical-align: top;
}

.procurement-copy-box {
  margin-top: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}

.procurement-copy-textarea {
  width: 100%;
  min-height: 160px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  resize: vertical;
}

@media (max-width: 720px) {
  .procurement-copy-box .panel-head {
    align-items: flex-start;
  }
}

.procurement-shell {
  position: relative;
}

.procurement-shell.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

.procurement-shell.is-loading::after {
  content: 'Aggiornamento tabella...';
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.18);
}

.inline-actions-compact {
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.procurement-copy-box-master {
  margin-top: 18px;
}

.procurement-copy-textarea-master {
  min-height: 220px;
}

.procurement-transfer-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.procurement-transfer-grid .field:last-child {
  max-width: 220px;
}

.procurement-transfer-meta p,
.procurement-transfer-help p {
  margin: 0 0 10px;
  color: var(--muted);
}

.procurement-transfer-form {
  gap: 18px;
}

@media (max-width: 900px) {
  .procurement-transfer-grid {
    grid-template-columns: 1fr;
  }

  .procurement-transfer-grid .field:last-child {
    max-width: none;
  }
}

.seu-kpis {
  margin-bottom: 18px;
}

.seu-table-wrap {
  overflow-x: auto;
}

.seu-table {
  min-width: 1180px;
}

.seu-composition-cell {
  min-width: 360px;
  white-space: normal;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .seu-composition-cell {
    min-width: 280px;
  }
}

.editor-shell-wide {
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.7fr);
}

.section-head-tight {
  align-items: flex-start;
}

.section-head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.section-technical-live {
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
}

.tech-live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.tech-live-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tech-live-card span,
.tech-live-card small {
  color: var(--muted);
}

.tech-live-card strong {
  font-size: 24px;
  color: var(--text);
}

.tech-composition-box {
  border: 1px solid #d8e4f3;
  border-radius: 14px;
  background: #f4f8fd;
  padding: 16px;
  margin-bottom: 18px;
}

.tech-composition-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tech-composition-copy {
  line-height: 1.6;
  font-weight: 700;
}

.tech-section-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tech-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: baseline;
}

.tech-category-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.tech-category-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}

.tech-category-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.tech-category-card-head span {
  color: var(--muted);
  font-size: 12px;
}

.tech-category-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tech-category-card li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid #eef2f8;
}

.tech-category-card li:first-child {
  border-top: 0;
  padding-top: 0;
}

.tech-category-card li small {
  color: var(--muted);
}

.material-table-v2 {
  gap: 10px;
}

.material-table-row-v2 {
  grid-template-columns: 0.9fr 1.2fr 1.9fr 0.55fr 0.8fr 1.15fr auto;
}

.material-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.material-cell-detail {
  gap: 10px;
}

.material-detail-summary {
  border: 1px dashed #cdd9ea;
  border-radius: 12px;
  background: #f7fafe;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.material-detail-summary small {
  color: var(--muted);
}

.material-detail-manual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.material-detail-manual-grid > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.material-detail-manual-grid label {
  font-size: 12px;
  color: var(--muted);
}

.material-row-linked .material-detail-summary {
  background: #eefaf1;
  border-color: #d6eadb;
}

.empty-note {
  border: 1px dashed #cad6e6;
  border-radius: 14px;
  background: #f8fbff;
  padding: 16px;
  color: var(--muted);
}

@media (max-width: 1280px) {
  .material-table-row-v2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .editor-shell-wide {
    grid-template-columns: 1fr;
  }
  .material-detail-manual-grid {
    grid-template-columns: 1fr;
  }
}

.docs-pending-group {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
  overflow: hidden;
}

.docs-pending-group summary {
  list-style: none;
  cursor: pointer;
}

.docs-pending-group summary::-webkit-details-marker {
  display: none;
}

.docs-pending-group[open] summary {
  border-bottom: 1px solid var(--line);
}

.mini-item-clickable {
  cursor: pointer;
}

.docs-pending-group-body {
  padding: 12px 14px;
}

.docs-pending-project-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.docs-pending-project-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.docs-pending-project-row small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.45;
}

.service-policy-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.service-policy-box strong {
  color: var(--text);
}

.service-policy-box small {
  color: var(--muted);
  line-height: 1.45;
}

.service-success {
  background: var(--success-bg);
  border-color: #c7e7cf;
}

.service-danger {
  background: var(--danger-bg);
  border-color: #f3c3c3;
}

.service-warn {
  background: var(--warn-bg);
  border-color: #f2dfab;
}

.service-neutral {
  background: var(--slate-bg);
  border-color: #d1dbe7;
}

.top-gap-small {
  margin-top: 12px;
}

@media (max-width: 900px) {
  .docs-pending-project-row {
    flex-direction: column;
  }
}

.async-table-shell {
  position: relative;
}

.async-table-shell.is-loading {
  opacity: 0.68;
  pointer-events: none;
}

.async-table-shell.is-loading::after {
  content: attr(data-loading-text);
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.18);
}

.docs-ops-card {
  display: grid;
  gap: 16px;
}

.docs-ops-form {
  display: grid;
  gap: 14px;
}

.docs-table-wrap td small {
  color: var(--muted);
  line-height: 1.45;
}

.docs-pagination {
  margin-top: 4px;
}

@media (max-width: 900px) {
  .docs-ops-card .panel-head {
    align-items: flex-start;
  }
}

.project-ops-card {
  margin-bottom: 16px;
}

.batch-edit-card {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.batch-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.batch-edit-section {
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.batch-edit-section h4 {
  margin: 0;
  font-size: 17px;
}

.batch-scope-field {
  max-width: 360px;
}

.helper-inline {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.checkbox-col {
  width: 52px;
  text-align: center;
}

.form-error {
  color: #b42318;
  font-size: 12px;
  margin-top: 6px;
}

@media (max-width: 900px) {
  .batch-summary {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Phase 12 - sospensione progetto e cancellazione sicura */
.row-suspended {
  background: #f8fafc;
  color: #64748b;
}

.row-suspended td {
  border-color: #e2e8f0;
}

.badge-98 {
  background: #e2e8f0;
  color: #334155;
}

.section-suspended-active {
  border-color: #f97316 !important;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.10);
}

.link-danger {
  color: #b42318 !important;
  font-weight: 700;
}

.danger-zone-card {
  border: 1px solid #fecaca;
  background: #fff7f7;
}

.summary-strip-tight {
  margin: 12px 0;
}

.kpi-link {
  text-decoration: none;
  color: inherit;
}

.kpi-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}


/* phase15 kpi links */
.kpi-link { color: inherit; text-decoration: none; cursor: pointer; }
.kpi-link:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(15, 23, 42, .12); }
.print-margin-note { display: none; }


/* phase16 access UI */
.auth-shell { min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.auth-card { width: min(460px, 100%); padding: 28px; }
.auth-card h2 { margin-top: 0; }
.auth-link { margin-top: 16px; }
.user-form-card { max-width: 980px; }
.userbox { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.error-box { border-left: 4px solid #dc2626; background: #fee2e2; }


/* phase16.1 user role visibility */
.role-selector-box { border: 1px solid rgba(15, 23, 42, .12); border-radius: 16px; padding: 18px; margin-bottom: 18px; background: linear-gradient(135deg, rgba(219,234,254,.65), rgba(248,250,252,.95)); }
.role-selector-box label { display: block; font-weight: 800; margin-bottom: 8px; }
.role-selector-box select { font-size: 1rem; font-weight: 700; }
.role-help-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.role-help-grid span { border: 1px solid rgba(15, 23, 42, .10); border-radius: 12px; padding: 9px 10px; background: #fff; font-size: .86rem; }
@media (max-width: 900px) { .role-help-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .role-help-grid { grid-template-columns: 1fr; } }

/* phase18-settings-graph */
.settings-hub-grid a.card { text-decoration: none; color: inherit; }
.settings-hub-card { transition: transform .15s ease, box-shadow .15s ease; }
.settings-hub-card:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(15, 23, 42, .10); }
.settings-hub-eyebrow { display: inline-block; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: #64748b; margin-bottom: .35rem; }
.settings-hub-card h3 { margin-top: 0; }
.email-method-panel { margin-top: 1rem; }
.email-method-graph { border-left: 4px solid #2563eb; padding-left: 1rem; }
.email-method-smtp { border-left: 4px solid #64748b; padding-left: 1rem; }

/* PHASE19A_OPERATIONAL_RULES */
.row-blocked {
    background: #f8fafc;
    border-left: 4px solid #94a3b8;
}
.row-blocked td,
.row-blocked .muted {
    color: #475569;
}
.pill-blocked,
.mini-badge.blocked,
.tag-chip-blocked {
    background: #e2e8f0;
    color: #334155;
    border-color: #94a3b8;
}
/* /PHASE19A_OPERATIONAL_RULES */

/* PHASE19A1_ADMIN_OK_DASHBOARD */
.kpi-link { color: inherit; text-decoration: none; cursor: pointer; }
.kpi-link:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(15, 23, 42, .12); }
.pill-amber { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
.panel-amber { border-top: 4px solid #f59e0b; }
/* /PHASE19A1_ADMIN_OK_DASHBOARD */

/* PHASE19B_PROJECT_SECTIONS */
.section-project-sections {
    border-left: 4px solid #2563eb;
}
.section-formset-grid {
    display: grid;
    gap: 12px;
}
.card-soft,
.section-detail-card {
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    padding: 14px;
    background: #f8fafc;
}
.section-mini-grid {
    grid-template-columns: 90px minmax(180px, 1fr) 160px 180px minmax(260px, 2fr) 90px 80px;
}
.section-delete-field {
    align-self: end;
}
.material-cell-section select {
    min-width: 150px;
}
.section-detail-card + .section-detail-card {
    margin-top: 10px;
}
.section-detail-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: baseline;
    margin-bottom: 8px;
}
.section-detail-head span {
    color: #475569;
    font-size: .9rem;
}
@media (max-width: 1100px) {
    .section-mini-grid {
        grid-template-columns: 1fr 1fr;
    }
}
/* /PHASE19B_PROJECT_SECTIONS */

/* PHASE19B_WAITING_ADMIN_TECH_METRICS */
.kpi-link { color: inherit; text-decoration: none; cursor: pointer; }
.kpi-link:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(15, 23, 42, .12); }
.pill-amber { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
.panel-amber { border-top: 4px solid #f59e0b; }
.panel-head small { color: #64748b; font-size: .86rem; }
/* /PHASE19B_WAITING_ADMIN_TECH_METRICS */

/* PHASE19B2_UI_SECTIONS_DASHBOARD */
.section-formset-hidden,
.section-form-row-hidden,
.material-cell-section-hidden,
.hidden-field { display: none !important; }
.section-project-sections-simple .section-current-summary {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    margin-bottom: 1rem;
    border-left: 4px solid #2563eb;
}
.section-row-title {
    font-weight: 800;
    color: #1e293b;
    margin-bottom: .65rem;
}
.kpi-dashboard-groups {
    display: grid;
    grid-template-columns: repeat(4, minmax(230px, 1fr));
    gap: 1rem;
    align-items: stretch;
    width: 100%;
}
.kpi-group-card {
    background: #f8fafc;
    border: 1px solid #dbe5f2;
    border-radius: 18px;
    padding: .8rem;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .05);
}
.kpi-group-head {
    margin-bottom: .7rem;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}
.kpi-group-head strong {
    font-size: .95rem;
    color: #17243a;
}
.kpi-group-head small {
    color: #64748b;
    font-size: .78rem;
}
.kpi-group-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
}
.kpi-group-grid .kpi {
    min-height: 112px;
    margin: 0;
}
@media (max-width: 1350px) {
    .kpi-dashboard-groups { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
}
@media (max-width: 760px) {
    .kpi-dashboard-groups { grid-template-columns: 1fr; }
    .kpi-group-grid { grid-template-columns: 1fr; }
}
/* /PHASE19B2_UI_SECTIONS_DASHBOARD */

/* PHASE20A_SEZIONI_INTERVENTO */
.section-project-sections-simple .section-current-summary strong::before {
    content: '✓ ';
    color: #16a34a;
}
.section-project-sections-simple .section-mini-grid {
    grid-template-columns: 160px 1fr 1fr;
}
.section-project-sections-simple .section-mini-grid .field-wide {
    grid-column: 1 / -1;
}
.section-project-sections-simple .hidden-field,
.section-project-sections-simple .section-form-row-hidden,
.material-cell-section-hidden {
    display: none !important;
}
.section-suspension {
    border-color: #cbd5e1;
    background: linear-gradient(180deg, #f8fafc, #ffffff);
}
@media (max-width: 900px) {
    .section-project-sections-simple .section-mini-grid { grid-template-columns: 1fr; }
}
/* /PHASE20A_SEZIONI_INTERVENTO */

/* PHASE20A_FIX_INTERVENTO_SOSPENSIONE */
.section-suspension-bottom {
    margin-top: 24px;
    border-color: #cbd5e1;
    background: linear-gradient(180deg, #f8fafc, #ffffff);
}
.section-suspension-bottom textarea {
    min-height: 96px;
}
/* /PHASE20A_FIX_INTERVENTO_SOSPENSIONE */

/* Hotfix fase 20A: nasconde la vecchia scheda sospensione renderizzata nel blocco sezioni standard */
.section-card.section-suspension:not(.section-suspension-bottom) {
    display: none !important;
}

.section-suspension-bottom {
    border-color: #d6e0ef;
    background: #ffffff;
}

.section-suspension-bottom .section-head {
    background: #f8fafc;
}

/* PHASE20A_STABLE_SUSPENSION_BOTTOM_START */
.section-card.section-suspension:not(.section-suspension-bottom) {
    display: none !important;
}
.section-suspension-bottom {
    border-color: #cbd5e1;
    background: #ffffff;
}
.section-suspension-bottom .section-head {
    background: #f8fafc;
}
.section-suspension-bottom .field-checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}
.section-suspension-bottom textarea {
    min-height: 90px;
}
/* PHASE20A_STABLE_SUSPENSION_BOTTOM_END */

/* PHASE20A2_EXISTING_SECTIONS */
.phase20a2-hidden {
    display: none !important;
}

.phase20a2-existing-sections {
    border-color: #d6e0ef;
    background: #ffffff;
}

.existing-sections-toolbar {
    display: grid;
    grid-template-columns: minmax(240px, 320px) 1fr;
    gap: 18px;
    padding: 18px;
    align-items: end;
}

.existing-section-summary {
    border: 1px solid #d8e4f2;
    border-radius: 14px;
    background: #f8fafc;
    padding: 14px 16px;
    color: #24364a;
}

.existing-section-slots {
    padding: 0 18px 18px;
    display: grid;
    gap: 14px;
}

.existing-section-row {
    border: 1px solid #d8e4f2;
    border-radius: 16px;
    background: #fbfdff;
    padding: 14px;
}

.existing-section-row-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.section-suspension-bottom {
    border-color: #d6e0ef;
    background: #ffffff;
}

.section-card.section-suspension:not(.section-suspension-bottom) {
    display: none !important;
}

@media (max-width: 900px) {
    .existing-sections-toolbar {
        grid-template-columns: 1fr;
    }
}
/* /PHASE20A2_EXISTING_SECTIONS */



/* PHASE20B_QUALITY_DASHBOARD */
.quality-kpis .kpi-red { border-left-color: #c0392b; }
.quality-kpis .kpi-amber { border-left-color: #d99a16; }
.quality-details {
    border: 1px solid #dbe5f2;
    border-radius: 14px;
    margin: 12px 0;
    background: #f8fbff;
    overflow: hidden;
}
.quality-details summary {
    cursor: pointer;
    padding: 13px 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #223246;
}
.quality-list {
    border-top: 1px solid #dbe5f2;
    display: grid;
    gap: 8px;
    padding: 12px;
}
.quality-row {
    border: 1px solid #dbe5f2;
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
}
.quality-row a { font-weight: 800; white-space: nowrap; }
.quality-critical { border-left: 4px solid #c0392b; }
.quality-warning { border-left: 4px solid #d99a16; }
/* /PHASE20B_QUALITY_DASHBOARD */


/* phase20d-history */
.history-list { display: grid; gap: 12px; padding: 18px; }
.history-item { display: grid; grid-template-columns: 120px 1fr; gap: 16px; border: 1px solid #d8e4f2; border-radius: 16px; background: #fbfdff; padding: 14px; }
.history-time { color: #64748b; display: grid; align-content: start; gap: 4px; }
.history-title-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.history-body p { margin: 8px 0; }
.history-details { margin-top: 10px; }
.history-fields { display: grid; gap: 6px; margin-top: 8px; }
.history-field-row { display: grid; grid-template-columns: 180px 1fr auto 1fr; gap: 8px; align-items: start; border-top: 1px solid #e5edf7; padding-top: 6px; }
.old-value { color: #991b1b; word-break: break-word; }
.new-value { color: #166534; word-break: break-word; }
@media (max-width: 900px) { .history-item { grid-template-columns: 1fr; } .history-field-row { grid-template-columns: 1fr; } }
/* /phase20d-history */


/* PHASE20F_DASHBOARD_QUALITY */
.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 18px 0;
}
.dashboard-group {
    padding: 0;
    overflow: hidden;
}
.dashboard-group-head {
    padding: 16px 18px 10px;
    border-bottom: 1px solid #e6edf5;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}
.dashboard-group-head h3 { margin: 0; }
.dashboard-group-head small { color: #64748b; font-weight: 700; }
.dashboard-group-kpis { display: grid; gap: 0; }
.kpi-mini {
    display: block;
    padding: 14px 18px;
    border-bottom: 1px solid #eef3f8;
    color: inherit;
    text-decoration: none;
    background: #fff;
}
.kpi-mini:hover { background: #f8fbff; }
.kpi-mini span { display: block; color: #64748b; font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.kpi-mini strong { display: block; font-size: 1.65rem; line-height: 1.1; margin-top: 4px; color: #0f172a; }
.kpi-mini small { display: block; color: #64748b; margin-top: 4px; }
.group-commesse { border-top: 4px solid #2563eb; }
.group-admin { border-top: 4px solid #f59e0b; }
.group-operativa { border-top: 4px solid #16a34a; }
.group-controlli { border-top: 4px solid #64748b; }
.kpi-mini-red strong { color: #b91c1c; }
.kpi-mini-amber strong { color: #b45309; }
.kpi-mini-orange strong { color: #c2410c; }
.kpi-mini-green strong { color: #15803d; }
.kpi-mini-blue strong { color: #1d4ed8; }
.kpi-mini-slate strong { color: #475569; }
.kpi-mini-docs strong { color: #6d28d9; }
.dashboard-note-card { margin: 18px 0; background: #f8fafc; border-color: #dbe5f2; }
.panel-amber { border-top: 4px solid #f59e0b; }
.pill-amber { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
@media (max-width: 1100px) {
    .dashboard-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .dashboard-summary-grid { grid-template-columns: 1fr; }
}
/* /PHASE20F_DASHBOARD_QUALITY */


/* Fase 21A - menu acquisti e ordini fornitore */
.nav-menu { position: relative; display: inline-flex; align-items: center; }
.nav-menu-button { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; padding: .65rem .8rem; border-radius: 999px; }
.nav-menu-button:hover { background: rgba(15, 23, 42, .08); }
.nav-menu-panel { display: none; position: absolute; top: 100%; left: 0; min-width: 220px; background: #fff; border: 1px solid #d6e0ef; border-radius: 14px; box-shadow: 0 16px 40px rgba(15, 23, 42, .12); padding: .45rem; z-index: 30; }
.nav-menu:hover .nav-menu-panel, .nav-menu:focus-within .nav-menu-panel { display: grid; gap: .25rem; }
.nav-menu-panel a { display: block; padding: .65rem .8rem; border-radius: 10px; white-space: nowrap; }
.copy-area { width: 100%; min-height: 180px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .95rem; border: 1px solid #d6e0ef; border-radius: 12px; padding: .85rem; }
.mini-input { max-width: 90px; padding: .35rem .45rem; border: 1px solid #d6e0ef; border-radius: 8px; }
.danger-zone { border-color: #fecaca; }

/* Fase 21B - menu principale pulito */
.nav {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
}
.nav > a,
.nav-dropdown-main {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: .55rem .78rem;
    border-radius: 999px;
    color: inherit;
    text-decoration: none;
    line-height: 1;
    font: inherit;
    background: transparent;
    border: 0;
    cursor: pointer;
}
.nav > a:hover,
.nav-dropdown:hover .nav-dropdown-main,
.nav-dropdown:focus-within .nav-dropdown-main {
    background: rgba(15, 23, 42, .08);
}
.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
}
.nav-dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 235px;
    background: #fff;
    border: 1px solid #d6e0ef;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .12);
    padding: .45rem;
    z-index: 50;
}
.nav-dropdown:hover .nav-dropdown-panel,
.nav-dropdown:focus-within .nav-dropdown-panel {
    display: grid;
    gap: .25rem;
}
.nav-dropdown-panel a {
    display: block;
    padding: .65rem .78rem;
    border-radius: 10px;
    color: #1f2937;
    text-decoration: none;
    white-space: nowrap;
}
.nav-dropdown-panel a:hover {
    background: #f1f5f9;
}
/* Evita che vecchi dropdown fase 21A alterino la grafica del menu */
.nav-menu.nav-acquisti-group { display: none !important; }


/* Spegne residui dei vecchi menu acquisti inseriti in modo inline */
.nav-menu.nav-acquisti-group,
.nav-acquisti-clean > .nav-dropdown-main,
.nav-acquisti-clean > .nav-dropdown-panel {
    display: none !important;
}

/* Fase 21C.2 - menu principale definitivo e dropdown Acquisti verticale */
nav.nav,
.nav.usolar-main-nav,
.usolar-main-nav {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 1.25rem !important;
    flex-wrap: wrap !important;
    min-height: 58px !important;
    padding: 0 1.5rem !important;
    overflow: visible !important;
}

.usolar-main-nav > a.main-nav-link,
.usolar-main-nav > .main-nav-dropdown,
.usolar-main-nav > .main-nav-dropdown > a.main-nav-link {
    height: 42px !important;
    min-height: 42px !important;
    line-height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #0057ff !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    font: inherit !important;
    cursor: pointer !important;
}

.usolar-main-nav > .main-nav-dropdown {
    position: relative !important;
    flex: 0 0 auto !important;
    overflow: visible !important;
}

.usolar-main-nav .main-nav-dropdown-toggle::after {
    content: '▾';
    display: inline-block;
    margin-left: .35rem;
    font-size: .72em;
    line-height: 1;
    transform: translateY(-1px);
    opacity: .75;
}

.usolar-main-nav .main-nav-dropdown-panel {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    right: auto !important;
    z-index: 5000 !important;
    min-width: 245px !important;
    max-width: 340px !important;
    width: max-content !important;
    display: none !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: .25rem !important;
    padding: .45rem !important;
    margin: 0 !important;
    background: #ffffff !important;
    border: 1px solid #d6e0ef !important;
    border-radius: 14px !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .16) !important;
}

.usolar-main-nav .main-nav-dropdown:hover > .main-nav-dropdown-panel,
.usolar-main-nav .main-nav-dropdown:focus-within > .main-nav-dropdown-panel {
    display: flex !important;
}

.usolar-main-nav .main-nav-dropdown-panel > a {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    line-height: 1.25 !important;
    padding: .72rem .85rem !important;
    margin: 0 !important;
    border-radius: 10px !important;
    color: #1f2937 !important;
    background: transparent !important;
    text-decoration: none !important;
    text-align: left !important;
    white-space: nowrap !important;
}

.usolar-main-nav .main-nav-dropdown-panel > a:hover,
.usolar-main-nav .main-nav-dropdown-panel > a:focus {
    background: #f1f5f9 !important;
    color: #0057ff !important;
}

/* Spegne strutture vecchie che aprivano Acquisti in orizzontale */
.usolar-main-nav details.nav-dropdown,
.usolar-main-nav details.nav-acquisti-menu,
.usolar-main-nav .nav-dropdown-panel:not(.main-nav-dropdown-panel),
.usolar-main-nav .nav-menu.nav-acquisti-group,
.usolar-main-nav .nav-acquisti-clean,
.usolar-main-nav .nav-dropdown-main {
    display: none !important;
}

@media (max-width: 900px) {
    nav.nav,
    .nav.usolar-main-nav,
    .usolar-main-nav {
        gap: .75rem !important;
        padding: .55rem 1rem !important;
    }
    .usolar-main-nav .main-nav-dropdown-panel {
        position: absolute !important;
        left: 0 !important;
    }
}

@media (max-width: 640px) {
    .usolar-main-nav {
        align-items: flex-start !important;
    }
    .usolar-main-nav .main-nav-dropdown {
        width: 100% !important;
        justify-content: flex-start !important;
    }
    .usolar-main-nav .main-nav-dropdown-panel {
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        box-shadow: none !important;
        margin-top: .25rem !important;
    }
}

/* Fase 21C.3 - dropdown Acquisti stabile: niente gap, hover e click persistente */
.usolar-main-nav > .main-nav-dropdown {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 42px !important;
    min-height: 42px !important;
    overflow: visible !important;
    z-index: 6000 !important;
}

.usolar-main-nav > .main-nav-dropdown > .main-nav-dropdown-toggle {
    height: 42px !important;
    min-height: 42px !important;
    line-height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .35rem !important;
    padding: 0 !important;
    margin: 0 !important;
    vertical-align: middle !important;
}

.usolar-main-nav .main-nav-dropdown-panel {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: auto !important;
    margin-top: 0 !important;
    transform: translateY(0) !important;
    z-index: 7000 !important;
    display: none !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    min-width: 250px !important;
    max-width: 360px !important;
    width: max-content !important;
    padding: .5rem !important;
    background: #ffffff !important;
    border: 1px solid #d6e0ef !important;
    border-radius: 0 0 14px 14px !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .16) !important;
    pointer-events: auto !important;
}

.usolar-main-nav .main-nav-dropdown:hover > .main-nav-dropdown-panel,
.usolar-main-nav .main-nav-dropdown:focus-within > .main-nav-dropdown-panel,
.usolar-main-nav .main-nav-dropdown.is-open > .main-nav-dropdown-panel {
    display: flex !important;
}

.usolar-main-nav .main-nav-dropdown-panel > a {
    display: block !important;
    width: 100% !important;
    padding: .72rem .85rem !important;
    line-height: 1.25 !important;
    text-align: left !important;
    white-space: nowrap !important;
    color: #1f2937 !important;
    background: transparent !important;
    border-radius: 10px !important;
    text-decoration: none !important;
}

.usolar-main-nav .main-nav-dropdown-panel > a:hover,
.usolar-main-nav .main-nav-dropdown-panel > a:focus {
    background: #f1f5f9 !important;
    color: #0057ff !important;
}

/* evita che regole vecchie riaprano i figli acquisti in orizzontale */
.usolar-main-nav .main-nav-dropdown-panel {
    flex-wrap: nowrap !important;
}

@media (max-width: 640px) {
    .usolar-main-nav > .main-nav-dropdown {
        width: auto !important;
    }
    .usolar-main-nav .main-nav-dropdown-panel {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        width: max-content !important;
    }
}


/* Fase 23A - elenchi cantiere */
.catalog-card,
.catalog-form-card,
.soft-note {
  width: 100%;
}

.catalog-filter-row {
  display: flex;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
}

.catalog-filter-row .field {
  min-width: 280px;
  max-width: 520px;
  flex: 1 1 320px;
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #203348;
  padding: 10px 0;
}

.catalog-table td,
.catalog-table th {
  vertical-align: middle;
}

.color-chip {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--chip-color, #2563eb);
  border: 1px solid rgba(0,0,0,.15);
  vertical-align: middle;
  margin-right: 8px;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.row-actions form {
  display: inline;
  margin: 0;
}

