:root {
  --bg: #f3f6fb;
  --bg-soft: #eef3f9;
  --card: #ffffff;
  --card-alt: #f8fbff;
  --border: #d8e1ec;
  --border-strong: #c7d4e3;
  --text: #172033;
  --muted: #617089;
  --primary: #24364d;
  --primary-strong: #18283e;
  --primary-soft: #edf3fa;
  --primary-text: #ffffff;
  --accent: #6f8fb4;
  --ok-bg: #edf8f1;
  --ok-bd: #bfe3cb;
  --ok-tx: #1d6a43;
  --warn-bg: #fff7e9;
  --warn-bd: #efd39a;
  --warn-tx: #9a6511;
  --err-bg: #fff1f1;
  --err-bd: #efc0c0;
  --err-tx: #a13535;
  --blue-bg: #eef5ff;
  --blue-bd: #bfd4f3;
  --blue-tx: #29589b;
  --shadow-sm: 0 8px 20px rgba(28, 45, 68, 0.06);
  --shadow-md: 0 16px 40px rgba(28, 45, 68, 0.1);
  --radius: 20px;
  --radius-sm: 14px;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  /* Sfondo esteso a tutta la finestra (niente "stacco" sotto le pagine corte) e spazio
     della barra di scorrimento sempre riservato (il layout non salta tra pagine). */
  min-height: 100%;
  background-color: var(--bg);
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(111, 143, 180, 0.1), transparent 28%),
    linear-gradient(180deg, #f7f9fc 0%, var(--bg) 100%);
  background-repeat: no-repeat;
  background-color: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  line-height: 1.45;
}
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 30px 24px 40px;
}
.header {
  margin-bottom: 22px;
  padding: 24px 26px;
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
}
h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.02em;
}
h1 {
  font-size: 32px;
}
h2 {
  font-size: 24px;
}
h3 {
  font-size: 18px;
}
p {
  margin: 0;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.stack {
  display: grid;
  gap: 16px;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 26px;
  align-items: start;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 39, 0.42);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal-card {
  width: min(620px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 26px 60px rgba(15, 23, 42, 0.2);
  padding: 26px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 22px;
}
.modal-choice-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
  border-radius: 18px;
  padding: 18px 18px;
  cursor: pointer;
  display: grid;
  gap: 8px;
  color: var(--text);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
  box-shadow: 0 6px 16px rgba(28, 45, 68, 0.04);
}
.modal-choice-btn strong {
  font-size: 18px;
}
.modal-choice-btn:hover {
  border-color: var(--border-strong);
  background: #fff;
  box-shadow: 0 12px 24px rgba(28, 45, 68, 0.1);
  transform: translateY(-1px);
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-body {
  padding: 22px;
}
.row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.space {
  justify-content: space-between;
}
.toolbar,
.right-actions,
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.actions {
  justify-content: space-between;
}
.btn {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border-radius: 14px;
  padding: 11px 15px;
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease;
  box-shadow: 0 2px 0 rgba(15, 23, 42, 0.02);
}
.btn:hover:not(:disabled) {
  border-color: var(--border-strong);
  box-shadow: 0 10px 18px rgba(28, 45, 68, 0.08);
  transform: translateY(-1px);
}
.btn.small {
  padding: 8px 10px;
  font-size: 12px;
}
.btn.primary {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: var(--primary-text);
  border-color: var(--primary);
  box-shadow: 0 10px 18px rgba(36, 54, 77, 0.18);
}
.btn.primary:hover:not(:disabled) {
  box-shadow: 0 14px 24px rgba(36, 54, 77, 0.26);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.subtle,
.section-box {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--card-alt) 0%, #f7f9fc 100%);
  border-radius: 18px;
  padding: 16px;
}
.subcategory-box {
  margin-top: 6px;
  margin-left: 18px;
  padding: 18px 18px 16px 22px;
  border-radius: 18px;
  border: 1px dashed #b8c7d9;
  border-left: 5px solid #6f8fb4;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  position: relative;
}
.subcategory-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4d6989;
}
.subcategory-label::before {
  content: "Sottocategoria";
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(111, 143, 180, 0.14);
  color: #314862;
  font-size: 10px;
  letter-spacing: 0.05em;
}
.alert {
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.alert.ok {
  background: var(--ok-bg);
  border-color: var(--ok-bd);
  color: var(--ok-tx);
}
.alert.warn {
  background: var(--warn-bg);
  border-color: var(--warn-bd);
  color: var(--warn-tx);
}
.alert.err {
  background: var(--err-bg);
  border-color: var(--err-bd);
  color: var(--err-tx);
}
.alert.blue {
  background: var(--blue-bg);
  border-color: var(--blue-bd);
  color: var(--blue-tx);
}
.field {
  display: grid;
  gap: 6px;
}
.field label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.label-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #eef4fb 0%, #e4edf8 100%);
  border: 1px solid #d5e0ee;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  flex: 0 0 24px;
}
.label-icon-img {
  width: 14px;
  height: 14px;
  display: block;
  object-fit: contain;
  pointer-events: none;
  flex: 0 0 auto;
}
.input,
textarea,
input[type="number"],
input[type="text"],
input[type="email"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 13px;
  font: inherit;
  background: #fff;
  color: var(--text);
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease,
    background 0.12s ease;
}
.input:focus,
textarea:focus,
input:focus {
  outline: none;
  border-color: #8fa9c8;
  box-shadow: 0 0 0 4px rgba(111, 143, 180, 0.14);
  background: #fff;
}
textarea {
  min-height: 90px;
  resize: vertical;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.grid-6 {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.option-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 15px;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  cursor: pointer;
  min-height: 68px;
  display: grid;
  align-content: center;
  gap: 4px;
  width: 100%;
  appearance: none;
  text-align: left;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease;
  box-shadow: 0 4px 12px rgba(28, 45, 68, 0.03);
}
.option-card:focus-visible {
  outline: none;
  border-color: #8fa9c8;
  box-shadow:
    0 0 0 4px rgba(111, 143, 180, 0.16),
    0 12px 20px rgba(28, 45, 68, 0.08);
}
.option-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 12px 20px rgba(28, 45, 68, 0.08);
  transform: translateY(-1px);
}
.option-card.active {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 14px 24px rgba(36, 54, 77, 0.22);
}

.hardware-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.hardware-grid .premium-select-card {
  min-height: 76px;
  padding: 12px 14px;
  gap: 6px;
  align-content: center;
  justify-items: center;
  text-align: center;
}
.hardware-grid .premium-select-card .premium-content {
  justify-items: center;
  text-align: center;
  width: 100%;
  align-self: center;
  align-content: center;
  min-height: 100%;
}
.hardware-grid .premium-title {
  font-size: 14px;
  text-align: center;
}
.hardware-grid .premium-cta {
  margin-top: 0;
  font-size: 11px;
  justify-self: center;
}

.product-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.product-card {
  position: relative;
  min-height: 204px;
  padding: 16px 12px 14px;
  align-content: start;
  justify-items: center;
  text-align: center;
  gap: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}
.product-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 72px;
  background: linear-gradient(180deg, rgba(111, 143, 180, 0.12) 0%, rgba(111, 143, 180, 0.03) 100%);
  pointer-events: none;
}
.product-card .product-icon-wrap {
  position: relative;
  z-index: 1;
  width: 92px;
  height: 92px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fd 100%);
  border: 1px solid #d9e5f2;
  box-shadow:
    0 12px 24px rgba(28, 45, 68, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.product-card img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 8px 14px rgba(28, 45, 68, 0.12));
  border-radius: 18px;
  background: transparent;
}
.product-card .product-text {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  width: 100%;
}
.product-card .product-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}
.product-card .product-subtitle {
  display: none;
}
.product-card .product-cta {
  display: none;
}
.product-card .product-selected-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  color: #27425f;
  border: 1px solid rgba(111, 143, 180, 0.28);
  box-shadow: 0 8px 14px rgba(28, 45, 68, 0.08);
}
.product-card .product-selected-badge::before,
.premium-select-card .premium-selected-badge::before {
  content: "";
  width: 8px;
  height: 14px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
}
.product-card:hover .product-icon-wrap {
  transform: translateY(-2px);
  box-shadow:
    0 16px 28px rgba(28, 45, 68, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.product-card.active {
  background: linear-gradient(180deg, #304963 0%, #24364d 100%);
}
.product-card.active::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
}
.product-card.active .product-icon-wrap {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(242, 247, 252, 0.96) 100%);
  border-color: rgba(255, 255, 255, 0.55);
}
.product-card.active .product-title,
.product-card.active .product-subtitle {
  color: #fff;
}
.product-card.active .product-subtitle {
  color: rgba(255, 255, 255, 0.84);
}
.product-card.active .product-cta {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}
.premium-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.premium-grid.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.premium-grid.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.premium-grid.grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.premium-grid.grid-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.premium-select-card {
  position: relative;
  min-height: 148px;
  padding: 16px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-content: stretch;
  gap: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  overflow: hidden;
}
.premium-select-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 60px;
  background: linear-gradient(180deg, rgba(111, 143, 180, 0.1) 0%, rgba(111, 143, 180, 0.02) 100%);
  pointer-events: none;
}
.premium-select-card .premium-selected-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.94);
  color: #27425f;
  border: 1px solid rgba(111, 143, 180, 0.28);
  box-shadow: 0 8px 14px rgba(28, 45, 68, 0.08);
}
.premium-select-card .premium-media,
.premium-select-card .premium-badge {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 76px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fd 100%);
  border: 1px solid #d9e5f2;
  box-shadow:
    0 12px 24px rgba(28, 45, 68, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.premium-select-card .premium-media img {
  width: 66px;
  height: 66px;
  object-fit: contain;
  display: block;
}
.premium-select-card .premium-media img.joint-icon,
.premium-select-card[data-action="toggle-joint"] .premium-media img {
  width: 68px;
  height: 68px;
}

.premium-select-card[data-action="toggle-joint"] {
  min-height: 104px;
  padding: 12px 14px;
  grid-template-columns: 84px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  align-content: center;
  column-gap: 14px;
  row-gap: 6px;
}
.premium-select-card[data-action="toggle-joint"]::before {
  height: 100%;
  width: 118px;
}
.premium-select-card[data-action="toggle-joint"] .premium-media {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 74px;
  height: 74px;
  border-radius: 18px;
  justify-self: start;
  overflow: hidden;
  padding: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fd 100%);
}
.premium-select-card[data-action="toggle-joint"] .premium-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}
.premium-select-card[data-action="toggle-joint"] .premium-content {
  grid-column: 2;
  grid-row: 1;
  text-align: center;
  align-self: end;
  gap: 0;
}
.premium-select-card[data-action="toggle-joint"] .premium-title {
  font-size: 15px;
}
.premium-select-card[data-action="toggle-joint"] .premium-subtitle {
  display: none;
}
.premium-select-card[data-action="toggle-joint"] .premium-cta {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  align-self: start;
  padding: 7px 11px;
  font-size: 10px;
}

.premium-select-card[data-action="toggle-internal-shutter"] .premium-media,
.premium-select-card[data-action="toggle-profile-change"] .premium-media,
.premium-select-card[data-action="toggle-reported"] .premium-media,
.premium-select-card[data-action="toggle-wood-wood"] .premium-media {
  overflow: hidden;
  padding: 0;
}
.premium-select-card[data-action="toggle-internal-shutter"] .premium-media img,
.premium-select-card[data-action="toggle-profile-change"] .premium-media img,
.premium-select-card[data-action="toggle-reported"] .premium-media img,
.premium-select-card[data-action="toggle-wood-wood"] .premium-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}
.premium-select-card .premium-badge {
  font-size: 18px;
  font-weight: 800;
  color: #37506b;
  letter-spacing: 0.02em;
}
.premium-select-card .premium-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 5px;
  align-self: center;
  align-content: center;
  justify-items: center;
  min-height: 100%;
  text-align: center;
}
.premium-select-card .premium-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.28;
}
.premium-select-card .premium-subtitle {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  font-weight: 600;
}
.premium-select-card .premium-cta {
  display: none;
}
.premium-select-card.active {
  background: linear-gradient(180deg, #304963 0%, #24364d 100%);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 14px 24px rgba(36, 54, 77, 0.22);
}
.premium-select-card.active::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
}
.premium-select-card.active .premium-media,
.premium-select-card.active .premium-badge {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(242, 247, 252, 0.96) 100%);
  border-color: rgba(255, 255, 255, 0.55);
}
.premium-select-card.active .premium-title,
.premium-select-card.active .premium-subtitle {
  color: #fff;
}
.premium-select-card.active .premium-subtitle {
  color: rgba(255, 255, 255, 0.84);
}
.premium-select-card.active .premium-cta {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}
.premium-select-card.locked-option-card {
  cursor: not-allowed;
}
.premium-select-card.locked-option-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(39, 66, 95, 0.12);
}
.premium-select-card.locked-option-card:not(.active) {
  background: linear-gradient(180deg, #f9fbfd 0%, #f1f6fb 100%);
}
.premium-select-card.locked-option-card .premium-cta {
  min-width: 138px;
}
.parameter-stack {
  display: grid;
  gap: 14px;
  max-width: 560px;
}
.parameter-stack.thickness-grid {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  align-items: stretch;
  max-width: 760px;
}
.parameter-stack.thickness-grid.has-antina-thickness {
  grid-template-columns: repeat(3, minmax(210px, 1fr));
  max-width: 980px;
}
.parameter-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%);
  box-shadow: 0 12px 22px rgba(28, 45, 68, 0.06);
}
.parameter-card.thickness-card {
  gap: 10px;
  padding: 14px;
}
.parameter-top {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 14px;
  align-items: center;
}
.thickness-card .parameter-top {
  grid-template-columns: 58px 1fr;
  gap: 10px;
}
.parameter-image {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fd 100%);
  border: 1px solid #d9e5f2;
  box-shadow:
    0 12px 24px rgba(28, 45, 68, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  overflow: hidden;
}
.thickness-card .parameter-image {
  width: 58px;
  height: 58px;
  border-radius: 16px;
}
.parameter-image img {
  width: 66px;
  height: 66px;
  object-fit: contain;
  display: block;
  border-radius: inherit;
}
.thickness-card .parameter-image img {
  width: 50px;
  height: 50px;
}
.antina-thickness-card .parameter-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Modalità di Lavorazione: pulsanti toggle sotto ogni riquadro spessore */
.working-mode-row {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.working-mode-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.working-mode-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.working-mode-btn {
  flex: 1 1 0;
  min-width: 96px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}
.working-mode-btn:hover {
  border-color: var(--primary);
}
.working-mode-btn.active {
  background: var(--primary);
  border-color: var(--primary-strong);
  color: var(--primary-text);
}
.working-mode-btn.disabled,
.working-mode-btn:disabled {
  background: var(--bg-soft);
  border-color: var(--border);
  color: var(--muted);
  opacity: 0.55;
  cursor: not-allowed;
}
.working-mode-btn.disabled:hover,
.working-mode-btn:disabled:hover {
  border-color: var(--border);
}
/* Tag modalità di lavorazione nel riepilogo prodotto */
.wm-tags {
  display: inline-flex;
  gap: 4px;
  margin-left: 6px;
  flex-wrap: wrap;
  vertical-align: middle;
}
.wm-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--border);
}
.wm-summary {
  margin-top: 4px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.wm-summary-label {
  font-weight: 700;
}
.wm-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.wm-abbr {
  font-weight: 700;
}
.parameter-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
}
.parameter-subtitle {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  font-weight: 600;
  margin-top: 4px;
}
.parameter-card .field {
  margin: 0;
}
.compact-field {
  max-width: 190px;
}
.compact-field label {
  font-size: 12px;
}
.unit-input {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.unit-input span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.unit-input .thickness-input {
  width: 76px;
  min-width: 76px;
  padding: 10px 9px;
  text-align: right;
}
@media (max-width: 900px) {
  .parameter-stack.thickness-grid.has-antina-thickness {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    max-width: 760px;
  }
}
@media (max-width: 720px) {
  .parameter-stack.thickness-grid,
  .parameter-stack.thickness-grid.has-antina-thickness {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
}
.premium-select-card .inline-parameter {
  position: relative;
  z-index: 1;
  margin-top: 2px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #d9e5f2;
  width: 100%;
}
.premium-select-card .inline-parameter label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}
.premium-select-card.active .inline-parameter {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}
.premium-select-card.active .inline-parameter label {
  color: #fff;
}
.premium-select-card .inline-parameter .input {
  background: rgba(255, 255, 255, 0.96);
}

.premium-select-card .compact-inline-parameter {
  padding: 10px 12px;
  width: fit-content;
  min-width: 190px;
}
.premium-select-card .compact-inline-parameter label {
  margin-bottom: 6px;
  font-size: 11px;
}
.premium-select-card .compact-inline-parameter .unit-input {
  gap: 8px;
}
.premium-select-card .compact-inline-parameter .thickness-input {
  width: 76px;
  min-width: 76px;
  padding: 10px 9px;
  text-align: right;
}
.pill {
  border: 1px solid #b8d6c4;
  background: #eff8f2;
  color: #1d6a43;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.progress {
  width: 100%;
  height: 12px;
  background: #e4ebf3;
  border-radius: 999px;
  overflow: hidden;
}
.progress > div {
  height: 100%;
  background: linear-gradient(90deg, #314862 0%, #6f8fb4 100%);
}
.step-chip {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  background: #fff;
  font-weight: 700;
}
.step-chip.current {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  border-color: var(--primary);
  color: #fff;
}

.stepper-card {
  border-radius: 16px;
  box-shadow: none;
}
.stepper-body {
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}
.stepper-head {
  gap: 8px;
}
.stepper-head .row {
  gap: 8px;
}
.stepper-progress {
  height: 6px;
}
.stepper-grid {
  gap: 5px;
}
.stepper-grid .step-chip {
  border-radius: 10px;
  padding: 5px 6px;
  font-size: 10px;
  line-height: 1.15;
  font-weight: 700;
}
.stepper-pill {
  padding: 4px 7px;
  font-size: 10px;
}
.step-chip.done {
  background: #eef8f1;
  border-color: #bfe3cb;
  color: #1d6a43;
}
.line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.summary-box {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  box-shadow: 0 4px 12px rgba(28, 45, 68, 0.03);
}
.summary-box .label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.summary-box .value {
  margin-top: 6px;
  font-size: 17px;
  font-weight: 800;
}
.section-title {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 800;
}
.list {
  display: grid;
  gap: 12px;
}
.item-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fbfdff 0%, #f6f9fc 100%);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  gap: 10px;
}
.top-tabs {
  display: flex;
  gap: 10px;
}
.tab-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 800;
  transition: all 0.12s ease;
}
.tab-btn:hover {
  border-color: var(--border-strong);
  box-shadow: 0 10px 18px rgba(28, 45, 68, 0.06);
}
.tab-btn.active {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #fff;
  border-color: var(--primary);
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.admin-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: #fff;
  display: grid;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(28, 45, 68, 0.03);
}
.admin-card.admin-collapsible {
  padding: 0;
  overflow: visible;
  gap: 0;
  border-color: rgba(92, 124, 163, 0.42);
  background: #fff;
}
.admin-card.admin-collapsible.open {
  grid-column: 1 / -1;
}
.admin-card.tone-a {
  background: #eaf3ff;
  border-color: #b9d3f1;
}
.admin-card.tone-b {
  background: #e9f7ee;
  border-color: #b8dcc4;
}
.admin-card.tone-c {
  background: #fff0d8;
  border-color: #eccb96;
}
.admin-card.tone-d {
  background: #eee8ff;
  border-color: #cbbcf2;
}
.admin-card.tone-e {
  background: #e3f5f5;
  border-color: #aed7d7;
}
.admin-card.tone-f {
  background: #ffe8ec;
  border-color: #efb8c3;
}
.admin-card-header {
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 13px 14px;
  background: transparent;
  color: #24364d;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.admin-card-header:hover,
.admin-card-header:focus-visible {
  background: rgba(255, 255, 255, 0.5);
  outline: none;
}
.admin-card-chevron {
  display: none !important;
}
.admin-card-title {
  display: block;
  color: #0f2238;
  font-weight: 900;
  font-size: 14px;
  line-height: 1.2;
  min-width: 0;
}
.admin-card-count {
  min-width: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(92, 124, 163, 0.38);
  color: #20364f;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}
.admin-card-body {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}
.admin-card-hint {
  margin-top: -2px;
}
.admin-card-actions {
  display: flex;
  justify-content: flex-end;
  overflow: visible;
}
.admin-rows {
  display: grid;
  gap: 8px;
}
.admin-row {
  display: grid;
  grid-template-columns: 1fr 96px 38px;
  gap: 8px;
  align-items: center;
  overflow: visible;
}
.admin-row .input {
  min-height: 38px;
  padding: 9px 10px;
  border-radius: 12px;
}
.admin-icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 12px;
  border: 1px solid rgba(111, 143, 180, 0.24);
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
  color: #27425f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(27, 47, 69, 0.06);
}
.admin-icon-btn.add {
  color: #2e7d32;
  border-color: rgba(46, 125, 50, 0.24);
  background: linear-gradient(180deg, #fff 0%, #f5fff6 100%);
}
.admin-icon-btn.danger {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.24);
  background: linear-gradient(180deg, #fff 0%, #fff7f7 100%);
}
.admin-icon-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  padding: 7px 9px;
  border-radius: 9px;
  background: #1f3146;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 12px 26px rgba(27, 47, 69, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  z-index: 120;
}
.admin-icon-btn:hover::after,
.admin-icon-btn:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}
.admin-empty {
  padding: 8px 10px;
  border: 1px dashed rgba(111, 143, 180, 0.35);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
}
.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}
details pre {
  overflow: auto;
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px;
  border-radius: 14px;
  font-size: 12px;
}
.workload-box {
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7fb 100%);
  border: 1px solid var(--border);
}
.work-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
}
.work-row.total {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #cbd5e1;
  font-weight: 800;
}
ul {
  margin: 10px 0 0 18px;
}
.sidebar-sticky {
  position: sticky;
  top: 22px;
}
@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar-sticky {
    position: static;
  }
  .grid-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .admin-grid,
  .grid-4,
  .summary-grid,
  .product-grid,
  .premium-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 760px) {
  h1 {
    font-size: 26px;
  }
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-6,
  .option-grid,
  .product-grid,
  .premium-grid,
  .summary-grid,
  .admin-grid,
  .admin-row {
    grid-template-columns: 1fr;
  }
  .container {
    padding: 16px;
  }
  .top-tabs {
    flex-direction: column;
  }
  .header {
    padding: 18px;
  }
  .card-body {
    padding: 18px;
  }
  .modal-card {
    padding: 18px;
  }

  .stepper-body {
    padding: 9px 10px;
  }
  .stepper-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stepper-grid .step-chip {
    padding: 5px 4px;
    font-size: 9px;
  }
}

/* Barra laterale azioni rapide */
.app-shell {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.app-main {
  min-width: 0;
}
.action-rail {
  position: sticky;
  top: 22px;
  z-index: 50;
}
.action-rail-inner {
  display: grid;
  gap: 9px;
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: var(--shadow-sm);
}
.rail-group {
  display: grid;
  gap: 9px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.rail-group:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}
.rail-btn {
  position: relative;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: var(--text);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease;
}
.rail-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  filter: grayscale(0.25);
}
.rail-btn:hover:not(:disabled),
.rail-btn:focus-visible {
  border-color: var(--border-strong);
  box-shadow: 0 10px 18px rgba(28, 45, 68, 0.1);
  transform: translateY(-1px);
  outline: none;
}

