:root {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #17231d;
  background: #f3f6f4;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, #e0eee6, transparent 38%),
    #f3f6f4;
}

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

.page {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 40px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page.is-wide-data-page {
  width: min(1520px, calc(100% - 32px));
}

.auth-shell {
  width: min(100%, 1080px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, 470px);
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #d7e2db;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 28px 90px rgba(27, 54, 39, 0.14);
}

.auth-shell.is-onboarding {
  width: min(100%, 1180px);
  grid-template-columns: minmax(310px, 0.72fr) minmax(600px, 1.28fr);
}

.auth-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 650px;
  padding: 54px;
  color: #f7fbf8;
  background:
    radial-gradient(circle at 8% 4%, rgba(147, 207, 171, 0.22), transparent 34%),
    linear-gradient(145deg, #153d29 0%, #245b3e 100%);
}

.auth-intro .brand h1,
.auth-intro .brand p { color: #ffffff; }

.auth-intro .brand-mark {
  color: #163e2a;
  background: #ffffff;
}

.auth-intro h2 {
  max-width: 580px;
  margin: 22px 0 14px;
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.auth-intro > p {
  max-width: 570px;
  margin: 0;
  color: #dbece2;
  font-size: 16px;
  line-height: 1.65;
}

.public-beta-badge {
  width: fit-content;
  margin-top: 46px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.auth-benefits {
  display: grid;
  gap: 12px;
  margin: 28px 0;
  padding: 0;
  list-style: none;
}

.auth-benefits li {
  position: relative;
  padding-left: 30px;
  color: #f5faf7;
  font-weight: 650;
}

.auth-benefits li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: -2px;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #173e2a;
  background: #bfe2cb;
  font-size: 12px;
  font-weight: 900;
}

.auth-intro .auth-beta-copy {
  margin-top: 12px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: #c8ddd0;
  font-size: 13px;
}

.auth-card {
  width: 100%;
  padding: 36px;
  background: #ffffff;
}

.auth-mobile-brand { display: none; }

.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 32px;
  padding: 5px;
  border-radius: 12px;
  background: #eef3ef;
}

.auth-mode-button {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  color: #627069;
  background: transparent;
  font-weight: 750;
}

.auth-mode-button.active {
  color: #183e2b;
  background: #ffffff;
  box-shadow: 0 3px 12px rgba(28, 58, 41, 0.09);
}

.auth-pane-heading { margin-bottom: 26px; }
.auth-pane-heading h2 {
  margin: 0;
  color: #17231d;
  font-size: 27px;
  letter-spacing: -0.025em;
}
.auth-pane-heading > p:last-child {
  margin: 9px 0 0;
  color: #68746d;
  font-size: 14px;
  line-height: 1.5;
}
.auth-pane-heading-centered { text-align: center; }

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

.auth-form-grid .field-wide { grid-column: 1 / -1; }

.field-help {
  display: block;
  margin-top: 7px;
  color: #748179;
  font-size: 12px;
  line-height: 1.4;
}

.auth-consent {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  margin: 3px 0 20px;
  color: #59665f;
  font-size: 13px;
  line-height: 1.45;
}

.auth-consent input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: #183e2b;
}

.auth-submit-button,
.auth-stacked-actions > button,
.auth-onboarding-actions .primary-button { width: 100%; }

.auth-text-button {
  display: block;
  width: fit-content;
  margin: 14px auto 0;
  padding: 4px;
  border: 0;
  color: #315e45;
  background: transparent;
  font-weight: 700;
}

.auth-text-button:hover { text-decoration: underline; }

.auth-step-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 22px auto 18px;
  border-radius: 17px;
  color: #214d35;
  background: #e3f1e8;
  font-size: 27px;
}

.auth-stacked-actions {
  display: grid;
  gap: 10px;
}

.auth-onboarding-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.auth-onboarding-actions .primary-button { width: auto; }

.auth-card.is-onboarding { padding: 38px 42px; }

@media (max-width: 900px) {
  .auth-shell,
  .auth-shell.is-onboarding {
    width: min(100%, 680px);
    display: block;
  }

  .auth-intro { display: none; }
  .auth-mobile-brand {
    display: flex;
    margin-bottom: 28px;
  }
}

