/* Stile condiviso: mantenere l’ordine delle regole, perché quelle successive affinano il tema originale. */
/* Theme values and visual assets from Eumetra.Budget wwwroot/css/style.css. */

/* Colori del tema, carattere e valori comuni. */
:root {
  --ink: #243e4c;
  --muted: #6c7d86;
  --blue: #3c6880;
  --navy: #243e4c;
  --teal: #459d93;
  --gold: #d49c1a;
  --line: #d5d5d5;
  --light: #f2f7fa;
  --danger: #c96662;
  --font: 'Hanken Grotesk', 'Segoe UI', Arial, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 14px/1.5 var(--font);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 3px;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #84b8d3;
}
button {
  cursor: pointer;
  background: var(--blue);
  color: #fff;
  border: 1px solid var(--blue);
  border-radius: 50rem;
  padding: 7px 18px;
  font-weight: 400;
  line-height: 1.5;
  transition: background 0.15s;
}
button:hover:not(:disabled) {
  background: #305366;
  border-color: #305366;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: white;
}
.primary:hover:not(:disabled) {
  background: #b98612;
  border-color: #b98612;
}
.danger {
  background: transparent;
  color: #b04d49;
  border-color: #c96662;
}
.danger:hover:not(:disabled) {
  background: #f8e7e5;
  border-color: #b34d49;
}
.small {
  font-size: 12px;
  padding: 5px 12px;
}
.link,
.icon-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  text-align: left;
  font-weight: 500;
  border-radius: 0;
}
.link:hover:not(:disabled),
.icon-link:hover:not(:disabled) {
  background: transparent;
  text-decoration: underline;
}
.icon-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.icon-link img {
  width: 22px;
  height: 22px;
}
a {
  color: var(--blue);
}
/* Struttura della piattaforma: menu laterale e area di lavoro. */
.layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  background: var(--navy);
  color: #fff;
  width: 250px;
  flex: 0 0 250px;
  height: 100vh;
  position: sticky;
  top: 0;
}
.brand {
  height: 64px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand > a {
  display: block;
  height: 48px;
}
.brand img {
  height: 100%;
  width: auto;
  max-width: 170px;
}
.nav-body {
  height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.greeting {
  text-align: center;
  padding: 18px 15px 24px;
  margin: 0 16px 15px;
  border-bottom: 1px solid #ffffff30;
  font-size: 14px;
}
.nav {
  padding: 0 16px;
}
.nav button {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  height: 48px;
  margin-bottom: 8px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: #d7d7d7;
  text-align: left;
  padding: 10px 13px;
  font-size: 14px;
}
.nav button img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}
.nav button.active {
  background: #ffffff5e;
  color: white;
}
.nav button:hover:not(:disabled) {
  background: #ffffff1a;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 22px 28px;
  color: #d8e3e9;
  font-size: 12px;
}
.sidebar-bottom p {
  margin: 6px 0 18px;
}
.sidebar-bottom button {
  background: transparent;
  border: 1px solid #a3b6c2;
  color: #fff;
}
.tag-demo {
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.menu-toggle {
  display: none;
}
.workspace {
  flex: 1;
  min-width: 0;
  position: relative;
}
.demo-toolbar {
  min-height: 42px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 25px;
  background: #fff;
  border-bottom: 1px solid #e2e8eb;
  color: var(--muted);
  font-size: 11px;
  gap: 16px;
}
.rolebox {
  display: flex;
  gap: 10px;
  align-items: center;
}
.rolebox select {
  border-radius: 50rem;
  background: #fff;
  color: var(--ink);
  border: 1px solid #d8e0e5;
  padding: 3px 24px 3px 10px;
  font-size: 12px;
}
.page-banner {
  background: var(--blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px 24px;
  min-height: 64px;
}
.page-banner h1 {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 500;
  margin: 0;
  letter-spacing: 0;
}
.status-approved,
.status-pending {
  font-size: 11px;
  display: inline-block;
  border-radius: 50rem;
  padding: 6px 16px;
  white-space: nowrap;
}
.status-approved {
  background: var(--teal);
  color: white;
}
.status-pending {
  background: #f2f7fa;
  color: #b78a20;
}
.main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 20px 28px 145px;
}
.main:focus {
  outline: none;
}
h1,
h2,
h3 {
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 12px;
}
h1 {
  font-size: 27px;
}
h2 {
  font-size: 21px;
}
h3 {
  font-size: 16px;
}
.breadcrumb {
  font-size: 12px;
  margin: 0 0 22px;
  color: var(--muted);
}
.breadcrumb a {
  text-decoration: none;
}
.titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin: 8px 0 26px;
}
.titlebar h1 {
  font-size: 25px;
  margin-bottom: 6px;
}
.eyebrow {
  font-size: 10px;
  color: var(--blue);
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.subtitle {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.card {
  background: var(--light);
  border: 1px solid var(--line);
  border-radius: 32px;
  overflow: hidden;
  margin-bottom: 34px;
}
.card-head {
  background: var(--blue);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  padding: 22px;
  min-height: 70px;
}
.card-head h2 {
  font-size: 21px;
  margin: 0;
  font-weight: 500;
}
.card-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #e7f2f8;
}
.card-head .stat-mini {
  color: #deebf0;
  font-size: 12px;
}
.card-head .eyebrow {
  color: #fff;
}
.card-body {
  padding: 26px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  font-size: 13px;
  font-weight: 600;
  padding: 14px 12px;
  color: var(--ink);
  white-space: nowrap;
}
td {
  padding: 17px 12px;
  border-bottom: 1px solid #dbe2e6;
  vertical-align: middle;
  font-size: 13px;
}
tr:last-child td {
  border-bottom: 0;
}
.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sub {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}
.lock {
  color: #687c87;
}
.row-title {
  font-weight: 500;
}
.total-line {
  display: flex;
  justify-content: flex-end;
  gap: 32px;
  padding: 18px 26px;
  border-top: 1px solid #dbe2e6;
  font-size: 13px;
}
.total-line strong {
  font-size: 15px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 50rem;
  background: #e9edf0;
  color: #617681;
  padding: 5px 10px;
}
.badge.rda {
  background: #f8edd0;
  color: #926a16;
}
.badge.oda {
  background: #459d93;
  color: white;
}
.badge.cancelled {
  background: #f4e0df;
  color: #a9504c;
}
.document-link {
  text-decoration: none;
}
.document-link:hover .badge {
  box-shadow: 0 0 0 2px #9fbcc9;
}
.free-row {
  color: #71858e;
  font-size: 11px;
  white-space: nowrap;
}
/* Intestazione e tabelle del budget, coerenti con la grafica originale. */
.budget-heading {
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: 22px 28px;
  background: var(--light);
}
.budget-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 35px;
  font-size: 14px;
}
.budget-info b {
  font-weight: 650;
}
.budget-switch {
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: center;
  border-top: 1px solid #dfe6ea;
  margin-top: 18px;
  padding-top: 16px;
}
.budget-switch label {
  font-size: 12px;
  white-space: nowrap;
}
.budget-switch select {
  max-width: 70%;
  color: var(--blue);
  border: 1px solid #d4dfe5;
  background: white;
  border-radius: 50rem;
  padding: 6px 12px;
  font-size: 12px;
}
.revision-box {
  text-align: center;
  margin: 18px 0 22px;
  font-size: 13px;
}
.revision-box > span {
  display: block;
  margin-bottom: 10px;
}
.revision-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
}
.revision-strip select {
  background: var(--blue);
  color: white;
  border: 0;
  border-radius: 50rem;
  padding: 6px 13px;
  font-size: 12px;
}
.section-heading {
  text-align: center;
  font-size: 24px;
  margin: 0 0 40px;
}
.budget-card .card-head {
  padding: 22px;
  min-height: 72px;
}
.budget-card .card-body {
  padding: 12px 12px 22px;
}
.budget-table {
  border-collapse: separate;
  border-spacing: 0 12px;
}
.budget-table th {
  padding: 8px 10px;
  font-size: 13px;
  white-space: normal;
}
.budget-table td {
  padding: 13px 8px;
  border: 0;
}
.budget-table tbody tr:nth-child(odd) td {
  background: #e6ecef;
}
.budget-table tbody tr:nth-child(odd) td:first-child {
  border-radius: 24px 0 0 24px;
}
.budget-table tbody tr:nth-child(odd) td:last-child {
  border-radius: 0 24px 24px 0;
}
.budget-table tfoot th {
  border-top: 1px solid #d8e1e6;
  padding: 24px 8px 6px;
  font-weight: 600;
}
.labor-table {
  min-width: 620px;
}
.labor-table th:first-child {
  width: 30%;
}
.external-table {
  min-width: 1020px;
}
.external-table td:first-child {
  min-width: 210px;
  width: 23%;
}
.external-table td:nth-child(5) {
  min-width: 170px;
}
.external-table td:nth-child(6) {
  min-width: 110px;
}
.value-pill {
  display: block;
  border-radius: 50rem;
  padding: 7px 11px;
  background: #fff;
  border: 1px solid #dce5e9;
  line-height: 1.25;
  font-size: 13px;
  font-weight: 400;
}
.budget-table .value-pill {
  background: transparent;
  box-shadow: 0 1px 3px #243e4c08;
  border-color: #dde5e9;
}
.budget-table .num .value-pill {
  text-align: center;
}
.row-action {
  border: 0;
  padding: 3px 4px;
  background: none !important;
  display: inline-grid;
  place-items: center;
  border-radius: 0;
}
.row-action img {
  width: 25px;
  height: 25px;
}
.row-action:disabled {
  opacity: 0.32;
}
.purchase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 2fr;
  gap: 20px;
  align-items: center;
  text-align: center;
  padding: 16px 10px;
}
.stat-number {
  display: block;
  font-size: 24px;
  font-weight: 500;
  color: var(--blue);
}
.stat-label {
  display: block;
  font-size: 12px;
  margin-top: 3px;
}
.purchase-grid .actions {
  justify-content: center;
}
.context-note {
  font-size: 12px;
  text-align: center;
  color: var(--muted);
  margin: 12px 12px 0;
}
.budget-card.acquisti .card-body {
  padding: 20px;
}
.budget-card:not(.acquisti) .card-body:has(> p),
.budget-card .card-body:has(> form) {
  padding: 24px 28px;
}
.budget-card.summary-card {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.summary-card td {
  padding: 12px 18px;
}
.sale-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: center;
  text-align: center;
  padding: 28px !important;
}
.sale-info .value-pill {
  max-width: 230px;
  margin: auto;
}
.demo-context {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid #dfe5e9;
  padding: 14px 24px;
}
.margin-bar {
  background: #f5edd9;
  position: fixed;
  bottom: 0;
  left: 250px;
  right: 0;
  z-index: 15;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
  box-shadow: 0 -3px 10px #243e4c06;
}
.margin-toggle {
  display: block;
  width: 100%;
  border: 1px solid var(--ink);
  border-radius: 50rem;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  padding: 4px;
}
.margin-toggle:hover:not(:disabled) {
  background: #f2e4c5;
  border-color: var(--ink);
}
.margin-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: var(--teal);
  color: white;
  border-radius: 5px;
  padding: 7px 10px;
  margin-top: 16px;
}
.margin-result b,
.margin-result em {
  display: block;
  line-height: 1.3;
}
.margin-result b {
  font-size: 15px;
  font-weight: 600;
}
.margin-result em {
  font-size: 12px;
}
.margin-result > strong {
  font-size: 18px;
  font-weight: 600;
}
.margin-details {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 14px 2px 0;
  font-size: 12px;
}
.hint {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--muted);
  margin: 18px 0;
}
.hint-icon {
  border: 1px solid #99aeb9;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 11px;
}
.field label {
  display: block;
  font-size: 12px;
  margin-bottom: 7px;
  font-weight: 500;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #dbe3e8;
  background: #fff;
  color: var(--ink);
  padding: 8px 15px;
  border-radius: 50rem;
  min-height: 36px;
  box-shadow: 0 1px 3px #243e4c06;
}
.field textarea {
  border-radius: 18px;
  min-height: 85px;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid #9cbecf;
  border-color: var(--blue);
}
/* Ricerca acquisti e campi dei moduli. */
.filter-grid {
  display: grid;
  grid-template-columns: 1.5fr 1.2fr 1fr 0.7fr auto;
  gap: 14px;
  align-items: end;
}
.filter-grid .primary {
  background: var(--blue);
  border-color: var(--blue);
}
.filter-summary {
  border-top: 1px solid #dce4e9;
  padding: 12px 26px;
  font-size: 12px;
  color: var(--muted);
}
.empty {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}
.empty h3 {
  color: var(--ink);
  font-size: 18px;
}
.muted {
  color: var(--muted);
}
/* Dettaglio delle pratiche e informazioni laterali. */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 25px;
}
.detail-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}
.detail-info p {
  margin: 5px 0;
  font-size: 13px;
}
.wide {
  grid-column: 1/-1;
}
.notice {
  padding: 14px 20px;
  border: 1px solid #e9d6a8;
  background: #faf4e5;
  border-radius: 18px;
  color: #8a691e;
  font-size: 12px;
  margin-bottom: 24px;
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.step {
  padding: 25px;
  background: var(--light);
  border: 1px solid var(--line);
  border-radius: 28px;
}
.step b {
  display: grid;
  place-items: center;
  border-radius: 50%;
  height: 34px;
  width: 34px;
  background: var(--blue);
  color: white;
  margin-bottom: 16px;
}
.step p {
  color: var(--muted);
  font-size: 13px;
}
.supplier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.supplier-card {
  padding: 26px;
}
.supplier-card h2 {
  font-size: 19px;
}
.supplier-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0;
}
.supplier-card button {
  margin-top: 16px;
}
.metadata {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}
.metadata label {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.metadata strong {
  font-size: 14px;
  font-weight: 500;
}
.stat-mini {
  font-size: 12px;
  color: var(--muted);
}
/* Dialoghi condivisi per RDA e conferme. */
dialog {
  width: min(780px, calc(100vw - 32px));
  max-height: 90vh;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 0;
  background: var(--light);
  color: var(--ink);
  box-shadow: 0 24px 80px #243e4c40;
}
dialog::backdrop {
  background: #243e4c77;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 26px;
  background: var(--blue);
  color: white;
}
.dialog-head h2 {
  font-size: 22px;
  margin: 0;
}
.dialog-head p {
  margin: 5px 0 0;
  font-size: 12px;
  color: #e1edf4;
}
.close {
  background: transparent;
  border: 0;
  font-size: 26px;
  line-height: 1;
  padding: 0 6px;
}
.dialog-body {
  padding: 24px 26px;
}
.dialog-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 18px 26px;
  border-top: 1px solid #d6e0e6;
  background: #fff;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.picker {
  border: 1px solid #d4e0e6;
  border-radius: 18px;
  overflow: hidden;
  margin-top: 15px;
  background: white;
}
.picker label {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 17px 15px;
  border-bottom: 1px solid #e0e7ec;
  cursor: pointer;
  font-size: 13px;
}
.picker label:last-child {
  border: 0;
}
.picker input {
  accent-color: var(--blue);
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.picker .money {
  margin-left: auto;
  white-space: nowrap;
  font-weight: 500;
}
.picker-summary {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  font-size: 13px;
}
.error {
  min-height: 18px;
  margin: 14px 0 0;
  color: #b33d35;
  font-size: 12px;
}
#toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  max-width: 90vw;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 15px);
  background: var(--navy);
  color: #fff;
  border-radius: 12px;
  padding: 14px 22px;
  transition: 0.2s;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
body:has(.margin-bar) #toast {
  bottom: 150px;
}
.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  font-size: 10px;
  color: #80949e;
  margin-top: 35px;
}
.skip {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 100;
  background: white;
  padding: 10px;
}
.skip:focus {
  top: 10px;
}
.print-sheet {
  display: none;
}
@media (min-width: 768px) and (max-width: 991px) {
  .main {
    max-width: 768px;
    padding-left: 24px;
    padding-right: 24px;
  }
}
@media (max-width: 1199px) {
  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .supplier-grid {
    grid-template-columns: 1fr 1fr;
  }
  .purchase-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .purchase-grid .actions {
    grid-column: 1/-1;
  }
}
@media (max-width: 991px) {
  .layout {
    display: block;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  .brand {
    height: 56px;
    padding: 6px 16px;
  }
  .brand > a {
    height: 44px;
  }
  .menu-toggle {
    display: block;
    background: #ffffff15;
    border: 1px solid #ffffff20;
    color: #a9bcc6;
    font-size: 22px;
    border-radius: 0;
    line-height: 1;
    padding: 8px 13px;
  }
  .nav-body {
    display: none;
    height: auto;
    max-height: 75vh;
  }
  .sidebar.menu-open .nav-body {
    display: flex;
  }
  .sidebar-bottom {
    margin-top: 20px;
  }
  .margin-bar {
    left: 0;
  }
  .workspace {
    width: 100%;
  }
  .demo-toolbar {
    padding: 7px 20px;
    min-height: 37px;
  }
  .page-banner {
    padding: 17px 20px;
  }
  .page-banner h1 {
    font-size: 23px;
  }
}
@media (max-width: 650px) {
  .main {
    padding: 20px 16px 145px;
  }
  .demo-toolbar > span {
    font-size: 10px;
  }
  .rolebox {
    gap: 5px;
  }
  .rolebox label {
    display: none;
  }
  .rolebox select {
    max-width: 160px;
  }
  .page-banner {
    gap: 8px;
    padding: 15px;
  }
  .page-banner h1 {
    font-size: 21px;
  }
  .status-approved,
  .status-pending {
    font-size: 10px;
    padding: 5px 11px;
  }
  .budget-heading {
    padding: 20px;
    border-radius: 28px;
  }
  .budget-info {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .budget-switch {
    align-items: flex-start;
    flex-direction: column;
  }
  .budget-switch select {
    max-width: 100%;
    width: 100%;
  }
  .card {
    border-radius: 28px;
    margin-bottom: 28px;
  }
  .card-head {
    min-height: 62px;
    padding: 18px;
    flex-wrap: wrap;
  }
  .card-head h2 {
    font-size: 20px;
  }
  .card-body {
    padding: 20px;
  }
  .card-body.table-wrap {
    padding: 10px;
  }
  .budget-card .card-body {
    padding: 12px;
  }
  .filter-grid,
  .form-grid,
  .detail-info,
  .steps,
  .supplier-grid,
  .sale-info {
    grid-template-columns: 1fr;
  }
  .wide {
    grid-column: auto;
  }
  .titlebar {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }
  .titlebar h1 {
    font-size: 23px;
  }
  .field input,
  .field select {
    max-width: 100%;
  }
  .table-wrap > table:not(.budget-table) {
    min-width: 620px;
  }
  .purchase-grid {
    gap: 15px 8px;
    padding: 10px 0;
  }
  .stat-number {
    font-size: 24px;
  }
  .stat-label {
    font-size: 11px;
  }
  .margin-result > strong {
    font-size: 15px;
  }
  .margin-result b {
    font-size: 13px;
  }
  .margin-result em {
    font-size: 10px;
  }
  .margin-result {
    gap: 8px;
  }
  .margin-details {
    display: block;
  }
  .margin-details span {
    display: block;
    margin: 3px 0;
  }
  .dialog-head,
  .dialog-body,
  .dialog-foot {
    padding: 19px;
  }
  .dialog-head h2 {
    font-size: 20px;
  }
  .picker label {
    gap: 10px;
    padding: 14px 10px;
  }
  .picker .money {
    font-size: 12px;
  }
  .page-footer {
    flex-direction: column;
    gap: 5px;
  }
  .revision-strip {
    flex-wrap: wrap;
  }
  .sale-info {
    gap: 20px;
  }
  .section-heading {
    margin-bottom: 28px;
  }
  .demo-context {
    padding: 13px 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
/* Stampa del solo facsimile ODA: il resto dell’interfaccia è nascosto. */
@media print {
  body {
    background: white;
  }
  .layout,
  .skip,
  dialog,
  #toast {
    display: none !important;
  }
  .print-sheet {
    display: block;
    padding: 25px;
    font: 12px/1.5 Arial;
    color: black;
  }
  .print-sheet h1 {
    font-size: 25px;
  }
  .print-sheet table {
    margin: 25px 0;
  }
  .print-sheet th,
  .print-sheet td {
    border: 1px solid #aaa;
  }
  .print-top {
    display: flex;
    justify-content: space-between;
  }
  .print-note {
    border-top: 1px solid #aaa;
    padding-top: 15px;
  }
}

body:has(.margin-details) .main {
  padding-bottom: 230px;
}

/* Supplier registry follows the observed Customers search and detail pages. */
.banner-action {
  font-size: 12px;
  padding: 5px 17px;
  white-space: nowrap;
}
.supplier-filter {
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--light);
  padding: 16px 28px;
  margin: -3px 0 26px;
}
.supplier-filter form {
  display: flex;
  align-items: center;
  gap: 24px;
}
.supplier-filter form > label {
  display: block;
  font-size: 14px;
  margin: 0;
  white-space: nowrap;
}
.supplier-filter input {
  display: block;
  width: 210px;
  min-width: 0;
  padding: 7px 17px;
  background: white;
  border: 1px solid #dfe5e9;
  border-radius: 50rem;
  min-height: 36px;
  color: var(--ink);
  font: inherit;
}
.supplier-filter input:focus {
  outline: 2px solid #9cbecf;
}
.supplier-filter .actions {
  margin: 0;
  gap: 25px;
  flex-wrap: nowrap;
}
.supplier-filter button[type='submit'] {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 6px 18px;
}
.supplier-filter button img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}
.supplier-filter .link {
  font-size: 14px;
  font-weight: 400;
}
.supplier-table-wrap {
  width: 100%;
  overflow-x: auto;
  padding: 0 12px;
}
.supplier-table {
  border-collapse: collapse;
  font-size: 14px;
}
.supplier-table thead th {
  padding: 20px 10px;
  text-transform: none;
  font-size: 14px;
  white-space: normal;
}
.supplier-table tbody tr:nth-child(odd) {
  background: #f2f2f2;
}
.supplier-table td {
  padding: 22px 10px;
  border: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.supplier-table th:first-child {
  width: 30%;
}
.supplier-table .supplier-actions {
  min-width: 176px;
  white-space: nowrap;
  overflow-wrap: normal;
}
.supplier-actions button + button {
  margin-left: 18px;
}
.supplier-actions .icon-link {
  font-size: 12px;
  display: inline-flex;
  gap: 5px;
}
.supplier-actions img {
  height: 20px;
  width: 20px;
}
.supplier-result-count {
  font-size: 14px;
  margin: 24px 12px 14px;
}
.supplier-result-count strong {
  font-weight: 400;
}
.supplier-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  font-size: 14px;
  margin: 14px 0;
}
.supplier-pagination button {
  font-size: 12px;
  padding: 5px 14px;
}
.supplier-pagination button:disabled {
  opacity: 0.4;
}
.supplier-empty h2 {
  font-size: 24px;
}
.supplier-empty p {
  font-size: 18px;
}
.supplier-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  font-size: 14px;
  margin: 3px 0 32px;
}
.supplier-back img {
  width: 25px;
  height: 25px;
}
.supplier-detail-panel {
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--light);
  padding: 48px 44px;
}
.supplier-field {
  display: grid;
  grid-template-columns: 24% minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  margin-bottom: 35px;
}
.supplier-field:last-child {
  margin-bottom: 0;
}
.supplier-field label {
  color: #829098;
  font-size: 14px;
  font-weight: 400;
  padding-top: 8px;
}
.supplier-field input,
.supplier-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #dce4e9;
  border-radius: 50rem;
  padding: 7px 16px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  min-height: 36px;
  box-shadow: 0 1px 3px #243e4c05;
}
.supplier-field textarea {
  border-radius: 28px;
  min-height: 62px;
  resize: vertical;
}
.supplier-field input:focus,
.supplier-field textarea:focus {
  outline: 2px solid #9cbecf;
  border-color: var(--blue);
}
.supplier-form-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 8px 0 15px;
}
.supplier-form-actions button {
  min-width: 145px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
}
.supplier-form-actions img {
  width: 22px;
  height: 22px;
  filter: brightness(0) invert(1);
}
.supplier-used-note {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin: 18px 0;
}
.supplier-detail-form > .error {
  margin-top: 15px;
  min-height: 18px;
}
.page-banner:has(.banner-action) {
  gap: 12px;
}
body:has(.supplier-filter) .main,
body:has(.supplier-detail-form) .main {
  padding-bottom: 45px;
}
@media (max-width: 767px) {
  .supplier-table-wrap {
    padding: 0 12px;
    overflow: visible;
  }
  .supplier-table thead {
    display: none;
  }
  .supplier-table,
  .supplier-table tbody {
    display: block;
    width: 100%;
  }
  .supplier-table tbody tr {
    display: block;
    margin: 0 0 28px;
    width: 100%;
  }
  .supplier-table td {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    gap: 22px;
    text-align: right;
    padding: 25px 9px;
    border-bottom: 1px solid #ddd;
    font-size: 12px;
    min-width: 0;
  }
  .supplier-table td[data-label]::before {
    content: attr(data-label);
    text-transform: uppercase;
    text-align: left;
    font-size: 10px;
    white-space: nowrap;
  }
  .supplier-table td.supplier-actions {
    display: flex;
    justify-content: flex-end;
    min-width: 0;
    gap: 22px;
    padding: 23px 22px;
    border: 0;
  }
  .supplier-actions button + button {
    margin-left: 0;
  }
  .supplier-field {
    display: block;
    margin-bottom: 38px;
  }
  .supplier-field label {
    display: block;
    margin: 0 0 10px;
    padding: 0;
  }
  .supplier-detail-panel {
    padding: 48px 44px;
  }
  .supplier-filter {
    padding: 22px 28px;
  }
  .supplier-filter form {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .supplier-filter input {
    width: 100%;
  }
  .supplier-filter .actions {
    justify-content: flex-start;
  }
  .supplier-form-actions {
    flex-direction: column;
    gap: 15px;
    margin: 10px 12px;
  }
  .supplier-form-actions button {
    width: 100%;
  }
  .supplier-back {
    font-size: 13px;
  }
  .supplier-pagination {
    gap: 22px;
  }
  .supplier-result-count {
    font-size: 13px;
  }
  .page-banner:has(.banner-action) h1 {
    font-size: 21px;
  }
  .supplier-filter .actions {
    gap: 25px;
  }
}
@media (max-width: 400px) {
  .supplier-detail-panel {
    padding: 35px 25px;
  }
  .supplier-filter {
    padding: 22px;
  }
  .supplier-table td {
    gap: 12px;
  }
  .supplier-actions .icon-link {
    font-size: 11px;
  }
}

/* Budget header: same compact metadata row and commands as the original. */
.budget-heading {
  padding: 20px 28px;
}
.original-budget-info {
  display: grid;
  grid-template-columns: 0.55fr 1.75fr 1.1fr 1.85fr 0.55fr 0.9fr 0.8fr;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  line-height: 1.45;
}
.original-budget-info > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.original-budget-info .icon-link {
  font-size: 14px;
  white-space: nowrap;
  font-weight: 600;
}
.original-budget-info .icon-link img {
  width: 28px;
  height: 28px;
}
.budget-switch {
  margin-top: 14px;
  padding-top: 12px;
}
.revision-box {
  margin: 16px 0 18px;
}
.section-heading {
  margin-bottom: 38px;
}
.revision-strip select {
  padding: 6px 15px;
}
@media (max-width: 1199px) {
  .original-budget-info {
    grid-template-columns: 0.7fr 1.8fr 1.3fr;
    gap: 16px 24px;
  }
}
@media (max-width: 767px) {
  .budget-heading {
    padding: 22px;
  }
  .original-budget-info {
    grid-template-columns: 1fr 1fr;
    font-size: 13px;
    gap: 14px 18px;
  }
  .original-budget-info > div:nth-child(2) {
    grid-column: 1/-1;
    grid-row: 1;
  }
  .original-budget-info > div:nth-child(4) {
    grid-column: 1/-1;
  }
  .original-budget-info .icon-link {
    font-size: 13px;
  }
  .original-budget-info .icon-link img {
    width: 25px;
    height: 25px;
  }
  .budget-switch {
    padding-top: 15px;
  }
  .section-heading {
    margin-bottom: 28px;
  }
}

/* Original approved-budget panels and fixed margin footer. */
.original-summary,
.original-sale,
.original-notes {
  width: 100%;
  margin: 0 auto 46px;
}
.original-summary-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 12px;
}
.summary-main,
.summary-outside {
  min-width: 0;
}
.original-summary-table,
.outside-costs {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}
.original-summary-table th,
.original-summary-table td,
.outside-costs th,
.outside-costs td {
  padding: 13px 8px;
  font-size: 14px;
  border: 0;
}
.original-summary-table thead th {
  font-size: 13px;
  font-weight: 600;
}
.original-summary-table thead th:nth-child(2) {
  text-align: right;
}
.original-summary-table thead th:nth-child(3) {
  text-align: center;
}
.original-summary-table tbody th {
  font-weight: 600;
  white-space: normal;
}
.original-summary-table tbody td:nth-child(2) {
  text-align: right;
  white-space: nowrap;
}
.original-summary-table tbody td:nth-child(3) {
  text-align: center;
  white-space: nowrap;
}
.original-summary-table tbody tr:nth-child(odd) > *,
.outside-costs tbody tr:nth-child(odd) > * {
  background: #e6ecef;
}
.threshold-bad,
.original-summary-table .threshold-bad th,
.original-summary-table .threshold-bad td {
  color: var(--danger);
}
.threshold-good {
  color: var(--teal);
}
.summary-outside h3 {
  font-size: 18px;
  margin: 16px 0;
}
.outside-costs th {
  font-weight: 600;
  white-space: normal;
}
.outside-costs td {
  width: 50%;
}
.outside-costs input,
.mol-control input,
.original-sale input,
.original-sale textarea,
.original-notes textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #dce3e7;
  border-radius: 50rem;
  padding: 7px 15px;
  font: inherit;
  color: var(--ink);
  background: white;
  line-height: 1.5;
}
.outside-costs input:disabled,
.mol-control input:disabled,
.original-sale input:disabled,
.original-sale textarea:disabled,
.original-notes textarea:disabled {
  background: #e6ecef;
  color: var(--ink);
  opacity: 1;
}
.mol-control {
  display: flex;
  align-items: center;
}
.mol-control input {
  text-align: right;
  padding: 6px 4px;
  width: 75px;
}
.mol-control span {
  padding: 0 6px;
}
.outside-costs tfoot th,
.outside-costs tfoot td {
  border-top: 1px solid #748a94;
  border-bottom: 1px solid #748a94;
  padding: 20px 8px;
}
.outside-costs tfoot th {
  border-left: 1px solid #748a94;
  border-radius: 24px 0 0 24px;
}
.outside-costs tfoot td {
  text-align: right;
  border-right: 1px solid #748a94;
  border-radius: 0 24px 24px 0;
  font-weight: 600;
}
.original-sale-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 26px 12px;
  gap: 24px;
}
.sale-amounts {
  padding-right: 18px;
  border-right: 1px solid #d8e1e6;
}
.sale-field {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 8px;
}
.sale-field h3 {
  font-size: 18px;
  color: var(--blue);
  font-weight: 500;
  margin: 0;
}
.sale-field em {
  display: block;
  color: #88969e;
  font-size: 14px;
  line-height: 1.5;
  margin-top: 2px;
}
.sale-field > span {
  font-size: 14px;
}
.original-sale textarea,
.original-notes textarea {
  border-radius: 16px;
  resize: vertical;
  display: block;
  padding: 8px 15px;
  min-height: 100px;
}
.original-notes-body {
  padding: 24px 12px;
}
.original-notes textarea {
  width: 75%;
  margin: 0 auto 24px;
  min-height: 156px;
}
.original-notes textarea:focus {
  outline: 2px solid #9cbecf;
}
.acquisition-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 2px;
}
.acquisition-actions button {
  font-size: 14px;
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
}
.acquisition-actions img {
  height: 21px;
  width: 21px;
}
.acquisition-won {
  background: var(--teal);
  border-color: var(--teal);
}
.acquisition-won:hover:not(:disabled) {
  background: #39847c;
  border-color: #39847c;
}
.acquisition-lost {
  background: var(--danger);
  border-color: var(--danger);
}
.acquisition-lost:hover:not(:disabled) {
  background: #ad5551;
  border-color: #ad5551;
}
.acquisition-pending {
  background: var(--blue);
  border-color: var(--blue);
}
.original-footer {
  padding: 16px;
  background: #f5edd9;
}
.original-footer .margin-toggle {
  display: none;
}
.footer-content {
  width: 83.3333%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 50% 41.6667%;
  justify-content: space-between;
  gap: 0;
}
.footer-costs {
  border: 1px solid #d3d3d3;
  border-radius: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}