.rail-btn.active {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 10px 18px rgba(36, 54, 77, 0.18);
}
.rail-btn.active:hover:not(:disabled),
.rail-btn.active:focus-visible {
  box-shadow: 0 14px 24px rgba(36, 54, 77, 0.24);
}
.rail-icon {
  font-size: 21px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rail-icon-img,
.button-icon-img {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
  pointer-events: none;
}
.rail-icon-img {
  width: 26px;
  height: 26px;
}
.rail-btn.active .rail-icon-img {
  filter: brightness(0) invert(1);
}
.rail-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.2);
  transition:
    opacity 0.12s ease,
    transform 0.12s ease;
}
.rail-btn::before {
  content: "";
  position: absolute;
  left: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  border: 6px solid transparent;
  border-right-color: var(--primary);
  transition: opacity 0.12s ease;
}
.rail-btn:hover::after,
.rail-btn:hover::before,
.rail-btn:focus-visible::after,
.rail-btn:focus-visible::before {
  opacity: 1;
}
.rail-btn:hover::after,
.rail-btn:focus-visible::after {
  transform: translateY(-50%) translateX(0);
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .action-rail {
    position: sticky;
    top: 0;
    z-index: 80;
    margin: -8px -4px 0;
  }
  .action-rail-inner {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    border-radius: 18px;
    padding: 8px;
  }
  .rail-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }
  .rail-group {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    padding: 0 10px 0 0;
    margin: 0 10px 0 0;
    border-bottom: 0;
    border-right: 1px solid var(--border);
  }
  .rail-group:last-child {
    padding-right: 0;
    margin-right: 0;
    border-right: 0;
  }
  .rail-btn::after,
  .rail-btn::before {
    display: none;
  }
}

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

.profile-section-box {
  gap: 14px;
}
.profile-section-box.profile-tone-a {
  background: #eaf3ff;
  border-color: #b9d3f1;
}
.profile-section-box.profile-tone-b {
  background: #e9f7ee;
  border-color: #b8dcc4;
}
.profile-section-box.profile-tone-c {
  background: #fff0d8;
  border-color: #eccb96;
}
.profile-section-box.profile-tone-d {
  background: #eee8ff;
  border-color: #cbbcf2;
}
.profile-section-box.profile-tone-e {
  background: #e3f5f5;
  border-color: #aed7d7;
}
.profile-section-box.profile-tone-f {
  background: #ffe8ec;
  border-color: #efb8c3;
}
.profile-section-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}
.profile-options-grid {
  gap: 10px;
}
.premium-select-card.profile-option-card {
  min-height: 58px;
  padding: 8px 10px;
  align-content: center;
  gap: 0;
}
.premium-select-card.profile-option-card::before {
  height: 100%;
  background: linear-gradient(90deg, rgba(111, 143, 180, 0.08) 0%, rgba(111, 143, 180, 0) 72%);
}
.premium-select-card.profile-option-card .premium-content {
  text-align: center;
  justify-items: center;
  gap: 0;
  align-self: center;
  align-content: center;
  min-height: 100%;
}
.premium-select-card.profile-option-card .premium-title {
  font-size: 13px;
  line-height: 1.18;
}
.premium-select-card.profile-option-card .premium-cta {
  justify-self: center;
  margin-top: 0;
  padding: 7px 11px;
  font-size: 10px;
}
.premium-select-card.profile-option-card .premium-media,
.premium-select-card.profile-option-card .premium-badge {
  display: none;
}

.persiana-slat-grid .premium-select-card.profile-option-card {
  min-height: 150px;
  align-content: start;
  gap: 8px;
}

.persiana-slat-grid .premium-select-card.profile-option-card .premium-media {
  display: grid;
  width: 96px;
  height: 78px;
  border-radius: 14px;
  padding: 6px;
  overflow: hidden;
  justify-self: center;
}

.persiana-slat-grid .premium-select-card.profile-option-card .premium-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.persiana-slat-grid .premium-select-card.profile-option-card .premium-content {
  align-self: start;
  min-height: 34px;
  display: grid;
  place-items: center;
}

.persiana-slat-grid .premium-select-card.profile-option-card .premium-title {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.premium-select-card.profile-option-card.persiana-door-card {
  min-height: 150px;
  align-content: start;
  gap: 8px;
}

.premium-select-card.profile-option-card.persiana-door-card .premium-content {
  align-self: start;
  min-height: 34px;
  display: grid;
  place-items: center;
}

.premium-select-card.profile-option-card.persiana-door-card .premium-media {
  display: grid;
  width: 96px;
  height: 78px;
  border-radius: 14px;
  padding: 6px;
  overflow: hidden;
  justify-self: center;
}

.premium-select-card.profile-option-card.persiana-door-card .premium-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.persiana-slat-detail-list {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.persiana-slat-detail {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.persiana-slat-passage-grid {
  grid-template-columns: repeat(3, minmax(0, 180px));
  justify-content: start;
}

.persiana-slat-passage-grid .premium-select-card.profile-option-card {
  min-height: 54px;
  padding: 8px 10px;
  gap: 0;
  align-content: center;
  align-items: center;
}

.persiana-slat-passage-grid .premium-select-card.profile-option-card::before {
  height: 100%;
}

.persiana-slat-passage-grid .premium-select-card.profile-option-card .premium-content {
  align-self: center;
  min-height: 0;
  height: 100%;
  align-content: center;
}

.persiana-slat-passage-grid .premium-select-card.profile-option-card .premium-title {
  min-height: 0;
  font-size: 12px;
  line-height: 1.15;
  display: flex;
  align-items: center;
  justify-content: center;
}

.persiana-shape-upload {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(11, 53, 88, 0.12);
  border-radius: 14px;
  background: rgba(235, 244, 253, 0.55);
}

.persiana-shape-file-row {
  margin-top: -2px;
}

@media (max-width: 720px) {
  .profile-section-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }
  .premium-select-card.profile-option-card {
    min-height: 54px;
  }
}

/* Stato catalogo sul pulsante Import Catalogo */
.rail-btn.catalog-status-missing {
  background: linear-gradient(180deg, #fff8d8 0%, #fff1a8 100%);
  border-color: #ead36c;
}
.rail-btn.catalog-status-loaded {
  background: linear-gradient(180deg, #e8f8ee 0%, #c9efd6 100%);
  border-color: #8fd1a4;
}
.rail-btn.catalog-status-error {
  background: linear-gradient(180deg, #ffecec 0%, #ffd1d1 100%);
  border-color: #e89a9a;
}
.rail-btn.catalog-status-missing:hover:not(:disabled),
.rail-btn.catalog-status-loaded:hover:not(:disabled),
.rail-btn.catalog-status-error:hover:not(:disabled),
.rail-btn.catalog-status-missing:focus-visible,
.rail-btn.catalog-status-loaded:focus-visible,
.rail-btn.catalog-status-error:focus-visible {
  box-shadow: 0 10px 18px rgba(28, 45, 68, 0.14);
}

/* Stato catalogo sul pulsante Pagina Amministrativa Punteggi */
.rail-btn.catalog-status-admin-missing {
  background: linear-gradient(180deg, #ffecec 0%, #ffd1d1 100%);
  border-color: #e89a9a;
}
.rail-btn.catalog-status-admin-loaded {
  background: linear-gradient(180deg, #e8f8ee 0%, #c9efd6 100%);
  border-color: #8fd1a4;
}
.rail-btn.catalog-status-admin-dirty {
  background: linear-gradient(180deg, #fff8d8 0%, #fff1a8 100%);
  border-color: #ead36c;
}
.rail-btn.catalog-status-admin-missing.active,
.rail-btn.catalog-status-admin-loaded.active,
.rail-btn.catalog-status-admin-dirty.active {
  color: var(--text);
  box-shadow: 0 10px 18px rgba(28, 45, 68, 0.16);
}
.rail-btn.catalog-status-admin-missing:hover:not(:disabled),
.rail-btn.catalog-status-admin-loaded:hover:not(:disabled),
.rail-btn.catalog-status-admin-dirty:hover:not(:disabled),
.rail-btn.catalog-status-admin-missing:focus-visible,
.rail-btn.catalog-status-admin-loaded:focus-visible,
.rail-btn.catalog-status-admin-dirty:focus-visible {
  box-shadow: 0 10px 18px rgba(28, 45, 68, 0.14);
}

.variant-reduction-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  max-width: 520px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%);
  box-shadow: 0 10px 20px rgba(28, 45, 68, 0.06);
}
.variant-reduction-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: var(--primary);
  background: rgba(46, 107, 154, 0.1);
  border: 1px solid rgba(46, 107, 154, 0.18);
}
.variant-reduction-text {
  min-width: 0;
}
.percent-input .thickness-input {
  width: 64px;
  min-width: 64px;
}
@media (max-width: 640px) {
  .variant-reduction-card {
    grid-template-columns: 42px 1fr;
  }
  .variant-reduction-card .percent-input {
    grid-column: 2;
  }
}

/* Miniature grafiche sequenze di apertura */
.premium-grid.grid-4[data-openings-grid] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.premium-select-card[data-action="toggle-opening"] {
  min-height: 142px;
  padding: 12px;
  gap: 8px;
}
.premium-select-card[data-action="toggle-opening"]::before {
  height: 46px;
}
.premium-select-card[data-action="toggle-opening"] .premium-selected-badge {
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  font-size: 12px;
}
.premium-select-card[data-action="toggle-opening"] .premium-media {
  width: 108px;
  height: 68px;
  border-radius: 14px;
  justify-self: center;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}
.premium-select-card[data-action="toggle-opening"] .premium-media img {
  width: 102px;
  height: 62px;
  object-fit: contain;
}
.premium-select-card[data-action="toggle-opening"] .opening-media {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
}
.premium-select-card[data-action="toggle-opening"] .opening-media .opening-part {
  width: auto;
  height: 62px;
  max-width: none;
  object-fit: contain;
  flex: 0 1 auto;
}
.premium-select-card[data-action="toggle-opening"] .opening-media-3 .opening-part,
.premium-select-card[data-action="toggle-opening"] .opening-media-4 .opening-part {
  height: 50px;
}
.premium-select-card[data-action="toggle-opening"] .premium-title {
  min-height: auto;
  font-size: 13px;
  line-height: 1.25;
}
.premium-select-card[data-action="toggle-opening"] .premium-subtitle {
  display: none;
}

@media (max-width: 900px) {
  .premium-grid.grid-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .premium-select-card[data-action="toggle-opening"] {
    min-height: 134px;
    padding: 10px;
  }
  .premium-select-card[data-action="toggle-opening"] .premium-media {
    width: 96px;
    height: 62px;
  }
  .premium-select-card[data-action="toggle-opening"] .premium-media img {
    width: 90px;
    height: 56px;
  }
  .premium-select-card[data-action="toggle-opening"] .opening-media .opening-part {
    width: auto;
    height: 56px;
  }
  .premium-select-card[data-action="toggle-opening"] .opening-media-3 .opening-part,
  .premium-select-card[data-action="toggle-opening"] .opening-media-4 .opening-part {
    height: 46px;
  }
}

/* Normalizzazione immagini tipologia Antone/Scuro */
.antone-type-grid .premium-select-card {
  min-height: 152px;
  padding: 12px;
  gap: 8px;
}
.antone-type-grid .premium-select-card .premium-media {
  width: 132px;
  height: 80px;
  border-radius: 12px;
  justify-self: center;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d9e5f2;
  box-shadow:
    0 8px 16px rgba(28, 45, 68, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.antone-type-grid .premium-select-card .premium-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform: none;
}
.antone-type-grid .premium-select-card.active .premium-media {
  background: #ffffff;
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow:
    0 8px 16px rgba(12, 24, 40, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
}
@media (max-width: 720px) {
  .antone-type-grid .premium-select-card .premium-media {
    width: 114px;
    height: 70px;
  }
}

/* Griglia Profili: 6 scelte per riga */
.profile-options-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.profile-options-grid .profile-option-card {
  min-height: 58px;
  padding: 8px 10px;
  gap: 0;
}
.profile-options-grid .premium-title {
  font-size: 12px;
  line-height: 1.22;
}
@media (max-width: 1180px) {
  .profile-options-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .profile-options-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .profile-options-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Banca dati clienti + storico offerte */
.client-db-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(420px, 1.2fr);
  gap: 16px;
}
.client-history-card {
  grid-column: 1 / -1;
}
.client-db-list,
.offer-history-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}
.customer-db-row,
.offer-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(111, 143, 180, 0.2);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.customer-db-row.active {
  border-color: rgba(46, 107, 154, 0.45);
  box-shadow: 0 0 0 3px rgba(46, 107, 154, 0.08);
}
.btn.compact {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}
.row.wrap {
  flex-wrap: wrap;
}
.empty-state {
  padding: 12px;
  border: 1px dashed rgba(111, 143, 180, 0.28);
  border-radius: 14px;
  background: rgba(247, 251, 255, 0.75);
}
@media (max-width: 980px) {
  .client-db-layout {
    grid-template-columns: 1fr;
  }
}

/* Dati cliente integrati: toolbar azioni + pannello carica cliente */
.client-single-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
.client-data-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.client-icon-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.icon-action-btn {
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid rgba(111, 143, 180, 0.24);
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
  color: #27425f;
  font-weight: 800;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(27, 47, 69, 0.07);
}
.icon-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(27, 47, 69, 0.1);
}
.icon-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.icon-action-symbol {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(46, 107, 154, 0.1);
}
.icon-action-symbol .button-icon-img {
  width: 16px;
  height: 16px;
}
.client-load-panel {
  border: 1px solid rgba(111, 143, 180, 0.22);
  border-radius: 22px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.client-load-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.client-search-field label {
  display: block;
  margin-bottom: 7px;
  font-weight: 800;
  color: #27425f;
}
.client-load-list {
  max-height: 340px;
  overflow: auto;
  margin: 12px 0;
}
@media (max-width: 760px) {
  .client-data-header {
    display: grid;
  }
  .client-icon-actions {
    justify-content: stretch;
  }
  .icon-action-btn {
    flex: 1 1 140px;
    justify-content: center;
  }
}

/* Ricerca automatica indirizzo cliente */
.address-autocomplete-field {
  position: relative;
}
.address-search-status {
  margin-top: 7px;
  font-size: 12px;
  color: #6b7c90;
  font-weight: 700;
}
.address-suggestions {
  margin-top: 8px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(111, 143, 180, 0.22);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(27, 47, 69, 0.1);
  max-height: 280px;
  overflow: auto;
  z-index: 4;
}
.address-suggestion {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(111, 143, 180, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  color: #22384f;
  padding: 10px 12px;
  cursor: pointer;
  display: grid;
  gap: 4px;
}
.address-suggestion:hover {
  border-color: rgba(46, 107, 154, 0.42);
  box-shadow: 0 10px 22px rgba(27, 47, 69, 0.08);
  transform: translateY(-1px);
}
.address-suggestion span {
  font-weight: 800;
  line-height: 1.3;
}
.address-suggestion small {
  color: #6b7c90;
  font-weight: 700;
}

.offer-final-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.offer-final-actions .final-icon-btn {
  position: relative;
  min-width: 48px;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}
.offer-final-actions .final-icon-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  max-width: 230px;
  width: max-content;
  padding: 8px 10px;
  border-radius: 10px;
  background: #1f3146;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  box-shadow: 0 12px 28px rgba(27, 47, 69, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  z-index: 20;
}
.offer-final-actions .final-icon-btn:hover::after,
.offer-final-actions .final-icon-btn:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}
.offer-final-actions .danger-lite {
  color: #8a2b2b;
  border-color: rgba(185, 28, 28, 0.22);
  background: linear-gradient(180deg, #fff 0%, #fff7f7 100%);
}

/* Fix campo indirizzo: input stabile e suggerimenti senza descrizione sorgente */
.address-autocomplete-field {
  min-width: 0;
  overflow: visible;
}
.address-autocomplete-field .label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  white-space: nowrap;
}
.address-autocomplete-field .input {
  width: 100%;
  box-sizing: border-box;
  display: block;
}
.address-suggestions {
  width: 100%;
  box-sizing: border-box;
}
.address-suggestion {
  min-width: 0;
}
.address-suggestion span {
  display: block;
  overflow-wrap: anywhere;
  word-break: normal;
}
.address-suggestion small {
  display: none;
}

/* Pulizia pagina dati cliente */
.client-data-header h2,
.client-load-header h3,
.client-history-card h2 {
  margin-bottom: 0;
}
.icon-only-btn {
  position: relative;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 13px;
  border: 1px solid rgba(111, 143, 180, 0.24);
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
  color: #27425f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(27, 47, 69, 0.07);
}
.icon-only-btn.danger {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.28);
  background: linear-gradient(180deg, #fff 0%, #fff7f7 100%);
}
.icon-only-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  padding: 7px 9px;
  border-radius: 9px;
  background: #1f3146;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 12px 26px rgba(27, 47, 69, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  z-index: 50;
}
.icon-only-btn:hover::after,
.icon-only-btn:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}
.customer-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
.close-load-btn {
  flex: 0 0 auto;
}
.client-search-field {
  margin-top: 4px;
}

/* Dropdown indirizzi: non sposta il campo/label */
.address-autocomplete-field {
  position: relative;
  z-index: 30;
}
.address-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  margin-top: 0;
  max-height: 260px;
  overflow: auto;
  z-index: 80;
}

/* Fix campo Cerca cliente: nessun salto/uscita dal label durante la digitazione */
.client-load-panel {
  overflow: visible;
}
.client-search-field {
  position: relative;
  min-width: 0;
  z-index: 40;
  padding-bottom: 0;
}
.client-search-field label {
  display: inline-flex;
  align-items: center;
  margin-bottom: 7px;
  white-space: nowrap;
}
.client-search-field .input {
  width: 100%;
  box-sizing: border-box;
  display: block;
}
.client-search-field + .client-db-list,
.client-load-list {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 142px;
  margin: 0;
  max-height: 300px;
  overflow: auto;
  z-index: 70;
  background: #ffffff;
  border: 1px solid rgba(111, 143, 180, 0.22);
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 16px 34px rgba(27, 47, 69, 0.14);
}
.client-load-panel:has(.client-load-list) {
  padding-bottom: 84px;
}

/* Fix tooltip azioni risultati cliente: sopra dropdown e barra di ricerca */
.client-load-list,
.customer-db-row,
.customer-row-actions {
  overflow: visible;
}
.customer-row-actions .icon-only-btn {
  z-index: 120;
}
.customer-row-actions .icon-only-btn::after {
  top: 50%;
  bottom: auto;
  right: calc(100% + 10px);
  transform: translateY(-50%) translateX(4px);
  z-index: 250;
}
.customer-row-actions .icon-only-btn:hover::after,
.customer-row-actions .icon-only-btn:focus-visible::after {
  transform: translateY(-50%) translateX(0);
}
.client-load-panel,
.client-search-field {
  z-index: 90;
}
.client-load-list {
  z-index: 110;
}

/* Correzione definitiva ricerca cliente: risultati dentro al pannello, non overlay a tutta pagina */
.client-load-panel {
  position: relative;
  overflow: visible;
  padding-bottom: 16px !important;
}
.client-search-field {
  position: relative;
  z-index: 1;
  padding-bottom: 0;
  margin-bottom: 12px;
}
.client-search-field + .client-db-list,
.client-load-list {
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  width: 100% !important;
  box-sizing: border-box;
  margin: 10px 0 12px 0 !important;
  max-height: 260px;
  overflow: auto;
  z-index: 1;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
.client-load-panel:has(.client-load-list) {
  padding-bottom: 16px !important;
}
.client-load-list .customer-db-row {
  background: #ffffff;
  border: 1px solid rgba(111, 143, 180, 0.22);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: 0 8px 18px rgba(27, 47, 69, 0.06);
}
.client-load-list .customer-db-row:last-child {
  margin-bottom: 0;
}
.client-load-list .customer-row-actions .icon-only-btn::after {
  top: auto;
  bottom: calc(100% + 8px);
  right: 0;
  transform: translateY(4px);
}
.client-load-list .customer-row-actions .icon-only-btn:hover::after,
.client-load-list .customer-row-actions .icon-only-btn:focus-visible::after {
  transform: translateY(0);
}

/* Sidebar prodotti salvati: riepilogo compatto */
.saved-product-card {
  display: grid;
  gap: 8px;
}
.saved-product-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.saved-product-head strong {
  line-height: 1.28;
  color: #0f172a;
}
.saved-product-date {
  margin-top: -2px;
}
.saved-product-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  overflow: visible;
}
.saved-product-icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 12px;
  border: 1px solid rgba(111, 143, 180, 0.24);
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
  color: #27425f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(27, 47, 69, 0.07);
}
.saved-product-icon-btn.danger {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.28);
  background: linear-gradient(180deg, #fff 0%, #fff7f7 100%);
}
.saved-product-icon-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  padding: 7px 9px;
  border-radius: 9px;
  background: #1f3146;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 12px 26px rgba(27, 47, 69, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  z-index: 80;
}
.saved-product-icon-btn:hover::after,
.saved-product-icon-btn:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}
.saved-product-score {
  color: #0f172a;
}

/* Semaforo cliente nella barra step */
.customer-traffic-light {
  width: 16px;
  height: 16px;
  display: inline-block;
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.18);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.9),
    0 6px 12px rgba(27, 47, 69, 0.12);
}
.customer-traffic-light.yellow {
  background: #f5c542;
}
.customer-traffic-light.green {
  background: #22c55e;
}
.stepper-head {
  min-height: 18px;
}

/* Fix finale ricerca cliente */
.client-load-panel {
  position: relative;
  overflow: visible !important;
}
.client-search-field {
  position: relative;
  z-index: 2;
  margin-bottom: 12px;
  min-width: 0;
}
.client-search-field label {
  display: block;
  margin-bottom: 7px;
  white-space: nowrap;
}
.client-search-field .input {
  width: 100%;
  box-sizing: border-box;
  display: block;
}
.client-load-list {
  position: static !important;
  display: grid;
  gap: 8px;
  width: 100% !important;
  margin: 10px 0 12px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  max-height: none !important;
  overflow: visible !important;
  z-index: 1;
}
.client-load-list .customer-db-row {
  position: relative;
  overflow: visible !important;
  background: #ffffff;
  border: 1px solid rgba(111, 143, 180, 0.22);
  border-radius: 16px;
  padding: 12px;
  margin: 0;
  box-shadow: 0 8px 18px rgba(27, 47, 69, 0.06);
}
.client-load-list .customer-row-actions {
  position: relative;
  overflow: visible !important;
  z-index: 20;
}
.client-load-list .customer-row-actions .icon-only-btn {
  position: relative;
  z-index: 30;
}
.client-load-list .customer-row-actions .icon-only-btn::after {
  top: 50% !important;
  bottom: auto !important;
  right: calc(100% + 10px) !important;
  left: auto !important;
  transform: translateY(-50%) translateX(4px) !important;
  z-index: 999 !important;
}
.client-load-list .customer-row-actions .icon-only-btn:hover::after,
.client-load-list .customer-row-actions .icon-only-btn:focus-visible::after {
  transform: translateY(-50%) translateX(0) !important;
}

/* Stepper compatto: semaforo sotto/allineato alla barra avanzamento */
.compact-stepper-body {
  gap: 7px;
  padding-top: 8px;
}
.stepper-progress-with-light {
  position: relative;
  margin-right: 26px;
  overflow: visible;
}
.stepper-progress-with-light .customer-traffic-light {
  position: absolute;
  right: -26px;
  top: 50%;
  transform: translateY(-50%);
}