@media (max-width: 560px) {
  .page {
    width: min(100%, calc(100% - 20px));
    padding: 18px 0;
  }

  .auth-shell { border-radius: 18px; }
  .auth-card,
  .auth-card.is-onboarding { padding: 25px 20px; }
  .auth-form-grid { grid-template-columns: 1fr; }
  .auth-form-grid .field-wide { grid-column: auto; }
  .auth-onboarding-actions { flex-direction: column-reverse; }
  .auth-onboarding-actions .primary-button,
  .auth-onboarding-actions .secondary-button { width: 100%; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  background: #183e2b;
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
}

.brand h1 { margin: 0; font-size: 25px; line-height: 1.1; }
.brand p { margin: 5px 0 0; color: #68746d; font-size: 14px; }

.environment-badge {
  width: fit-content;
  margin: 25px 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf4ef;
  color: #315e45;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.field { margin-bottom: 18px; }
.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #ccd7d0;
  border-radius: 10px;
  outline: none;
  background: #ffffff;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: #315e45;
  box-shadow: 0 0 0 3px rgba(49, 94, 69, 0.12);
}

.field input:disabled,
.field textarea:disabled,
.field select:disabled {
  cursor: not-allowed;
  background: #f2f4f2;
}

#loginButton,
.primary-button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  padding: 0 18px;
  background: #183e2b;
  color: #ffffff;
  font-weight: 750;
}

#loginButton { width: 100%; min-height: 49px; }
#loginButton:hover,
.primary-button:hover { background: #102f20; }
#loginButton:disabled,
.primary-button:disabled { cursor: wait; opacity: 0.65; }

.secondary-button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid #cbd6cf;
  border-radius: 9px;
  background: #ffffff;
  color: #243b2e;
  font-weight: 700;
}

.secondary-button:hover { background: #f5f8f6; }

.message {
  min-height: 22px;
  margin: 14px 0 0;
  color: #a32929;
  font-size: 14px;
}

.message.success { color: #276640; }
.beta-note { margin: 18px 0 0; color: #79847e; font-size: 12px; text-align: center; }
.hidden { display: none !important; }

.dashboard { width: 100%; }
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.brand-small .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 21px;
}

.welcome-card,
.info-card,
.module-card {
  border: 1px solid #dce5df;
  background: #ffffff;
  box-shadow: 0 14px 45px rgba(27, 54, 39, 0.07);
}

.welcome-card { padding: 30px; border-radius: 18px; }
.eyebrow {
  margin: 0 0 8px;
  color: #3e7052;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.welcome-card h2 { margin: 0; font-size: clamp(26px, 4vw, 38px); }
.muted { color: #6b7770; }

.content-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.info-card { padding: 24px; border-radius: 16px; }
.info-card h3 { margin: 0 0 18px; }
dl { margin: 0; }
dl div { padding: 12px 0; border-bottom: 1px solid #edf1ee; }
dl div:last-child { border-bottom: 0; }
dt { color: #738078; font-size: 12px; font-weight: 700; text-transform: uppercase; }
dd { margin: 4px 0 0; font-weight: 700; }

.module-card {
  margin-top: 20px;
  padding: 26px;
  border-radius: 18px;
}

.module-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.module-header h2 { margin: 0; font-size: 25px; }
.module-description { margin: 8px 0 0; max-width: 700px; }

.page-module-toolbar {
  align-items: center;
  justify-content: flex-end;
  min-height: 42px;
}

.context-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.form-panel {
  margin-top: 24px;
  padding: 22px;
  border: 1px solid #dbe5df;
  border-radius: 14px;
  background: #f8faf9;
}

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

.field-wide { grid-column: 1 / -1; }
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.empty-state {
  margin-top: 22px;
  padding: 26px;
  display: grid;
  gap: 6px;
  border: 1px dashed #c9d6ce;
  border-radius: 13px;
  color: #617067;
  text-align: center;
  background: #fafcfb;
}

.entity-list {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.entity-card {
  padding: 20px;
  border: 1px solid #dce5df;
  border-radius: 14px;
  background: #ffffff;
}

.entity-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.entity-card h3 { margin: 0; font-size: 18px; }
.entity-trade-name { margin: 5px 0 0; color: #6b7770; font-size: 14px; }
.entity-meta { margin: 16px 0 0; display: grid; gap: 8px; }
.entity-meta-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; font-size: 14px; }
.entity-meta-label { color: #738078; font-weight: 700; }

.status-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e9f4ed;
  color: #276640;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .page { width: min(100% - 22px, 1180px); padding: 22px 0; }
  .auth-card { padding: 25px; }
  .content-grid,
  .entity-list,
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .module-header { flex-direction: column; }
  .module-header .primary-button { width: 100%; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions button { width: 100%; }
  .entity-meta-row { grid-template-columns: 1fr; gap: 2px; }
}


.form-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.form-panel-heading h3 {
  margin: 0;
  font-size: 21px;
}

.field textarea {
  min-height: 110px;
  padding: 12px 14px;
  resize: vertical;
}

.module-toolbar {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid #edf1ee;
}

.toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #526158;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.toggle-control input {
  width: 18px;
  height: 18px;
  accent-color: #183e2b;
}

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

.supplier-list {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.supplier-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  border: 1px solid #dce5df;
  border-radius: 14px;
  background: #ffffff;
}

.supplier-card.is-archived {
  background: #f7f8f7;
  opacity: 0.82;
}

.supplier-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.supplier-card h3 {
  margin: 0;
  font-size: 18px;
}

.supplier-subtitle {
  margin: 5px 0 0;
  color: #6b7770;
  font-size: 13px;
  font-weight: 700;
}

.status-badge-archived {
  background: #eceeed;
  color: #5d6661;
}

.card-actions {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.danger-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #d8bcbc;
  border-radius: 9px;
  background: #ffffff;
  color: #8b2f2f;
  font-weight: 700;
}

.danger-button:hover {
  background: #fff5f5;
  border-color: #c88f8f;
}

.danger-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 760px) {
  .supplier-list {
    grid-template-columns: 1fr;
  }

  .module-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .card-actions {
    flex-direction: column;
  }

  .card-actions button {
    width: 100%;
  }
}


/* Modulo Imballaggi */
.field select {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #cfdad3;
  border-radius: 9px;
  background: #ffffff;
  color: #20372a;
  font: inherit;
}

.field select:focus {
  outline: 3px solid rgba(51, 111, 76, 0.14);
  border-color: #4d8061;
}

.packaging-list {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.packaging-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  border: 1px solid #dce5df;
  border-radius: 14px;
  background: #ffffff;
}

.packaging-card.is-archived {
  background: #f7f8f7;
  opacity: 0.82;
}

.packaging-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.packaging-card h3 {
  margin: 0;
  font-size: 18px;
}

.packaging-subtitle {
  margin: 5px 0 0;
  color: #6b7770;
  font-size: 13px;
  font-weight: 700;
}

.status-badge-draft {
  background: #fff2cc;
  color: #765a00;
}

@media (max-width: 760px) {
  .packaging-list {
    grid-template-columns: 1fr;
  }
}


/* Modulo Componenti */
.component-filters {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}

.compact-field {
  min-width: min(380px, 100%);
  margin-bottom: 0;
}

.compact-field label {
  margin-bottom: 5px;
  font-size: 12px;
}

.component-list {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.component-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  border: 1px solid #dce5df;
  border-radius: 14px;
  background: #ffffff;
}

.component-card.is-archived {
  background: #f7f8f7;
  opacity: 0.82;
}

.component-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.component-card h3 {
  margin: 0;
  font-size: 18px;
}

.component-subtitle {
  margin: 5px 0 0;
  color: #6b7770;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 760px) {
  .component-list {
    grid-template-columns: 1fr;
  }

  .component-filters {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .compact-field {
    min-width: 0;
  }
}



/* Modulo Pratiche */
.practice-filters {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}

.practice-list {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.practice-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  border: 1px solid #dce5df;
  border-radius: 14px;
  background: #ffffff;
}

.practice-card.is-archived {
  background: #f7f8f7;
  opacity: 0.82;
}

.practice-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.practice-card h3 {
  margin: 0;
  font-size: 18px;
}

.practice-subtitle {
  margin: 5px 0 0;
  color: #6b7770;
  font-size: 13px;
  font-weight: 700;
}

.linked-components-preview {
  min-height: 58px;
  padding: 14px;
  border: 1px solid #cfdad3;
  border-radius: 9px;
  background: #f7faf8;
  color: #314b3d;
  line-height: 1.5;
}

.linked-components-preview.is-incomplete {
  border-color: #dfc46a;
  background: #fff9e6;
  color: #765a00;
}

@media (max-width: 760px) {
  .practice-list {
    grid-template-columns: 1fr;
  }

  .practice-filters {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }
}

.practice-table-toolbar {
  display: flex;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
  margin: 22px 0 14px;
  padding: 16px;
  border: 1px solid #e0e8e3;
  border-radius: 14px;
  background: #f8fbf9;
}

.practice-table-toolbar .compact-field {
  min-width: 180px;
  flex: 0 1 220px;
}

.practice-search-field {
  flex: 1 1 320px;
}

.practice-search-field label,
.practice-search-field input {
  display: block;
  width: 100%;
}

.practice-search-field label {
  margin-bottom: 6px;
  color: #526158;
  font-size: 12px;
  font-weight: 800;
}

.practice-table-shell {
  overflow: auto;
  max-width: 100%;
  border: 1px solid #dce5df;
  border-radius: 15px;
  background: #fff;
}

.practice-data-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.practice-data-table th,
.practice-data-table td {
  padding: 11px 12px;
  border-right: 1px solid #e7ece9;
  border-bottom: 1px solid #e7ece9;
  text-align: left;
  vertical-align: middle;
  background: #fff;
  white-space: nowrap;
}

.practice-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #edf4ef;
  color: #294435;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.practice-data-table thead button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.practice-data-table thead button.active {
  color: #0f5b31;
}

.practice-data-table th:last-child,
.practice-data-table td:last-child {
  border-right: 0;
}

.practice-data-table tbody tr:nth-child(even) td,
.practice-data-table tbody tr:nth-child(even) th {
  background: #fafcfb;
}

.practice-data-table tbody tr:hover td,
.practice-data-table tbody tr:hover th {
  background: #f3f8f5;
}

.practice-data-table tbody tr.is-archived {
  opacity: 0.72;
}

.practice-sticky-column {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 170px;
  background: #fff !important;
}

.practice-data-table thead .practice-sticky-column {
  z-index: 6;
  background: #e8f1eb !important;
}

.practice-code-cell strong {
  color: #183e2b;
  font-size: 13px;
}

.practice-title-cell {
  min-width: 230px;
  max-width: 340px;
  color: #183e2b;
  font-weight: 800;
  white-space: normal !important;
}

.practice-wrap-cell {
  min-width: 190px;
  max-width: 300px;
  white-space: normal !important;
}

.practice-row-actions {
  display: flex;
  gap: 7px;
  flex-wrap: nowrap;
}

.practice-check-badge {
  display: inline-flex;
  align-items: center;
  max-width: 240px;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 800;
  white-space: normal;
}

.practice-check-badge.is-complete {
  background: #dff1e5;
  color: #1f6a3b;
}

.practice-check-badge.is-incomplete {
  background: #fff0c9;
  color: #765700;
}

@media (max-width: 760px) {
  .practice-table-toolbar {
    align-items: stretch;
  }

  .practice-table-toolbar .compact-field,
  .practice-search-field {
    flex: 1 1 100%;
  }
}


/* Modulo Documenti */
.document-filters { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; }
.document-list { display: grid; gap: 1rem; }
.document-card { border: 1px solid #d9e1e8; border-radius: 14px; padding: 1.1rem; background: #fff; }
.document-card.is-archived { opacity: .72; background: #f6f7f8; }
.document-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.document-card-header h3 { margin: 0; }
.document-subtitle { margin: .35rem 0 0; color: #5c6770; }
.document-components-checklist { display: grid; gap: .55rem; padding: .85rem; min-height: 3.25rem; max-height: 16rem; overflow-y: auto; border: 1px solid #d9e1e8; border-radius: 10px; background: #fff; }
.document-component-option { display: flex; align-items: flex-start; gap: .65rem; padding: .55rem .65rem; border-radius: 8px; cursor: pointer; }
.document-component-option:hover { background: #f3f6f8; }
.document-component-option input { margin-top: .15rem; }
.field-help { margin: .4rem 0 0; font-size: .85rem; }
.storage-placeholder { display: flex; flex-direction: column; gap: .3rem; padding: .9rem; border: 1px dashed #aab7c2; border-radius: 10px; background: #f8fafb; }
.status-badge.status-warning { background: #fff3cd; color: #705600; }
.status-badge.status-danger { background: #f8d7da; color: #842029; }
.status-badge.status-neutral, .status-badge.status-archived { background: #e9ecef; color: #495057; }
@media (max-width: 760px) { .document-card-header { flex-direction: column; } .document-filters { align-items: stretch; } }

/* Modulo Matrice requisiti PPWR */
.matrix-toolbar {
  align-items: flex-end;
}

.matrix-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) minmax(260px, 1fr);
  gap: 16px;
  width: 100%;
}

.matrix-summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #edf5ef;
  color: #285a3c;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.requirements-matrix-list {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.requirement-card {
  padding: 20px;
  border: 1px solid #dce5df;
  border-radius: 14px;
  background: #ffffff;
}

.requirement-card.is-not-applicable {
  background: #f7f8f7;
}

.requirement-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.requirement-card h3 {
  margin: 2px 0 0;
  font-size: 18px;
}

.requirement-description {
  max-width: 920px;
  margin: 7px 0 0;
  line-height: 1.5;
}

.requirement-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 14px 0 18px;
}

.requirement-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef1ef;
  color: #45534a;
  font-size: 12px;
  font-weight: 700;
}

.requirement-tag.is-blocking {
  background: #f8d7da;
  color: #842029;
}

.requirement-tag.is-document {
  background: #e5efff;
  color: #234f8c;
}

.requirement-tag.is-data {
  background: #edf5ef;
  color: #285a3c;
}

.requirement-tag.is-reference {
  background: #fff3cd;
  color: #705600;
}

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

.requirement-documents-checklist {
  display: grid;
  gap: 8px;
  min-height: 54px;
  max-height: 220px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid #cfdad3;
  border-radius: 9px;
  background: #fafcfb;
}

.requirement-document-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
}

.requirement-document-option:hover {
  background: #edf5ef;
}

.requirement-document-option input {
  margin-top: 3px;
}

.requirement-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e3e9e5;
}

.requirement-saved-state {
  font-size: 13px;
}

@media (max-width: 760px) {
  .matrix-filters,
  .requirement-form-grid {
    grid-template-columns: 1fr;
  }

  .requirement-card-header,
  .requirement-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .matrix-summary {
    align-self: flex-start;
  }
}


/* --- Esperienza semplificata: Nuovo packaging --- */
.simple-workspace {
  margin-top: 20px;
}

.simple-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 30px;
  border: 1px solid #d8e4dc;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(235, 246, 239, 0.96), rgba(255, 255, 255, 0.98));
  box-shadow: 0 18px 50px rgba(27, 54, 39, 0.08);
}

.simple-hero h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
}

.simple-hero-copy {
  max-width: 720px;
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.6;
}

.hero-action {
  min-height: 52px;
  padding-inline: 24px;
  white-space: nowrap;
}

.simple-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.simple-stat {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 18px 20px;
  border: 1px solid #dce5df;
  border-radius: 14px;
  background: #ffffff;
}

.simple-stat-value {
  color: #183e2b;
  font-size: 26px;
  font-weight: 850;
}

.simple-empty {
  display: grid;
  gap: 5px;
  margin-top: 16px;
  padding: 24px;
  border: 1px dashed #bdcec3;
  border-radius: 14px;
  background: #f9fbfa;
  color: #647168;
}

.simple-empty strong {
  color: #273b30;
}

.dashboard-attention-card {
  margin-top: 16px;
  padding: 22px;
  border: 1px solid #dce5df;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 32px rgba(27, 54, 39, 0.05);
}

.dashboard-attention-header,
.wizard-header,
.wizard-step-heading,
.wizard-actions,
.wizard-document-heading,
.wizard-component-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.dashboard-attention-header {
  align-items: flex-start;
}

.dashboard-attention-header > div {
  display: grid;
  gap: 5px;
}

.dashboard-attention-header h3 {
  margin: 0;
  font-size: 21px;
}

.dashboard-attention-header p:last-child {
  margin: 0;
}

.dashboard-attention-table-shell {
  width: 100%;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid #dfe7e2;
  border-radius: 13px;
}

.dashboard-attention-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.dashboard-attention-table th,
.dashboard-attention-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #e8eeea;
  text-align: center;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.dashboard-attention-table thead th {
  background: #f3f7f4;
  color: #43554a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.dashboard-attention-table tbody tr:last-child > * {
  border-bottom: 0;
}

.dashboard-attention-table tbody tr:hover {
  background: #fbfdfb;
}

.dashboard-col-packaging { width: 23%; }
.dashboard-col-company { width: 18%; }
.dashboard-col-components { width: 11%; }
.dashboard-col-missing { width: 17%; }
.dashboard-col-status { width: 15%; }
.dashboard-col-action { width: 16%; }

.dashboard-attention-table .dashboard-packaging-cell {
  text-align: left;
}

.dashboard-packaging-cell strong,
.dashboard-packaging-cell span {
  display: block;
}

.dashboard-packaging-cell strong {
  color: #1e3829;
  font-size: 14px;
}

.dashboard-packaging-cell span {
  margin-top: 4px;
  color: #6b7770;
  font-size: 12px;
  font-weight: 500;
}

.dashboard-number-cell {
  font-size: 16px;
  font-weight: 850;
}

.dashboard-document-badge,
.dashboard-dossier-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.dashboard-document-badge {
  min-width: 36px;
  padding: 5px 10px;
}

.dashboard-document-badge.is-missing {
  background: #fee7e4;
  color: #a3332c;
}

.dashboard-document-badge.is-review {
  background: #fff1d6;
  color: #865900;
}

.dashboard-document-badge.is-complete {
  background: #e5f4e9;
  color: #23623b;
}

.dashboard-document-badge.is-neutral {
  background: #eef2ef;
  color: #657168;
}

.dashboard-dossier-status {
  width: 118px;
  padding: 5px 9px;
  background: #fff1d6;
  color: #805600;
}

.dashboard-dossier-status.is-create,
.dashboard-dossier-status.is-components {
  background: #fee7e4;
  color: #97362f;
}

.dashboard-dossier-status.is-ready {
  background: #e5f4e9;
  color: #23623b;
}

.dashboard-open-dossier {
  width: 116px;
  max-width: 100%;
  justify-content: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef2ef;
  color: #536158;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.success {
  background: #e5f4e9;
  color: #23623b;
}

.status-pill.warning {
  background: #fff1d6;
  color: #8a5b00;
}

.status-pill.attention {
  background: #fff7d8;
  color: #755c00;
}

.status-pill.neutral {
  background: #eef2ef;
  color: #536158;
}

.wizard-shell {
  margin-top: 20px;
  padding: 30px;
  border: 1px solid #d5e2d9;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(27, 54, 39, 0.11);
}

.wizard-header {
  align-items: flex-start;
}

.wizard-header h2,
.wizard-step-heading h3,
.wizard-success h3 {
  margin: 0;
}

.wizard-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 26px 0 24px;
  padding: 0;
  list-style: none;
}

.wizard-progress li {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 9px 12px;
  border-radius: 12px;
  background: #f2f5f3;
  color: #748078;
  font-size: 13px;
  font-weight: 750;
}

.wizard-progress li span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #d1dcd5;
  font-size: 12px;
}

.wizard-progress li.active {
  background: #e4f0e8;
  color: #183e2b;
}

.wizard-progress li.active span,
.wizard-progress li.complete span {
  border-color: #315e45;
  background: #315e45;
  color: #ffffff;
}

.wizard-progress li.complete {
  color: #315e45;
}

.wizard-message {
  min-height: 0;
  margin-bottom: 10px;
}

.wizard-step-heading {
  align-items: flex-start;
  margin-bottom: 22px;
}

.wizard-step-heading p:last-child {
  margin-bottom: 0;
}

.wizard-actions {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e8eeea;
}

.inline-control {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.inline-control select {
  min-width: 0;
}

.compact-action {
  min-height: 48px;
  padding-inline: 12px;
  white-space: nowrap;
}

.wizard-component-list {
  display: grid;
  gap: 10px;
}

.wizard-component-card {
  padding: 15px 16px;
  border: 1px solid #dde6e0;
  border-radius: 13px;
  background: #fbfcfb;
}

.wizard-component-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.wizard-component-main > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.wizard-component-main strong,
.wizard-component-main span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.wizard-component-main span {
  color: #6b7770;
  font-size: 12px;
  white-space: normal;
}

.wizard-component-number {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: #e6f0e9;
  color: #315e45;
  font-weight: 850;
}

.compact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.text-button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #315e45;
  font-weight: 750;
}

.text-button:hover {
  background: #edf4ef;
}

.wizard-inline-panel {
  margin-top: 16px;
}

.wizard-info-banner {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-left: 4px solid #5d8a6d;
  border-radius: 10px;
  background: #eef6f1;
  color: #345543;
  font-size: 14px;
  line-height: 1.5;
}

.wizard-document-list {
  display: grid;
  gap: 14px;
}

.wizard-document-card {
  overflow: hidden;
  border: 1px solid #dce5df;
  border-radius: 14px;
  background: #ffffff;
}

.wizard-document-heading {
  padding: 15px 17px;
  background: #f4f7f5;
}

.wizard-document-heading span {
  color: #6b7770;
  font-size: 12px;
}

.wizard-document-status-list {
  display: grid;
}

.wizard-document-status {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 17px;
  border-top: 1px solid #edf1ee;
}

.wizard-document-status > div {
  display: grid;
  gap: 3px;
}

.wizard-document-status > div span {
  color: #6b7770;
  font-size: 12px;
}

.document-status-mark {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  font-weight: 900;
}

.wizard-document-status.available .document-status-mark {
  background: #dff0e4;
  color: #21613a;
}

.wizard-document-status.to_verify .document-status-mark {
  background: #fff0c9;
  color: #855d00;
}

.wizard-document-status.missing .document-status-mark {
  background: #f8e1e1;
  color: #9a3030;
}

.wizard-final-summary {
  display: grid;
  gap: 18px;
}

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

.wizard-summary-grid > div {
  display: grid;
  gap: 5px;
  padding: 15px;
  border: 1px solid #e0e7e2;
  border-radius: 12px;
  background: #fafcfb;
}

.wizard-summary-grid span {
  color: #718078;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.wizard-readiness {
  display: grid;
  gap: 5px;
  padding: 17px;
  border-radius: 12px;
}

.wizard-readiness.warning {
  background: #fff4dd;
  color: #765000;
}

.wizard-readiness.success {
  background: #e8f5ec;
  color: #245c38;
}

.wizard-readiness span {
  font-size: 13px;
}

.wizard-success {
  padding: 42px 24px;
  text-align: center;
}

.success-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #dff1e5;
  color: #23623b;
  font-size: 34px;
  font-weight: 900;
}

.success-actions {
  justify-content: center;
  margin-top: 24px;
}

.advanced-area {
  margin-top: 20px;
  border: 1px solid #dce5df;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 34px rgba(27, 54, 39, 0.05);
}

.advanced-area > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  cursor: pointer;
  list-style: none;
}

.advanced-area > summary::-webkit-details-marker {
  display: none;
}

.advanced-area > summary span:first-child {
  display: grid;
  gap: 4px;
}

.advanced-area > summary small {
  color: #6b7770;
}

.advanced-chevron {
  font-size: 24px;
  transition: transform 0.2s ease;
}

.advanced-area[open] .advanced-chevron {
  transform: rotate(180deg);
}

.advanced-content {
  padding: 0 20px 20px;
  border-top: 1px solid #e7ede9;
}

.advanced-content .content-grid {
  margin-top: 20px;
}

@media (max-width: 760px) {
  .simple-hero,
  .dashboard-attention-header,
  .wizard-header,
  .wizard-step-heading,
  .wizard-actions,
  .wizard-component-card {
    align-items: stretch;
    flex-direction: column;
  }

  .simple-stats,
  .wizard-progress,
  .wizard-summary-grid {
    grid-template-columns: 1fr;
  }

  .wizard-progress li {
    min-height: 40px;
  }

  .inline-control {
    flex-direction: column;
  }

  .success-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .success-actions button,
  .hero-action {
    width: 100%;
  }

  .dashboard-attention-card {
    padding: 16px;
  }

  .dashboard-attention-header .secondary-button {
    width: 100%;
  }

  .dashboard-attention-table-shell {
    overflow-x: auto;
  }

  .dashboard-attention-table {
    min-width: 760px;
  }

  .wizard-shell {
    padding: 20px;
  }
}


/* Caricamento documenti Firebase Storage */
.document-upload-progress {
  width: 100%;
  height: 12px;
  margin-top: 8px;
}

.document-file-ready {
  color: #21613a;
  font-weight: 750;
}

.document-file-missing {
  color: #8a4d00;
}

.wizard-document-status.ready_to_upload .document-status-mark,
.wizard-document-status.uploaded_to_verify .document-status-mark {
  background: #dcecf8;
  color: #205b83;
}

.wizard-document-status.file_missing .document-status-mark,
.wizard-document-status.upload_error .document-status-mark {
  background: #f8e1e1;
  color: #9a3030;
}

.wizard-document-upload {
  display: grid;
  gap: 8px;
  min-width: min(100%, 320px);
  margin-left: auto;
}

.wizard-document-upload input[type="file"] {
  max-width: 100%;
}

.wizard-upload-file-name {
  color: #315e45;
  font-size: 12px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.wizard-document-status.has-upload {
  background: #f4f9fc;
}

@media (max-width: 760px) {
  .wizard-document-status {
    flex-wrap: wrap;
  }

  .wizard-document-upload {
    width: 100%;
    margin-left: 38px;
  }
}


/* Documenti: selezione multipla degli articoli del fornitore */
.document-component-selection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.document-component-selection-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.document-component-selection-actions .text-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}


/* Documenti: requisiti PPWR coperti */
.document-requirement-selection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.document-requirement-selection-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.document-requirement-selection-actions .text-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.document-requirements-checklist {
  display: grid;
  gap: 14px;
  padding: 14px;
  max-height: 28rem;
  overflow-y: auto;
  border: 1px solid #d9e1e8;
  border-radius: 10px;
  background: #fff;
}

.document-requirement-group {
  display: grid;
  gap: 8px;
}

.document-requirement-group + .document-requirement-group {
  padding-top: 12px;
  border-top: 1px solid #e7ecef;
}

.document-requirement-group h4 {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.document-requirement-options {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.document-requirement-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border: 1px solid #e2e8ec;
  border-radius: 9px;
  background: #f9fbfc;
}

.document-requirement-option input {
  margin-top: 2px;
}


/* Navigazione a pagine e azienda attiva */
.dashboard-header-context {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.active-company-control {
  display: grid;
  gap: 5px;
  min-width: min(320px, 50vw);
  color: #53645a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.active-company-control select {
  width: 100%;
  min-height: 42px;
  padding: 0 38px 0 12px;
  border: 1px solid #cbd6cf;
  border-radius: 9px;
  outline: none;
  background: #ffffff;
  color: #20382a;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
}

.active-company-control select:focus {
  border-color: #315e45;
  box-shadow: 0 0 0 3px rgba(49, 94, 69, 0.12);
}

.app-primary-nav {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: flex;
  gap: 8px;
  margin: 0 0 22px;
  padding: 8px;
  overflow-x: auto;
  border: 1px solid #dce5df;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 30px rgba(27, 54, 39, 0.06);
  backdrop-filter: blur(12px);
}

.app-nav-button {
  min-height: 40px;
  padding: 0 15px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #526158;
  font-weight: 750;
}

.app-nav-button:hover {
  background: #f0f5f2;
  color: #183e2b;
}

.app-nav-button.active {
  background: #183e2b;
  color: #ffffff;
}

.app-page {
  min-width: 0;
}

.app-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  padding: 25px 27px;
  border: 1px solid #dce5df;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 12px 38px rgba(27, 54, 39, 0.06);
}

.app-page-heading h2 {
  margin: 0;
  font-size: clamp(25px, 3vw, 34px);
}

.app-page-heading .muted {
  max-width: 720px;
  margin: 8px 0 0;
}

.app-page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.module-launch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.module-launch-card {
  min-height: 145px;
  padding: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  border: 1px solid #d8e2dc;
  border-radius: 16px;
  background: #ffffff;
  color: #21382b;
  text-align: left;
  box-shadow: 0 10px 32px rgba(27, 54, 39, 0.05);
}

button.module-launch-card:hover {
  border-color: #8eab99;
  background: #f7faf8;
  transform: translateY(-1px);
}

.module-launch-card strong {
  font-size: 18px;
}

.module-launch-card span {
  color: #69766e;
  font-size: 14px;
  line-height: 1.45;
}

.module-launch-card.is-disabled {
  opacity: 0.58;
  box-shadow: none;
}

.module-launch-grid-ppwr {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.optional-label {
  color: #75827a;
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
}

@media (max-width: 900px) {
  .module-launch-grid,
  .module-launch-grid-ppwr {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .dashboard-header,
  .dashboard-header-context,
  .app-page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-header-context {
    width: 100%;
  }

  .active-company-control {
    width: 100%;
    min-width: 0;
  }

  .dashboard-header-context > .secondary-button {
    width: 100%;
  }

  .app-primary-nav {
    top: 4px;
  }

  .app-page-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .app-page-actions button {
    width: 100%;
  }

  .module-launch-grid,
  .module-launch-grid-ppwr {
    grid-template-columns: 1fr;
  }

  .module-launch-card {
    min-height: 112px;
  }
}


.app-page > .module-card {
  margin-top: 0;
}


/* Matrice PPWR compatta: componenti sulle righe, requisiti sulle colonne */
.compact-matrix-module {
  overflow: visible;
}

.compact-matrix-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #5f6d65;
}

.compact-matrix-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.matrix-status-dot,
.compact-matrix-status-button {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 900;
  line-height: 1;
}

.matrix-status-dot {
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
}

.compact-requirements-matrix {
  display: grid;
  gap: 18px;
}

.matrix-view-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.matrix-requirement-group {
  display: grid;
  gap: 9px;
}

.matrix-group-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.matrix-group-heading h3,
.matrix-group-heading p {
  margin: 0;
}

.matrix-group-heading p {
  margin-top: 3px;
  font-size: 12px;
}

.matrix-group-count {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef4f0;
  color: #355744;
  font-size: 11px;
  font-weight: 800;
}

.compact-matrix-scroll {
  overflow: hidden;
  max-width: 100%;
  border: 1px solid #dce5df;
  border-radius: 14px;
  background: #fff;
}

.compact-matrix-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.compact-matrix-table th,
.compact-matrix-table td {
  border-right: 1px solid #e6ece8;
  border-bottom: 1px solid #e6ece8;
  background: #fff;
}

.compact-matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f3f7f4;
}

.compact-matrix-table tr:last-child th,
.compact-matrix-table tr:last-child td {
  border-bottom: 0;
}

.compact-matrix-table th:last-child,
.compact-matrix-table td:last-child {
  border-right: 0;
}

.compact-matrix-component-header,
.compact-matrix-component-cell {
  position: sticky;
  left: 0;
  z-index: 4;
  width: 180px;
  padding: 10px 11px;
  text-align: left;
  background: #f8faf9 !important;
}

.compact-matrix-component-cell {
  z-index: 2;
}

.compact-matrix-component-cell strong,
.compact-matrix-component-cell span {
  display: block;
  overflow-wrap: anywhere;
}

.compact-matrix-component-cell span {
  margin-top: 3px;
  color: #708077;
  font-size: 11px;
  font-weight: 500;
}

.compact-matrix-requirement-header {
  width: auto;
  padding: 8px 2px;
  text-align: center;
  vertical-align: bottom;
}

.compact-matrix-code {
  display: block;
  font-weight: 900;
  color: #234634;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.compact-matrix-requirement-header small {
  display: none;
  margin-top: 4px;
  color: #68776f;
  font-size: 9px;
  line-height: 1.15;
  white-space: normal;
}

.compact-matrix-status-cell {
  width: auto;
  height: 54px;
  padding: 5px 2px;
  text-align: center;
}

.compact-matrix-status-button {
  min-width: 30px;
  height: 30px;
  padding: 0 5px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 14px;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.compact-matrix-status-button:hover,
.compact-matrix-status-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(25, 58, 39, 0.16);
  outline: 2px solid #2c6a44;
  outline-offset: 2px;
}

.is-ok {
  background: #dff1e5;
  color: #1f6a3b;
  border-color: #b7ddc3;
}

.is-warning {
  background: #fff0c9;
  color: #845c00;
  border-color: #ead18a;
}

.is-error {
  background: #f8dddd;
  color: #a02d2d;
  border-color: #e7b4b4;
}

.is-na {
  background: #e9edef;
  color: #566169;
  border-color: #d2d9dd;
  font-size: 10px;
}

.is-pending {
  background: #f2f4f3;
  color: #748078;
  border-color: #dce2de;
}

.compact-matrix-result-header,
.compact-matrix-row-summary {
  width: 118px;
  padding: 7px 6px;
  text-align: center;
  background: #fafcfb;
}

.compact-row-summary {
  display: flex;
  justify-content: center;
  gap: 3px;
  flex-wrap: wrap;
}

.compact-summary-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 4px 5px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.compact-matrix-help {
  margin: 0;
  font-size: 12px;
}

.compact-requirements-matrix.is-expanded .compact-matrix-scroll {
  overflow-x: auto;
}

.compact-requirements-matrix.is-expanded .compact-matrix-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

.compact-requirements-matrix.is-expanded .compact-matrix-component-header,
.compact-requirements-matrix.is-expanded .compact-matrix-component-cell {
  width: 250px;
  min-width: 250px;
  max-width: 300px;
  padding: 12px 14px;
}

.compact-requirements-matrix.is-expanded .compact-matrix-requirement-header,
.compact-requirements-matrix.is-expanded .compact-matrix-status-cell {
  width: 112px;
  min-width: 112px;
}

.compact-requirements-matrix.is-expanded .compact-matrix-requirement-header {
  padding: 9px 5px;
}

.compact-requirements-matrix.is-expanded .compact-matrix-requirement-header small {
  display: block;
}

.compact-requirements-matrix.is-expanded .compact-matrix-code {
  font-size: 11px;
}

.compact-requirements-matrix.is-expanded .compact-matrix-result-header,
.compact-requirements-matrix.is-expanded .compact-matrix-row-summary {
  width: 150px;
  min-width: 150px;
}

.matrix-detail-panel {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #e4ebe6;
}

.matrix-detail-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 14px;
}

.matrix-detail-heading h3 {
  margin: 0;
}

@media (max-width: 760px) {
  .compact-matrix-component-header,
  .compact-matrix-component-cell {
    width: 150px;
  }

  .compact-matrix-requirement-header,
  .compact-matrix-status-cell {
    min-width: 42px;
  }

  .compact-matrix-scroll {
    overflow-x: auto;
  }

  .compact-matrix-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
  }

  .matrix-group-heading,
  .matrix-view-actions {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .matrix-detail-heading {
    display: grid;
  }
}


/* Modulo Fornitori V2: wizard, tabella e importazione Excel */
.supplier-workspace {
  overflow: visible;
}

.supplier-module-header {
  align-items: flex-start;
}

.supplier-primary-actions,
.supplier-wizard-navigation,
.supplier-row-actions,
.supplier-import-upload,
.supplier-import-options {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.supplier-wizard-panel,
.supplier-import-panel {
  margin: 22px 0;
  padding: 24px;
  border: 1px solid #d9e4dd;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdfc 0%, #f5f9f6 100%);
  box-shadow: 0 12px 32px rgba(24, 62, 43, 0.08);
}

.supplier-panel-heading,
.supplier-wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.supplier-panel-heading h3,
.supplier-step-heading h4 {
  margin: 0;
}

.icon-close-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #d5e0d9;
  border-radius: 999px;
  background: #fff;
  color: #526158;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.supplier-wizard-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 26px;
  padding: 0;
  list-style: none;
}

.supplier-wizard-progress li {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid #dce5df;
  border-radius: 12px;
  background: #fff;
  color: #6d7972;
  font-size: 13px;
  font-weight: 800;
}

.supplier-wizard-progress li span {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 999px;
  background: #edf2ef;
}

.supplier-wizard-progress li.active {
  border-color: #5c8b6d;
  color: #183e2b;
  box-shadow: 0 0 0 3px rgba(70, 126, 91, 0.10);
}

.supplier-wizard-progress li.active span,
.supplier-wizard-progress li.complete span {
  background: #183e2b;
  color: #fff;
}

.supplier-step-heading {
  margin-bottom: 18px;
}

.supplier-wizard-actions {
  align-items: center;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #dfe7e2;
}

.supplier-wizard-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.supplier-summary-card {
  padding: 18px;
  border: 1px solid #dce5df;
  border-radius: 14px;
  background: #fff;
}

.supplier-summary-card h5 {
  margin: 0 0 13px;
  font-size: 15px;
}

.supplier-summary-card dl {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1.3fr);
  gap: 8px 14px;
  margin: 0;
}

.supplier-summary-card dt {
  color: #718078;
  font-size: 12px;
  font-weight: 800;
}

.supplier-summary-card dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #263c30;
  font-size: 13px;
}

.supplier-import-upload {
  justify-content: space-between;
  margin-top: 20px;
}

.supplier-import-dropzone {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 520px;
  min-height: 86px;
  padding: 16px;
  border: 1px dashed #88a895;
  border-radius: 14px;
  background: #fff;
}

.supplier-import-dropzone strong,
.supplier-import-dropzone span {
  display: block;
}

.supplier-import-dropzone span {
  margin-top: 4px;
  color: #738078;
  font-size: 12px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.supplier-import-preview {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.supplier-import-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.supplier-import-stat {
  padding: 14px;
  border: 1px solid #dce5df;
  border-radius: 12px;
  background: #fff;
}

.supplier-import-stat strong,
.supplier-import-stat span {
  display: block;
}

.supplier-import-stat strong {
  font-size: 22px;
}

.supplier-import-stat span {
  margin-top: 2px;
  color: #6e7b73;
  font-size: 12px;
  font-weight: 800;
}

.supplier-import-stat.is-ready strong { color: #1f6a3b; }
.supplier-import-stat.is-update strong { color: #6d5f00; }
.supplier-import-stat.is-error strong { color: #a02d2d; }

.supplier-import-options {
  justify-content: flex-end;
}

.supplier-import-options label {
  color: #526158;
  font-size: 13px;
  font-weight: 800;
}

.supplier-import-table-shell,
.supplier-table-shell {
  overflow: auto;
  max-width: 100%;
  border: 1px solid #dce5df;
  border-radius: 15px;
  background: #fff;
}

.supplier-import-table,
.supplier-data-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.supplier-import-table th,
.supplier-import-table td,
.supplier-data-table th,
.supplier-data-table td {
  padding: 11px 12px;
  border-right: 1px solid #e7ece9;
  border-bottom: 1px solid #e7ece9;
  text-align: left;
  vertical-align: middle;
  background: #fff;
  white-space: nowrap;
}

.supplier-import-table thead th,
.supplier-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #edf4ef;
  color: #294435;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.supplier-data-table thead button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.supplier-data-table thead button.active {
  color: #0f5b31;
}

.supplier-import-table tr:last-child td,
.supplier-data-table tr:last-child td,
.supplier-data-table tr:last-child th {
  border-bottom: 0;
}

.supplier-import-table th:last-child,
.supplier-import-table td:last-child,
.supplier-data-table th:last-child,
.supplier-data-table td:last-child {
  border-right: 0;
}

.supplier-data-table tbody tr:nth-child(even) td,
.supplier-data-table tbody tr:nth-child(even) th {
  background: #fafcfb;
}

.supplier-data-table tbody tr:hover td,
.supplier-data-table tbody tr:hover th {
  background: #f3f8f5;
}

.supplier-data-table tbody tr.is-archived {
  opacity: 0.72;
}

.supplier-sticky-column {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 220px;
  max-width: 280px;
  background: #fff !important;
}

.supplier-data-table thead .supplier-sticky-column {
  z-index: 6;
  background: #e8f1eb !important;
}

.supplier-name-cell strong,
.supplier-name-cell span {
  display: block;
}

.supplier-name-cell strong {
  color: #183e2b;
  font-size: 13px;
}

.supplier-name-cell span {
  margin-top: 3px;
  color: #738078;
  font-size: 11px;
  font-weight: 500;
}

.supplier-address-cell {
  max-width: 260px;
  white-space: normal !important;
}

.supplier-table-link {
  color: #245f3b;
  text-decoration: none;
}

.supplier-table-link:hover {
  text-decoration: underline;
}

.supplier-country-badge,
.supplier-count-badge,
.supplier-import-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf1ef;
  color: #5b6861;
  font-weight: 900;
}

.supplier-count-badge.has-items {
  background: #dff1e5;
  color: #1f6a3b;
}

.supplier-import-status {
  max-width: 280px;
  white-space: normal;
}

.supplier-import-status.is-ready {
  background: #dff1e5;
  color: #1f6a3b;
}

.supplier-import-status.is-duplicate {
  background: #fff0c9;
  color: #765700;
}

.supplier-import-status.is-error {
  background: #f8dddd;
  color: #9c2d2d;
}

.supplier-row-actions {
  flex-wrap: nowrap;
}

.table-action-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #cedbd3;
  border-radius: 8px;
  background: #fff;
  color: #294435;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.table-action-button:hover {
  background: #f1f7f3;
}

.table-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.table-action-button.is-danger {
  border-color: #e2c5c5;
  color: #8b2f2f;
}

.supplier-table-toolbar {
  display: flex;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
  margin: 22px 0 14px;
  padding: 16px;
  border: 1px solid #e0e8e3;
  border-radius: 14px;
  background: #f8fbf9;
}

.supplier-search-field {
  flex: 1 1 340px;
}

.supplier-search-field label,
.supplier-search-field input {
  display: block;
  width: 100%;
}

.supplier-search-field label {
  margin-bottom: 6px;
  color: #526158;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .supplier-primary-actions {
    width: 100%;
  }

  .supplier-primary-actions > * {
    flex: 1 1 180px;
  }

  .supplier-import-stats,
  .supplier-wizard-summary {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .supplier-wizard-progress,
  .supplier-import-stats,
  .supplier-wizard-summary {
    grid-template-columns: 1fr;
  }

  .supplier-panel-heading,
  .supplier-wizard-actions,
  .supplier-import-upload {
    display: grid;
  }

  .supplier-wizard-navigation,
  .supplier-wizard-navigation button,
  .supplier-wizard-actions > button,
  .supplier-import-upload > button {
    width: 100%;
  }
}

.supplier-notes-cell {
  min-width: 220px;
  max-width: 320px;
  white-space: normal !important;
}

/* Componenti V2: wizard, libreria, tabella e importazione */
.component-workspace {
  overflow: visible;
}

.component-module-header {
  align-items: flex-start;
}

.component-primary-actions,
.component-wizard-navigation,
.component-row-actions,
.component-import-upload,
.inline-create-row,
.component-quick-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.component-wizard-panel,
.component-import-panel,
.component-detail-panel {
  margin: 22px 0;
  padding: 24px;
  border: 1px solid #d9e4dd;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdfc 0%, #f5f9f6 100%);
  box-shadow: 0 12px 32px rgba(24, 62, 43, 0.08);
}

.component-panel-heading,
.component-wizard-actions,
.component-quick-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.component-panel-heading h3,
.component-step-heading h4 {
  margin: 0;
}

.component-detail-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.component-wizard-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 26px;
  padding: 0;
  list-style: none;
}

.component-wizard-progress li {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid #dce5df;
  border-radius: 12px;
  background: #fff;
  color: #6d7972;
  font-size: 13px;
  font-weight: 800;
}

.component-wizard-progress li span {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 999px;
  background: #edf2ef;
}

.component-wizard-progress li.active {
  border-color: #5c8b6d;
  color: #183e2b;
  box-shadow: 0 0 0 3px rgba(70, 126, 91, 0.1);
}

.component-wizard-progress li.active span,
.component-wizard-progress li.complete span {
  background: #183e2b;
  color: #fff;
}

.component-step-heading {
  margin-bottom: 18px;
}

.component-wizard-actions {
  align-items: center;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #dfe7e2;
}

.component-wizard-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.component-detail-content {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.component-detail-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.component-detail-section {
  min-width: 0;
  padding: 18px;
  border: 1px solid #dbe5de;
  border-radius: 15px;
  background: #fff;
}

.component-detail-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.component-detail-section-heading h4,
.component-detail-section-heading p {
  margin: 0;
}

.component-detail-section-heading p {
  margin-top: 3px;
  font-size: .78rem;
}

.component-detail-table-shell {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #e0e8e2;
  border-radius: 12px;
}

.component-detail-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
}

.component-detail-table th,
.component-detail-table td {
  vertical-align: middle;
  white-space: normal;
}

.component-detail-table small {
  display: block;
  margin-top: 4px;
  color: #718078;
  font-size: .7rem;
  font-weight: 500;
}

.component-detail-documents-table th:nth-child(1) { width: 24%; }
.component-detail-documents-table th:nth-child(2) { width: 18%; }
.component-detail-documents-table th:nth-child(3) { width: 32%; }
.component-detail-documents-table th:nth-child(4) { width: 15%; }
.component-detail-documents-table th:nth-child(5) { width: 11%; }
.component-detail-packagings-table th:nth-child(1) { width: 10%; text-align: center; }
.component-detail-packagings-table th:nth-child(2) { width: 32%; }
.component-detail-packagings-table th:nth-child(3) { width: 22%; }
.component-detail-packagings-table th:nth-child(4) { width: 22%; }
.component-detail-packagings-table th:nth-child(5) { width: 14%; }

.component-packaging-presence-cell {
  text-align: center !important;
}

.component-packaging-presence-cell input {
  appearance: none;
  display: inline-grid;
  place-content: center;
  width: 19px;
  height: 19px;
  margin: 0;
  border: 1px solid #1d683e;
  border-radius: 4px;
  background: #1d683e;
  opacity: 1;
}

.component-packaging-presence-cell input::after {
  content: "✓";
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.component-detail-empty {
  margin: 0;
  padding: 16px;
  border: 1px dashed #c6d6cb;
  border-radius: 11px;
  color: #627168;
  background: #f8fbf9;
}

.inline-create-row {
  align-items: stretch;
}

.inline-create-row select {
  flex: 1 1 300px;
}

.component-library-note {
  padding: 14px 16px;
  border: 1px solid #cfded5;
  border-radius: 12px;
  background: #f4f9f6;
}

.component-library-note strong,
.component-library-note small {
  display: block;
}

.component-library-note strong {
  color: #183e2b;
}

.component-quick-supplier {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #cfded5;
  border-radius: 14px;
  background: #fff;
}

.component-import-upload {
  justify-content: space-between;
  margin-top: 20px;
}

.component-import-dropzone {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 520px;
  min-height: 86px;
  padding: 16px;
  border: 1px dashed #88a895;
  border-radius: 14px;
  background: #fff;
}

.component-import-dropzone strong,
.component-import-dropzone span {
  display: block;
}

.component-import-dropzone span {
  margin-top: 4px;
  color: #738078;
  font-size: 12px;
}

.component-import-preview {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.component-import-preview-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #dce5df;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.72);
}

.component-import-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.component-import-section-heading h4 {
  margin: 0;
  color: #183e2b;
}

.component-import-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.component-table-toolbar {
  display: flex;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
  margin: 22px 0 14px;
  padding: 16px;
  border: 1px solid #e0e8e3;
  border-radius: 14px;
  background: #f8fbf9;
}

.component-table-toolbar .compact-field {
  min-width: 190px;
  flex: 0 1 240px;
}

.component-search-field {
  flex: 1 1 320px;
}

.component-search-field label,
.component-search-field input {
  display: block;
  width: 100%;
}

.component-search-field label {
  margin-bottom: 6px;
  color: #526158;
  font-size: 12px;
  font-weight: 800;
}

.component-import-table-shell,
.component-table-shell {
  overflow: auto;
  max-width: 100%;
  border: 1px solid #dce5df;
  border-radius: 15px;
  background: #fff;
}

.component-import-table,
.component-data-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.component-import-table th,
.component-import-table td,
.component-data-table th,
.component-data-table td {
  padding: 11px 12px;
  border-right: 1px solid #e7ece9;
  border-bottom: 1px solid #e7ece9;
  text-align: left;
  vertical-align: middle;
  background: #fff;
  white-space: nowrap;
}

.component-import-table thead th,
.component-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #edf4ef;
  color: #294435;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.component-data-table thead button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.component-data-table thead button.active {
  color: #0f5b31;
}

.component-import-table th:last-child,
.component-import-table td:last-child,
.component-data-table th:last-child,
.component-data-table td:last-child {
  border-right: 0;
}

.component-data-table tbody tr:nth-child(even) td,
.component-data-table tbody tr:nth-child(even) th {
  background: #fafcfb;
}

.component-data-table tbody tr:hover td,
.component-data-table tbody tr:hover th {
  background: #f3f8f5;
}

.component-data-table tbody tr.is-archived {
  opacity: 0.72;
}

.component-sticky-column {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 180px;
  max-width: 240px;
  background: #fff !important;
}

.component-data-table thead .component-sticky-column {
  z-index: 6;
  background: #e8f1eb !important;
}

.component-code-cell strong,
.component-code-cell span {
  display: block;
}

.component-code-cell strong {
  color: #183e2b;
  font-size: 13px;
}

.component-code-cell span {
  max-width: 230px;
  margin-top: 3px;
  overflow: hidden;
  color: #738078;
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
}

.component-name-cell {
  min-width: 220px;
  max-width: 320px;
  color: #183e2b;
  font-weight: 800;
  white-space: normal !important;
}

.component-wrap-cell {
  min-width: 200px;
  max-width: 300px;
  white-space: normal !important;
}

.component-row-actions {
  flex-wrap: nowrap;
}

@media (max-width: 900px) {
  .component-primary-actions {
    width: 100%;
  }

  .component-primary-actions > * {
    flex: 1 1 180px;
  }

  .component-import-stats,
  .component-wizard-summary,
  .component-detail-overview {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .component-wizard-progress,
  .component-import-stats,
  .component-wizard-summary,
  .component-detail-overview {
    grid-template-columns: 1fr;
  }

  .component-detail-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .component-panel-heading,
  .component-wizard-actions,
  .component-import-upload {
    display: grid;
  }

  .component-wizard-navigation,
  .component-wizard-navigation button,
  .component-wizard-actions > button,
  .component-import-upload > button,
  .inline-create-row > * {
    width: 100%;
  }
}


/* Packaging: wizard, distinta componenti, tabella e importazione Excel */
.packaging-module-header,
.packaging-panel-heading,
.packaging-import-summary-row,
.packaging-wizard-actions,
.packaging-wizard-navigation,
.packaging-primary-actions,
.packaging-component-tools,
.packaging-copy-row,
.packaging-row-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.packaging-module-header,
.packaging-panel-heading,
.packaging-import-summary-row,
.packaging-wizard-actions { justify-content: space-between; }
.packaging-primary-actions { justify-content: flex-end; }
.packaging-wizard-panel,
.packaging-import-panel {
  margin: 20px 0;
  padding: 22px;
  border: 1px solid #d9e4dd;
  border-radius: 18px;
  background: #fbfdfb;
  box-shadow: 0 10px 30px rgba(24, 62, 43, 0.06);
}
.packaging-wizard-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0 24px;
  padding: 0;
  list-style: none;
}
.packaging-wizard-progress li {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 12px; background: #edf2ef; color: #66736c; font-weight: 700; font-size: 12px;
}
.packaging-wizard-progress li span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: #d8e1dc; }
.packaging-wizard-progress li.active { background: #e1efe6; color: #183e2b; }
.packaging-wizard-progress li.complete { background: #edf7f0; color: #27633d; }
.packaging-step-heading { margin-bottom: 18px; }
.packaging-step-heading h4 { margin: 0 0 4px; font-size: 18px; }
.packaging-component-tools { align-items: flex-end; margin-bottom: 16px; }
.packaging-component-search { flex: 1 1 280px; }
.packaging-copy-components { flex: 1 1 340px; }
.packaging-copy-row select { min-width: 250px; flex: 1; }
.packaging-inline-component-panel { margin: 16px 0; padding: 18px; border: 1px dashed #9fbeaa; border-radius: 14px; background: #f4f9f5; }
.packaging-component-library { overflow: auto; max-width: 100%; border: 1px solid #dfe7e2; border-radius: 14px; }
.packaging-component-library-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.packaging-component-library-table th,
.packaging-component-library-table td { padding: 9px 10px; border-right: 1px solid #e5ebe7; border-bottom: 1px solid #e5ebe7; background: #fff; vertical-align: middle; }
.packaging-component-library-table thead th { position: sticky; top: 0; z-index: 2; background: #edf4ef; color: #254333; text-align: left; }
.packaging-component-library-table tr.is-selected td { background: #f1f8f3; }
.packaging-component-library-table td strong,
.packaging-component-library-table td span { display: block; }
.packaging-component-library-table td span { color: #718078; font-size: 11px; }
.packaging-component-library-table input[type="text"] { min-width: 150px; }
.packaging-quantity-input { width: 90px; }
.packaging-selection-summary { margin: 10px 0 0; font-weight: 700; }
.packaging-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.packaging-summary-grid > div { padding: 14px; border: 1px solid #dde6e0; border-radius: 12px; background: #fff; }
.packaging-summary-grid span,
.packaging-summary-grid strong { display: block; }
.packaging-summary-grid span { color: #718078; font-size: 12px; margin-bottom: 4px; }
.packaging-import-upload,
.packaging-import-dropzone { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.packaging-import-upload { justify-content: space-between; margin-top: 18px; }
.packaging-import-dropzone { flex: 1; padding: 16px; border: 1px dashed #9db7a5; border-radius: 14px; background: #f7faf8; }
.packaging-import-dropzone strong,
.packaging-import-dropzone span { display: block; }
.packaging-import-dropzone span { margin-top: 3px; color: #718078; font-size: 12px; }
.packaging-import-preview { margin-top: 18px; }
.packaging-import-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.packaging-import-stats > div { min-width: 90px; padding: 9px 12px; border-radius: 10px; background: #eef4f0; text-align: center; }
.packaging-import-stats strong,
.packaging-import-stats span { display: block; }
.packaging-import-stats span { font-size: 11px; color: #6d7a72; }
.packaging-import-table-shell,
.packaging-table-shell { overflow: auto; max-width: 100%; border: 1px solid #dce5df; border-radius: 14px; background: #fff; }
.packaging-import-table,
.packaging-data-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.packaging-import-table th,
.packaging-import-table td,
.packaging-data-table th,
.packaging-data-table td { padding: 10px 12px; border-right: 1px solid #e5ebe7; border-bottom: 1px solid #e5ebe7; background: #fff; vertical-align: top; }
.packaging-import-table thead th,
.packaging-data-table thead th { position: sticky; top: 0; z-index: 3; background: #edf4ef; color: #254333; white-space: nowrap; }
.packaging-data-table thead button { border: 0; background: transparent; font: inherit; font-weight: 800; color: inherit; cursor: pointer; }
.packaging-data-table thead button.active { color: #176538; }
.packaging-sticky-column { position: sticky; left: 0; z-index: 4 !important; min-width: 145px; background: #f7faf8 !important; text-align: left; }
.packaging-code-cell strong,
.packaging-code-cell span { display: block; }
.packaging-code-cell span { margin-top: 3px; color: #728078; font-size: 11px; }
.packaging-name-cell { min-width: 250px; max-width: 360px; }
.packaging-product-codes-cell { min-width: 190px; max-width: 320px; }
.packaging-count-button { border: 1px solid #bdd5c5; border-radius: 999px; padding: 5px 9px; background: #edf7f0; color: #1d5d37; font-weight: 800; cursor: pointer; white-space: nowrap; }
.packaging-row-actions { min-width: 250px; }
.packaging-table-toolbar { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin: 18px 0; }
.packaging-search-field { flex: 1 1 320px; }
.packaging-import-table tr.has-error td { background: #fff5f5; }
.compact-empty { min-width: 100%; border: 0; }
@media (max-width: 760px) {
  .packaging-wizard-progress { grid-template-columns: 1fr 1fr; }
  .packaging-primary-actions { justify-content: flex-start; }
  .packaging-wizard-panel, .packaging-import-panel { padding: 16px; }
}
.packaging-dossier-workspace:not(:empty) {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #dbe5de;
}

.packaging-dossier-button {
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.packaging-dossier-button.is-complete {
  background: #e3f5e9;
  color: #17643a;
}

.packaging-dossier-button.is-warning {
  background: #fff1cc;
  color: #805b00;
}

.document-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.document-summary-grid article {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid #dbe5de;
  border-radius: 14px;
  background: #f8fbf9;
}

.document-summary-grid strong {
  color: #183e2b;
  font-size: 1.7rem;
}

.document-summary-grid span {
  color: #617269;
  font-size: 0.86rem;
}

.document-wizard-panel {
  margin-bottom: 24px;
}

.document-wizard-progress {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.document-file-drop {
  padding: 16px;
  border: 1px dashed #93ae9d;
  border-radius: 12px;
  background: #f8fbf9;
}

.document-table-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(150px, 1fr)) auto auto;
  gap: 12px;
  align-items: end;
  margin: 20px 0 14px;
}

.document-search-field {
  display: grid;
  gap: 6px;
}

.document-search-field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #52645a;
}

.document-search-field input {
  min-height: 42px;
}

.document-table-shell,
.document-coverage-preview {
  overflow: auto;
  border: 1px solid #dbe5de;
  border-radius: 14px;
}

.document-data-table,
.document-coverage-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.document-data-table th,
.document-data-table td,
.document-coverage-table th,
.document-coverage-table td {
  padding: 12px;
  border-bottom: 1px solid #e7eee9;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.document-data-table thead th,
.document-coverage-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef5f0;
  color: #294b38;
  font-size: 0.78rem;
}

.document-data-table thead button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.document-sticky-column {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 240px;
  background: #fff;
}

.document-data-table thead .document-sticky-column {
  z-index: 3;
  background: #eef5f0;
}

.document-title-cell strong,
.document-title-cell span {
  display: block;
}

.document-title-cell span {
  margin-top: 4px;
  color: #718078;
  font-size: 0.78rem;
  font-weight: 500;
}

.document-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.document-coverage-table th:first-child {
  min-width: 240px;
}

.document-coverage-table td {
  text-align: center;
}

.coverage-check {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #e3f5e9;
  color: #17643a;
  font-weight: 900;
}

@media (max-width: 1100px) {
  .document-table-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .document-summary-grid,
  .document-table-toolbar {
    grid-template-columns: 1fr;
  }
}

/* Dossier visuale, coperture sintetiche, caricamento multiplo e controllo finale */
.dossier-visual-panel {
  margin-top: 18px;
  border: 1px solid #cfddd3;
  border-radius: 20px;
  background: #f6f9f7;
  box-shadow: 0 18px 42px rgba(25, 55, 38, .10);
  overflow: hidden;
}

.dossier-visual-heading,
.dossier-section-heading,
.dossier-heading-actions,
.document-heading-actions,
.document-batch-upload-row,
.document-batch-editor-heading,
.document-batch-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dossier-visual-heading {
  padding: 22px 24px;
  border-bottom: 1px solid #d8e3db;
  background: #fff;
}

.dossier-visual-heading h3,
.dossier-section-heading h4,
.document-batch-editor-heading h4 {
  margin: 0;
}

.dossier-visual-heading p,
.dossier-section-heading p {
  margin: 4px 0 0;
}

.dossier-heading-actions { flex-wrap: wrap; justify-content: flex-end; }
.document-heading-actions { flex-wrap: wrap; justify-content: flex-end; }
.dossier-heading-actions .icon-close-button { margin-left: 4px; }
.dossier-visual-content { display: grid; gap: 18px; padding: 20px; }

.dossier-loading-state {
  padding: 56px 24px;
  border-radius: 16px;
  background: #fff;
  color: #5f7066;
  text-align: center;
}

.dossier-status-hero {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) minmax(420px, 2fr);
  gap: 20px;
  padding: 22px;
  border: 1px solid #c8d8cc;
  border-radius: 18px;
  color: #143524;
  background: linear-gradient(135deg, #eaf4ed, #fff);
}

.dossier-status-hero.is-blocked { border-color: #e4beb9; background: linear-gradient(135deg, #fff0ee, #fff); }
.dossier-status-hero.is-warning { border-color: #e7d09d; background: linear-gradient(135deg, #fff8e8, #fff); }
.dossier-status-main { display: grid; align-content: center; gap: 4px; }
.dossier-status-main > span { font-size: .7rem; font-weight: 900; letter-spacing: .12em; }
.dossier-status-main > strong { font-size: 1.55rem; }
.dossier-status-main p { margin: 2px 0 0; color: #53675a; }

.dossier-status-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(72px, 1fr));
  gap: 9px;
}

.dossier-status-metrics article {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 84px;
  padding: 10px 8px;
  border: 1px solid rgba(77, 112, 89, .16);
  border-radius: 13px;
  background: rgba(255,255,255,.82);
  text-align: center;
}

.dossier-status-metrics strong { font-size: 1.35rem; }
.dossier-status-metrics span { color: #66766d; font-size: .72rem; }

.dossier-visual-section {
  padding: 20px;
  border: 1px solid #dbe5de;
  border-radius: 17px;
  background: #fff;
}

.dossier-section-heading { margin-bottom: 15px; }
.dossier-identity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dossier-identity-grid article {
  display: grid;
  gap: 4px;
  min-height: 70px;
  padding: 12px 14px;
  border: 1px solid #e1e9e3;
  border-radius: 12px;
  background: #f9fbfa;
}

.dossier-identity-grid span { color: #6c7a71; font-size: .73rem; font-weight: 750; }
.dossier-identity-grid strong { align-self: start; font-size: .9rem; overflow-wrap: anywhere; }
.dossier-table-shell { overflow: auto; border: 1px solid #dde6df; border-radius: 13px; }
.dossier-data-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: .78rem; }
.dossier-data-table th,
.dossier-data-table td { padding: 10px 11px; border-right: 1px solid #e8eee9; border-bottom: 1px solid #e8eee9; text-align: left; vertical-align: top; }
.dossier-data-table thead th { position: sticky; top: 0; z-index: 1; color: #294c38; background: #eef5f0; font-size: .72rem; white-space: nowrap; }
.dossier-data-table tbody tr:last-child td { border-bottom: 0; }
.dossier-data-table tbody tr:hover td { background: #fbfdfb; }
.dossier-inline-empty { padding: 18px; border: 1px dashed #bdcfc2; border-radius: 12px; color: #627168; background: #f8fbf9; }

.document-component-badges,
.document-requirement-marks {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 120px;
}

.document-component-badge,
.document-requirement-mark,
.dossier-mini-ok {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 7px;
  border: 1px solid #bdd1c3;
  border-radius: 999px;
  color: #245038;
  background: #edf6f0;
  font-size: .69rem;
  font-weight: 850;
  white-space: nowrap;
}

.document-requirement-mark.is-missing { border-color: #e4b9b5; color: #8a2e25; background: #fff0ef; }
.document-requirement-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 10px 0 14px;
  padding: 10px 12px;
  border: 1px solid #dce7df;
  border-radius: 11px;
  color: #586a5f;
  background: #f8faf9;
  font-size: .7rem;
}
.document-requirement-legend b { color: #1f5637; }
.dossier-document-legend { margin-top: 0; }

.dossier-check-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.dossier-check-box { padding: 14px; border: 1px solid #dce5df; border-radius: 13px; background: #fafcfb; }
.dossier-check-box.is-error { border-color: #e4c0bc; background: #fff5f4; }
.dossier-check-box.is-warning { border-color: #e8d5aa; background: #fffaf0; }
.dossier-check-box.is-ok { border-color: #c7ddce; background: #f3f9f5; }
.dossier-check-box h5 { margin: 0 0 8px; font-size: .84rem; }
.dossier-check-box ul { margin: 0; padding-left: 18px; color: #57665d; font-size: .76rem; }
.dossier-check-box li + li { margin-top: 5px; }
.dossier-check-more {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(55, 105, 73, .16);
}
.dossier-check-more summary {
  color: #245b38;
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
}
.dossier-check-more[open] summary { margin-bottom: 8px; }
.dossier-signature-note { margin: 13px 0 0; font-size: .75rem; }

.document-batch-panel { margin-top: 18px; }
.document-batch-upload-row { align-items: end; margin: 16px 0; }
.document-batch-upload-row > .field:first-child { flex: 0 1 340px; }
.document-batch-upload-row > .field:last-child { flex: 1 1 420px; }
.document-batch-workspace {
  display: grid;
  grid-template-columns: minmax(210px, .8fr) minmax(0, 2.2fr);
  gap: 14px;
  margin: 18px 0;
}
.document-batch-queue,
.document-batch-editor { border: 1px solid #dbe5de; border-radius: 15px; background: #fff; overflow: hidden; }
.document-batch-queue-heading { display: grid; gap: 2px; padding: 13px; border-bottom: 1px solid #e3ebe5; background: #f3f7f4; }
.document-batch-queue-item { display: grid; width: 100%; gap: 3px; padding: 11px 13px; border: 0; border-bottom: 1px solid #e8eee9; color: #2f4136; background: #fff; text-align: left; cursor: pointer; }
.document-batch-queue-item:hover,
.document-batch-queue-item.is-active { background: #eef6f0; }
.document-batch-queue-item.is-active { box-shadow: inset 4px 0 #3b7652; }
.document-batch-queue-item.is-complete span { color: #2f754c; }
.document-batch-queue-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-batch-queue-item span { color: #7a867e; font-size: .72rem; }
.document-batch-editor { padding: 16px; }
.document-batch-editor-heading { margin-bottom: 13px; }
.document-batch-associations { display: grid; grid-template-columns: 1fr 1.15fr; gap: 12px; margin-top: 14px; }
.document-batch-associations section { min-width: 0; }
.document-batch-associations h5 { margin: 0 0 7px; }
.document-batch-associations .document-components-checklist,
.document-batch-associations .document-requirements-checklist { max-height: 220px; }
.document-batch-editor-actions { justify-content: flex-end; margin-top: 13px; }

@media (max-width: 980px) {
  .dossier-status-hero { grid-template-columns: 1fr; }
  .dossier-identity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dossier-check-columns { grid-template-columns: 1fr; }
  .document-batch-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .dossier-visual-heading,
  .document-batch-upload-row,
  .document-batch-editor-heading { align-items: stretch; flex-direction: column; }
  .dossier-heading-actions,
  .document-heading-actions { width: 100%; justify-content: stretch; }
  .dossier-heading-actions > button,
  .document-heading-actions > button { flex: 1 1 auto; }
  .dossier-status-metrics { grid-template-columns: repeat(2, 1fr); }
  .dossier-identity-grid,
  .document-batch-associations { grid-template-columns: 1fr; }
}

.practice-component-picker-field {
  gap: 12px;
}

.practice-component-picker-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.practice-component-picker-heading .muted {
  margin: 4px 0 0;
  max-width: 820px;
}

.practice-component-picker-label {
  display: block;
  color: #263c30;
  font-size: 0.9rem;
  font-weight: 750;
}

.practice-component-picker-table-shell {
  overflow: auto;
  max-height: 460px;
  border: 1px solid #dbe5de;
  border-radius: 14px;
  background: #fff;
}

.practice-component-picker-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  table-layout: fixed;
}

.practice-component-picker-table th,
.practice-component-picker-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e7eee9;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}

.practice-component-picker-table th {
  background: #eef5f0;
  color: #294b38;
  font-size: 0.78rem;
  font-weight: 800;
}

.practice-component-picker-table th:nth-child(1) { width: 7%; }
.practice-component-picker-table th:nth-child(2) { width: 15%; }
.practice-component-picker-table th:nth-child(3) { width: 24%; }
.practice-component-picker-table th:nth-child(4) { width: 19%; }
.practice-component-picker-table th:nth-child(5) { width: 25%; }
.practice-component-picker-table th:nth-child(6) { width: 10%; }

.practice-component-filter-row th {
  padding: 7px 8px;
  background: #f8fbf9;
}

.practice-component-filter-row input {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 0.78rem;
}

.practice-component-picker-table tbody tr:last-child td {
  border-bottom: 0;
}

.practice-component-picker-table tbody tr.is-selected td {
  background: #f0f8f3;
}

.practice-component-picker-table tbody td:first-child {
  text-align: center;
  vertical-align: middle;
}

.practice-component-picker-table input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: #17623b;
}

.practice-component-picker-table td strong,
.practice-component-picker-table td span {
  display: block;
}

.practice-component-picker-table td span {
  margin-top: 3px;
  color: #64766b;
  font-size: 0.76rem;
  line-height: 1.35;
}

.practice-component-picker-empty {
  padding: 22px !important;
  color: #66786e;
  text-align: center !important;
}

.practice-component-selection-count {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
}

/* Flusso lineare V4.2: archivi compatti, focus sui wizard e coperture leggibili */
.module-launch-card.is-featured-wide {
  grid-column: 1 / -1;
  min-height: 118px;
  background: linear-gradient(135deg, #edf6f0, #ffffff);
}

.packaging-workspace.is-focused-mode .packaging-table-toolbar,
.packaging-workspace.is-focused-mode #packagingsLoading,
.packaging-workspace.is-focused-mode #packagingsEmpty,
.packaging-workspace.is-focused-mode #packagingsTableShell,
.component-workspace.is-focused-mode .component-table-toolbar,
.component-workspace.is-focused-mode #componentCoverageLegend,
.component-workspace.is-focused-mode #componentsLoading,
.component-workspace.is-focused-mode #componentsEmpty,
.component-workspace.is-focused-mode #componentsTableShell,
.document-workspace.is-focused-mode .document-summary-grid,
.document-workspace.is-focused-mode .document-table-toolbar,
.document-workspace.is-focused-mode #documentRequirementLegend,
.document-workspace.is-focused-mode #documentsLoading,
.document-workspace.is-focused-mode #documentsEmpty,
.document-workspace.is-focused-mode #documentsTableShell {
  display: none !important;
}

.packaging-table-shell,
.component-table-shell,
.document-table-shell,
.dossier-table-shell,
.packaging-component-library {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
}

.packaging-data-table {
  width: 100%;
  min-width: 1040px;
  table-layout: auto;
}

.packaging-data-table th,
.packaging-data-table td,
.component-data-table th,
.component-data-table td,
.document-data-table th,
.document-data-table td {
  vertical-align: middle;
  line-height: 1.35;
}

.packaging-sticky-column,
.component-sticky-column,
.document-sticky-column {
  box-shadow: 8px 0 12px -12px rgba(23, 55, 36, .7);
}

.packaging-sticky-column {
  min-width: 245px;
  max-width: 310px;
}

.packaging-code-cell span {
  white-space: normal;
}

.packaging-product-codes-cell {
  min-width: 170px;
  max-width: 260px;
  white-space: normal;
}

.component-data-table {
  min-width: 1180px;
}

.component-sticky-column {
  min-width: 245px;
  max-width: 310px;
}

.component-technical-cell {
  min-width: 220px;
  max-width: 300px;
  white-space: normal !important;
}

.component-technical-cell strong,
.component-technical-cell span {
  display: block;
}

.component-technical-cell span {
  margin-top: 4px;
  color: #6f7d75;
  font-size: .72rem;
}

.component-coverage-cell {
  min-width: 330px;
  white-space: normal !important;
}

.component-coverage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 5px;
}

.coverage-status-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 9px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #dce7df;
  border-radius: 12px;
  color: #5d6c63;
  background: #f8fbf9;
  font-size: .74rem;
}

.coverage-symbol,
.document-presence-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .69rem;
  font-weight: 900;
  white-space: nowrap;
}

button.document-presence-badge:not(:disabled) {
  cursor: pointer;
}

button.document-presence-badge:not(:disabled):hover {
  filter: brightness(.97);
  box-shadow: 0 0 0 2px rgba(26, 100, 58, .12);
}

button.document-presence-badge:focus-visible {
  outline: 3px solid rgba(26, 100, 58, .28);
  outline-offset: 2px;
}

button.document-presence-badge:disabled {
  cursor: not-allowed;
  opacity: .62;
}

.coverage-symbol.is-covered,
.document-presence-badge.is-present {
  border-color: #b9d7c2;
  color: #17643a;
  background: #e8f6ec;
}

.coverage-symbol.is-review,
.document-presence-badge.is-review {
  border-color: #e2c985;
  color: #795a00;
  background: #fff5d9;
}

.coverage-symbol.is-missing,
.document-presence-badge.is-missing {
  border-color: #e5b9b4;
  color: #922f27;
  background: #fff0ee;
}

.coverage-symbol.is-na {
  border-color: #d7ded9;
  color: #77827b;
  background: #f0f2f1;
}

.component-row-actions,
.document-row-actions,
.packaging-row-actions {
  display: flex;
  flex-wrap: wrap;
  min-width: 210px;
  gap: 6px;
}

.table-action-button.is-primary {
  border-color: #9fc1aa;
  color: #ffffff;
  background: #245f3b;
}

.table-action-button.is-primary:hover {
  background: #194c2d;
}

.document-data-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.document-table-toolbar {
  grid-template-columns: minmax(240px, 1.5fr) repeat(3, minmax(150px, 1fr)) auto auto;
}

.document-data-table td:nth-child(3) {
  min-width: 0;
  white-space: normal;
}

.document-data-table td:last-child,
.document-data-table th:last-child {
  position: static;
  background: inherit;
  box-shadow: none;
}

.document-data-table thead th:last-child {
  background: #eef5f0;
}

.document-title-cell {
  min-width: 0;
  max-width: none;
  white-space: normal !important;
}

.document-data-table .document-sticky-column,
.document-data-table thead .document-sticky-column {
  position: static;
  min-width: 0;
  background: inherit;
  box-shadow: none;
}

.document-data-table thead .document-sticky-column {
  background: #eef5f0;
}

.document-data-table th,
.document-data-table td {
  padding: 10px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.document-data-table th:nth-child(1) { width: 23%; }
.document-data-table th:nth-child(2) { width: 14%; }
.document-data-table th:nth-child(3) { width: 25%; }
.document-data-table th:nth-child(4) { width: 12%; }
.document-data-table th:nth-child(5) { width: 9%; }
.document-data-table th:nth-child(6) { width: 17%; }

.document-data-table .document-requirement-marks {
  min-width: 0;
}

.document-data-table .document-row-actions {
  min-width: 0;
  align-items: center;
}

@media (max-width: 1150px) {
  .document-data-table {
    min-width: 940px;
    table-layout: fixed;
  }
}

.dossier-data-table.component-detail-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
}

.dossier-data-table.component-detail-table th,
.dossier-data-table.component-detail-table td {
  vertical-align: middle;
  white-space: normal;
}

.packaging-summary-components {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.packaging-summary-components h5 {
  margin: 0 0 2px;
}

.packaging-summary-components article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #dfe8e2;
  border-radius: 12px;
  background: #fff;
}

.packaging-summary-components article div,
.packaging-summary-components article strong,
.packaging-summary-components article span:not(.document-presence-badge) {
  display: block;
}

.packaging-summary-components article span:not(.document-presence-badge) {
  margin-top: 3px;
  color: #6d7a72;
  font-size: .73rem;
}

.dossier-evidence-list {
  display: grid;
  gap: 14px;
}

.dossier-evidence-card {
  overflow: hidden;
  border: 1px solid #d7e2da;
  border-radius: 15px;
  background: #fff;
}

.dossier-evidence-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 17px;
  border-bottom: 1px solid #e2e9e4;
  background: #f7faf8;
}

.dossier-evidence-card-heading h5,
.dossier-evidence-card-heading p {
  margin: 0;
}

.dossier-evidence-card-heading h5 {
  color: #1c442d;
  font-size: .92rem;
}

.dossier-evidence-card-heading p {
  margin-top: 4px;
  color: #68766e;
  font-size: .73rem;
}

.dossier-evidence-coverage {
  padding: 12px 16px;
  border-bottom: 1px solid #e6ece8;
  background: #fcfdfc;
}

.dossier-component-documents {
  padding: 12px 16px 16px;
}

.dossier-component-documents .dossier-inline-empty {
  margin: 0;
  padding: 12px 14px;
}

.dossier-requirement-explanation {
  margin-bottom: 14px;
  padding: 13px 15px;
  border: 1px solid #cfe0d4;
  border-left: 4px solid #315e43;
  border-radius: 12px;
  color: #334a3c;
  background: #f4f9f5;
  font-size: .84rem;
  line-height: 1.5;
}

.dossier-requirement-settings-table {
  min-width: 1040px;
}

.dossier-requirement-settings-table td {
  vertical-align: top;
}

.dossier-requirement-settings-table td:first-child {
  min-width: 190px;
}

.dossier-requirement-settings-table td:first-child strong,
.dossier-requirement-settings-table td:first-child small {
  display: block;
}

.dossier-requirement-settings-table td:first-child small {
  margin-top: 4px;
  color: #718078;
  font-weight: 800;
}

.dossier-requirement-settings-table select,
.dossier-requirement-settings-table input {
  width: 100%;
  min-height: 38px;
}

.dossier-requirement-settings-table td:nth-child(4) {
  min-width: 220px;
}

.dossier-requirement-settings-table td:nth-child(5) {
  min-width: 330px;
}

.requirement-kind-label {
  display: inline-flex;
  padding: 4px 8px;
  border: 1px solid #d7e0da;
  border-radius: 999px;
  color: #59675f;
  background: #f4f6f5;
  font-size: .71rem;
  font-weight: 800;
  white-space: nowrap;
}

.requirement-kind-label.is-legal_core,
.requirement-kind-label.is-dossier_core {
  border-color: #b8d5c1;
  color: #185b36;
  background: #e8f5ec;
}

.requirement-kind-label.is-legal_conditional,
.requirement-kind-label.is-other_law_conditional,
.requirement-kind-label.is-legal_future {
  border-color: #e2cb91;
  color: #755a12;
  background: #fff7df;
}

.dossier-requirement-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

.dossier-requirement-actions .message {
  flex: 1;
  margin: 0;
}

@media (max-width: 720px) {
  .component-coverage-grid {
    grid-template-columns: repeat(2, minmax(72px, 1fr));
  }

  .packaging-summary-components article,
  .dossier-evidence-card-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .dossier-evidence-card-heading button {
    width: 100%;
  }

  .dossier-requirement-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dossier-requirement-actions button {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .practice-component-picker-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .practice-component-picker-heading .secondary-button {
    width: 100%;
  }
}

/* Componenti V4.3.3: tabella compatta e dati tecnici su righe distinte */
.component-table-shell {
  scrollbar-gutter: auto;
}

.component-data-table {
  width: 100%;
  min-width: 1080px;
  table-layout: fixed;
}

.component-data-table th,
.component-data-table td {
  padding: 10px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.component-data-table th:nth-child(1) { width: 12%; }
.component-data-table th:nth-child(2) { width: 10%; }
.component-data-table th:nth-child(3) { width: 14%; }
.component-data-table th:nth-child(4) { width: 11%; }
.component-data-table th:nth-child(5) { width: 24%; }
.component-data-table th:nth-child(6) { width: 6%; }
.component-data-table th:nth-child(7) { width: 7%; }
.component-data-table th:nth-child(8) { width: 16%; }

.component-sticky-column,
.component-data-table thead .component-sticky-column {
  position: static;
  min-width: 0;
  max-width: none;
  box-shadow: none;
}

.component-code-cell span {
  max-width: none;
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
}

.component-supplier-cell,
.component-technical-cell,
.component-coverage-cell {
  min-width: 0;
  max-width: none;
  white-space: normal !important;
}

.component-supplier-cell {
  line-height: 1.45;
}

.component-technical-cell strong,
.component-technical-cell span {
  display: block;
  margin: 0;
}

.component-technical-cell .component-technical-material {
  margin-top: 3px;
  color: #253d30;
  font-weight: 750;
}

.component-technical-cell span:not(.component-technical-material) {
  margin-top: 3px;
  color: #6f7d75;
  font-size: .72rem;
}

.component-coverage-grid {
  grid-template-columns: repeat(3, minmax(58px, 1fr));
}

.component-row-actions {
  min-width: 0;
  align-content: center;
  flex-wrap: wrap;
}

.component-detail-section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .component-detail-heading-actions,
  .component-detail-heading-actions .secondary-button {
    width: 100%;
  }

  .component-detail-section-actions,
  .component-detail-section-actions button {
    width: 100%;
  }
}

/* Fornitori V4.3.4: riepilogo completo senza scorrimento sui normali schermi PC */
.supplier-data-table {
  width: 100%;
  min-width: 1080px;
  table-layout: fixed;
}

.supplier-data-table th,
.supplier-data-table td {
  padding: 10px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.supplier-data-table th:nth-child(1) { width: 17%; }
.supplier-data-table th:nth-child(2) { width: 11%; }
.supplier-data-table th:nth-child(3) { width: 17%; }
.supplier-data-table th:nth-child(4) { width: 21%; }
.supplier-data-table th:nth-child(5) { width: 10%; }
.supplier-data-table th:nth-child(6) { width: 9%; }
.supplier-data-table th:nth-child(7) { width: 7%; }
.supplier-data-table th:nth-child(8) { width: 8%; }

.supplier-sticky-column,
.supplier-data-table thead .supplier-sticky-column {
  position: static;
  min-width: 0;
  max-width: none;
  box-shadow: none;
}

.supplier-cell-stack,
.supplier-contact-cell,
.supplier-usage-cell {
  min-width: 0;
  max-width: none;
}

.supplier-cell-stack > *,
.supplier-contact-cell > * {
  display: block;
}

.supplier-cell-stack > * + *,
.supplier-contact-cell > * + * {
  margin-top: 4px;
}

.supplier-cell-muted {
  color: #6f7d75;
  font-size: .72rem;
}

.supplier-address-cell,
.supplier-notes-cell {
  min-width: 0;
  max-width: none;
  white-space: normal !important;
}

.supplier-contact-cell strong {
  color: #253d30;
}

.supplier-contact-cell a {
  overflow-wrap: anywhere;
}

.supplier-website-link {
  color: #5d6f64;
  font-size: .72rem;
}

.supplier-notes-cell > span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: #5f6d65;
  font-size: .72rem;
}

.supplier-usage-cell > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  color: #5f6d65;
  font-size: .68rem;
  font-weight: 750;
}

.supplier-usage-cell > span + span {
  margin-top: 5px;
}

.supplier-usage-cell .supplier-count-badge {
  min-width: 25px;
  min-height: 23px;
  padding: 2px 6px;
}

.supplier-data-table .supplier-row-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.supplier-data-table .table-action-button {
  width: 100%;
  min-height: 29px;
  padding: 0 5px;
}

@media (max-width: 1120px) {
  .supplier-data-table {
    min-width: 980px;
  }

  .supplier-data-table th,
  .supplier-data-table td {
    padding: 8px;
  }
}

/* Packaging e dossier V4.3.7: distinta essenziale, ritorno rapido e tabella compatta */
.dossier-back-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.packaging-table-shell {
  overflow-x: hidden;
  scrollbar-gutter: auto;
}

.packaging-data-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.packaging-data-table th,
.packaging-data-table td {
  min-width: 0;
  padding: 10px 8px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.packaging-data-table thead th {
  white-space: normal;
}

.packaging-data-table th:nth-child(1) { width: 22%; }
.packaging-data-table th:nth-child(2) { width: 12%; }
.packaging-data-table th:nth-child(3) { width: 11%; }
.packaging-data-table th:nth-child(4) { width: 9%; }
.packaging-data-table th:nth-child(5) { width: 15%; }
.packaging-data-table th:nth-child(6) { width: 12%; }
.packaging-data-table th:nth-child(7) { width: 19%; }

.packaging-sticky-column,
.packaging-data-table thead .packaging-sticky-column {
  position: static;
  min-width: 0;
  max-width: none;
  box-shadow: none;
}

.packaging-data-table .packaging-row-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  gap: 6px;
}

.packaging-data-table .packaging-row-actions .table-action-button {
  width: 100%;
  min-width: 0;
  min-height: 31px;
  padding: 5px 6px;
  white-space: normal;
}

.packaging-dossier-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 44px;
  padding: 5px 8px;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

.packaging-count-button,
.document-presence-badge {
  max-width: 100%;
}

@media (max-width: 900px) {
  .packaging-table-shell {
    overflow-x: auto;
  }

  .packaging-data-table {
    min-width: 820px;
  }
}

@media (max-width: 720px) {
  .dossier-back-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }
}

/* Packaging e dossier V4.3.8: editor distinta unico e tabelle senza tagli laterali */
.packaging-workspace,
.packaging-dossier-workspace,
.dossier-visual-panel,
.dossier-visual-content,
.dossier-visual-content > *,
.dossier-visual-section,
.dossier-evidence-list,
.dossier-evidence-card,
.dossier-component-documents {
  min-width: 0;
  max-width: 100%;
}

.packaging-component-tools {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 1.2fr) auto;
  align-items: end;
}

.packaging-component-search,
.packaging-copy-components {
  min-width: 0;
}

.packaging-component-search .field-help {
  display: block;
  margin-top: 5px;
  color: #67776d;
  font-size: .72rem;
  line-height: 1.35;
}

.packaging-component-library {
  width: 100%;
  overflow-x: hidden;
  scrollbar-gutter: auto;
}

.packaging-component-library-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.packaging-component-library-table th,
.packaging-component-library-table td {
  min-width: 0;
  padding: 9px 8px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  vertical-align: middle;
}

.packaging-component-library-table thead th,
.packaging-component-library-table tbody td {
  text-align: center;
  vertical-align: middle;
}

.packaging-component-library-table th:nth-child(1) { width: 5%; }
.packaging-component-library-table th:nth-child(2) { width: 14%; }
.packaging-component-library-table th:nth-child(3) { width: 10%; }
.packaging-component-library-table th:nth-child(4) { width: 13%; }
.packaging-component-library-table th:nth-child(5) { width: 7%; }
.packaging-component-library-table th:nth-child(6) { width: 14%; }
.packaging-component-library-table th:nth-child(7) { width: 14%; }
.packaging-component-library-table th:nth-child(8) { width: 6%; }
.packaging-component-library-table th:nth-child(9) { width: 17%; }

.packaging-component-library-table input[type="text"],
.packaging-component-library-table input[type="number"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  text-align: center;
}

.packaging-component-library-table .packaging-quantity-input {
  width: 100%;
}

.packaging-component-technical-cell > span,
.packaging-component-pdf-cell > *,
.packaging-component-requirements-cell > *,
.packaging-component-link-fields label,
.packaging-component-link-fields label > span {
  display: block;
}

.packaging-component-technical-cell > span + span {
  margin-top: 4px;
}

.packaging-component-technical-cell > span:last-child,
.packaging-component-document-hint {
  color: #6d7b73;
  font-size: .72rem;
}

.packaging-component-name-link,
.packaging-component-pdf-link {
  width: 100%;
  margin: 0;
  padding: 5px 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.packaging-component-name-link strong {
  color: #176538;
  text-decoration: underline;
  text-decoration-color: #9bc6aa;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.packaging-component-name-link:hover,
.packaging-component-name-link:focus-visible,
.packaging-component-pdf-link:hover,
.packaging-component-pdf-link:focus-visible {
  outline: none;
  background: #e7f3ea;
  box-shadow: 0 0 0 2px #a7cfb3;
}

.packaging-component-pdf-link {
  max-width: 92px;
  margin: 0 auto;
}

.packaging-component-pdf-cell,
.packaging-component-requirements-cell {
  text-align: center;
}

.packaging-pdf-count {
  width: 34px;
  height: 34px;
  margin: 0 auto 5px;
  border-radius: 50%;
  background: #f7e5e3;
  color: #8a2d28;
  font-size: .92rem;
  font-weight: 850;
  line-height: 34px;
}

.packaging-pdf-count.is-present {
  background: #dff1e5;
  color: #176538;
}

.packaging-pdf-count-label,
.packaging-requirement-detail,
.packaging-requirement-empty {
  color: #6d7b73;
  font-size: .69rem;
  line-height: 1.3;
}

.packaging-requirement-count {
  margin-bottom: 5px;
  font-size: .76rem;
  font-weight: 850;
}

.packaging-requirement-count.is-covered { color: #176538; }
.packaging-requirement-count.is-review { color: #8a5b11; }
.packaging-requirement-count.is-missing { color: #a33a32; }

.packaging-requirement-empty {
  padding-top: 8px;
}

.packaging-component-link-fields {
  display: grid;
  gap: 7px;
}

.packaging-back-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.packaging-component-link-fields label > span {
  margin-bottom: 3px;
  color: #617068;
  font-size: .68rem;
  font-weight: 750;
}

.packaging-data-table th:nth-child(1) { width: 24%; }
.packaging-data-table th:nth-child(2) { width: 12%; }
.packaging-data-table th:nth-child(3) { width: 10%; }
.packaging-data-table th:nth-child(4) { width: 9%; }
.packaging-data-table th:nth-child(5) { width: 16%; }
.packaging-data-table th:nth-child(6) { width: 12%; }
.packaging-data-table th:nth-child(7) { width: 17%; }

.packaging-data-table .packaging-row-actions {
  grid-template-columns: 1fr;
}

.packaging-data-table .packaging-dossier-button {
  width: 100%;
  max-width: 112px;
}

.practice-component-readonly-field {
  gap: 12px;
}

.readonly-field {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid #cbd8cf;
  border-radius: 8px;
  background: #f3f7f4;
  color: #183e2b;
  font-weight: 600;
  line-height: 1.35;
}

.readonly-field.is-placeholder {
  color: #64756b;
  font-weight: 400;
}

.practice-component-readonly-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.practice-component-readonly-heading .muted {
  max-width: 780px;
  margin: 4px 0 0;
}

.dossier-visual-content {
  grid-template-columns: minmax(0, 1fr);
}

.dossier-status-hero {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr);
}

.dossier-status-main,
.dossier-status-metrics,
.dossier-status-metrics article,
.dossier-section-heading > *,
.dossier-evidence-card-heading > * {
  min-width: 0;
}

.dossier-evidence-card-heading h5,
.dossier-evidence-card-heading p {
  overflow-wrap: anywhere;
}

.dossier-table-shell,
.component-detail-table-shell {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  scrollbar-gutter: auto;
}

.dossier-data-table,
.dossier-data-table.component-detail-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}

.dossier-data-table th,
.dossier-data-table td,
.dossier-data-table.component-detail-table th,
.dossier-data-table.component-detail-table td {
  min-width: 0;
  padding: 9px 8px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.dossier-data-table thead th {
  white-space: normal;
}

.dossier-data-table .document-component-badges,
.dossier-data-table .document-requirement-marks,
.dossier-evidence-coverage .component-coverage-grid {
  min-width: 0;
}

.dossier-requirement-settings-table {
  min-width: 0;
}

.dossier-requirement-settings-table th:nth-child(1) { width: 19%; }
.dossier-requirement-settings-table th:nth-child(2) { width: 15%; }
.dossier-requirement-settings-table th:nth-child(3) { width: 17%; }
.dossier-requirement-settings-table th:nth-child(4) { width: 19%; }
.dossier-requirement-settings-table th:nth-child(5) { width: 30%; }

.dossier-requirement-settings-table td:first-child,
.dossier-requirement-settings-table td:nth-child(4),
.dossier-requirement-settings-table td:nth-child(5) {
  min-width: 0;
}

.dossier-requirement-settings-table select,
.dossier-requirement-settings-table input,
.dossier-requirement-settings-table textarea {
  width: 100%;
  min-width: 0;
}

.dossier-requirement-settings-table textarea {
  min-height: 58px;
  padding: 8px 10px;
  resize: vertical;
  border: 1px solid #ccd7d0;
  border-radius: 8px;
}

@media (max-width: 1050px) {
  .packaging-component-tools {
    grid-template-columns: 1fr 1fr;
  }

  .packaging-component-tools > button {
    width: 100%;
  }

  .dossier-status-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .packaging-component-tools,
  .practice-component-readonly-heading {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .practice-component-readonly-heading {
    flex-direction: column;
  }

  .practice-component-readonly-heading button {
    width: 100%;
  }

  .packaging-component-library,
  .dossier-table-shell,
  .component-detail-table-shell {
    overflow-x: auto;
  }

  .packaging-component-library-table,
  .dossier-data-table,
  .dossier-data-table.component-detail-table {
    min-width: 760px;
  }
}

/* V4.6.1: filtri collegati, campi allineati e navigazione tra archivi */
.library-filter-toolbar {
  align-items: flex-start;
  padding: 16px;
  border: 1px solid #e0e8e3;
  border-radius: 14px;
  background: #f8fbf9;
}

.library-filter-toolbar .supplier-search-field,
.library-filter-toolbar .packaging-search-field,
.library-filter-toolbar .component-search-field,
.library-filter-toolbar .practice-search-field,
.library-filter-toolbar .document-search-field,
.library-filter-toolbar .compact-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0;
}

.library-filter-toolbar .supplier-search-field label,
.library-filter-toolbar .packaging-search-field label,
.library-filter-toolbar .component-search-field label,
.library-filter-toolbar .practice-search-field label,
.library-filter-toolbar .document-search-field label,
.library-filter-toolbar .compact-field label {
  min-height: 15px;
  margin-bottom: 0;
  color: #526158;
  font-size: 12px;
  font-weight: 800;
  line-height: 15px;
}

.library-filter-toolbar .supplier-search-field input,
.library-filter-toolbar .packaging-search-field input,
.library-filter-toolbar .component-search-field input,
.library-filter-toolbar .practice-search-field input,
.library-filter-toolbar .document-search-field input,
.library-filter-toolbar .compact-field input,
.library-filter-toolbar .compact-field select {
  width: 100%;
  min-height: 48px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #ccd7d0;
  border-radius: 10px;
  outline: none;
  color: #23392c;
  background: #fff;
  font: inherit;
}

.library-filter-toolbar .supplier-search-field input:focus,
.library-filter-toolbar .packaging-search-field input:focus,
.library-filter-toolbar .component-search-field input:focus,
.library-filter-toolbar .practice-search-field input:focus,
.library-filter-toolbar .document-search-field input:focus,
.library-filter-toolbar .compact-field input:focus,
.library-filter-toolbar .compact-field select:focus {
  border-color: #315e45;
  box-shadow: 0 0 0 3px rgba(49, 94, 69, .12);
}

.archive-filter-summary {
  display: grid;
  flex: 0 0 190px;
  grid-template-rows: 32px auto;
  align-items: start;
  justify-items: center;
  min-width: 190px;
  min-height: 69px;
  text-align: center;
}

.archive-filter-summary .toggle-control {
  align-self: start;
  min-height: 26px;
  white-space: nowrap;
}

.archive-filter-summary .count-label {
  display: block;
  min-height: 34px;
  line-height: 17px;
  white-space: normal;
}

.document-table-toolbar.library-filter-toolbar {
  grid-template-columns: minmax(240px, 1.5fr) repeat(3, minmax(150px, 1fr)) minmax(190px, auto);
}

.component-search-field input,
.component-packaging-search-field input,
.packaging-search-field input,
.packaging-component-search input,
.packaging-copy-row input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #ccd7d0;
  border-radius: 10px;
  outline: none;
  color: #23392c;
  background: #fff;
  font: inherit;
}

.component-search-field input:focus,
.component-packaging-search-field input:focus,
.packaging-search-field input:focus,
.packaging-component-search input:focus,
.packaging-copy-row input:focus {
  border-color: #315e45;
  box-shadow: 0 0 0 3px rgba(49, 94, 69, .12);
}

.packaging-search-field label,
.packaging-component-search label,
.packaging-copy-components > label {
  display: block;
  margin-bottom: 6px;
  color: #526158;
  font-size: 12px;
  font-weight: 800;
}

.component-table-toolbar .compact-field input,
.component-table-toolbar .compact-field select,
.packaging-table-toolbar .compact-field select {
  min-height: 48px;
}

.component-packaging-search-field {
  flex: 1 1 260px !important;
  min-width: 230px !important;
}

.packaging-table-toolbar {
  padding: 16px;
  border: 1px solid #e0e8e3;
  border-radius: 14px;
  background: #f8fbf9;
}

.packaging-table-toolbar .compact-field {
  min-width: 190px;
  flex: 0 1 240px;
}

.packaging-component-tools {
  gap: 14px;
}

.packaging-copy-row {
  align-items: stretch;
  flex-wrap: nowrap;
}

.packaging-copy-row input {
  min-width: 0;
  flex: 1 1 280px;
}

.packaging-copy-row button,
.packaging-component-tools > button {
  min-height: 48px;
}

.linked-count-button {
  border: 1px solid transparent;
  font: inherit;
}

button.linked-count-button.has-items {
  cursor: pointer;
}

button.linked-count-button.has-items:hover {
  border-color: #84b394;
  background: #cfe8d7;
}

button.linked-count-button:focus-visible {
  outline: 3px solid rgba(49, 94, 69, .22);
  outline-offset: 2px;
}

.linked-filter-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -2px 0 14px;
  padding: 10px 12px;
  border: 1px solid #b9d6c2;
  border-radius: 12px;
  color: #214c32;
  background: #edf7f0;
  font-size: .82rem;
  font-weight: 800;
}

.linked-filter-notice.hidden {
  display: none;
}

.linked-filter-notice button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #9fc2aa;
  border-radius: 9px;
  color: #1d5b36;
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.linked-filter-notice button:hover {
  background: #f7fbf8;
}

@media (max-width: 1050px) {
  .document-table-toolbar.library-filter-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .packaging-copy-row {
    flex-wrap: wrap;
  }

  .packaging-copy-row button {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .document-table-toolbar.library-filter-toolbar {
    grid-template-columns: 1fr;
  }

  .archive-filter-summary {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }

  .linked-filter-notice {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Pratiche / Dossier V4.4.4: viste esclusive e tabella compatta */
.practice-list-view,
.practice-workspace,
.practice-workspace > * {
  min-width: 0;
  max-width: 100%;
}

.practice-table-shell {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.practice-data-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.practice-data-table th,
.practice-data-table td {
  min-width: 0;
  padding: 11px 9px;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.practice-data-table th:nth-child(1) { width: 23%; }
.practice-data-table th:nth-child(2) { width: 26%; }
.practice-data-table th:nth-child(3) { width: 17%; }
.practice-data-table th:nth-child(4) { width: 22%; }
.practice-data-table th:nth-child(5) { width: 12%; }

.practice-sticky-column,
.practice-data-table thead .practice-sticky-column {
  position: static;
  min-width: 0;
  max-width: none;
  background: inherit !important;
}

.practice-stack-cell > strong,
.practice-stack-cell > span,
.practice-stack-cell > small {
  display: block;
}

.practice-stack-cell > strong {
  color: #183e2b;
  font-size: .79rem;
  line-height: 1.3;
}

.practice-stack-cell > span {
  margin-top: 5px;
  color: #43584b;
  font-size: .75rem;
  line-height: 1.35;
}

.practice-stack-cell > small {
  margin-top: 6px;
  color: #6b7a71;
  font-size: .68rem;
  line-height: 1.3;
}

.practice-status-summary-cell {
  display: table-cell;
}

.practice-status-summary-cell > span {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 7px;
  white-space: normal;
}

.practice-row-actions {
  display: block;
  min-width: 0;
}

.practice-row-actions .table-action-button {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 6px;
  white-space: normal;
}

.practice-row-actions .primary-table-action {
  border-color: #176538;
  background: #176538;
  color: #fff;
  font-weight: 800;
}

.practice-row-actions .primary-table-action:hover,
.practice-row-actions .primary-table-action:focus-visible {
  background: #0f4e2a;
}

@media (max-width: 980px) {
  .practice-data-table th,
  .practice-data-table td {
    padding: 9px 6px;
    font-size: .7rem;
  }

  .practice-data-table th:nth-child(1) { width: 23%; }
  .practice-data-table th:nth-child(2) { width: 25%; }
  .practice-data-table th:nth-child(3) { width: 17%; }
  .practice-data-table th:nth-child(4) { width: 23%; }
  .practice-data-table th:nth-child(5) { width: 12%; }
}

/* V4.6.2: conformità nel componente, controlli navigabili e distinta allineata */
.component-wizard-progress {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* V4.6.3: dichiarazione e matrice tecnica come PDF separati */
.declaration-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 190px;
}

.declaration-file-actions .table-action-button {
  white-space: nowrap;
}

.component-core-requirements {
  display: grid;
  gap: 14px;
}

.component-core-requirement-card {
  padding: 18px;
  border: 1px solid #dbe5de;
  border-radius: 14px;
  background: #fff;
}

.component-core-requirement-card.is-automatic-na {
  border-color: #c9ddcf;
  background: #f5faf6;
}

.component-core-requirement-card.is-to-evaluate {
  border-color: #e5d7a6;
  background: #fffaf0;
}

.component-core-requirement-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.component-core-requirement-heading h5 {
  margin: 0;
  color: #183e2b;
  font-size: 16px;
}

.component-core-requirement-heading p {
  margin: 5px 0 0;
  line-height: 1.4;
}

.component-core-requirement-fields {
  display: grid;
  grid-template-columns: minmax(190px, .7fr) minmax(280px, 1.3fr);
  gap: 14px;
  margin-top: 14px;
}

.component-core-automatic-state {
  margin: 12px 0 0;
  color: #315e45;
  font-size: 13px;
  font-weight: 700;
}

.component-core-document-state {
  margin: 10px 0 0;
  font-size: 12px;
}

.component-core-requirements-unavailable {
  padding: 16px;
  border: 1px solid #e1b7b7;
  border-radius: 12px;
  background: #fff3f3;
  color: #8b2f2f;
  font-weight: 700;
}

.component-detail-conformity-table th:nth-child(1) { width: 25%; }
.component-detail-conformity-table th:nth-child(2) { width: 16%; }
.component-detail-conformity-table th:nth-child(3) { width: 17%; }
.component-detail-conformity-table th:nth-child(4) { width: 8%; }
.component-detail-conformity-table th:nth-child(5) { width: 34%; }

.dossier-check-link {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.dossier-check-link:hover,
.dossier-check-link:focus-visible {
  color: #123f27;
  text-decoration-thickness: 2px;
}

.packaging-component-tools {
  align-items: start;
}

.packaging-component-tools > button {
  align-self: start;
  margin-top: 24px;
}

@media (max-width: 760px) {
  .component-wizard-progress,
  .component-core-requirement-fields {
    grid-template-columns: 1fr;
  }

  .component-core-requirement-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .component-core-requirement-heading .status-badge {
    align-self: flex-start;
  }

  .packaging-component-tools > button {
    width: 100%;
    margin-top: 0;
  }
}

/* V4.6.4: compact MP/PFAS/MOCA cards in the component wizard */
.component-core-requirements {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.component-core-requirement-card {
  display: flex;
  min-width: 0;
  padding: 14px;
  flex-direction: column;
}

.component-core-requirement-heading {
  gap: 10px;
}

.component-core-requirement-heading > div {
  min-width: 0;
}

.component-core-requirement-heading h5 {
  font-size: 14px;
  line-height: 1.25;
}

.component-core-requirement-heading p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
}

.component-core-requirement-heading .status-badge {
  flex: 0 0 auto;
  white-space: nowrap;
}

.component-core-requirement-fields {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.component-core-requirement-fields .field {
  margin-bottom: 0;
}

.component-core-requirement-fields .field label {
  margin-bottom: 5px;
  font-size: 12px;
}

.component-core-requirement-fields select {
  min-height: 42px;
}

.component-core-requirement-fields textarea {
  min-height: 76px;
  padding: 9px 11px;
  line-height: 1.35;
}

.component-core-automatic-state {
  margin-top: 9px;
  font-size: 12px;
  line-height: 1.35;
}

.component-core-document-state {
  margin-top: auto;
  padding-top: 10px;
  line-height: 1.35;
}

@media (max-width: 1100px) {
  .component-core-requirements {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .component-core-requirements {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* V4.6.4: align MP/PFAS/MOCA fields on the three-column desktop layout */
@media (min-width: 1101px) {
  .component-core-requirement-heading {
    min-height: 58px;
  }

  .component-core-automatic-state {
    min-height: 34px;
  }

  .component-core-requirement-fields textarea {
    height: 76px;
  }
}