.footer-cost {
  padding: 5px 12px;
}
.footer-cost:first-child {
  border-right: 1px solid #d3d3d3;
}
.footer-cost h3 {
  font-size: 20px;
  line-height: 1.2;
  margin: 0;
  font-weight: 500;
}
.footer-cost h3 > span {
  font-size: 14px;
  font-weight: 400;
  text-transform: uppercase;
}
.footer-cost h3 strong {
  font-weight: 700;
}
.footer-cost h3 small {
  font-size: 16px;
  font-weight: 400;
}
.footer-cost em {
  font-size: 14px;
  line-height: 1.5;
  display: block;
  color: #86939b;
  white-space: nowrap;
}
.footer-right {
  display: grid;
  grid-template-columns: 2fr 1fr;
  align-items: stretch;
}
.original-footer .margin-result {
  height: 100%;
  margin: 0;
  padding: 5px;
  background: var(--teal);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.original-footer .margin-result.threshold-background {
  background: var(--danger);
}
.original-footer .margin-result h3 {
  font-size: 18px;
  line-height: 1.2;
  margin: 0;
  font-weight: 500;
}
.original-footer .margin-result em {
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
}
.original-footer .margin-result > strong {
  font-size: 20px;
  font-weight: 600;
  white-space: nowrap;
}
.original-footer .margin-result small {
  font-size: 16px;
}
.footer-price {
  text-align: center;
  align-self: center;
  padding: 0 10px;
  white-space: nowrap;
}
.footer-price span {
  display: block;
  text-transform: uppercase;
  font-size: 14px;
  line-height: 1.2;
  margin-bottom: 6px;
}
.footer-price strong {
  font-size: 22px;
  font-weight: 500;
  color: var(--teal);
  line-height: 1.2;
}
.main:has(.original-footer) {
  padding-bottom: 180px;
}
@media (min-width: 992px) {
  .original-summary,
  .original-sale,
  .original-notes {
    width: 83.3333%;
  }
  .original-summary .card-head,
  .original-sale .card-head,
  .original-notes .card-head {
    padding: 24px 12px;
  }
  .original-summary-body {
    gap: 24px;
  }
}
@media (max-width: 1199px) and (min-width: 992px) {
  .footer-content {
    width: 100%;
    grid-template-columns: 49% 49%;
  }
  .footer-cost {
    padding: 5px 8px;
  }
  .footer-cost h3 {
    font-size: 18px;
  }
  .footer-cost h3 small {
    font-size: 14px;
  }
  .footer-cost em {
    font-size: 12px;
  }
  .original-footer .margin-result h3 {
    font-size: 16px;
  }
  .original-footer .margin-result em {
    font-size: 11px;
  }
  .original-footer .margin-result > strong {
    font-size: 18px;
  }
  .original-footer .margin-result small {
    font-size: 14px;
  }
  .footer-price span {
    font-size: 11px;
  }
  .footer-price strong {
    font-size: 18px;
  }
  .original-summary {
    width: 100%;
  }
  .original-summary-body {
    gap: 12px;
  }
}
@media (max-width: 991px) {
  .original-summary-body,
  .original-sale-body {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .summary-outside h3 {
    margin: 20px 0;
  }
  .sale-amounts {
    padding: 0 0 24px;
    border-right: 0;
  }
  .sale-field {
    display: block;
    margin-bottom: 10px;
  }
  .sale-field h3 {
    font-size: 18px;
  }
  .sale-field > span {
    display: block;
  }
  .original-sale-body {
    padding: 24px 12px;
  }
  .original-notes textarea {
    width: 100%;
  }
  .acquisition-actions {
    flex-direction: column;
    gap: 12px;
  }
  .acquisition-actions button {
    width: 100%;
    justify-content: center;
  }
  .original-footer .margin-toggle {
    display: block;
    background: transparent;
  }
  .original-footer.is-expanded .margin-toggle {
    background: var(--navy);
    color: white;
  }
  .footer-content {
    display: block;
    width: 100%;
  }
  .footer-costs,
  .footer-price {
    display: none;
  }
  .original-footer.is-expanded .footer-costs {
    display: block;
    margin-top: 2px;
    margin-bottom: 16px;
  }
  .original-footer.is-expanded .footer-price {
    display: block;
    margin-top: 16px;
  }
  .footer-cost:first-child {
    border-right: 0;
  }
  .footer-cost {
    padding: 8px 12px;
  }
  .footer-cost h3 {
    font-size: 20px;
  }
  .footer-right {
    display: block;
  }
  .original-footer .margin-result {
    min-height: 50px;
    height: auto;
    flex-wrap: nowrap;
    padding: 5px;
    margin-top: 16px;
  }
  .original-footer.is-expanded .margin-result {
    margin-top: 0;
  }
  .original-footer .margin-result h3 {
    font-size: 16px;
  }
  .original-footer .margin-result em {
    font-size: 13px;
  }
  .original-footer .margin-result > strong {
    font-size: 20px;
  }
  .original-footer .margin-result small {
    font-size: 16px;
  }
  .footer-price span {
    font-size: 13px;
  }
  .footer-price strong {
    font-size: 22px;
  }
  .main:has(.original-footer.is-expanded) {
    padding-bottom: 370px;
  }
  .main:has(.original-footer) {
    padding-bottom: 165px;
  }
}
@media (max-width: 767px) {
  .original-summary-table thead,
  .outside-costs thead {
    display: none;
  }
  .original-summary-table,
  .original-summary-table tbody,
  .original-summary-table tr,
  .outside-costs,
  .outside-costs tbody,
  .outside-costs tr {
    display: block;
    width: 100%;
  }
  .original-summary-table tbody tr {
    margin: 12px 0;
  }
  .original-summary-table tbody th {
    display: block;
    text-align: center;
    padding: 20px 8px;
    border-bottom: 2px solid #d6dde2;
  }
  .original-summary-table tbody td {
    display: flex;
    justify-content: space-between;
    padding: 16px 8px;
    text-align: right !important;
    border-bottom: 1px solid #dce3e7;
    font-size: 12px;
  }
  .original-summary-table tbody td[data-label]::before {
    content: attr(data-label);
    text-transform: uppercase;
    font-size: 10px;
  }
  .original-summary-table tbody td:empty {
    display: none;
  }
  .original-summary-table tbody tr:nth-child(odd) {
    background: #e6ecef;
    border-radius: 24px;
    overflow: hidden;
  }
  .original-summary-table tbody tr:nth-child(odd) > * {
    background: transparent;
  }
  .original-summary-table td.mol-cell {
    justify-content: flex-end;
  }
  .outside-costs tbody tr {
    margin-bottom: 12px;
    padding: 12px 8px;
    background: #e6ecef;
    border-radius: 24px;
  }
  .outside-costs tbody td {
    display: block;
    width: 100%;
    padding: 8px 0;
  }
  .outside-costs td[data-label]::before {
    content: attr(data-label);
    display: block;
    text-transform: uppercase;
    font-size: 10px;
    margin-bottom: 10px;
  }
  .outside-costs tfoot {
    display: block;
  }
  .outside-costs tfoot tr {
    display: flex;
    justify-content: space-between;
    border: 1px solid #748a94;
    border-radius: 24px;
    padding: 20px 8px;
  }
  .outside-costs tfoot th,
  .outside-costs tfoot td {
    display: block;
    border: 0;
    padding: 0;
    border-radius: 0;
  }
  .original-summary-body {
    padding: 12px;
  }
  .original-notes .card-head h2,
  .original-sale .card-head h2 {
    font-size: 21px;
  }
  .original-summary-table tbody td:not([data-label]):not(.mol-cell) {
    justify-content: flex-end;
  }
  .original-footer .margin-result > strong {
    font-size: 18px;
  }
  .original-footer .margin-result small {
    font-size: 14px;
  }
  .original-notes .card-head,
  .original-sale .card-head {
    min-height: 72px;
  }
}
@media (max-width: 400px) {
  .original-footer .margin-result {
    gap: 6px;
  }
  .original-footer .margin-result h3 {
    font-size: 14px;
  }
  .original-footer .margin-result em {
    font-size: 10px;
  }
  .original-footer .margin-result > strong {
    font-size: 16px;
  }
  .original-footer .margin-result small {
    font-size: 12px;
  }
}

/* Editing dei costi esterni: solo Draft, senza pratica attiva. */
.external-cost-input {
  width: 100%;
  min-width: 85px;
  color: var(--ink);
  font: inherit;
}
.external-cost-input:disabled {
  opacity: 0.65;
  background: #e9edef;
  cursor: default;
}
.icon-link[aria-disabled='true'] {
  cursor: default;
}
.icon-link[aria-disabled='true']:hover {
  background: transparent;
  text-decoration: none;
}

.detail-layout:not(:has(> aside)) {
  grid-template-columns: 1fr;
}

#filters .filter-grid {
  grid-template-columns: 1.5fr 1.2fr 1fr 1fr 0.7fr auto;
}
@media (max-width: 1199px) {
  #filters .filter-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 650px) {
  #filters .filter-grid {
    grid-template-columns: 1fr;
  }
}