/* Storico offerte: azioni a icone */
.offer-history-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  overflow: visible;
}
.history-icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 12px;
  border: 1px solid rgba(111, 143, 180, 0.24);
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
  color: #27425f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(27, 47, 69, 0.07);
}
.history-icon-btn.danger {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.28);
  background: linear-gradient(180deg, #fff 0%, #fff7f7 100%);
}
.history-icon-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  padding: 7px 9px;
  border-radius: 9px;
  background: #1f3146;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 12px 26px rgba(27, 47, 69, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  z-index: 90;
}
.history-icon-btn:hover::after,
.history-icon-btn:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

/* Azienda/cliente come campo ricerca cliente */
.customer-company-search-field {
  position: relative;
  overflow: visible;
  z-index: 45;
}
.customer-company-search-field .label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  white-space: nowrap;
}
.customer-company-search-field .input {
  width: 100%;
  box-sizing: border-box;
  display: block;
}
.customer-company-search-field .company-search-results {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  top: calc(100% + 8px) !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 10px !important;
  border: 1px solid rgba(111, 143, 180, 0.22) !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  box-shadow: 0 16px 34px rgba(27, 47, 69, 0.14) !important;
  max-height: 290px !important;
  overflow: visible !important;
  z-index: 120 !important;
}
.customer-company-search-field .company-search-results[hidden] {
  display: none !important;
}
.customer-company-search-field .customer-db-row {
  background: #ffffff;
  border: 1px solid rgba(111, 143, 180, 0.22);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 8px;
  overflow: visible !important;
}
.customer-company-search-field .customer-db-row:last-child {
  margin-bottom: 0;
}
.customer-company-search-field .customer-row-actions,
.customer-company-search-field .customer-row-actions .icon-only-btn {
  overflow: visible !important;
  z-index: 140;
}
.customer-company-search-field .customer-row-actions .icon-only-btn::after {
  top: 50% !important;
  bottom: auto !important;
  right: calc(100% + 10px) !important;
  transform: translateY(-50%) translateX(4px) !important;
  z-index: 999 !important;
}
.customer-company-search-field .customer-row-actions .icon-only-btn:hover::after,
.customer-company-search-field .customer-row-actions .icon-only-btn:focus-visible::after {
  transform: translateY(-50%) translateX(0) !important;
}

/* Tooltip laterali nello storico offerte */
.offer-history-list,
.offer-history-row,
.offer-history-actions {
  overflow: visible;
}
.offer-history-actions .history-icon-btn {
  z-index: 120;
}
.offer-history-actions .history-icon-btn::after {
  top: 50%;
  bottom: auto;
  right: calc(100% + 10px);
  transform: translateY(-50%) translateX(4px);
  z-index: 250;
}
.offer-history-actions .history-icon-btn:hover::after,
.offer-history-actions .history-icon-btn:focus-visible::after {
  transform: translateY(-50%) translateX(0);
}

/* Stepper: barra di avanzamento con lo stato (pallino + "Passo N di 5") accanto */
.stepper-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.stepper-top .stepper-progress {
  flex: 1;
  margin: 0;
}
.stepper-status .customer-traffic-light {
  position: static;
  transform: none;
  width: 12px;
  height: 12px;
  box-shadow: none;
}

.stepper-progress-with-light {
  margin-right: 0;
}
.stepper-progress-with-light .customer-traffic-light {
  position: static;
  transform: none;
}

/* Riepilogo prodotto più compatto */
.summary-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.summary-grid-compact .summary-box {
  padding: 12px;
  border-radius: 16px;
}
.summary-grid-compact .summary-box .label {
  font-size: 12px;
  line-height: 1.2;
}
.summary-grid-compact .summary-box .value {
  margin-top: 5px;
  font-size: 15px;
  line-height: 1.25;
}
@media (max-width: 1100px) {
  .summary-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .summary-grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Pulsante Esci presente in tutti gli step */
.step-actions {
  align-items: center;
}
.step-left-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  overflow: visible;
}
.step-left-actions .final-icon-btn {
  position: relative;
  min-width: 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}
.step-left-actions .final-icon-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  padding: 7px 9px;
  border-radius: 9px;
  background: #1f3146;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 12px 26px rgba(27, 47, 69, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  z-index: 90;
}
.step-left-actions .final-icon-btn:hover::after,
.step-left-actions .final-icon-btn:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

/* Barra lingue sopra sidebar */
.language-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 10px;
  overflow: visible;
}
.language-btn {
  position: relative;
  width: 38px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(111, 143, 180, 0.24);
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(27, 47, 69, 0.07);
}
.language-btn.active {
  border-color: rgba(46, 107, 154, 0.55);
  box-shadow:
    0 0 0 3px rgba(46, 107, 154, 0.12),
    0 8px 18px rgba(27, 47, 69, 0.07);
  background: linear-gradient(180deg, #ffffff 0%, #edf6ff 100%);
}
.language-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  padding: 7px 9px;
  border-radius: 9px;
  background: #1f3146;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 12px 26px rgba(27, 47, 69, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  z-index: 120;
}
.language-btn:hover::after,
.language-btn:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