/* Navigazione di ritorno, resa come link anziché azione sulla pratica. */
.budget-return-link {
  display: inline-block;
  margin: -6px 0 18px;
  font-size: 13px;
  color: var(--blue);
  text-decoration: none;
}
.budget-return-link:hover {
  text-decoration: underline;
}

/* Azioni raggruppate per ruolo; la disabilitazione è impostata dal JavaScript. */
.role-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.role-action-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.role-action-label {
  min-width: 92px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.role-action-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 650px) {
  .role-action-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

#filters .filter-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
#filters .purchase-filter-actions {
  align-self: end;
  min-height: 36px;
  gap: 18px;
}
@media (max-width: 1199px) {
  #filters .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 650px) {
  #filters .filter-grid {
    grid-template-columns: 1fr;
  }
}

/* Note informative e footer leggibili su tutti gli schermi. */
.hint {
  color: #243e4c;
  background: #eef4f7;
  border: 1px solid #627b89;
  border-left: 5px solid #3c6880;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 24px 0;
  font-size: 16px;
  line-height: 1.65;
  gap: 12px;
  align-items: flex-start;
}
.hint-icon {
  color: #243e4c;
  border: 2px solid #3c6880;
  background: #fff;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  margin-top: 1px;
}
.page-footer {
  color: #243e4c;
  background: #f2f7fa;
  border-top: 2px solid #627b89;
  border-radius: 0 0 8px 8px;
  padding: 16px 18px;
  font-size: 16px;
  line-height: 1.6;
  gap: 14px 24px;
  flex-wrap: wrap;
}
@media (max-width: 650px) {
  .hint {
    padding: 14px;
    font-size: 16px;
  }
  .page-footer {
    font-size: 16px;
    padding: 14px;
    gap: 10px;
  }
}