/* Icone bandiere reali nella barra lingue */
.language-btn {
  padding: 0;
}
.flag-icon {
  width: 20px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid rgba(15, 23, 42, 0.15);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.flag-it {
  background: linear-gradient(90deg, #009246 0 33.33%, #ffffff 33.33% 66.66%, #ce2b37 66.66% 100%);
}
.flag-fr {
  background: linear-gradient(90deg, #0055a4 0 33.33%, #ffffff 33.33% 66.66%, #ef4135 66.66% 100%);
}
.flag-es {
  background: linear-gradient(180deg, #aa151b 0 25%, #f1bf00 25% 75%, #aa151b 75% 100%);
}
.flag-de {
  background: linear-gradient(180deg, #000000 0 33.33%, #dd0000 33.33% 66.66%, #ffce00 66.66% 100%);
}
.flag-gb {
  background-image: url("assets/flags/flag-gb.png");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

/* Barra lingue centrata/spaziata sulla sidebar */
.language-bar {
  width: 100%;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}
.language-btn {
  flex: 1 1 0;
  max-width: 56px;
}

/* Bandiere più leggibili */
.flag-icon {
  width: 22px;
  height: 15px;
}

/* Uniforma tutte le bandiere: stessa impostazione grafica */
.language-bar .language-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.language-bar .flag-icon {
  width: 22px;
  height: 15px;
  min-width: 22px;
  min-height: 15px;
  border-radius: 3px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  display: inline-block;
  overflow: hidden;
  flex: 0 0 auto;
}

/* Storico offerte: 4 azioni compatte */
.offer-history-actions {
  gap: 6px;
}
.offer-history-actions .history-icon-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
}

/* Pagina cliente dedicata, separata dal flusso prodotto */
.customer-workspace {
  display: grid;
  gap: 12px;
}
.customer-workspace-lang {
  display: flex;
  justify-content: flex-end;
}
.customer-workspace .language-bar {
  width: auto;
  min-width: 260px;
  max-width: 360px;
  margin-bottom: 0;
}
.customer-workspace .client-single-layout {
  width: 100%;
}

/* Pagina iniziale: logo, presentazione e accesso cliente */
.customer-start-page {
  display: grid;
  gap: 14px;
}
.customer-start-hero {
  overflow: hidden;
}
.customer-start-hero-inner {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 18px;
  align-items: stretch;
}
.customer-start-logo-panel {
  border-radius: 22px;
  padding: 18px;
  min-height: 156px;
  display: grid;
  place-items: center;
  background: #ffffff;
  border: 1px solid rgba(111, 143, 180, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.customer-start-logo {
  display: block;
  width: min(100%, 360px);
  max-height: 110px;
  object-fit: contain;
}
.customer-start-copy {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 4px 0;
}
.customer-start-copy h1 {
  margin: 0;
  font-size: clamp(28px, 4.2vw, 38px);
  line-height: 1.06;
  color: #16314c;
}
.customer-start-copy p {
  display: none;
}
.customer-start-actions-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.95fr);
  gap: 14px;
  align-items: stretch;
}
.customer-start-section-head {
  display: grid;
  gap: 2px;
}
.customer-start-section-head h2 {
  margin: 0;
}
.customer-start-search-field {
  position: relative;
  overflow: visible;
  z-index: 40;
}
.customer-start-search-field .input {
  width: 100%;
  box-sizing: border-box;
}
.customer-start-results {
  position: static !important;
  display: grid;
  gap: 8px;
  width: 100% !important;
  margin: 10px 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  overflow: visible !important;
  max-height: none !important;
}
.customer-start-results[hidden] {
  display: none !important;
}
.customer-start-cta-card {
  justify-content: space-between;
}
/* ---- Selezione ruolo temporanea (da rimuovere dopo implementazione login) ---- */
.temp-role-selector {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: #fffbe6;
  border: 1.5px dashed #f0a500;
  border-radius: 10px;
  flex-wrap: wrap;
}
.temp-role-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: #f0a500;
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.temp-role-label {
  font-size: 13px;
  color: #7a5c00;
  display: flex;
  align-items: center;
  gap: 8px;
}
.temp-role-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.temp-role-btn {
  padding: 6px 16px;
  border: 1.5px solid #d4b04a;
  border-radius: 8px;
  background: #fff;
  color: #5a4200;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.temp-role-btn.active {
  background: #f0a500;
  border-color: #c88c00;
  color: #fff;
  font-weight: 700;
}
.temp-role-btn:hover:not(.active) {
  background: #fff7dd;
  border-color: #c88c00;
}
/* ---- Login page ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.login-card {
  width: 100%;
  max-width: 420px;
}
.login-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}
.login-logo-img {
  height: 56px;
  object-fit: contain;
}
.login-title {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px;
}
.login-roles {
  display: flex;
  gap: 10px;
}
.login-role-btn {
  flex: 1 1 0;
  font-size: 15px;
  padding: 12px 0;
}
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 4px;
  color: var(--color-muted, #888);
  font-size: 12px;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1 1 0;
  height: 1px;
  background: var(--color-border, #e5e7eb);
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.login-name-input {
  font-size: 15px;
}
.login-btn {
  margin-top: 4px;
  width: 100%;
  font-size: 15px;
  padding: 10px 0;
}
.login-temp-note {
  font-size: 12px;
  color: var(--color-muted, #888);
  border-top: 1px solid var(--color-border, #e5e7eb);
  padding-top: 12px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.login-temp-note .temp-role-badge {
  align-self: flex-start;
}
.hero-action-btn-customer {
  min-height: 124px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 48%, #f5fbf3 100%);
}
.hero-action-btn-graphic-only {
  justify-content: center;
}
.hero-illustration-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 118px;
  max-width: 42%;
  flex: 0 0 118px;
}
.hero-illustration-wrap-full {
  width: min(100%, 210px);
  max-width: 100%;
  flex: 0 1 210px;
}
.hero-illustration-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.hero-action-btn {
  position: relative;
  width: 100%;
  min-height: 84px;
  border: 1px solid rgba(46, 107, 154, 0.24);
  border-radius: 20px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #eff7ff 0%, #ffffff 52%, #f3fbf2 100%);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  color: #16314c;
  box-shadow: 0 14px 28px rgba(27, 47, 69, 0.08);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease;
  overflow: visible;
}
.hero-action-btn:hover,
.hero-action-btn:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(46, 107, 154, 0.38);
  box-shadow: 0 18px 32px rgba(27, 47, 69, 0.12);
  outline: none;
}
.hero-action-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  padding: 7px 10px;
  border-radius: 10px;
  background: #1f3146;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 12px 26px rgba(27, 47, 69, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  z-index: 90;
}
.hero-action-btn:hover::after,
.hero-action-btn:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}
.hero-action-content {
  display: grid;
  gap: 4px;
  text-align: left;
  align-content: center;
  flex: 1 1 auto;
}
.hero-action-content-single {
  justify-items: start;
}
.hero-action-content strong {
  font-size: 18px;
  line-height: 1.15;
}
.hero-action-content span {
  font-size: 13px;
  color: #5b7189;
  font-weight: 700;
}
@media (max-width: 920px) {
  .customer-start-hero-inner,
  .customer-start-actions-grid {
    grid-template-columns: 1fr;
  }
  .customer-start-logo-panel {
    min-height: 128px;
  }
}
@media (max-width: 640px) {
  .hero-action-btn {
    min-height: 74px;
    padding: 14px;
  }
  .hero-action-btn-customer {
    min-height: 108px;
    align-items: center;
    flex-direction: row;
  }
  .hero-illustration-wrap {
    width: 90px;
    max-width: 36%;
    flex-basis: 90px;
  }
  .hero-illustration-wrap-full {
    width: min(100%, 170px);
    max-width: 100%;
    flex-basis: auto;
  }
  .customer-start-copy h1 {
    font-size: 28px;
  }
}

/* Selettore lingua globale nella sidebar sinistra */
.rail-language-selector {
  position: relative;
  display: flex;
  justify-content: center;
  overflow: visible;
}
.language-current-btn .flag-icon,
.language-flyout-btn .flag-icon {
  width: 22px;
  height: 15px;
  min-width: 22px;
  min-height: 15px;
}
.language-flyout {
  position: absolute;
  left: calc(100% + 12px);
  top: 0;
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(111, 143, 180, 0.24);
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(27, 47, 69, 0.18);
  z-index: 300;
  min-width: 168px;
}
.language-flyout-btn {
  width: 100%;
  border: 1px solid rgba(111, 143, 180, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
  border-radius: 12px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  text-align: left;
  color: #27425f;
  font-weight: 800;
  font-size: 12px;
}
.language-flyout-btn:hover {
  border-color: rgba(46, 107, 154, 0.42);
  box-shadow: 0 8px 18px rgba(27, 47, 69, 0.08);
  transform: translateY(-1px);
}
.language-bar {
  display: none !important;
}

/* Pagina finale ordine */
.order-final-page {
  display: grid;
  gap: 16px;
}
.order-final-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.order-final-kicker {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef8f1;
  border: 1px solid #bfe3cb;
  color: #1d6a43;
  font-weight: 900;
  font-size: 12px;
  margin-bottom: 8px;
}
.order-final-total {
  min-width: 160px;
  text-align: right;
  border: 1px solid rgba(111, 143, 180, 0.22);
  border-radius: 18px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}
.order-final-total strong {
  display: block;
  font-size: 24px;
  line-height: 1.15;
  color: #0f172a;
}
.order-final-total span {
  display: block;
  margin-top: 4px;
  color: #6b7c90;
  font-weight: 800;
}
.order-final-navigator {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.order-final-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
}
.order-final-products {
  display: grid;
  gap: 10px;
}
.order-final-product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(111, 143, 180, 0.2);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  overflow: visible;
}
.order-final-product-score {
  white-space: nowrap;
}
.order-final-actions {
  display: inline-flex;
  gap: 7px;
  overflow: visible;
}
@media (max-width: 980px) {
  .order-final-grid,
  .order-final-product,
  .order-final-title-row {
    grid-template-columns: 1fr;
    display: grid;
  }
  .order-final-total {
    text-align: left;
  }
}

/* Pulsante Esci in alto a destra nel flusso prodotto */
.product-workspace-panel {
  position: relative;
  padding-top: 0;
}
.product-exit-top-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 60;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(185, 28, 28, 0.28);
  background: linear-gradient(180deg, #fff 0%, #fff7f7 100%);
  color: #b91c1c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(27, 47, 69, 0.1);
}
.product-exit-top-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  padding: 7px 9px;
  border-radius: 9px;
  background: #1f3146;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 12px 26px rgba(27, 47, 69, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  z-index: 90;
}
.product-exit-top-btn:hover::after,
.product-exit-top-btn:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}
.product-workspace-panel .stepper-card {
  padding-right: 48px;
}

/* Backup clienti/offerte visibile nella pagina iniziale */
.customer-start-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* Pulsanti operativi come icone con tooltip */
.auto-icon-only-btn {
  position: relative;
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0 !important;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  overflow: visible;
}
.auto-icon-only-btn span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.auto-icon-only-btn .button-icon-img,
.icon-only-btn .button-icon-img,
.saved-product-icon-btn .button-icon-img,
.history-icon-btn .button-icon-img,
.final-icon-btn .button-icon-img,
.product-exit-top-btn .button-icon-img,
.icon-action-btn .button-icon-img {
  width: 20px;
  height: 20px;
}
.product-save-top-btn .button-icon-img,
.product-exit-top-btn .button-icon-img,
.final-icon-btn .button-icon-img,
.order-final-navigator .auto-icon-only-btn .button-icon-img,
.order-final-grid .row.space .auto-icon-only-btn .button-icon-img {
  width: 26px;
  height: 26px;
}
.button-icon-fallback {
  font-size: 16px;
  line-height: 1;
}
.auto-icon-only-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  padding: 7px 9px;
  border-radius: 9px;
  background: #1f3146;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 12px 26px rgba(27, 47, 69, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  z-index: 220;
}
.auto-icon-only-btn:hover::after,
.auto-icon-only-btn:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}
.actions,
.right-actions,
.client-icon-actions,
.customer-start-toolbar,
.modal-actions,
.order-final-navigator {
  overflow: visible;
}

/* Pagina Dati Cliente rivista: scheda anagrafica + storico */
.client-detail-page {
  display: grid;
  gap: 16px;
}
.compact-client-card,
.compact-history-card {
  gap: 14px;
}
.compact-client-header {
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(111, 143, 180, 0.16);
}
.client-form-sections {
  display: grid;
  gap: 12px;
}
.client-form-section {
  border: 1px solid rgba(111, 143, 180, 0.18);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 14px;
}
.client-section-title {
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #496782;
  margin-bottom: 10px;
}
.compact-field-grid {
  gap: 12px;
}
.compact-field-grid .field,
.client-form-section .field {
  min-width: 0;
}
.client-form-section textarea {
  min-height: 86px;
}
.client-history-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(111, 143, 180, 0.16);
}
.customer-history-list {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}
.customer-history-row {
  padding: 12px 14px;
  overflow: visible;
}
.customer-history-main {
  min-width: 0;
}
.offer-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 0 2px;
}
.offer-filter-pill {
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid var(--color-border, #e5e7eb);
  background: var(--color-surface, #fff);
  font-size: 12px;
  cursor: pointer;
  color: var(--color-text-muted, #6b7280);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.offer-filter-pill:hover {
  border-color: var(--color-primary, #2563eb);
  color: var(--color-primary, #2563eb);
}
.offer-filter-pill.active {
  background: var(--color-primary, #2563eb);
  color: #fff;
  border-color: var(--color-primary, #2563eb);
}
.offer-sort-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 6px 0 2px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  margin-bottom: 4px;
}
.offer-note-preview {
  margin-top: 3px;
  font-size: 12px;
  color: var(--color-text-muted, #6b7280);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}
.offer-status-select {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--color-border, #e5e7eb);
  background: var(--color-surface, #fff);
  color: var(--color-text, #111827);
  cursor: pointer;
  align-self: center;
}
.offer-notes-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border, #e5e7eb);
}
.offer-notes-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text, #111827);
  margin-bottom: 6px;
}
.offer-notes-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.offer-notes-textarea {
  flex: 1;
  min-height: 56px;
  font-size: 13px;
  resize: vertical;
}

/* Pulsante "Check List" nel riepilogo: inattivo finché l'offerta non è Definitiva,
   giallo quando attiva, verde quando la check-list è completa. */
.btn.btn-checklist:disabled,
.btn.btn-checklist[disabled] {
  opacity: 1;
  color: #9ca3af;
  background: #f3f4f6;
  border-color: #e5e7eb;
  cursor: not-allowed;
}
.btn.btn-checklist.is-yellow {
  color: #7c5e00;
  background: #ffd84d;
  border-color: #e0b400;
  font-weight: 600;
}
.btn.btn-checklist.is-yellow:hover {
  background: #f5c800;
}
.btn.btn-checklist.is-green {
  color: #0f5132;
  background: #34c759;
  border-color: #1f9d4a;
  font-weight: 600;
}
.btn.btn-checklist.is-green:hover {
  background: #2cb14f;
}

/* Modale "Check-list tecnica" aperto dal riepilogo ordine — layout compatto */
.tech-checklist-modal {
  width: min(820px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.tc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 18px 8px 18px;
}
.tc-modal-sub {
  padding: 0 18px 10px 18px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.tc-modal-body {
  padding: 14px 18px 18px 18px;
  overflow-y: auto;
}

/* Modale "Macchine" (tipologia macchina + gestione marche/modelli) */
.machines-modal {
  width: min(760px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.machines-modal .tc-modal-close {
  font-size: 20px;
  line-height: 1;
  color: var(--color-text, #374151);
}
.mac-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 18px;
  background: var(--card-alt, #f4f7fb);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.mac-brands {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mac-brand {
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 12px;
  padding: 10px 12px 12px;
  background: var(--color-bg, #f9fafb);
}
.mac-brand-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.mac-brand-name {
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-text, #1f2937);
}
.mac-brand-remove {
  border: 1px solid transparent;
  background: transparent;
  color: #b23b3b;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
  padding: 3px 8px;
}
.mac-brand-remove:hover {
  border-color: #e6b3b3;
  background: #fdeeee;
}
.mac-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.machine-chip {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--color-border, #d7dee7);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}
.machine-chip.selected {
  border-color: var(--color-primary, #2d6ea3);
  box-shadow: 0 0 0 2px rgba(45, 110, 163, 0.25);
}
.machine-chip-select {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-text, #1f2937);
}
.machine-chip.selected .machine-chip-select {
  color: var(--color-primary, #2d6ea3);
  font-weight: 800;
}
.machine-chip-remove {
  border: 0;
  border-left: 1px solid var(--color-border, #e5e7eb);
  background: transparent;
  padding: 0 9px;
  font-size: 14px;
  line-height: 1;
  color: #9aa4af;
  cursor: pointer;
}
.machine-chip-remove:hover {
  color: #b23b3b;
  background: #fdeeee;
}
.mac-empty-models {
  margin-bottom: 10px;
}
.mac-add-row,
.mac-add-brand-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.mac-add-row .input,
.mac-add-brand-row .input {
  flex: 1;
  min-width: 0;
}
.mac-add-brand-row {
  padding: 12px 18px 16px;
  border-top: 1px solid var(--color-border, #e5e7eb);
}

/* Modale "Importa cliente da Bitrix" */
.bitrix-import-modal {
  width: min(640px, 94vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.bitrix-search {
  width: 100%;
  margin-bottom: 10px;
}
.bitrix-list {
  display: flex;
  flex-direction: column;
}
.bitrix-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.bitrix-row-name {
  font-weight: 600;
  color: var(--color-text, #111827);
}
.bitrix-state {
  padding: 18px 4px;
  text-align: center;
}
.bitrix-error {
  color: #c62828;
}
/* Pagina admin "Catalogo Bitrix" — tabella di mappatura voci → codice/nome */
.bx-cat-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bx-cat-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(120px, 0.8fr) minmax(200px, 2fr);
  gap: 8px;
  align-items: center;
}
/* Righe moduli/config: prima colonna "Visibilità" (interruttore) accanto al nome */
.bx-cat-row--visible {
  grid-template-columns: minmax(80px, 0.5fr) minmax(160px, 1.2fr) minmax(120px, 0.8fr) minmax(200px, 2fr);
}
.bx-cat-visible {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
}
/* Interruttore orizzontale (toggle) al posto della checkbox */
.bx-cat-visible .bx-cat-visible-chk {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.bx-cat-switch {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.18s ease;
}
.bx-cat-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s ease;
}
.bx-cat-visible-chk:checked + .bx-cat-switch {
  background: #2f9e44;
}
.bx-cat-visible-chk:checked + .bx-cat-switch::after {
  transform: translateX(16px);
}
.bx-cat-visible-chk:focus-visible + .bx-cat-switch {
  outline: 2px solid #2f6fb0;
  outline-offset: 2px;
}
.bx-cat-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted, #6b7280);
}
.bx-cat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text, #111827);
}
.bx-cat-input {
  font-size: 13px;
}
.bx-cat-input.bx-cat-dup {
  background: #fff3c4;
  border-color: #e0b400;
}
@media (max-width: 720px) {
  .bx-cat-row,
  .bx-cat-row--visible {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .bx-cat-head {
    display: none;
  }
}

.bitrix-hint {
  color: #b45309;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 10px;
  text-align: left;
}
/* Sezione "Da Bitrix" dentro il menu a tendina della ricerca cliente */
.bitrix-inline-section {
  border-top: 1px dashed var(--color-border, #d1d5db);
  margin-top: 6px;
  padding-top: 4px;
}
.bitrix-inline-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary, #2d6ea3);
  padding: 4px 6px 2px;
}
.bitrix-inline-loading {
  padding: 4px 6px 8px;
}
.tc-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  background: var(--color-bg, #f9fafb);
  cursor: pointer;
}
.tc-modal-close:hover {
  border-color: var(--color-primary, #2d6ea3);
}
.tc-modal-close .button-icon-img {
  width: 16px;
  height: 16px;
}
.tc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.tc-title-icon {
  width: 20px;
  height: 20px;
}
.tc-products {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tc-product {
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--color-surface, #fff);
}
.tc-product-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text, #111827);
  margin-bottom: 6px;
}
.tc-group {
  margin-top: 8px;
}
.tc-group-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary, #2d6ea3);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  padding-bottom: 2px;
  margin-bottom: 5px;
}
.tc-rows {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.tc-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--color-text, #374151);
  padding: 3px 8px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  background: var(--color-bg, #f9fafb);
  transition:
    background 0.12s,
    border-color 0.12s;
}
.tc-check:hover {
  border-color: var(--color-primary, #2d6ea3);
}
.tc-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
  accent-color: #1a8a3c;
}
.tc-check.on {
  background: #eaf6ee;
  border-color: #1a8a3c;
  color: #176a30;
  font-weight: 600;
}
.tc-shape-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tc-shape-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.tc-shape-label {
  min-width: 54px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted, #6b7280);
}

/* Tabella storico offerte nella scheda cliente (colonne allineate header+righe) */
.cust-offer-table {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  overflow: hidden;
}
.cust-offer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-surface-alt, #f3f4f6);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted, #6b7280);
}
.cust-offer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  transition: background 0.12s;
}
.cust-offer-row:last-child {
  border-bottom: none;
}
.cust-offer-row:hover {
  background: var(--color-surface-alt, #f9fafb);
}
/* Colonne: stesse larghezze in header e righe */
.cofh-offer {
  flex: 1 1 0;
  min-width: 0;
}
.cofh-offer strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cofh-date {
  flex: 0 0 100px;
  width: 100px;
  font-size: 13px;
  color: var(--color-text, #111827);
  white-space: nowrap;
}
.cofh-status {
  flex: 0 0 150px;
  width: 150px;
}
.cofh-points {
  flex: 0 0 100px;
  width: 100px;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.cofh-points .small {
  font-size: 11px;
}
.cofh-products {
  flex: 0 0 70px;
  width: 70px;
  text-align: center;
  font-weight: 600;
}
.cust-offer-head .cofh-products {
  text-align: left;
}
.cofh-actions {
  flex: 0 0 168px;
  width: 168px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.cofh-offer .offer-note-preview {
  max-width: 100%;
}
/* Select stato colorato in base allo stato corrente */
.offer-status-select.status-complete {
  color: #166534;
  border-color: rgba(22, 101, 52, 0.4);
}
.offer-status-select.status-verify {
  color: #92400e;
  border-color: rgba(146, 64, 14, 0.4);
}
.offer-status-select.status-incomplete {
  color: #991b1b;
  border-color: rgba(153, 27, 27, 0.4);
}
.offer-status-select.status-draft {
  color: #374151;
  border-color: rgba(55, 65, 81, 0.4);
}
.offer-status-select.status-archived {
  color: #4b5563;
  border-color: rgba(75, 85, 99, 0.4);
}
.offer-status-select.status-sent {
  color: #1d4ed8;
  border-color: rgba(29, 78, 216, 0.4);
}
.offer-status-select.status-definitive {
  color: #7c5e00;
  border-color: rgba(124, 94, 0, 0.45);
}
@media (max-width: 820px) {
  .cust-offer-head {
    display: none;
  }
  .cust-offer-row {
    flex-wrap: wrap;
    gap: 6px 12px;
  }
  .cofh-offer {
    flex: 1 1 100%;
  }
  .cofh-actions {
    flex: 1 1 100%;
    width: auto;
    justify-content: flex-end;
  }
}
.client-icon-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
@media (max-width: 760px) {
  .compact-client-header,
  .client-history-header {
    display: grid;
  }
  .client-icon-actions {
    justify-content: flex-start;
  }
}

/* Header step prodotto: pulsante Esci dentro la sezione, in alto a destra */
.step-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  overflow: visible;
}
.step-section-header > div:first-child {
  min-width: 0;
}
.step-section-header .product-exit-top-btn {
  position: relative;
  top: auto;
  right: auto;
  flex: 0 0 auto;
  margin-left: auto;
}
.product-workspace-panel .stepper-card {
  padding-right: inherit;
}

/* Fix robusto campo indirizzo: risultati in overlay, nessuno spostamento della label */
.client-detail-page,
.client-data-card,
.compact-client-card,
.client-form-sections,
.client-form-section,
.address-autocomplete-field {
  overflow: visible !important;
}
.address-autocomplete-field {
  position: relative !important;
  z-index: 120 !important;
  min-width: 0;
}
.address-autocomplete-field .label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  white-space: nowrap;
}
.address-autocomplete-field .input {
  width: 100%;
  box-sizing: border-box;
  display: block;
}
.address-search-status,
.address-suggestions {
  position: absolute !important;
  left: 0;
  right: 0;
  top: calc(100% + 8px) !important;
  margin-top: 0 !important;
  z-index: 300 !important;
}
.address-search-status {
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid rgba(111, 143, 180, 0.22);
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(27, 47, 69, 0.1);
}
.address-suggestions {
  width: 100%;
  box-sizing: border-box;
  max-height: 280px;
  overflow: auto;
}

/* Admin: intestazioni sezioni con nome completo sempre visibile */
.admin-card-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  min-height: 44px;
}
.admin-card-header::before,
.admin-card-header::after {
  content: none !important;
  display: none !important;
}
.admin-section-name,
.admin-card-title {
  display: block !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  overflow: visible !important;
  white-space: normal !important;
  text-overflow: clip !important;
  color: #0f2238 !important;
  font-weight: 900 !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
}
.admin-card-count {
  flex: 0 0 auto !important;
  min-width: auto !important;
  white-space: nowrap !important;
}

/* Tooltip riepilogo ordine: apri verso destra per non sovrapporsi alla sidebar sinistra */
.order-final-navigator .auto-icon-only-btn::after {
  left: calc(100% + 10px);
  right: auto;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%) translateX(-4px);
}
.order-final-navigator .auto-icon-only-btn:hover::after,
.order-final-navigator .auto-icon-only-btn:focus-visible::after {
  transform: translateY(-50%) translateX(0);
}

/* Sezione Licenza */
.license-main-block,
.license-modules-block,
.license-machines-block {
  overflow: visible;
  padding: 14px 16px;
  border-radius: 18px;
  gap: 12px;
}
.license-main-block {
  background: linear-gradient(180deg, rgba(111, 143, 180, 0.06) 0%, rgba(255, 255, 255, 0.92) 100%);
}
.license-modules-block {
  background: linear-gradient(180deg, rgba(111, 143, 180, 0.05) 0%, rgba(255, 255, 255, 0.92) 100%);
}
.license-machines-block {
  background: linear-gradient(180deg, rgba(111, 143, 180, 0.08) 0%, rgba(255, 255, 255, 0.82) 100%);
}
.license-main-block .section-title,
.license-modules-block .section-title,
.license-machines-block .section-title {
  margin-bottom: 0;
}
.license-main-layout {
  display: grid;
  grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}
.license-overview-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 10px 8px 10px 4px;
}
.license-total-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #cfe0f4;
  background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
  color: #2160b5;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 8px 18px rgba(37, 79, 144, 0.08);
}
.license-total-pill::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background: center / contain no-repeat url("assets/license-total-badge.svg");
}
.license-key-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.license-count-card {
  border: 1px solid #d6e2ef;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
  box-shadow: 0 12px 24px rgba(27, 47, 69, 0.06);
  padding: 16px 18px 14px;
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 128px;
}
.license-count-card.has-value {
  border-color: #bcd3f1;
  box-shadow: 0 14px 28px rgba(37, 79, 144, 0.1);
}
.license-count-head {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  text-align: left;
}
.license-count-icon-wrap {
  width: 92px;
  height: 92px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffffff 0%, #edf5fc 100%);
  border: 1px solid #d8e3ef;
  box-shadow: 0 10px 20px rgba(27, 47, 69, 0.08);
}
.license-count-icon {
  width: 68px;
  height: 68px;
  object-fit: contain;
  display: block;
}
.license-count-title {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
  color: #24364d;
  padding-top: 10px;
}
.license-counter {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 54px;
  gap: 8px;
  align-items: center;
  max-width: 138px;
  margin-left: auto;
  margin-right: auto;
}
.license-counter-btn {
  height: 40px;
  border-radius: 16px;
  border: 1px solid #d1dfef;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9fe 100%);
  color: #27425f;
  font-size: 28px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(27, 47, 69, 0.06);
}
.license-counter-btn:hover:not(:disabled) {
  border-color: #a8c3e4;
  box-shadow: 0 12px 22px rgba(27, 47, 69, 0.1);
}
.license-counter-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.license-counter-value {
  height: 40px;
  border-radius: 16px;
  border: 1px solid #d8e3ef;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  color: #1f3146;
}
.license-grid {
  gap: 12px;
}
/* Nuova UX chiavi: scelta tipologia + n° postazioni contemporanee */
.license-seats-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid #d8e3ef;
  border-radius: 16px;
  background: #f7fafd;
}
.license-seats-title {
  font-weight: 700;
  color: #1f3146;
}
.license-cnc-row {
  margin-top: 12px;
  max-width: 320px;
}
.license-variant-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.license-variant-label {
  font-weight: 700;
  color: #1f3146;
}
/* Riquadro "Richiesta cliente" mostrato al commerciale sopra i contatori chiavi */
.license-client-request {
  margin: 8px 0 12px;
  padding: 12px 14px;
  border: 1px solid #cfe0f2;
  border-left: 4px solid #2f6fb0;
  border-radius: 12px;
  background: #eef5fc;
}
.license-client-request-title {
  font-weight: 800;
  color: #1f3146;
  margin-bottom: 6px;
}
.license-client-request-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: #1f3146;
}
.license-client-request-row span {
  color: #55677d;
}
@media (max-width: 1100px) {
  .license-main-layout {
    grid-template-columns: 1fr;
  }
  .license-key-grid {
    grid-template-columns: 1fr;
  }
  .license-count-head {
    grid-template-columns: 72px minmax(0, 1fr);
  }
  .license-count-icon-wrap {
    width: 72px;
    height: 72px;
  }
  .license-count-icon {
    width: 52px;
    height: 52px;
  }
}
.premium-grid.grid-5.license-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
}
.license-grid .premium-select-card.license-image-card {
  min-height: 0;
  aspect-ratio: 1 / 1;
  padding: 10px;
  gap: 0;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  align-items: stretch;
  justify-items: stretch;
  overflow: visible;
  border-radius: 22px;
}
.license-grid .premium-select-card.license-image-card::before {
  height: 62px;
}
.license-grid .premium-select-card.license-image-card .premium-selected-badge {
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  font-size: 11px;
}
.license-grid .premium-select-card.license-image-card .premium-media {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  padding: 0;
  align-self: stretch;
  justify-self: stretch;
  display: grid;
  place-items: center;
  background: transparent;
}
.license-grid .premium-select-card.license-image-card .premium-media img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  border-radius: 14px;
  display: block;
  margin: auto;
}
.license-grid .premium-select-card.license-image-card .premium-content,
.license-grid .premium-select-card.license-image-card .premium-cta {
  display: none;
}
.license-grid .premium-select-card.license-image-card::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translate(-50%, 4px);
  padding: 8px 10px;
  border-radius: 10px;
  background: #1f3146;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  width: max-content;
  max-width: 170px;
  white-space: normal;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 12px 26px rgba(27, 47, 69, 0.18);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  z-index: 120;
}
.license-grid .premium-select-card.license-image-card:hover::after,
.license-grid .premium-select-card.license-image-card:focus-within::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1400px) {
  .premium-grid.grid-5.license-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}
@media (max-width: 1260px) {
  .premium-grid.grid-5.license-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .license-key-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 980px) {
  .license-main-layout {
    grid-template-columns: 1fr;
  }
  .premium-grid.grid-5.license-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .premium-grid.grid-5.license-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .license-key-grid {
    grid-template-columns: 1fr;
  }
}

/* Fix reale tooltip Riepilogo ordine: sopra agli altri pulsanti/card */
.order-final-page,
.order-final-hero,
.order-final-hero .card-body,
.order-final-navigator,
.order-final-grid,
.order-final-products,
.order-final-product,
.order-final-actions {
  overflow: visible !important;
}
.order-final-hero {
  position: relative;
  z-index: 30;
}
.order-final-navigator,
.order-final-actions {
  position: relative;
  z-index: 40;
  isolation: isolate;
}
.order-final-navigator .auto-icon-only-btn,
.order-final-actions .history-icon-btn {
  position: relative;
  z-index: 1;
}
.order-final-navigator .auto-icon-only-btn:hover,
.order-final-navigator .auto-icon-only-btn:focus-visible,
.order-final-actions .history-icon-btn:hover,
.order-final-actions .history-icon-btn:focus-visible {
  z-index: 9999;
}
.order-final-navigator .auto-icon-only-btn::after,
.order-final-actions .history-icon-btn::after {
  z-index: 10000 !important;
  pointer-events: none;
}
.order-final-navigator .auto-icon-only-btn::after {
  left: calc(100% + 10px) !important;
  right: auto !important;
  top: 50% !important;
  bottom: auto !important;
  transform: translateY(-50%) translateX(-4px) !important;
}
.order-final-navigator .auto-icon-only-btn:hover::after,
.order-final-navigator .auto-icon-only-btn:focus-visible::after {
  transform: translateY(-50%) translateX(0) !important;
}

.license-modules-block,
.license-machines-block,
.license-grid,
.premium-grid.grid-5.license-grid,
.license-main-layout,
.order-license-page,
.order-license-page .card,
.order-license-page .card-body {
  overflow: visible;
}
.license-grid .premium-select-card.license-image-card {
  position: relative;
}
.license-grid .premium-select-card.license-image-card:hover,
.license-grid .premium-select-card.license-image-card:focus-within {
  z-index: 140;
}
.license-counter-btn::after,
.license-counter-btn::before {
  content: none !important;
  display: none !important;
}

/* Azioni in alto nel flusso prodotto */
.product-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow: visible;
}
.product-save-top-btn,
.product-exit-top-btn {
  position: relative;
  top: auto;
  right: auto;
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 14px;
  border: 1px solid rgba(111, 143, 180, 0.24);
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
  color: #27425f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(27, 47, 69, 0.07);
}
.product-save-top-btn:hover,
.product-exit-top-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(27, 47, 69, 0.1);
}
.product-save-top-btn::after,
.product-exit-top-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  padding: 7px 9px;
  border-radius: 9px;
  background: #1f3146;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 12px 26px rgba(27, 47, 69, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  z-index: 90;
}
.product-save-top-btn:hover::after,
.product-save-top-btn:focus-visible::after,
.product-exit-top-btn:hover::after,
.product-exit-top-btn:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

/* Profili: pulsante aggiunta in testata e popup */
.profile-section-header {
  grid-template-columns: minmax(0, 1fr) auto;
}
.profile-add-option-btn {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.profile-modal-card {
  width: min(480px, 100%);
}
.profile-modal-actions {
  justify-content: flex-end;
}
.profile-modal-btn {
  min-width: 96px;
}

/* Stato offerta/prodotto */
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.01em;
  vertical-align: middle;
  white-space: nowrap;
}
.status-badge.complete {
  color: #166534;
  background: #dcfce7;
  border: 1px solid rgba(22, 101, 52, 0.18);
}
.status-badge.verify {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid rgba(146, 64, 14, 0.2);
}
.status-badge.incomplete {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid rgba(153, 27, 27, 0.2);
}
.status-badge.draft {
  color: #374151;
  background: #f3f4f6;
  border: 1px solid rgba(55, 65, 81, 0.18);
}
.status-badge.archived {
  color: #4b5563;
  background: #e5e7eb;
  border: 1px solid rgba(75, 85, 99, 0.2);
}
.status-badge.sent {
  color: #1d4ed8;
  background: #dbeafe;
  border: 1px solid rgba(29, 78, 216, 0.2);
}
.status-badge.definitive {
  color: #7c5e00;
  background: #fff3c4;
  border: 1px solid rgba(124, 94, 0, 0.25);
}
.product-title-with-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.summary-product-status-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: -4px;
}
.order-final-kicker .status-badge {
  margin-left: 8px;
}

@media (max-width: 720px) {
  .profile-section-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .profile-add-option-btn {
    justify-self: end;
  }
}

.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.admin-page-header h2 {
  margin: 0;
}
@media (max-width: 760px) {
  .admin-page-header {
    display: grid;
  }
}

/* Utensiliere ordine */
.order-tooling-page {
  display: grid;
  gap: 16px;
}

.tooling-upload-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(11, 53, 88, 0.12);
  border-radius: 16px;
  background: rgba(235, 244, 253, 0.55);
}

.tooling-attachment-list {
  display: grid;
  gap: 10px;
}

.tooling-attachment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(11, 53, 88, 0.1);
  border-radius: 14px;
  background: #fff;
}

.order-tooling-total span {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tooling-supplier-section {
  display: grid;
  gap: 12px;
}

.tooling-supplier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.tooling-supplier-card {
  min-height: 118px;
  border: 1px solid rgba(11, 53, 88, 0.14);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
  box-shadow: 0 8px 18px rgba(28, 45, 68, 0.05);
  cursor: pointer;
  display: grid;
  grid-template-rows: auto auto 1fr;
  justify-items: center;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  color: var(--text);
  text-align: center;
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease,
    border-color 0.14s ease,
    background 0.14s ease;
}

.tooling-supplier-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 12px 24px rgba(28, 45, 68, 0.1);
  transform: translateY(-1px);
}

.tooling-supplier-card.selected {
  border-color: rgba(45, 105, 161, 0.55);
  background: linear-gradient(180deg, #eef7ff 0%, #ffffff 100%);
  box-shadow: 0 12px 24px rgba(45, 105, 161, 0.12);
}

.tooling-supplier-card span:last-child {
  display: none;
}

.tooling-supplier-card.selected span:last-child {
  display: none;
}

.tooling-supplier-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
}

.tooling-supplier-icon-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

/* Admin traduzioni UI */
.translation-admin-card {
  overflow: hidden;
}
.translation-admin-header {
  align-items: flex-start;
}
.translation-admin-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
}
.translation-admin-toolbar .input {
  max-width: 360px;
}
.translation-table-wrap {
  overflow: auto;
  max-height: 520px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  background: #fff;
}
.translation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.translation-table th,
.translation-table td {
  border-bottom: 1px solid var(--border, #e5e7eb);
  padding: 8px;
  vertical-align: top;
}
.translation-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  text-align: left;
  font-weight: 700;
}
.translation-source {
  min-width: 220px;
  max-width: 320px;
  font-weight: 600;
  color: #374151;
  background: #fbfdff;
}
.translation-input {
  min-width: 190px;
  font-size: 12px;
}

/* Tooltip pagina Traduzioni UI: sotto i pulsanti header, sempre leggibili */
.translation-admin-card,
.translation-admin-header,
.translation-admin-header .client-icon-actions {
  overflow: visible !important;
}
.translation-admin-header .icon-action-btn {
  position: relative;
}
.translation-admin-header .icon-action-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  bottom: auto;
  padding: 7px 9px;
  border-radius: 9px;
  background: #1f3146;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 12px 26px rgba(27, 47, 69, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  z-index: 500;
}
.translation-admin-header .icon-action-btn:hover::after,
.translation-admin-header .icon-action-btn:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}
.translation-admin-header .icon-action-btn.danger::after {
  right: 0;
}

.material-choice-grid .premium-select-card.material-image-card {
  min-height: 156px;
  padding: 12px 14px;
  grid-template-columns: 148px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  align-content: center;
  column-gap: 14px;
  row-gap: 8px;
}
.material-choice-grid .premium-select-card.material-image-card::before {
  height: 100%;
  width: 180px;
}
.material-choice-grid .premium-select-card.material-image-card .premium-media {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 138px;
  height: 104px;
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
  justify-self: start;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}
.material-choice-grid .premium-select-card.material-image-card .premium-media img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  border-radius: 14px;
  display: block;
}
.material-choice-grid .premium-select-card.material-image-card .premium-content {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  text-align: left;
  gap: 0;
}
.material-choice-grid .premium-select-card.material-image-card .premium-title {
  font-size: 16px;
}
.material-choice-grid .premium-select-card.material-image-card .premium-cta {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  align-self: start;
  margin-top: 0;
}

.material-choice-grid .premium-select-card.material-image-card[data-product="Finestra"] {
  grid-template-columns: 132px 1fr;
}
.material-choice-grid .premium-select-card.material-image-card[data-product="Finestra"]::before {
  width: 162px;
}
.material-choice-grid
  .premium-select-card.material-image-card[data-product="Finestra"]
  .premium-media {
  width: 126px;
  height: 100px;
}

/* ===== Miglioramenti UI 2026-06 ===== */

/* Toast di feedback (mostra i messaggi prima invisibili) */
#pwin-toast-host.pwin-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  z-index: 9999;
  max-width: min(560px, 92vw);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 16px 40px rgba(27, 47, 69, 0.18);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}
#pwin-toast-host.pwin-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
#pwin-toast-host .pwin-toast-text {
  flex: 1;
}
#pwin-toast-host .pwin-toast-close {
  background: transparent;
  border: 0;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  padding: 0 2px;
}
#pwin-toast-host .pwin-toast-close:hover {
  opacity: 1;
}
#pwin-toast-host.pwin-toast-success {
  background: #e9f8ef;
  color: #1c7a45;
  border: 1px solid #b6e6c8;
}
#pwin-toast-host.pwin-toast-warning {
  background: #fff6e6;
  color: #8a5a00;
  border: 1px solid #ffe1a6;
}
#pwin-toast-host.pwin-toast-error {
  background: #fdecec;
  color: #a52121;
  border: 1px solid #f6c4c4;
}
#pwin-toast-host.pwin-toast-info {
  background: #eaf2fb;
  color: #1f4f86;
  border: 1px solid #c4dbf3;
}