/* Indice condiviso dei prototipi. */
.prototype-hub {
  font-size: 16px;
  color: #243e4c;
  background: #fff;
}
.hub-brand {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 32px;
  background: #243e4c;
  color: #fff;
  flex-wrap: wrap;
}
.hub-brand img {
  width: 180px;
  max-width: 100%;
  height: 52px;
  object-fit: contain;
}
.hub-brand span {
  font-size: 18px;
}
.hub-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 28px;
}
.hub-main h1 {
  font-size: 30px;
  line-height: 1.3;
  margin-bottom: 16px;
}
.hub-intro {
  font-size: 18px;
  line-height: 1.6;
  margin: 0 0 30px;
}
.hub-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.hub-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #627b89;
  border-radius: 24px;
  overflow: hidden;
  background: #f2f7fa;
}
.hub-card-head {
  background: #3c6880;
  color: #fff;
  padding: 24px;
  min-height: 140px;
}
.hub-number {
  font-size: 18px;
  font-weight: 700;
  display: block;
  margin-bottom: 12px;
}
.hub-card-head h2 {
  font-size: 23px;
  line-height: 1.3;
  margin: 0;
}
.hub-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  gap: 18px;
}
.hub-card-body p {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
}
.hub-state {
  font-weight: 700;
}
.hub-open {
  display: inline-block;
  margin-top: auto;
  padding: 12px 18px;
  background: #3c6880;
  color: #fff;
  border-radius: 50rem;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  min-height: 48px;
}
.hub-open:hover {
  background: #243e4c;
  text-decoration: underline;
}
.hub-open:focus-visible,
.prototype-index-back:focus-visible {
  outline: 3px solid #d49c1a;
  outline-offset: 4px;
}
.hub-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.prototype-index-back {
  display: block;
  color: #fff;
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 22px;
  text-decoration: underline;
  padding: 8px 0;
}
@media (max-width: 991px) {
  .hub-cards {
    grid-template-columns: 1fr;
  }
  .hub-card-head {
    min-height: 0;
  }
  .hub-main {
    padding: 28px 20px;
  }
  .hub-brand {
    padding: 18px 20px;
  }
  .hub-main h1 {
    font-size: 27px;
  }
}