/* Spunta sugli step completati dello stepper */
.step-chip.done::after {
  content: " \2713";
  font-weight: 700;
  margin-left: 4px;
}

/* Hint sotto/accanto ai pulsanti disabilitati */
.field-hint {
  font-size: 12px;
  color: #8a5a00;
  font-weight: 600;
  align-self: center;
}
.step-next-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

/* ---- Dashboard statistiche ---- */
.dashboard-page {
  display: grid;
  gap: 14px;
}
.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.dashboard-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.dashboard-stat-card {
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 14px;
  padding: 16px;
  background: var(--color-surface, #fff);
  text-align: center;
  box-shadow: 0 4px 12px rgba(28, 45, 68, 0.03);
}
.dashboard-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-primary, #2563eb);
  line-height: 1.1;
}
.dashboard-stat-label {
  margin-top: 6px;
  font-size: 13px;
  color: var(--color-text-muted, #6b7280);
}
.dashboard-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.dashboard-bars {
  display: grid;
  gap: 10px;
}
.dashboard-bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 36px;
  align-items: center;
  gap: 10px;
}
.dashboard-bar-track {
  background: var(--color-surface-alt, #f3f4f6);
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
}
.dashboard-bar-fill {
  height: 100%;
  background: var(--color-primary, #2563eb);
  border-radius: 999px;
  min-width: 4px;
  transition: width 0.3s ease;
}
.dashboard-bar-count {
  text-align: right;
  font-weight: 700;
  font-size: 13px;
  color: var(--color-text, #111827);
}
.dashboard-month-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 8px;
  min-height: 160px;
  padding-top: 8px;
}
.dashboard-month-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.dashboard-month-bar-wrap {
  display: flex;
  align-items: flex-end;
  height: 120px;
  width: 100%;
  max-width: 44px;
}
.dashboard-month-bar {
  width: 100%;
  background: var(--color-primary, #2563eb);
  border-radius: 6px 6px 0 0;
  min-height: 4px;
  transition: height 0.3s ease;
}
.dashboard-month-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text, #111827);
}
.dashboard-month-label {
  font-size: 11px;
  color: var(--color-text-muted, #6b7280);
}
@media (max-width: 760px) {
  .dashboard-bar-row {
    grid-template-columns: 92px 1fr 28px;
    gap: 8px;
  }
  .dashboard-bar-row .status-badge {
    font-size: 10px;
    padding: 3px 6px;
  }
}

/* ---- Lista clienti ---- */
.customer-list-page {
  display: grid;
  gap: 14px;
}
.customer-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.customer-list-search {
  width: 100%;
}
.customer-list-table {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  overflow: hidden;
}
.customer-list-head {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface-alt, #f3f4f6);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted, #6b7280);
}
.customer-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  transition: background 0.12s;
}
.customer-list-row:last-child {
  border-bottom: none;
}
.customer-list-row:hover {
  background: var(--color-surface-alt, #f9fafb);
}
.customer-list-col-name {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
}
.customer-list-col-name strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.customer-list-col-date {
  flex: 0 0 130px;
  width: 130px;
  font-size: 13px;
  color: var(--color-muted, #6b7280);
  white-space: nowrap;
}
.customer-list-col-offers {
  flex: 0 0 80px;
  width: 80px;
  text-align: center;
}
.customer-list-col-actions {
  flex: 0 0 100px;
  width: 100px;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}
.offer-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  background: var(--color-primary, #2563eb);
  color: #fff;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}
.sort-col-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted, #6b7280);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.sort-col-btn:hover {
  color: var(--color-text, #111827);
}
.sort-arrow {
  font-size: 10px;
  line-height: 1;
}
.sort-arrow.active {
  color: var(--color-primary, #2563eb);
}
.sort-arrow.inactive {
  opacity: 0.4;
}
.customer-list-empty {
  padding: 24px;
  text-align: center;
}
@media (max-width: 600px) {
  .customer-list-col-date {
    display: none;
  }
}

/* ==========================================================================
   Rifiniture UI — audit 2026-09-29
   ========================================================================== */

/* Campi in griglia: l'input non si "stira" per pareggiare il campo vicino (causava
   input di altezze diverse e disallineati, es. Azienda/Referente e Impostazioni
   conversione dei Punteggi). */
.grid-2 > .field,
.grid-3 > .field,
.compact-field-grid > .field {
  align-content: start;
}
/* Etichetta del campo Azienda uguale alle altre (aveva margine e altezza propri). */
.compact-field-grid > .field > label,
.grid-2 > .field > label {
  min-height: 28px;
  margin-bottom: 0;
}

/* Pulsanti icona "primari": le icone hanno tratto scuro, sullo sfondo scuro sparivano.
   Sfondo chiaro con bordo e ombra più marcati: restano l'azione principale. */
button.btn.primary.auto-icon-only-btn {
  background: #ffffff !important;
  border: 1.5px solid var(--primary) !important;
  box-shadow: 0 6px 16px rgba(28, 45, 68, 0.14);
}
button.btn.primary.auto-icon-only-btn:hover {
  background: var(--primary-soft) !important;
}

/* Pulsanti con icona + etichetta (azioni principali e riga del Riepilogo ordine). */
button.icon-label-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto !important;
  min-width: 0 !important;
  height: 42px;
  padding: 0 15px 0 11px !important;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(28, 45, 68, 0.06);
  cursor: pointer;
}
button.icon-label-btn .button-icon-img {
  width: 20px !important;
  height: 20px !important;
  flex: 0 0 auto;
}
button.icon-label-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-soft);
}
button.icon-label-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* Variante primaria (salvataggi, nuova offerta/cliente/prodotto): l'icona sta su un
   riquadro chiaro perché le icone del progetto hanno tratto scuro. */
button.icon-label-btn.is-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--primary-text) !important;
}
button.icon-label-btn.is-primary:hover:not(:disabled) {
  background: var(--primary-strong) !important;
}
button.icon-label-btn.is-primary .button-icon-img {
  background: #ffffff;
  border-radius: 6px;
  padding: 2px;
  width: 22px !important;
  height: 22px !important;
}
/* La riga del Riepilogo va a capo ordinatamente se lo spazio non basta. */
.order-final-navigator {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* Pulsanti a fondo pagina allineati a destra, come quelli in testata. */
.page-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Card licenze/moduli: nome visibile sotto l'immagine (prima si leggeva solo col mouse). */
.license-grid .premium-select-card.license-image-card {
  aspect-ratio: auto;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 8px;
  padding: 8px 8px 12px;
}
.license-grid .premium-select-card.license-image-card .premium-media {
  aspect-ratio: 1 / 1;
  height: auto;
}
.license-grid .premium-select-card.license-image-card .premium-content {
  display: block;
  text-align: center;
  padding: 0 2px;
}
.license-grid .premium-select-card.license-image-card .premium-title {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}
/* selezionata (sfondo scuro): nome in bianco, prima restava scuro e illeggibile */
.license-grid .premium-select-card.license-image-card.active .premium-title {
  color: #fff;
}
.license-grid .premium-select-card.license-image-card::after {
  display: none;
}

/* Finestra di conferma in stile app (sostituisce window.confirm). */
.confirm-backdrop {
  z-index: 10050;
}
.confirm-dialog {
  width: min(460px, 92vw);
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.confirm-title {
  margin: 0;
  font-size: 18px;
}
.confirm-message p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.5;
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
/* Solo nella finestra di conferma: altrove ".danger" è già usato per i pulsanti icona
   (cestino rosso su fondo bianco) e non va riempito. */
.confirm-actions .btn.danger {
  background: var(--err-tx);
  border-color: var(--err-tx);
  color: #ffffff;
}
.confirm-actions .btn.danger:hover {
  background: #8a2b2b;
}

/* Barra laterale: lo stato del catalogo (Punteggi/Traduzioni) non colora più tutto il
   pulsante — sembrava selezionato. Ora è un pallino nell'angolo; il pulsante ha lo stesso
   aspetto degli altri (bianco / scuro se attivo). */
.rail-btn[class*="catalog-status-admin-"]:not(.active) {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-color: var(--border);
}
.rail-btn[class*="catalog-status-admin-"].active {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  border-color: var(--primary);
  color: #fff;
}
.rail-btn[class*="catalog-status-admin-"]::before {
  /* ::before è la freccetta del tooltip: qui diventa il pallino, sempre visibile. */
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  left: auto;
  transform: none;
  opacity: 1;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-sizing: content-box;
}
/* Catalogo caricato e salvato è lo stato normale: niente pallino (giro 164). Il pallino
   compare solo quando serve attenzione: giallo = modifiche non salvate, rosso = manca. */
.rail-btn.catalog-status-admin-loaded::before {
  background: #2e9e5b;
  opacity: 0;
}
.rail-btn.catalog-status-admin-dirty::before {
  background: #e0a526;
}
.rail-btn.catalog-status-admin-missing::before {
  background: #d04545;
}

/* Modale Macchine (solo scelta) */
.mac-search-row {
  padding: 12px 18px 0;
}
.mac-search-row .input {
  width: 100%;
}
.machine-pick {
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #ffffff;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.machine-pick:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.machine-pick.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 800;
}
.machines-modal .mac-brand-name {
  margin-bottom: 8px;
}
.machines-modal .mac-chip-row {
  margin-bottom: 0;
}
.mac-modal-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--color-border, #e5e7eb);
}
/* Pagina Catalogo Macchine */
.machines-catalog-page .mac-add-brand-row {
  padding: 0;
  border-top: 0;
  max-width: 560px;
}
.mac-brand-title {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.03em;
}
.machine-chip-label {
  padding: 6px 4px 6px 12px;
  font-size: 13px;
  font-weight: 600;
}
.machines-catalog-page .mac-add-row {
  max-width: 560px;
}
.btn.danger-outline {
  background: #ffffff;
  border: 1px solid var(--err-bd);
  color: var(--err-tx);
}
.btn.danger-outline:hover {
  background: var(--err-bg);
}

/* Home: clienti recenti sotto la ricerca e testo nella card Nuovo cliente */
.recent-customers {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.recent-customers-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.recent-customer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--text);
}
.recent-customer-row:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.customer-start-cta-text {
  margin: 0;
}

/* Campo in sola lettura (es. nome azienda lato cliente). */
.input[readonly] {
  background: var(--bg-soft);
  color: var(--muted);
  cursor: not-allowed;
}
@media (max-width: 720px) {
  .bx-cat-vis-empty {
    display: none;
  }
}

/* Punteggi: 4 contatori su una riga e titoli di gruppo sopra le griglie di card. */
.summary-grid.summary-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .summary-grid.summary-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.admin-group-title {
  margin: 10px 0 -4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Riepilogo ordine: licenza / utensiliere / macchina in riquadri leggibili. */
.order-final-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  margin-top: 12px;
  max-width: 900px;
}
.order-final-fact {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-alt);
}
.order-final-fact-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.order-final-fact-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

/* Messaggi (toast) in basso a destra: in alto coprivano la barra degli step e le
   intestazioni di pagina. */
#pwin-toast-host.pwin-toast {
  top: auto;
  bottom: 20px;
  left: auto;
  right: 20px;
  transform: translateY(12px);
}
#pwin-toast-host.pwin-toast.visible {
  transform: translateY(0);
}
@media (max-width: 600px) {
  #pwin-toast-host.pwin-toast {
    right: 12px;
    left: 12px;
    max-width: none;
  }
}
/* Catalogo Macchine: pulsanti "Aggiungi" alti quanto il campo accanto. */
.mac-add-row,
.mac-add-brand-row {
  align-items: stretch;
}

/* Wizard: card di sola scelta testuale (profili, fornitori ferramenta). La spunta
   copriva il testo e il testo restava attaccato in alto: ora spunta piccola nell'angolo,
   spazio riservato ai lati e testo centrato in verticale. */
.premium-select-card.profile-option-card,
[data-action="toggle-hardware"].premium-select-card {
  display: flex !important;
  align-items: center;
  justify-content: center;
}
.premium-select-card.profile-option-card .premium-content {
  min-height: 0;
  padding: 0 16px;
}
[data-action="toggle-hardware"].premium-select-card .premium-content {
  min-height: 0;
  padding: 0 22px;
}
.premium-select-card.profile-option-card .premium-selected-badge,
[data-action="toggle-hardware"].premium-select-card .premium-selected-badge {
  top: 5px;
  right: 5px;
  width: 18px;
  height: 18px;
  box-shadow: none;
}
[data-action="toggle-hardware"].premium-select-card .premium-selected-badge {
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
}
.premium-select-card.profile-option-card .premium-selected-badge::before,
[data-action="toggle-hardware"].premium-select-card .premium-selected-badge::before {
  width: 5px;
  height: 9px;
}

/* Colonna "Offerta in lavorazione": titolo del prodotto a tutta larghezza, pulsanti sotto
   (prima il titolo era schiacciato a ~100px e andava a capo a pezzi). */
.saved-product-card .saved-product-head {
  flex-wrap: wrap;
  row-gap: 8px;
}
.saved-product-card .saved-product-head > strong {
  flex: 1 1 100%;
}
.saved-product-card .saved-product-head > :not(strong) {
  margin-left: auto;
}

/* Utensiliere: card fornitore compatte (icona + nome su una riga); prima erano alte
   118px con metà card vuota. */
.tooling-supplier-card {
  min-height: 64px !important;
  display: flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px !important;
}
.tooling-supplier-card .tooling-supplier-icon-img {
  width: 18px;
  height: 18px;
}

/* Check-list tecnica: barra di avanzamento sotto il titolo. */
.tc-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.tc-progress-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
}
.tc-progress-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #e0a526;
  transition: width 0.2s ease;
}
.tc-progress.is-complete .tc-progress-bar span {
  background: #2e9e5b;
}
.tc-progress-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

/* Pagina di accesso: scelta della lingua prima di entrare. */
.login-languages {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
.login-lang-btn {
  width: 38px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  opacity: 0.6;
}
.login-lang-btn:hover,
.login-lang-btn.active {
  opacity: 1;
  border-color: var(--primary);
}
.login-lang-btn.active {
  box-shadow: 0 0 0 2px rgba(36, 54, 77, 0.15);
}

/* Barra laterale, voce attiva: icona originale su un riquadro chiaro. Il filtro che
   inverte i colori trasformava le icone con parti piene (Traduzioni, Macchine, Catalogo
   Bitrix) in macchie bianche. */
.rail-btn.active .rail-icon-img {
  filter: none !important;
  background: #ffffff;
  border-radius: 7px;
  padding: 3px;
  box-sizing: content-box;
}
/* ==========================================================================
   Stile compatto e contemporaneo (audit 2026-09-29)
   Livello finale: riduce spaziature, raggi e ombre e uniforma tipografia e controlli.
   ========================================================================== */
:root {
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
  --border: #e2e8f0;
}
body {
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1 {
  font-size: 24px;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 19px;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 15px;
}
/* Card e riquadri */
.card {
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}
.card-body {
  padding: 18px;
}
.section-box {
  border-radius: 12px;
  padding: 14px;
}
.app-main {
  gap: 12px;
}
.app-shell {
  gap: 14px;
}
/* Campi e pulsanti */
.input,
select.input,
.field .input {
  font-size: 14px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
}
textarea.input,
textarea {
  font-size: 14px;
}
.btn,
button.icon-label-btn {
  border-radius: var(--radius-sm);
}
button.icon-label-btn {
  height: 38px;
  font-size: 13.5px;
}
.auto-icon-only-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: var(--radius-sm);
}
/* Home: intestazione sottile invece del blocco alto 200px */
.customer-start-hero .card-body {
  padding: 12px 18px;
}
.customer-start-logo-panel {
  padding: 6px 14px !important;
  min-height: 0 !important;
  height: auto !important;
  border-radius: 10px !important;
}
.customer-start-logo {
  max-height: 34px !important;
  width: auto !important;
}
.customer-start-copy h1 {
  font-size: 22px;
}
.customer-start-hero-inner {
  display: grid !important;
  grid-template-columns: auto 1fr !important;
  gap: 16px !important;
  align-items: center !important;
}
.customer-start-logo-panel {
  width: auto !important;
  min-width: 0 !important;
  flex: 0 0 auto !important;
  padding: 4px 12px !important;
}
.customer-start-logo {
  max-height: 46px !important;
}
.hero-illustration-img {
  max-height: 110px;
  object-fit: contain;
}
/* Barra laterale un po' più sottile */
.rail-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}
/* Scelte testuali del wizard più basse */
.premium-select-card.profile-option-card {
  min-height: 46px;
}
/* Card chiavi licenza (commerciale) più compatte */
.license-count-card {
  padding: 12px !important;
}
.license-count-icon-wrap {
  width: 52px !important;
  height: 52px !important;
}
.license-count-icon {
  max-width: 40px !important;
  max-height: 40px !important;
}
/* Colonna "Offerta in lavorazione": scheda cliente compatta. */
.side-client {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.side-client-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.side-client-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

/* Wizard, step Prodotto (giro 6): prodotti su una riga, materiali e opzioni più bassi. */
/* auto-fit: i prodotti si allargano a riempire la riga invece di lasciare colonne vuote. */
.option-grid.product-grid {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)) !important;
  gap: 10px !important;
}
.option-grid.product-grid .product-card {
  min-height: 0 !important;
  padding: 12px 8px 10px !important;
  gap: 8px !important;
}
.option-grid.product-grid .product-icon-wrap {
  width: 62px !important;
  height: 62px !important;
}
.option-grid.product-grid .product-icon-wrap img {
  max-width: 44px !important;
  max-height: 44px !important;
}
.option-grid.product-grid .product-card .product-selected-badge {
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
}
.premium-select-card.material-image-card {
  min-height: 0 !important;
  grid-template-columns: 84px 1fr !important;
  align-items: center !important;
  padding: 10px 14px !important;
}
.premium-select-card.material-image-card .premium-media {
  width: 84px !important;
  height: 64px !important;
}
.premium-select-card.material-image-card .premium-media img {
  max-height: 60px !important;
  object-fit: contain;
}
.premium-select-card.material-image-card::before {
  height: 100% !important;
}
.parameter-card.thickness-card {
  padding: 12px 14px !important;
  gap: 8px !important;
}
.premium-select-card[data-action="toggle-internal-shutter"],
.premium-select-card[data-action="toggle-profile-change"],
.premium-select-card[data-action="toggle-reported"],
.premium-select-card[data-action="toggle-wood-wood"] {
  min-height: 0 !important;
  padding: 12px !important;
  gap: 8px !important;
}

/* Wizard (giro 7): aperture e giunzioni compatte, ogni step sta in una schermata. */
.premium-grid:has(> [data-action="toggle-opening"]) {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
  gap: 10px !important;
}
.premium-select-card[data-action="toggle-opening"] {
  min-height: 0 !important;
  padding: 10px !important;
  gap: 6px !important;
}
.premium-select-card[data-action="toggle-opening"] .premium-media {
  height: 56px !important;
}
.premium-select-card[data-action="toggle-opening"] .premium-media img {
  max-height: 50px !important;
}
.premium-select-card[data-action="toggle-opening"] .premium-selected-badge,
.premium-select-card[data-action="toggle-joint"] .premium-selected-badge {
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
}
[data-action="toggle-hardware"].premium-select-card {
  min-height: 56px !important;
  padding: 8px 10px !important;
}
/* auto-fit: le 4 giunzioni riempiono la riga (con auto-fill restava una colonna vuota). */
.premium-grid:has(> [data-action="toggle-joint"]) {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
  gap: 10px !important;
}
.premium-select-card[data-action="toggle-joint"] {
  min-height: 0 !important;
  grid-template-columns: 52px 1fr !important;
  align-items: center !important;
  padding: 8px 12px !important;
}
.premium-select-card[data-action="toggle-joint"] .premium-media {
  width: 52px !important;
  height: 52px !important;
}
.premium-select-card[data-action="toggle-joint"] .premium-content {
  padding-right: 24px !important;
  text-align: left !important;
  justify-items: start !important;
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
  min-height: 0 !important;
}

/* Wizard, Riepilogo prodotto (giro 8): voci di punteggio su due colonne, totali a tutta
   larghezza; pulsanti in fondo della stessa misura degli altri (erano a 20px). */
.workload-box {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  column-gap: 32px;
}
.workload-box .work-row {
  padding: 4px 0 !important;
}
.workload-box .work-row.total {
  grid-column: 1 / -1;
  padding: 7px 0 !important;
}
@media (max-width: 900px) {
  .workload-box {
    grid-template-columns: 1fr;
  }
}
.offer-final-actions button.icon-label-btn {
  height: 38px !important;
  font-size: 13.5px !important;
  border-radius: var(--radius-sm) !important;
}
.offer-final-actions button.icon-label-btn .button-icon-img {
  width: 18px !important;
  height: 18px !important;
}
/* Wizard, Profili (giro 8): sezioni e scelte più compatte. */
.profile-section-box {
  padding: 10px 12px !important;
  gap: 8px !important;
}
.profile-options-grid {
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)) !important;
  gap: 8px !important;
}
.premium-select-card.profile-option-card {
  min-height: 40px !important;
  padding: 6px 8px !important;
}

/* Scheda cliente (giro 9): riquadri affiancati a due a due (Anagrafica | Contatti,
   Indirizzo | Note): da ~690 a ~380px, lo storico offerte entra nella stessa schermata. */
.client-form-sections {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 12px !important;
}
.client-form-section {
  padding: 12px 14px !important;
  margin: 0 !important;
}
.client-form-section .client-section-title {
  margin-bottom: 6px !important;
}
.client-form-section .grid-2 {
  gap: 10px !important;
}
.client-form-section textarea {
  min-height: 64px !important;
  height: 64px !important;
}
@media (max-width: 900px) {
  .client-form-sections {
    grid-template-columns: 1fr;
  }
}

/* Catalogo Macchine (giro 10): marche su due colonne, riquadri più compatti. */
.machines-catalog-page {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px !important;
  align-items: start;
}
.machines-catalog-page > .card:first-child {
  grid-column: 1 / -1;
}
.mac-brand-card .card-body {
  gap: 10px !important;
  padding: 14px 16px !important;
}
.mac-brand-card .mac-add-row {
  max-width: none !important;
}
.mac-brand-card .mac-add-row .input {
  padding: 7px 10px !important;
}
@media (max-width: 900px) {
  .machines-catalog-page {
    grid-template-columns: 1fr;
  }
}
/* Catalogo Bitrix (giro 10): colonna visibilità stretta e campi da tabella. */
.bx-cat-row--visible {
  grid-template-columns: 76px minmax(170px, 1.1fr) minmax(120px, 0.7fr) minmax(220px, 2fr) !important;
}
.bx-cat-input {
  padding: 6px 10px !important;
}
.bx-cat-table {
  gap: 4px !important;
}
@media (max-width: 720px) {
  .bx-cat-row--visible {
    grid-template-columns: 1fr !important;
  }
}

/* Licenza lato Cliente (giro 11): contatore postazioni accanto alla domanda (prima era
   spinto lontano a destra). */
.license-seats-block {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 28px !important;
  width: fit-content !important;
  max-width: 100%;
}

/* Schermi più piccoli (giro 12). */
@media (max-width: 1180px) {
  /* Riepilogo: Prodotti e Storico uno sopra l'altro (affiancati erano troppo stretti). */
  .order-final-grid {
    grid-template-columns: 1fr !important;
  }
}
/* Box Licenza/Utensiliere/Macchina: vanno a capo se lo spazio non basta. */
.order-final-facts {
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)) !important;
}
@media (max-width: 760px) {
  /* Telefono: la barra (orizzontale) scorre al suo interno invece di allargare la pagina. */
  .action-rail {
    max-width: 100%;
    min-width: 0;
  }
  .action-rail-inner {
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: thin;
  }
  .app-shell,
  .app-main {
    min-width: 0;
  }
}

/* Accessibilità (giro 13): anello di focus chiaro e uniforme per chi naviga da tastiera
   (compare solo con :focus-visible, non al clic del mouse). Prima era quasi invisibile o
   assente sui pulsanti. */
:where(button, a, [role="button"], .option-card, .premium-select-card, .rail-btn):focus-visible {
  outline: 2px solid #2d6ea3 !important;
  outline-offset: 2px !important;
}
.input:focus-visible,
textarea:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: none;
  border-color: #2d6ea3 !important;
  box-shadow: 0 0 0 3px rgba(45, 110, 163, 0.25) !important;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Telefono (giro 16): campi a 16px, altrimenti Safari su iPhone ingrandisce la pagina a
   ogni tocco su un campo (lo stile compatto li aveva portati a 14px). */
@media (max-width: 760px) {
  .input,
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Nuovo cliente non ancora salvato: indicazione del prossimo passo al posto dello storico. */
.client-next-step .card-body {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--blue-bg);
  border-radius: var(--radius);
  color: var(--blue-tx);
}
.client-next-step strong {
  white-space: nowrap;
}
.client-history-card[hidden] {
  display: none !important;
}

/* Punteggi: intestazione colonne Voce / Punti nelle sezioni aperte. */
.admin-row.admin-row-head {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 4px;
}

/* Stepper: stato dell'avanzamento leggibile (pallino + testo) */
.stepper-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #64748b);
  white-space: nowrap;
}
@media (max-width: 640px) {
  .stepper-status {
    font-size: 11px;
  }
}

/* Toast in basso al centro: in basso a destra copriva il pulsante "Continua" del
   configuratore e il totale nel riepilogo laterale. */
#pwin-toast-host.pwin-toast {
  right: auto;
  left: 50%;
  max-width: min(460px, calc(100vw - 24px));
  transform: translateX(-50%) translateY(12px);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.14);
}
#pwin-toast-host.pwin-toast.visible {
  transform: translateX(-50%) translateY(0);
}
@media (max-width: 600px) {
  #pwin-toast-host.pwin-toast {
    left: 12px;
    right: 12px;
    max-width: none;
    transform: translateY(12px);
  }
  #pwin-toast-host.pwin-toast.visible {
    transform: translateY(0);
  }
}

/* Stepper: 5 colonne vere (la griglia a 6 lasciava una colonna vuota), testo leggibile
   su una riga sola anche con la spunta dei passi completati. */
.stepper-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.stepper-grid .step-chip {
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 760px) {
  .stepper-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stepper-grid .step-chip {
    font-size: 10.5px;
    padding: 5px 4px;
  }
}
/* Giunzioni: titolo centrato verticalmente rispetto all'icona (senza sottotitolo stava in alto).
   Ora che il titolo sta al centro, la spunta in alto a destra non lo tocca: basta poco margine. */
.premium-select-card[data-action="toggle-joint"] .premium-content {
  grid-row: 1 / -1;
  align-self: center;
  min-width: 0;
  padding-right: 6px !important;
}
/* Riepilogo prodotto: Indietro a sinistra e Salva a destra, come negli altri passi. */
.offer-final-actions.step-actions {
  justify-content: space-between;
}
/* Riepilogo offerta: azioni raggruppate (configurazione | documenti e invio), Home a destra. */
.order-nav-sep {
  width: 1px;
  align-self: stretch;
  margin: 4px 4px;
  background: var(--border);
}
.order-final-navigator .order-nav-home {
  margin-left: auto;
}
@media (max-width: 760px) {
  .order-nav-sep {
    display: none;
  }
  .order-final-navigator .order-nav-home {
    margin-left: 0;
  }
}

/* Token "--color-*" usati da dashboard, lista offerte e ordinamenti non erano mai definiti
   e ricadevano su un blu acceso fuori palette: li colleghiamo ai colori dell'app. */
:root {
  --color-primary: var(--primary);
  --color-bg: var(--bg);
  --color-surface: var(--card);
  --color-surface-alt: var(--card-alt);
  --color-border: var(--border);
  --color-text: var(--text);
  --color-muted: var(--muted);
  --color-text-muted: var(--muted);
}
/* Statistiche: etichetta sopra e valore sotto, allineati a sinistra (lettura più rapida). */
.dashboard-stat-card {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 4px;
  text-align: left;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.dashboard-stat-value {
  font-size: 24px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.dashboard-stat-label {
  margin-top: 0;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
/* Home, "Nuovo cliente": illustrazione a sinistra, testo e pulsante a destra
   (prima l'illustrazione occupava metà larghezza lasciando un vuoto a destra). */
.customer-start-cta-card {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  column-gap: 16px;
  row-gap: 8px;
  align-items: start;
}
.customer-start-cta-card > .customer-start-section-head {
  grid-column: 1 / -1;
}
.customer-start-cta-card > .hero-action-btn {
  grid-column: 1;
  grid-row: 2 / 4;
  width: 100%;
  max-width: none;
  margin: 0;
}
.customer-start-cta-card > .customer-start-cta-text {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  align-self: end;
}
.customer-start-cta-card > div:last-child {
  grid-column: 2;
  grid-row: 3;
}
@media (max-width: 520px) {
  .customer-start-cta-card {
    grid-template-columns: 110px minmax(0, 1fr);
  }
}
/* Filtri dello storico offerte: numero di offerte per stato. */
.offer-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.offer-filter-count {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.offer-filter-pill.active .offer-filter-count {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
/* Catalogo Macchine: campi e pulsanti "Aggiungi" alti 38px con gli angoli del resto
   dell'app (la regola base input[type="text"] vinceva su .input: 46px e angoli 14px). */
.mac-add-row .input,
.mac-add-brand-row .input {
  height: 38px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.mac-add-row .btn,
.mac-add-brand-row .btn {
  height: 38px;
  min-height: 38px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 13px;
}
/* Textarea senza classe .input (es. Note cliente): stessi angoli degli altri campi. */
textarea {
  border-radius: var(--radius-sm);
}
/* Catalogo punteggi: card riassuntive nello stesso stile delle Statistiche. */
.summary-grid-4 .summary-box {
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}
.summary-grid-4 .summary-box .label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.summary-grid-4 .summary-box .value {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
/* I pulsanti non ereditano il font per impostazione del browser (Arial su Windows):
   tutti i controlli usano lo stesso carattere del testo dell'app. */
button,
input,
select,
textarea {
  font-family: inherit;
}
/* Accesso: campo nome alto come gli altri campi (38–40px) con angoli standard. */
input.login-name-input {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
}
/* Utensiliere: la matita sembrava "modifica". Ora ogni fornitore ha un indicatore tondo
   e, se scelto, la card è blu notte con la spunta come le altre scelte dell'app. */
.tooling-supplier-card .tooling-supplier-icon {
  display: none;
}
.tooling-supplier-card::before {
  content: "";
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  box-sizing: border-box;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.tooling-supplier-card.selected {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  border-color: var(--primary);
  color: #fff;
}
.tooling-supplier-card.selected::before {
  content: "\2713";
  background: #fff;
  border-color: #fff;
  color: var(--primary);
}
/* Telefono: barra di navigazione senza barra di scorrimento visibile (si scorre col dito)
   e pulsanti un po' più piccoli, così ne stanno di più. */
@media (max-width: 760px) {
  .action-rail-inner {
    scrollbar-width: none;
    gap: 6px;
  }
  .action-rail-inner::-webkit-scrollbar {
    display: none;
  }
  .action-rail-inner .rail-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
}
/* Telefono: fornitori ferramenta e tipologie di apertura su 2 colonne (in colonna
   singola la pagina delle aperture superava i 1100px); passi dello stepper a capo
   invece che troncati. */
@media (max-width: 760px) {
  .premium-grid.hardware-grid,
  .premium-grid.grid-4:not(.finestra-extra-grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .stepper-grid .step-chip {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
}
@media (max-width: 760px) {
  .hardware-grid .premium-select-card .premium-title {
    font-size: 13.5px;
    line-height: 1.25;
  }
  .hardware-grid .premium-select-card .premium-content {
    padding: 0 12px !important;
  }
}
/* Licenza, chiavi: titolo accanto all'icona (la colonna era ancora larga 92px con
   l'icona ridotta a 52px) e contatore − 0 + compatto con valore ben leggibile. */
.license-count-card {
  min-height: 0;
  gap: 10px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.license-count-head {
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.license-count-title {
  padding-top: 0;
  font-size: 15px;
}
.license-counter {
  grid-template-columns: 38px 48px 38px;
  justify-content: center;
  gap: 6px;
  max-width: none;
}
.license-counter-btn,
.license-counter-value {
  height: 38px;
  border-radius: var(--radius-sm);
  box-shadow: none;
}
.license-counter-btn {
  font-size: 20px;
  line-height: 1;
}
.license-counter-value {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
/* Licenza, moduli e connessioni: griglia che si adatta alla larghezza (card da ~112px
   in su) invece di 8/7/6/4/2 colonne fisse: più voci per riga, pagina più corta,
   3 colonne anche su telefono. */
.premium-grid.grid-5.license-grid {
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
}
/* Colonna "Offerta in lavorazione": card del prodotto salvato in ordine logico
   (nome, data, poi punti/giornate a sinistra e azioni a destra); prima i pulsanti
   andavano a capo tra il nome e la data. */
.saved-product-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title title"
    "date date"
    "score actions";
  column-gap: 8px;
  row-gap: 2px;
  align-items: center;
}
.saved-product-card .saved-product-head {
  display: contents;
}
.saved-product-card .saved-product-head > strong {
  grid-area: title;
}
.saved-product-card .saved-product-date {
  grid-area: date;
  margin: 0;
}
.saved-product-card .saved-product-score {
  grid-area: score;
  margin: 0;
}
.saved-product-card .saved-product-actions {
  grid-area: actions;
  margin-top: 4px;
}
/* Materiale: nome centrato in verticale e allineato a sinistra accanto all'immagine,
   come nelle Giunzioni (stava in alto al centro della card). */
.material-choice-grid .premium-select-card.material-image-card .premium-content {
  grid-row: 1 / -1;
  align-self: center;
  justify-self: start;
  text-align: left;
  padding-left: 6px;
}
.material-choice-grid .premium-select-card.material-image-card .premium-title {
  font-size: 15px;
}
/* Materiale e Giunzioni: niente pannello decorativo a sinistra (creava una "cucitura"
   a metà card proprio dove ora sta il nome). */
.material-choice-grid .premium-select-card.material-image-card::before,
.premium-select-card[data-action="toggle-joint"]::before {
  content: none;
}
/* Passo Prodotto: spessori su tutta la larghezza (2 colonne come il Materiale sopra;
   prima 2 colonne fisse da 373px lasciavano vuoto un terzo della riga). */
.parameter-stack.thickness-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.parameter-stack.thickness-grid,
.parameter-stack.thickness-grid.has-antina-thickness {
  max-width: none;
}
/* Opzioni prodotto: icona a sinistra e nome accanto (prima icona in alto a sinistra e
   nome in basso al centro, card alte 116px). */
.finestra-extra-grid .premium-select-card {
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: center;
  column-gap: 12px;
  min-height: 0;
  padding: 10px 14px;
}
.finestra-extra-grid .premium-select-card::before {
  content: none;
}
.finestra-extra-grid .premium-select-card .premium-media {
  width: 44px;
  height: 44px;
  grid-row: 1;
  grid-column: 1;
}
.finestra-extra-grid .premium-select-card .premium-content {
  grid-row: 1;
  grid-column: 2;
  text-align: left;
  /* nomi tutti a sinistra accanto all'icona (prima i corti erano centrati) */
  justify-items: start;
  align-self: center;
  padding-right: 14px;
}
.finestra-extra-grid .premium-select-card .premium-title {
  font-size: 13px;
  line-height: 1.25;
}
@media (max-width: 760px) {
  .parameter-stack.thickness-grid {
    grid-template-columns: 1fr;
  }
}
/* Traduzioni UI: tabella più compatta (righe ~44px invece di 57px), testo sorgente
   allineato al centro come i campi, campi da 32px con testo 13px. */
.translation-table td,
.translation-table th {
  vertical-align: middle;
  padding: 5px 6px;
}
.translation-table .translation-source {
  font-size: 12.5px;
  color: var(--muted);
}
.translation-table input.translation-input {
  height: 32px;
  padding: 5px 9px;
  font-size: 13px;
}
/* Punteggi: freccia davanti al nome della sezione (chiusa ›, aperta ruotata in giù):
   prima nulla indicava che le card si aprono. */
.admin-collapsible .admin-section-name::before {
  content: "\203A";
  display: inline-block;
  width: 14px;
  margin-right: 6px;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  text-align: center;
  transition: transform 0.15s ease;
}
.admin-collapsible.open .admin-section-name::before {
  transform: rotate(90deg);
}
/* Punteggi, sezioni a voci fisse (es. Opzioni prodotto): nome a sinistra e campo punti
   stretto a destra su una riga, come nelle altre sezioni (prima etichetta sopra e campo
   largo mezza pagina per un numero di una cifra). */
.admin-scalar-grid .field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.6);
}
.admin-scalar-grid .field label {
  margin: 0;
  padding: 0;
  font-weight: 600;
  align-self: center;
}
.grid-2.admin-scalar-grid {
  row-gap: 6px;
  column-gap: 10px;
}
.admin-scalar-grid .field .input {
  height: 34px;
  padding: 6px 10px;
}
.recent-customers[hidden] {
  display: none;
}
/* Righe cliccabili: la riga intera apre il cliente / l'offerta. */
[data-row-action] {
  cursor: pointer;
}
/* Righe cliccabili: stesso evidenziamento al passaggio del mouse ovunque (prima solo
   in alcune liste, e appena percettibile). */
[data-row-action] {
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
[data-row-action]:hover {
  background: var(--primary-soft);
  border-color: var(--border-strong);
}
/* Stepper: i passi già fatti sono pulsanti (si torna con un clic). */
button.step-chip {
  font: inherit;
  cursor: pointer;
  width: 100%;
}
.stepper-grid button.step-chip:hover {
  border-color: var(--ok-tx, #1d6a43);
  filter: brightness(0.97);
}
/* Contatore piccolo dentro un pulsante con etichetta (es. Check List 12/29). */
.btn-badge {
  margin-left: 2px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  font-variant-numeric: tabular-nums;
}
/* Telefono, Lista clienti: la riga intera apre la scheda, quindi il pulsante "Apri"
   è superfluo e lasciava troncato il nome del cliente. */
@media (max-width: 760px) {
  .customer-list-row .customer-list-col-actions [data-action="select-customer"] {
    display: none;
  }
  /* Colonne più strette (intestazione e righe uguali) per lasciare spazio al nome. */
  .customer-list-col-actions {
    flex: 0 0 44px;
    width: 44px;
  }
  .customer-list-col-offers {
    flex: 0 0 60px;
    width: 60px;
  }
}
[data-row-action]:focus-visible {
  outline: 2px solid #2d6ea3;
  outline-offset: 2px;
}
/* Scheda cliente: email e telefono con tipo nativo (tastiera giusta su telefono).
   Stesso aspetto degli altri campi; l'email non valida si evidenzia (non blocca). */
.input[type="email"],
.input[type="tel"] {
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}
.input[type="email"]:not(:placeholder-shown):not(:focus):invalid {
  border-color: var(--err-bd);
  background: var(--err-bg);
}
/* Finestra Macchine: marche su 2 colonne (prima una per riga, molto da scorrere). */
.machines-modal .mac-brands {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  /* riquadri della stessa riga alti uguali (giro 170) */
  align-items: stretch;
}
@media (max-width: 600px) {
  .machines-modal .mac-brands {
    grid-template-columns: 1fr;
  }
}
/* Colonna laterale: codice offerta sotto i dati del cliente. */
.side-offer-code {
  margin-top: 2px;
  color: var(--muted);
}

/* ==========================================================================
   Impaginazione (2026-09-29) — 1) Configuratore: barra Indietro / Continua sempre
   visibile in fondo allo schermo (prima stava in fondo alla pagina e con finestre
   basse bisognava scorrere a ogni passo).
   ========================================================================== */
.step-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin: 12px -18px -18px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
}
@media (max-width: 760px) {
  .step-actions {
    margin-left: -14px;
    margin-right: -14px;
    padding: 8px 14px;
  }
}

/* Impaginazione 2) Riepilogo ordine come "carrello": contenuto a sinistra, pannello
   fisso a destra con totale, configurazione dell'ordine e azioni. */
.order-checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
}
.order-checkout-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.order-checkout-side {
  position: sticky;
  top: 12px;
}
.order-products-head {
  margin-top: 4px;
}
.order-products-head h3,
.order-checkout-main h3 {
  margin: 0;
}
.order-side-total {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.order-side-total strong {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}
.order-side-total span {
  color: var(--muted);
  font-weight: 600;
}
.order-side-facts {
  display: grid;
  gap: 6px;
}
.order-side-fact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-alt);
}
.order-side-fact-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
/* Valore su al massimo 3 righe (la licenza elenca chiavi e moduli), poi i puntini. */
.order-side-fact .order-final-fact-value {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  white-space: normal;
  line-height: 1.3;
}
.order-side-fact-go {
  font-size: 20px;
  color: var(--muted);
}
.order-final-navigator.order-side-actions,
.order-final-navigator.order-side-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.order-side-actions button.icon-label-btn,
.order-side-links button.icon-label-btn {
  width: 100%;
  justify-content: flex-start;
}
.order-side-actions [data-action="export-pdf"] {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  border-color: var(--primary);
  color: #fff;
}
.order-side-actions [data-action="export-pdf"] .button-icon-img {
  filter: brightness(0) invert(1);
}
.order-side-links {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.order-side-links button.icon-label-btn {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.order-side-links button.icon-label-btn:hover:not(:disabled) {
  background: var(--primary-soft);
}
@media (max-width: 1100px) {
  .order-checkout {
    grid-template-columns: 1fr;
  }
  .order-checkout-side {
    position: static;
    order: -1;
  }
}
.order-checkout-side,
.order-checkout-side .card,
.order-checkout-side .card-body,
.order-side-facts,
.order-side-fact,
.order-final-navigator.order-side-actions,
.order-final-navigator.order-side-links {
  min-width: 0;
  max-width: 100%;
}
.order-side-facts,
.order-final-navigator.order-side-actions,
.order-final-navigator.order-side-links {
  grid-template-columns: minmax(0, 1fr);
}
.order-side-actions button.icon-label-btn,
.order-side-links button.icon-label-btn {
  min-width: 0;
  max-width: 100%;
}
.order-checkout-main .offer-notes-section {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

/* Impaginazione 3) Barra "Offerta in lavorazione" sopra lo stepper. */
.offer-bar .card-body.offer-bar-body {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 16px;
}
.offer-bar-kicker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.offer-bar-client {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 200px;
}
.offer-bar-client strong {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.offer-bar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-alt);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.offer-bar-toggle:hover {
  background: var(--primary-soft);
  border-color: var(--border-strong);
}
.offer-bar-count {
  min-width: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.offer-bar-caret {
  transition: transform 0.15s ease;
  color: var(--muted);
}
.offer-bar.open .offer-bar-caret {
  transform: rotate(180deg);
}
.offer-bar-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}
.offer-bar-total strong {
  font-size: 20px;
  font-weight: 800;
}
.offer-bar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.offer-bar-panel {
  border-top: 1px solid var(--border);
  padding: 12px 16px 16px;
}
.offer-bar-details {
  display: grid;
  gap: 10px;
}
.offer-bar-details .section-box .list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 8px;
}
@media (max-width: 760px) {
  .offer-bar .card-body.offer-bar-body {
    gap: 10px;
  }
  .offer-bar-total {
    align-items: flex-start;
  }
}
.offer-bar-counts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 6px 12px;
}
.offer-bar-counts > div:first-child {
  grid-column: 1 / -1;
}
.offer-bar-counts .line {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--border);
}

/* Impaginazione 4) Barra di navigazione con le scritte (menu esteso). */
.rail-label {
  display: none;
}
.rail-toggle-icon {
  font-size: 18px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
}
@media (min-width: 1200px) {
  .app-shell.rail-expanded {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .rail-expanded .action-rail-inner {
    padding: 10px;
  }
  .rail-expanded .rail-group {
    justify-items: stretch;
  }
  .rail-expanded .rail-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 0 10px;
  }
  .rail-expanded .rail-label {
    display: inline;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
  }
  .rail-expanded .rail-btn.active .rail-label {
    color: #fff;
  }
  /* Con le scritte visibili il suggerimento a lato non serve. */
  .rail-expanded .rail-btn::after {
    display: none !important;
  }
  .rail-expanded .rail-language-selector {
    width: 100%;
  }
}
/* Sotto i 1200px la barra resta con le sole icone (le scritte toglierebbero troppo
   spazio al contenuto), quindi il pulsante per estenderla non serve. */
@media (max-width: 1199px) {
  .rail-toggle-btn {
    display: none !important;
  }
}

/* Impaginazione 5) Scheda cliente su due colonne sugli schermi larghi: dati del cliente
   a sinistra (riquadri uno sotto l'altro), storico offerte a destra. */
@media (min-width: 1200px) {
  .client-detail-page {
    grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
    align-items: start;
  }
  .client-detail-page > .client-data-card {
    grid-row: 1 / span 3;
    position: sticky;
    top: 12px;
  }
  .client-detail-page .client-form-sections {
    grid-template-columns: 1fr;
  }
  .client-detail-page > .client-next-step,
  .client-detail-page > .client-history-card {
    grid-column: 2;
  }
}
@media (min-width: 1200px) {
  /* Colonna sinistra stretta: titolo e pulsanti sulla stessa riga. */
  .client-detail-page .compact-client-header {
    flex-wrap: nowrap;
  }
  .client-detail-page .compact-client-header > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
  }
  .client-detail-page .client-icon-actions {
    flex-wrap: nowrap;
  }
  /* Storico nella colonna destra: colonne fisse più strette, il codice offerta si legge. */
  .client-detail-page .cofh-offer {
    min-width: 150px;
  }
  .client-detail-page .cofh-date {
    flex-basis: 84px;
    width: 84px;
  }
  .client-detail-page .cofh-status {
    flex-basis: 112px;
    width: 112px;
  }
  .client-detail-page .offer-status-select {
    max-width: 100%;
  }
  .client-detail-page .cofh-points {
    flex-basis: 76px;
    width: 76px;
  }
  .client-detail-page .cofh-products {
    flex-basis: 64px;
    width: 64px;
  }
  .client-detail-page .cofh-actions {
    flex-basis: auto;
    width: auto;
    flex-shrink: 0;
  }
}
@media (min-width: 1200px) {
  /* Stesse larghezze in intestazione e righe (la cella azioni dell'intestazione è vuota). */
  .client-detail-page .cust-offer-head,
  .client-detail-page .cust-offer-row {
    gap: 8px;
  }
  .client-detail-page .cofh-status {
    flex-basis: 104px;
    width: 104px;
  }
  .client-detail-page .cofh-points {
    flex-basis: 72px;
    width: 72px;
  }
  .client-detail-page .cofh-products {
    flex-basis: 52px;
    width: 52px;
  }
  .client-detail-page .cofh-actions {
    flex: 0 0 154px;
    width: 154px;
  }
}

/* Impaginazione 6) Punteggi: indice delle sezioni fisso in alto con "Salva catalogo". */
.admin-index {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 -18px;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.admin-index-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.admin-index-btn {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-alt);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.admin-index-btn:hover {
  background: var(--primary-soft);
  border-color: var(--border-strong);
}
/* L'ancora non finisce sotto l'indice fisso. */
#admin-sec-settings,
#admin-sec-options,
#admin-sec-products,
#admin-sec-profiles,
#admin-sec-persiana {
  scroll-margin-top: 64px;
}
@media (max-width: 760px) {
  .admin-index {
    margin: 0 -14px;
    padding: 8px 14px;
    flex-wrap: wrap;
  }
  .admin-index-links {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1 1 100%;
    max-width: 100%;
  }
}
/* L'indice non deve imporre la propria larghezza alla scheda (su telefono la allargava). */
.admin-index,
.admin-index-links {
  min-width: 0;
}
@media (max-width: 760px) {
  .admin-index {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .admin-index-links {
    flex: initial;
  }
}
/* Home, "Nuovo cliente": se il riquadro è stretto (es. tablet) niente illustrazione,
   testo e pulsante a tutta larghezza (prima il pulsante sbordava). */
.card:has(> .customer-start-cta-card) {
  container-type: inline-size;
}
@container (max-width: 420px) {
  .customer-start-cta-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .customer-start-cta-card > .hero-action-btn {
    display: none;
  }
  .customer-start-cta-card > .customer-start-cta-text,
  .customer-start-cta-card > div:last-child {
    grid-column: 1;
  }
}
/* Statistiche: ultime offerte apribili con un clic. */
.dashboard-recent {
  display: grid;
  gap: 6px;
}
.dashboard-recent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.dashboard-recent-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}
.dashboard-recent-main strong,
.dashboard-recent-main .small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-recent-days {
  flex: 0 0 auto;
  min-width: 56px;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
/* Telefono: barra "Offerta in lavorazione" su una riga (prima 184px di altezza). */
@media (max-width: 760px) {
  .offer-bar .card-body.offer-bar-body {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 8px 12px;
  }
  .offer-bar-kicker,
  .offer-bar-client .small,
  .offer-bar-total .small,
  .offer-bar-toggle > span:first-child,
  .offer-bar-actions .btn-label {
    display: none;
  }
  .offer-bar-client {
    flex: 1 1 auto;
  }
  .offer-bar-total strong {
    font-size: 16px;
  }
  .offer-bar-toggle {
    padding: 0 8px;
    gap: 4px;
  }
  .offer-bar-actions {
    gap: 6px;
  }
  .offer-bar-actions button.icon-label-btn {
    width: 38px;
    padding: 0;
    justify-content: center;
  }
}
/* Contrasto (giro 81): testo della Check List gialla e numerini dei filtri un poco più
   scuri, sopra la soglia di leggibilità 4,5:1. */
.btn.btn-checklist.is-yellow,
.btn.btn-checklist.is-yellow .btn-label {
  color: #5c4500;
}
.offer-filter-count {
  color: #4b5a70;
}

/* Caricamento iniziale (in index.html, sostituito al primo disegno dell'app). */
.app-loading {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 600;
}
.app-loading-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  animation: app-loading-spin 0.8s linear infinite;
}
@keyframes app-loading-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .app-loading-spinner {
    animation: none;
  }
}
/* Traduzioni UI: la tabella (che scorre al suo interno) si adatta all'altezza della
   finestra, così non serve scorrere anche la pagina (prima era fissa a 520px). */
.translation-table-wrap {
  max-height: max(300px, calc(100vh - 260px));
}
/* Home, clienti recenti: meta + pulsante "Ultima offerta" a destra. */
.recent-customer-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.recent-last-offer {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
  white-space: nowrap;
}
/* Titoli che ricevono il focus al cambio pagina: nessun anello (non sono interattivi). */
#app main h1[tabindex="-1"]:focus,
#app main h2[tabindex="-1"]:focus {
  outline: none;
}
/* Telefono, Statistiche: le etichette delle card vanno a capo e la griglia non impone una
   larghezza minima superiore allo schermo (a 390px la pagina scorreva di lato). */
.dashboard-page,
.dashboard-page > *,
.dashboard-stat-card {
  min-width: 0;
}
.dashboard-stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
}
.dashboard-stat-label {
  white-space: normal;
  overflow-wrap: anywhere;
}
.dashboard-recent {
  grid-template-columns: minmax(0, 1fr);
}
.dashboard-recent-row {
  min-width: 0;
}
/* Telefono, clienti recenti: numero offerte e "Ultima offerta" sotto il nome (il pulsante
   usciva dal bordo della riga). */
@media (max-width: 600px) {
  .recent-customer-row {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .recent-customer-meta {
    width: 100%;
    justify-content: space-between;
  }
}
/* Riepilogo ordine a una colonna (tablet/telefono): prima intestazione e prodotti, poi il
   pannello (prima veniva in cima e spingeva titolo e prodotti fuori schermo); azioni del
   pannello su due colonne per accorciarlo. */
@media (max-width: 1100px) {
  .order-checkout-side {
    order: 0;
  }
  .order-final-navigator.order-side-actions,
  .order-final-navigator.order-side-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* Telefono: la barra di navigazione fissa in alto resta sopra i contenuti che scorrono
   (il campo indirizzo, a livello 120 per i suggerimenti, le passava sopra). */
@media (max-width: 760px) {
  .action-rail {
    z-index: 200;
  }
}
/* Storico offerte: la parola "prodotti" accanto al numero solo su telefono, dove
   l'intestazione della tabella è nascosta. */
.cofh-mobile-unit {
  display: none;
}
@media (max-width: 820px) {
  .cofh-mobile-unit {
    display: inline;
    font-weight: 400;
    color: var(--muted);
  }
  .cofh-products {
    flex: 0 0 auto;
    width: auto;
  }
}
/* Telefono, Riepilogo ordine: titolo "Prodotti nell'offerta" su una riga e pulsante
   "Aggiungi prodotto" sotto (prima il titolo andava a capo accanto al pulsante). */
@media (max-width: 600px) {
  .order-products-head {
    flex-wrap: wrap;
    gap: 8px;
  }
  .order-products-head h3 {
    flex: 1 1 100%;
  }
}
/* Telefono, Licenza: ogni chiave su una riga (icona e nome a sinistra, contatore a
   destra) invece di due blocchi uno sotto l'altro. */
@media (max-width: 760px) {
  .license-count-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px !important;
  }
  .license-count-head {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 8px;
  }
  .license-count-icon-wrap {
    width: 40px !important;
    height: 40px !important;
  }
  .license-count-icon {
    max-width: 30px !important;
    max-height: 30px !important;
  }
  .license-count-title {
    font-size: 14px;
  }
  .license-counter {
    grid-template-columns: 34px 40px 34px;
    gap: 4px;
  }
  .license-counter-btn,
  .license-counter-value {
    height: 34px;
  }
}
/* Riepilogo ordine: icona del tipo di prodotto a sinistra di ogni riga, per riconoscerli
   a colpo d'occhio. Su telefono l'icona è nascosta. */
.order-final-product {
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
}
.order-product-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  display: grid;
  place-items: center;
}
.order-product-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}
@media (max-width: 760px) {
  .order-product-icon {
    display: none;
  }
}
/* Stepper: modificando un prodotto salvato si può saltare anche ai passi successivi. */
.stepper-grid button.step-chip.jumpable:hover {
  border-color: var(--primary, #1f3550);
  color: var(--primary, #1f3550);
}
/* Profili: pulsanti larghi quanto il loro nome (prima tutti da 132px, con i nomi lunghi
   su 3-4 righe, es. "Separazione Lineare con Listello Sagomato", e spazio vuoto a destra).
   Le griglie della Persiana, con immagini, restano a colonne. */
.profile-options-grid.profile-chip-grid {
  display: flex !important;
  flex-wrap: wrap;
}
.profile-chip-grid .profile-option-card {
  flex: 0 0 auto;
  width: auto !important;
  min-width: 118px;
  max-width: min(360px, 100%);
  /* spazio a destra per la spunta di selezione */
  padding: 6px 26px !important;
}
/* Riepilogo prodotto: totali (punti e giornate) anche in testa alla sezione. */
.product-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.product-summary-kpi {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--primary-soft, #eaf1f8);
  border: 1px solid var(--border, #dbe3ec);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.product-summary-kpi span {
  color: var(--muted, #64748b);
}
/* Lista clienti: colonna Contatti (telefono ed e-mail) sugli schermi larghi, per
   riconoscere i clienti senza aprirne la scheda. */
.customer-list-col-contacts {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  gap: 1px;
  color: var(--color-muted, #6b7280);
}
.customer-list-col-contacts span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 1099px) {
  .customer-list-col-contacts {
    display: none;
  }
}
/* Scheda cliente: Indirizzo e Note in un solo riquadro senza titolo (prima due riquadri
   con titolo uguale all'etichetta del campo). */
.client-form-section.client-form-section-plain {
  display: grid;
  gap: 10px;
}
/* Stati offerta (4 tappe) + avviso Incompleta / Da Verificare: nello storico l'avviso
   sta sotto il select dello stato; nelle altre viste accanto allo stato. */
.cofh-status .offer-status-warning {
  margin-top: 3px;
  font-size: 10px;
}
.cofh-status:has(.offer-status-warning) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.cofh-status:has(.offer-status-warning) .offer-status-select {
  align-self: flex-start;
}
.dashboard-recent-status {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
@media (min-width: 1200px) {
  /* Storico nella scheda cliente: colonna Stato larga abbastanza per "In lavorazione". */
  .client-detail-page .cofh-status {
    flex-basis: 118px;
    width: 118px;
  }
}
/* Punteggi: ricerca voce nell'indice in alto; cercando, i gruppi senza sezioni
   corrispondenti spariscono e, se non resta nulla, compare "Nessuna voce trovata". */
.admin-index .admin-search {
  width: 220px;
  min-height: 34px;
  margin-left: auto;
  font-size: 13px;
}
.admin-grid:not(:has(.admin-card)) {
  display: none;
}
/* (:has non si può annidare: cercando si nascondono tutti i titoli di gruppo e si
   rimostrano quelli seguiti da sezioni; spariscono anche riepilogo e impostazioni) */
.card-body:has(> .admin-search-empty) .admin-group-title,
.card-body:has(> .admin-search-empty) > .summary-grid-4,
.card-body:has(> .admin-search-empty) > #admin-sec-settings {
  display: none;
}
.card-body:has(> .admin-search-empty) .admin-group-title:has(+ .admin-grid .admin-card) {
  display: block;
}
.admin-search-empty {
  display: none;
  padding: 16px;
  text-align: center;
}
.card-body:not(:has(.admin-collapsible)) > .admin-search-empty {
  display: block;
}
@media (max-width: 760px) {
  .admin-index .admin-search {
    grid-column: 1 / -1;
    order: 3;
    width: 100%;
    margin-left: 0;
  }
}
/* Traduzioni UI su schermi larghi: le sei colonne stanno nella larghezza della scheda
   (prima i campi da 190px la allargavano a 1230px e "Deutsch" restava tagliata). */
@media (min-width: 1100px) {
  .translation-table {
    table-layout: fixed;
  }
  .translation-table th:first-child {
    width: 17%;
  }
  .translation-table .translation-source {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .translation-table input.translation-input {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }
}
/* Riepilogo ordine: sotto le azioni, perché un pulsante è disattivato. */
.order-side-hints {
  margin: 0;
  padding: 0 2px;
  list-style: none;
  display: grid;
  gap: 2px;
  font-size: 11.5px;
  line-height: 1.35;
}
/* Check-list tecnica su desktop: finestra più larga e gruppi su due colonne (le coppie
   Telaio/Anta si affiancano): ~40% di scorrimento in meno. */
@media (min-width: 1200px) {
  .modal-card.tech-checklist-modal {
    width: min(1120px, 94vw);
    max-width: min(1120px, 94vw);
  }
  .tech-checklist-modal .tc-product {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 22px;
    align-items: start;
  }
  .tech-checklist-modal .tc-product > .tc-product-title {
    grid-column: 1 / -1;
  }
}
/* Utensiliere: disegni in un solo riquadro (titolo con numero, formati, Carica file). */
.tooling-files-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.tooling-files-head h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Spessori: l'esempio nel campo vuoto ("es. 80") in corsivo chiaro, per non scambiarlo
   per un valore già inserito (prima "80" grigio sembrava compilato). */
.thickness-input::placeholder {
  font-style: italic;
  color: #9aa6b5;
}
.section-note {
  margin: -4px 0 8px;
}
/* Persiana, card con immagine (Tipologia Stecca, Sportello): una regola del giro 7
   metteva tutte le card dei profili in riga (display:flex !important), così l'immagine
   si riduceva a una striscia di 14px a sinistra. Qui tornano immagine sopra e nome sotto. */
.persiana-slat-grid .premium-select-card.profile-option-card,
.premium-select-card.profile-option-card.persiana-door-card {
  display: grid !important;
  grid-template-rows: auto auto;
  justify-items: center;
  align-content: start;
  gap: 6px;
  padding: 8px !important;
}
.persiana-slat-grid .premium-select-card.profile-option-card .premium-content,
.premium-select-card.profile-option-card.persiana-door-card .premium-content {
  padding: 0 4px;
  min-height: 0;
}
/* Titolo di sezione con un'azione a destra (es. "Seleziona tutte" le aperture). */
.section-title-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.btn.btn-link {
  min-height: 0;
  padding: 2px 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--primary, #1f3550);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn.btn-link:hover {
  background: var(--primary-soft, #eaf1f8);
}
/* Scheda cliente NUOVO (non ancora salvato, niente storico): una sola colonna larga
   fino a 860px con il "Prossimo passo" sopra; prima i dati restavano in una colonna
   stretta (segnaposto troncati) e a destra c'era solo una riga di testo. */
@media (min-width: 1200px) {
  .client-detail-page:has(> .client-next-step) {
    /* tutta la larghezza (giro 187): a 860px restava un vuoto a destra e il campo
       Azienda troncava ancora il segnaposto "Scrivi o cerca azienda cliente". */
    grid-template-columns: minmax(0, 1fr);
  }
  .client-detail-page:has(> .client-next-step) > .client-data-card {
    grid-row: 2;
    position: static;
  }
  .client-detail-page:has(> .client-next-step) > .client-next-step {
    grid-column: 1;
    grid-row: 1;
  }
  .client-detail-page:has(> .client-next-step) .client-form-sections {
    grid-template-columns: 1fr 1fr;
  }
  /* Indirizzo e note su tutta la riga (prima mezza riga, con un riquadro vuoto accanto). */
  .client-detail-page:has(> .client-next-step) .client-form-section-plain {
    grid-column: 1 / -1;
  }
}
/* Accesso con XAuth: pulsante unico "Accedi con account DDX" (sostituisce il login
   provvisorio quando il server abilita XAuth). */
.login-xauth {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}
.login-xauth-btn {
  width: 100%;
  min-height: 48px;
  font-size: 15px;
}
.login-xauth-error {
  width: 100%;
  text-align: left;
}
/* Menu laterale espanso con etichette lunghe (es. tedesco "Abmelden / Benutzer
   wechseln"): i pulsanti allargavano il menu oltre i 200px, sopra il contenuto. Ora
   restano nella colonna e l'etichetta va a capo su due righe. */
@media (min-width: 1200px) {
  .rail-expanded .rail-group {
    grid-template-columns: minmax(0, 1fr);
  }
  .rail-expanded .rail-btn {
    min-width: 0;
  }
  .rail-expanded .rail-label {
    white-space: normal;
    line-height: 1.15;
  }
}
/* Statistiche: le righe di "Offerte per stato" filtrano le "Ultime offerte". */
.dashboard-bar-row[data-row-action] {
  cursor: pointer;
  border-radius: 10px;
  padding: 4px 6px;
  margin: 0 -6px;
}
.dashboard-bar-row[data-row-action]:hover {
  background: var(--primary-soft, #eaf1f8);
}
.dashboard-bar-row.active {
  background: var(--primary-soft, #eaf1f8);
  box-shadow: inset 3px 0 0 var(--primary, #1f3550);
}
.dashboard-recent-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dashboard-recent-head h2 {
  margin: 0;
}
/* Statistiche: i riquadri che aprono una pagina (Clienti totali / con offerte → Lista
   clienti) hanno una freccia e cambiano al passaggio del mouse; prima sembravano statici. */
.dashboard-stat-card[data-row-action] {
  position: relative;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.dashboard-stat-card[data-row-action]::after {
  content: "\203A";
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 20px;
  line-height: 1;
  color: var(--muted, #64748b);
}
.dashboard-stat-card[data-row-action]:hover,
.dashboard-stat-card[data-row-action]:focus-visible {
  border-color: var(--primary, #1f3550);
  box-shadow: 0 4px 14px rgba(31, 53, 80, 0.12);
}
/* Guida alle scorciatoie da tastiera (tasto "?"). */
.shortcuts-modal-card {
  width: min(520px, 94vw);
}
.shortcuts-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
  margin: 0;
  align-items: center;
}
.shortcuts-list dd {
  margin: 0;
  font-size: 13.5px;
}
.shortcuts-list kbd {
  display: inline-block;
  min-width: 28px;
  padding: 3px 8px;
  border: 1px solid var(--border-strong, #cbd5e1);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface, #fff);
  font: 700 12px/1.3 inherit;
  text-align: center;
}
/* Variante di spessore: passi 2-4 saltati (uguali al prodotto originale) e scelte di
   prodotto/materiale bloccate. */
.step-chip.skipped {
  opacity: 0.55;
  border-style: dashed;
  text-decoration: line-through;
}
.product-card[disabled],
.premium-select-card[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.6);
}
/* Riepilogo ordine: etichetta "-50%" sulle copie con sconto (varianti di spessore). */
.status-badge.variant-badge {
  color: #7c2d12;
  background: #ffedd5;
  border: 1px solid rgba(124, 45, 18, 0.2);
}
/* "Vai al contenuto": primo elemento raggiunto con Tab, visibile solo col focus; salta
   il menu laterale. */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 300;
  padding: 8px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--primary, #1f3550);
  color: #fff;
  font: 700 13px/1.2 inherit;
  transform: translateY(-160%);
  transition: transform 0.12s;
}
.skip-link:focus {
  transform: none;
  outline: 2px solid #fff;
  outline-offset: 2px;
}
#contenuto:focus {
  outline: none;
}

/* Statistiche: stati a zero visibili ma attenuati (giro 161) */
.dashboard-bar-row.is-empty .status-badge {
  opacity: 0.55;
}
.dashboard-bar-row.is-empty .dashboard-bar-count {
  color: var(--muted, #64748b);
  font-weight: 500;
}

/* Scheda cliente senza modifiche: "Salva" in tono spento (giro 162) */
button.icon-label-btn.is-primary.is-clean {
  background: var(--surface, #ffffff) !important;
  border-color: var(--border, #d8e0ea) !important;
  color: var(--text, #1e293b) !important;
  box-shadow: none !important;
}
button.icon-label-btn.is-primary.is-clean:hover:not(:disabled) {
  background: var(--primary-soft) !important;
  border-color: var(--primary) !important;
}

/* Riepilogo ordine: nello Storico cliente l'offerta aperta è segnata (giro 168) */
.offer-history-row.is-current {
  background: var(--primary-soft, #eef3f9);
  border-color: var(--border-strong, #c5d1df);
  cursor: default;
}
.history-current-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--primary, #1f2f46);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  vertical-align: 2px;
}

/* Catalogo Macchine (giro 169): riquadri della stessa riga alti uguali, con il campo
   "Nome nuova macchina" sempre in fondo; la marca appena aggiunta lampeggia. */
.machines-catalog-page {
  align-items: stretch;
}
.machines-catalog-page > .card:first-child {
  align-self: start;
}
.mac-brand-card > .card-body {
  height: 100%;
  box-sizing: border-box;
}
.mac-brand-card .mac-add-row {
  margin-top: auto !important;
}
.mac-brand-card.is-new {
  animation: mac-brand-new 2.4s ease-out;
}
@keyframes mac-brand-new {
  0%,
  40% {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft, #e6edf6);
  }
}
@media (prefers-reduced-motion: reduce) {
  .mac-brand-card.is-new {
    animation: none;
    border-color: var(--primary);
  }
}

/* Check-list tecnica: avanzamento del singolo prodotto accanto al nome (giro 171) */
.tc-product-count {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--border, #d8e1ec);
  color: var(--text, #172033);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  vertical-align: 1px;
}
.tc-product-count.is-complete {
  background: #d7f2e1;
  color: #1d6b3f;
}

/* Passo Ferramenta e aperture: aperture scelte / disponibili accanto al titolo (giro 172) */
.section-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--border, #d8e1ec);
  color: var(--text, #172033);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  vertical-align: 1px;
}

/* Profili: il "+" di ogni sezione ha anche la scritta "Aggiungi opzione" (giro 173) */
.profile-add-option-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.profile-add-option-btn .button-icon-img {
  width: 18px;
  height: 18px;
}

/* Riepilogo prodotto (giro 174): le voci di punteggio scorrono dall'alto in basso, prima
   la colonna di sinistra poi quella di destra (prima si leggevano a zig-zag per riga e le
   voci della stessa categoria finivano sparse). Totali sotto, a tutta larghezza. */
.workload-box {
  display: block !important;
}
.workload-box .work-lines {
  columns: 2;
  column-gap: 32px;
  margin-bottom: 4px;
}
.workload-box .work-lines .work-row {
  break-inside: avoid;
}
@media (max-width: 900px) {
  .workload-box .work-lines {
    columns: 1;
  }
}

/* Barra dell'offerta: il prodotto aperto nel configuratore è segnato "In modifica" (giro 176) */
.saved-product-card.is-editing {
  border-color: var(--primary, #1f2f46);
  box-shadow: 0 0 0 2px var(--primary-soft, #e6edf6);
}
.status-badge.editing-badge {
  background: var(--primary, #1f2f46);
  color: #ffffff;
  border-color: var(--primary, #1f2f46);
  margin-left: 4px;
}

/* Punteggi (giro 182): nelle righe "nome + punteggio" il testo del nome stava in alto
   dentro un'etichetta alta 28px, quindi più su del campo; ora è centrato. */
.admin-scalar-grid .field label {
  display: flex;
  align-items: center;
}

/* Punteggi (giro 183): il "+" per aggiungere una riga ha anche la scritta, come
   "Aggiungi opzione" nei Profili; prima era un'icona sola su una riga vuota. */
.admin-icon-btn.with-label {
  width: auto;
  padding: 0 12px;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.admin-icon-btn.with-label .button-icon-img {
  width: 18px;
  height: 18px;
}

/* Traduzioni UI (giro 184): celle come aree di testo che crescono col contenuto, così le
   traduzioni lunghe si leggono per intero invece di essere tagliate. */
.translation-table textarea.translation-input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 5px 9px;
  box-sizing: border-box;
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
  resize: none;
  overflow: hidden;
  field-sizing: content;
}

/* Lista clienti: clienti collegati a Bitrix (giro 196) */
.bitrix-link-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid #f2c48d;
  background: #fff4e5;
  color: #9a5a12;
  font-size: 10.5px;
  font-weight: 600;
  vertical-align: 1px;
}

/* Lista clienti (giro 198): nome ed etichetta "Bitrix" sulla stessa riga (il nome è un
   blocco e l'etichetta finiva sotto). */
.customer-list-col-name > strong {
  display: inline;
}
.customer-list-col-name > strong + .bitrix-link-badge + .small,
.customer-list-col-name > strong + .small {
  display: block;
}

/* Riepilogo ordine (giro 201): sui portatili (riga prodotto stretta, es. 1280 px con il
   menu espanso) la scritta "Modalità di Lavorazione" mandava a capo i tag Telaio/Anta e
   ogni prodotto diventava alto il doppio: sotto i 700 px di riga si mostrano solo i tag. */
.order-final-product {
  container-type: inline-size;
}
@container (max-width: 700px) {
  .order-final-product .wm-summary-label {
    display: none;
  }
}

/* Check-list tecnica: "Seleziona tutte" accanto al conteggio del prodotto (giro 209) */
.tc-all-btn {
  margin-left: 6px;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 600;
  vertical-align: 1px;
}

/* Statistiche (giro 210): i mesi a zero mostrano una linea sottile alla base. */
.dashboard-month-bar[style*="height:0%"] {
  height: 3px !important;
  opacity: 0.25;
}

/* Statistiche (giro 212): nota sotto l'etichetta di un riquadro */
.dashboard-stat-note {
  /* il riquadro è in column-reverse: order -1 la porta in fondo, sotto il valore */
  order: -1;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted, #64748b);
}

/* Lista clienti (giro 218): "Mostra tutti" sotto le prime 50 righe */
.customer-list-more {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

/* Storico offerte (giro 219): le archiviate in tono attenuato, così quelle in corso
   risaltano; tornano piene al passaggio del mouse o col focus. */
.cust-offer-row.is-archived > :not(.cofh-actions):not(:last-child) {
  opacity: 0.55;
}
.cust-offer-row.is-archived:hover > *,
.cust-offer-row.is-archived:focus-within > * {
  opacity: 1;
}

/* Spessori oltre il massimo (999 mm): campo rosso e avviso sotto */
.unit-input .thickness-input[aria-invalid] {
  border-color: var(--err-tx);
  box-shadow: 0 0 0 1px var(--err-tx);
}
.thickness-error {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--err-tx);
}
.thickness-error[hidden] {
  display: none;
}

/* Salvataggio non arrivato al server: avviso fisso con "Riprova" */
.alert.sync-problem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.alert.sync-problem .btn {
  flex: none;
}

/* Pagina di accesso: alta quanto la finestra; senza il margine del contenitore
   (30 px sopra + 40 sotto) non compare più una barra di scorrimento inutile. */
.container:has(> #app > .login-page) {
  padding-top: 0;
  padding-bottom: 0;
}

/* Email/telefono del cliente scritti male: campo segnato e avviso sotto (non blocca) */
.field .input[data-input^="customer."][aria-invalid] {
  border-color: var(--err-tx);
}
.field-warning {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--err-tx);
}
.field-warning[hidden] {
  display: none;
}

/* Finestra Macchine ancorata in alto: filtrando, l'elenco si accorcia verso il basso e il
   campo di ricerca resta fermo sotto il cursore (centrata, la finestra si ricentrava a
   ogni lettera e il campo scivolava giù di ~80 px). */
.modal-backdrop:has(> .machines-modal) {
  align-items: start;
  padding-top: 6vh;
}

/* "Chiudi" in testa alle finestre (Check List, Importa da Bitrix): il suggerimento compare
   sotto il pulsante. Sopra veniva tagliato dal bordo della finestra (overflow: hidden) e
   all'apertura, col cursore già sul pulsante, se ne vedeva solo un pezzo scuro. */
.tc-modal-close.auto-icon-only-btn::after {
  top: calc(100% + 8px);
  bottom: auto;
  transform: translateY(-4px);
}

/* Finestre al telefono: mai più larghe dello spazio dentro lo sfondo. Le larghezze in vw
   (94vw, 92vw) superavano il margine dello sfondo e sporgevano oltre il bordo destro. */
.modal-backdrop {
  /* colonna della griglia larga quanto lo spazio disponibile (con "auto" si allargava
     fino alla finestra e il 100% sotto non limitava nulla) */
  grid-template-columns: minmax(0, 1fr);
}
.modal-backdrop > .modal-card {
  max-width: 100%;
}

/* Testo solo per i lettori di schermo (non visibile a video) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Pagina Utenti e ruoli */
.users-table {
  display: grid;
  gap: 6px;
}
.users-row {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) minmax(140px, 1.3fr) minmax(130px, 1fr) minmax(200px, 1.3fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-wrap: anywhere;
}
.users-row.users-head {
  border: 0;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
@media (max-width: 760px) {
  .users-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .users-row.users-head {
    display: none;
  }
}

/* Menu laterale: chi è collegato (sopra "Esci") */
.rail-user {
  /* stessa misura dei pulsanti del menu ridotto (.rail-btn 42 px): iniziali allineate */
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
}
.rail-user-initials {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #1f3146;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex: none;
}
@media (min-width: 1200px) {
  .rail-expanded .rail-user {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px;
  }
  .rail-expanded .rail-user-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .rail-user-name {
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .rail-user-role {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
  }
}
/* Al telefono il menu è una barra orizzontale che scorre: la riga dell'utente la
   allungherebbe spingendo "Esci" fuori schermo, quindi lì si nasconde. */
@media (max-width: 760px) {
  .rail-user {
    display: none;
  }
}
.sync-problem-actions {
  display: flex;
  gap: 8px;
  flex: none;
}

/* Chi ha creato / modificato per ultimo un'offerta o un cliente */
.offer-authorship {
  margin-top: 2px;
  font-size: 12px;
}

/* Pagina Offerte */
.offers-filters {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(150px, 1fr));
  gap: 8px;
}
.offers-table {
  display: grid;
  gap: 6px;
}
.offers-row {
  display: grid;
  grid-template-columns:
    minmax(170px, 1.4fr) minmax(140px, 1.3fr) minmax(110px, 0.9fr) 70px 80px
    minmax(120px, 1fr) minmax(150px, 1.1fr) 44px;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-wrap: anywhere;
}
.offers-row[data-row-action] {
  cursor: pointer;
}
.offers-row[data-row-action]:hover {
  background: var(--bg-soft);
}
.offers-row.offers-head {
  border: 0;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.offers-num {
  text-align: right;
}
.offers-note {
  margin-top: 2px;
}
@media (max-width: 980px) {
  .offers-filters {
    grid-template-columns: 1fr 1fr;
  }
  .offers-row {
    grid-template-columns: 1fr 1fr;
    gap: 4px 10px;
  }
  .offers-row.offers-head {
    display: none;
  }
  .offers-num {
    text-align: left;
  }
}

/* Richieste cliente -> commerciale */
.rail-btn {
  position: relative;
}
.rail-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #b42318;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}
.request-badge.request-da-preventivare {
  background: #fff4e5;
  color: #8a4b00;
  border-color: #f5c27a;
}
.request-badge.request-in-carico {
  background: #e8f1ff;
  color: #1f4f99;
  border-color: #a9c6f2;
}
.request-badge.request-preventivato {
  background: #e7f6ec;
  color: #1d6b3a;
  border-color: #9fd3b1;
}
.offer-request-banner,
.home-requests-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.home-requests-alert {
  margin: 0 0 12px;
}
.order-send-request {
  width: 100%;
}
.order-request-status {
  display: grid;
  gap: 4px;
}

/* Lato cliente: novità sulle richieste (presa in carico / preventivo inviato) */
.client-request-updates {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}
.client-request-updates ul {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}
.client-request-updates li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.client-request-updates .link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.client-request-updates .link-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Commerciale di riferimento: campo nella scheda cliente, avviso di sola visualizzazione */
.sales-rep-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.sales-rep-field .sales-rep-label {
  color: var(--muted, #667085);
}
.sales-rep-field select.input {
  width: auto;
  min-width: 200px;
  padding-top: 4px;
  padding-bottom: 4px;
}
.offer-readonly-banner {
  margin: 0 0 12px;
}
.order-final-actions[hidden] {
  display: none;
}

/* Schede create dal cliente al primo accesso: verifica dei doppioni */
.self-registered-banner {
  display: grid;
  gap: 8px;
  margin: 0;
}
.self-registered-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.self-registered-actions select.input {
  flex: 1 1 200px;
  width: auto;
  min-width: 0;
  max-width: 100%;
}
/* il riquadro non deve allargare la colonna (il pulsante Salva sporgeva) */
.client-data-header > div:first-child,
.self-registered-banner {
  min-width: 0;
}
.home-new-accounts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.self-registered-badge {
  background: #fff4e5;
  color: #8a4b00;
}
.xauth-link-note {
  margin-top: 4px;
}

/* Utenti e ruoli: una sezione per ruolo */
.users-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}
.users-count {
  font-size: 12px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted, #617089);
}

/* Tecnico: Home con le offerte assegnate, campo di assegnazione nel riepilogo */
.tech-offer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e6eaf0;
}
.tech-offer-row:last-child {
  border-bottom: 0;
}
.tech-badge {
  background: #fff4e5;
  color: #8a4b00;
}
.tech-badge.done {
  background: #e7f6ec;
  color: #1e6b3a;
}
.technician-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}
.technician-field select.input {
  width: auto;
  min-width: 200px;
}

/* Backup: stato e file scaricabili */
.backup-status {
  display: grid;
  gap: 8px;
}
.backup-status .backup-failed {
  color: #b42318;
  font-weight: 600;
}
.backup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #e6eaf0;
}
.backup-row:last-child {
  border-bottom: 0;
}

/* Confronto tra versioni dell'offerta */
.offer-version-note {
  display: grid;
  gap: 6px;
  margin: 6px 0 10px;
}
.offer-version-note > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.offer-compare-modal .cmp-section + .cmp-section {
  margin-top: 14px;
}
.offer-compare-modal .cmp-section h4 {
  margin: 0 0 6px;
}
.offer-compare-modal ul {
  margin: 4px 0 0;
  padding-left: 0;
  list-style: none;
}
.offer-compare-modal .cmp-product,
.offer-compare-modal .cmp-fact {
  padding: 6px 0;
  border-bottom: 1px solid #e6eaf0;
}
.offer-compare-modal .cmp-plus {
  color: #1e6b3a;
}
.offer-compare-modal .cmp-minus {
  color: #b42318;
}

/* Promemoria di richiamo */
.callback-box {
  margin: 0 0 12px;
}
.alert.callback-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.callback-form {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e6eaf0;
  border-radius: 10px;
}
.callback-form label {
  display: grid;
  gap: 4px;
  max-width: 320px;
}
.callback-quick,
.callback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.callback-badge {
  background: #eef2f7;
  color: #3d4a5c;
}
.callback-badge.due {
  background: #fff4e5;
  color: #8a4b00;
}

/* Servizi aggiuntivi: giornate di test/corso (fuori dal conteggio) */
.service-list {
  display: grid;
  gap: 4px;
}
.service-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e6eaf0;
}
.service-counter {
  display: flex;
  align-items: center;
  gap: 10px;
}
.service-counter .btn {
  min-width: 36px;
  justify-content: center;
}
.service-value {
  min-width: 96px;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.service-note {
  display: grid;
  gap: 4px;
}

/* Agenda dei lavori: settimane (righe) x giorni lavorativi (colonne) */
.agenda-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.agenda-controls label {
  display: grid;
  gap: 4px;
}
.agenda-summary {
  font-weight: 600;
}
.agenda-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.agenda-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.agenda-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid #d5dbe4;
}
.agenda-grid {
  display: grid;
  gap: 4px;
  overflow-x: auto;
}
.agenda-week {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) repeat(5, minmax(48px, 1fr));
  gap: 4px;
  align-items: stretch;
}
.agenda-head {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #617089);
}
.agenda-week-label {
  align-self: center;
  color: var(--muted, #617089);
}
.agenda-cell {
  min-height: 40px;
  border-radius: 8px;
  background: #f4f6f9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.agenda-day {
  font-size: 12px;
  opacity: 0.75;
}
.agenda-mark {
  font-size: 11px;
  font-weight: 700;
}
.agenda-cell.config,
.agenda-swatch.config {
  background: #2f6fde;
  color: #fff;
}
.agenda-cell.delivery,
.agenda-swatch.delivery {
  background: #1f2937;
  color: #fff;
}
.agenda-cell.onsite,
.agenda-swatch.onsite {
  background: #e3a008;
  color: #1f2937;
}
.agenda-cell.online,
.agenda-swatch.online {
  background: #8b5cf6;
  color: #fff;
}

/* Registro attività */
.activity-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.activity-filters select.input {
  width: auto;
  min-width: 160px;
}
.activity-filters input[type="search"] {
  flex: 1 1 220px;
  min-width: 0;
}
.activity-list {
  display: grid;
}
.activity-row {
  display: grid;
  grid-template-columns: 140px minmax(160px, 220px) 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #e6eaf0;
  align-items: baseline;
}
@media (max-width: 760px) {
  .activity-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
.agenda-cell.holiday,
.agenda-swatch.holiday {
  background: repeating-linear-gradient(45deg, #f4f6f9, #f4f6f9 4px, #e3e8ef 4px, #e3e8ef 8px);
  color: #617089;
}
.users-search {
  max-width: 420px;
}
.bitrix-quote-link {
  display: inline-block;
  margin-top: 4px;
}

/* Storico offerte nella scheda cliente: quando la tabella è troppo stretta per tenere
   tutte le colonne e i quattro pulsanti (finestre da circa 1200 a 1500 px), le azioni
   passano su una seconda riga a destra invece di restare tagliate fuori. */
.client-detail-page .cust-offer-table {
  container-type: inline-size;
}
@container (max-width: 690px) {
  .client-detail-page .cust-offer-row {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .client-detail-page .cust-offer-row .cofh-actions {
    flex: 1 1 100%;
    width: auto;
    justify-content: flex-end;
  }
  .client-detail-page .cust-offer-head .cofh-actions {
    display: none;
  }
  /* Colonna Prodotti un po' più larga: l'intestazione con la freccia dell'ordinamento
     non resta tagliata. */
  .client-detail-page .cust-offer-head .cofh-products,
  .client-detail-page .cust-offer-row .cofh-products {
    flex-basis: 74px;
    width: 74px;
  }
  .client-detail-page .cust-offer-head .cofh-offer,
  .client-detail-page .cust-offer-row .cofh-offer {
    min-width: 130px;
  }
  .client-detail-page .cust-offer-head .cofh-products {
    overflow: visible;
    white-space: nowrap;
  }
}
/* Tabella ancora più stretta (finestre vicine ai 1200 px): stessa composizione del
   telefono, codice offerta su una riga e dati sotto. */
@container (max-width: 530px) {
  .client-detail-page .cust-offer-head {
    display: none;
  }
  .client-detail-page .cust-offer-row {
    gap: 6px 12px;
  }
  .client-detail-page .cust-offer-row .cofh-offer {
    flex: 1 1 100%;
    min-width: 0;
  }
  .client-detail-page .cust-offer-row .cofh-products {
    flex: 0 0 auto;
    width: auto;
  }
  .client-detail-page .cofh-mobile-unit {
    display: inline;
    font-weight: 400;
    color: var(--muted);
  }
}
.tech-delivery {
  font-weight: 600;
}

/* Segnalazioni del tecnico sui tempi (modale check-list e riepilogo ordine) */
.estimate-group .estimate-note + .estimate-note,
.estimate-group .estimate-form + .estimate-note {
  margin-top: 6px;
}
.estimate-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 6px 8px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  background: var(--color-surface, #fff);
  font-size: 13px;
}
.estimate-note.is-pending {
  border-color: #e0b44c;
}
.estimate-note-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.estimate-comment {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.estimate-note-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.estimate-status {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #fdf3dc;
  color: #8a5a00;
}
/* approvata in verde chiaro, respinta in rosso chiaro (richiesta di Luca) */
.estimate-note.is-approved {
  background: #eef8f1;
  border-color: #9fd3ae;
}
.estimate-note.is-approved .estimate-status {
  background: #d6efdd;
  color: #176a30;
}
.estimate-note.is-rejected {
  background: #fdf0f0;
  border-color: #f0b4b4;
}
.estimate-note.is-rejected .estimate-status {
  background: #fadcdc;
  color: #a12a2a;
}
.estimate-form {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px dashed var(--color-border, #d1d5db);
  border-radius: 8px;
}
.estimate-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 8px;
}
.estimate-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.estimate-panel {
  display: grid;
  gap: 8px;
}
.estimate-panel-row {
  display: grid;
  gap: 2px;
}
@media (max-width: 640px) {
  .estimate-form-grid {
    grid-template-columns: 1fr;
  }
  .estimate-note {
    flex-direction: column;
  }
}

/* Guida in linea: "i" accanto ai titoli e finestra con consigli e legenda */
.help-i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0;
  border: 1.5px solid var(--color-primary, #2d6ea3);
  border-radius: 50%;
  background: transparent;
  color: var(--color-primary, #2d6ea3);
  font: italic 700 12px/1 Georgia, "Times New Roman", serif;
  vertical-align: middle;
  cursor: pointer;
}
.help-i:hover,
.help-i:focus-visible {
  background: var(--color-primary, #2d6ea3);
  color: #fff;
}
.help-i.is-static {
  margin: 0 4px 0 0;
  cursor: default;
}
.help-modal-card {
  max-width: 560px;
}
.help-tips {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  line-height: 1.45;
}
.help-legend-title {
  margin: 4px 0 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary, #2d6ea3);
}
.help-legend {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 12px;
  margin: 0;
  align-items: center;
}
.help-legend dd {
  margin: 0;
  font-size: 13px;
}

/* Maggiorazione "cliente complesso" (riepilogo ordine, solo personale) */
.surcharge-field {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
}
.surcharge-field.is-active {
  border-color: #e0b44c;
  background: #fffaf0;
}
.surcharge-field label {
  font-weight: 600;
  font-size: 13px;
}
.surcharge-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.surcharge-row .input {
  width: 90px;
}
.order-side-total .surcharge-note {
  color: #8a5a00;
}

/* Pagina Offerte: segnalazioni del tecnico da valutare */
.status-badge.estimate-badge {
  background: #fdf3dc;
  color: #8a5a00;
  border-color: #e0b44c;
}
.status-badge.surcharge-badge {
  background: #fdf3dc;
  color: #8a5a00;
  border-color: #e0b44c;
}
.tech-estimates {
  color: #8a5a00;
}
.estimate-gone {
  color: #b45309;
}

/* Home: avvisi riuniti nel riquadro "Da fare", sotto ricerca e nuovo cliente. */
.home-todo .home-requests-alert {
  margin: 0;
}
.home-todo .card-body {
  gap: 10px;
}

/* Licenza (commerciale): sotto la richiesta del cliente, quanto è configurato
   nell'offerta e l'eventuale differenza. */
.license-configured-title {
  font-weight: 800;
  color: #1f3146;
  margin-top: 4px;
}
.license-request-mismatch {
  margin-top: 8px;
}

/* Profili: i gruppi avevano sei tinte diverse a seconda della posizione, senza un
   significato; ora fondo neutro uguale per tutti (l'accento resta sulla scelta). */
.profile-section-box[class*="profile-tone-"] {
  background: #f7f9fc;
  border-color: var(--border);
}

/* Barra dell'offerta: punti e giornate del prodotto in configurazione (personale) */
.offer-bar-current {
  display: block;
  color: var(--color-primary, #2d6ea3);
  font-weight: 600;
}
/* Maggiorazione cliente: una riga sola quando non c'è */
.surcharge-field.is-compact {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  border: 0;
}

/* Registro attività: righe su offerte e clienti apribili */
.activity-row.is-link {
  cursor: pointer;
}
.activity-row.is-link:hover .activity-what {
  color: var(--color-primary, #2d6ea3);
  text-decoration: underline;
}
.estimate-panel-row .estimate-note + .estimate-note {
  margin-top: 6px;
}

/* Configurazione: punti di ogni scelta (solo personale) */
.premium-points {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary, #2d6ea3);
  font-variant-numeric: tabular-nums;
}
.option-card.active .premium-points {
  color: inherit;
  opacity: 0.85;
}

/* "Torna al riepilogo" accanto a "Indietro" nei passi del prodotto: stesso aspetto. */
.step-left-actions .step-summary-jump {
  min-height: 38px;
  padding: 0 15px;
  background: #fff;
  border-color: #c7d4e3;
  font-size: 13.5px;
  box-shadow: 0 4px 12px rgba(28, 45, 68, 0.06);
}

/* Stepper: sotto i passi già fatti, una riga con le scelte (es. "Finestra · 68/68 mm"). */
.stepper-grid .step-chip.has-sub {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
}
.step-chip.has-sub::after {
  content: none;
}
.step-chip.has-sub .step-chip-label::after {
  content: " \2713";
  font-weight: 700;
}
.step-chip-label,
.step-chip-sub {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.step-chip-sub {
  font-size: 10.5px;
  font-weight: 600;
  opacity: 0.8;
}
@media (max-width: 760px) {
  .step-chip-sub {
    display: none;
  }
}

/* "Usa anche negli altri prodotti" accanto al titolo della sezione (passi 2 e 3). */
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 10px;
}
.section-title-row .section-title {
  margin-bottom: 0;
}
.apply-others-row {
  justify-content: flex-end;
}
.apply-others-btn {
  font-weight: 600;
}

/* Modelli di prodotto: "Parti da un modello" al passo 1. */
.template-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.template-picker-label {
  font-size: 13px;
  font-weight: 800;
}
.template-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.template-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.template-remove {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.template-remove:hover,
.template-remove:focus-visible {
  background: #fdecec;
  color: #b91c1c;
}
.template-picker-empty {
  margin-top: -4px;
}

/* Campo di testo dentro una conferma (es. nome del modello). */
.confirm-input {
  display: grid;
  gap: 6px;
  margin: 4px 0 12px;
}

/* Cliente, dopo "Invia al commerciale": cosa succede adesso e chi è il commerciale. */
.order-request-next {
  margin-top: 6px;
  line-height: 1.45;
}
.order-request-rep {
  margin-top: 4px;
  overflow-wrap: anywhere;
}

/* Cliente: "oppure — Non so, decide il commerciale" sotto le scelte di un'area. */
.undecided-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.undecided-or {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.undecided-btn.active {
  background: #fff4dc;
  border-color: #e3b04b;
  color: #7a4d00;
}
.undecided-note {
  margin-top: 10px;
}
.undecided-line {
  margin-top: 4px;
  color: #8a5a00;
  font-weight: 600;
}
.product-note-line {
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.product-note-field {
  display: grid;
  gap: 6px;
}
.product-note-field textarea {
  resize: vertical;
  min-height: 56px;
}
/* Cliente: scelte proposte dall'ultima richiesta. */
.prefill-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #eef5ff;
  color: #1f3f6b;
}

/* Riepilogo di un prodotto nuovo: "Indietro" a sinistra, le scelte di salvataggio a destra. */
.offer-final-actions:has(.save-next-btn) {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.offer-final-actions:has(.save-next-btn) > [data-action="prev-step"] {
  margin-right: auto;
}

/* Cliente: offerta già inviata, le modifiche creano una nuova versione. */
.readonly-hint {
  margin: -4px 0 8px;
}

/* Spessore sotto i 20 mm: avviso (non blocca), non errore. */
.thickness-error.is-warn {
  color: #8a5a00;
}
