:root {
  --bg: #eef0f6;
  --surface: #ffffff;
  --text: #1a2233;
  --muted: #5d6a80;
  --line: #dde3ec;
  --primary: #d61f7c;
  --primary-dark: #b01563;
  --primary-soft: #fde6f1;
  --good: #11763f;
  --good-soft: #e3f5ea;
  --warn: #8a5a00;
  --warn-soft: #fff3d6;
  --bad: #b3261e;
  --bad-soft: #fde8e6;
  --radius: 14px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 1rem;
}
h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}
p {
  margin: 0 0 0.75rem;
}
a {
  color: var(--primary);
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 0.85rem;
}
.right {
  text-align: right;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}
.nowrap {
  white-space: nowrap;
}

/* Struttura */
.shell {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: #1d1682;
  color: #e8edf7;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.2px;
}
.brand span {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: #a9b6d3;
}
.nav, .body > .nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav a {
  color: #d3dcf0;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}
.nav a:hover {
  background: rgba(255, 255, 255, 0.08);
}
.nav a.active {
  background: var(--primary);
  color: #fff;
}
.sidebar .user {
  margin-top: auto;
  font-size: 0.85rem;
  color: #a9b6d3;
}
.sidebar .user strong {
  color: #fff;
  display: block;
}
.main {
  padding: 1.75rem 2rem 3rem;
  max-width: 1200px;
  width: 100%;
}

/* Componenti */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.stats {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.cards {
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.stat .label {
  color: var(--muted);
  font-size: 0.85rem;
}
.stat .value {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0.15rem 0;
}
.service {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.service .cat {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.service h3 {
  margin: 0;
  font-size: 1.05rem;
}
.service .desc {
  color: var(--muted);
  flex: 1;
}
.service .price {
  font-weight: 600;
}
.service.disabled {
  opacity: 0.65;
}

.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  padding: 0.55rem 0.42rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
td.num,
th.num {
  text-align: right;
  white-space: nowrap;
}
tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary-dark);
  white-space: nowrap;
}
.badge.good {
  background: var(--good-soft);
  color: var(--good);
}
.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.badge.bad {
  background: var(--bad-soft);
  color: var(--bad);
}

.pos {
  color: var(--good);
  font-weight: 600;
}
.neg {
  color: var(--bad);
  font-weight: 600;
}

/* Form */
label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.25rem;
}
input,
select,
textarea {
  font: inherit;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid #c3ccda;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
input[type='checkbox'] {
  width: auto;
}
textarea {
  min-height: 140px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}
.field {
  margin-bottom: 0.9rem;
}
.hint {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.2rem;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}
.inline {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.cell-input {
  min-width: 84px;
  max-width: 130px;
}
.cell-input.wide {
  min-width: 220px;
  max-width: none;
}

button,
.btn {
  font: inherit;
  display: inline-block;
  cursor: pointer;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
button:hover,
.btn:hover {
  background: var(--primary-dark);
}
button.secondary,
.btn.secondary {
  background: #fff;
  color: var(--primary);
}
button.secondary:hover,
.btn.secondary:hover {
  background: var(--primary-soft);
}
button.danger {
  background: #fff;
  color: var(--bad);
  border-color: var(--bad);
}
button.danger:hover {
  background: var(--bad-soft);
}
button.small,
.btn.small {
  padding: 0.25rem 0.6rem;
  font-size: 0.85rem;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Login */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 2rem;
}
.login-card h1 {
  margin-bottom: 0.25rem;
}
.error-text {
  color: var(--bad);
  min-height: 1.3em;
  margin: 0.25rem 0 0.75rem;
  font-size: 0.9rem;
}

/* Modale */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 50;
}
.modal {
  background: var(--surface);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: auto;
  padding: 1.5rem;
}
.modal h2 {
  margin-bottom: 1rem;
}
.modal .actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}
.secret {
  background: var(--primary-soft);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  margin: 0.4rem 0 0.9rem;
  word-break: break-all;
  user-select: all;
}
.notice {
  background: var(--warn-soft);
  color: #5c3d00;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.9rem;
  font-size: 0.9rem;
}
.steps {
  margin: 0.25rem 0 0.9rem 1.1rem;
  padding: 0;
}

/* Notifiche */
#toasts {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 100;
}
.toast {
  background: #1d1682;
  color: #fff;
  padding: 0.65rem 0.95rem;
  border-radius: 10px;
  max-width: 340px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.toast.bad {
  background: var(--bad);
}
.toast.good {
  background: var(--good);
}

@media (max-width: 820px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: column;
    gap: 0.75rem;
  }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sidebar .user {
    margin-top: 0;
  }
  .main {
    padding: 1.25rem 1rem 3rem;
  }
}

/* ---------- Telefono ---------- */
html {
  -webkit-text-size-adjust: 100%;
}
body {
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }
  h1 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
  }
  input,
  select,
  textarea {
    font-size: 16px;
    min-height: 46px;
  }
  textarea {
    min-height: 140px;
  }
  button,
  .btn {
    min-height: 46px;
    padding: 0.6rem 1rem;
  }
  button.small,
  .btn.small {
    min-height: 40px;
    padding: 0.4rem 0.85rem;
  }

  /* Barra in alto: marchio e uscita */
  .shell {
    display: block;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: calc(0.6rem + env(safe-area-inset-top)) 1rem 0.6rem;
  }
  .sidebar .brand .brand-sub,
  .sidebar .user strong,
  .sidebar .user .who {
    display: none;
  }
  .sidebar .user {
    margin: 0;
  }

  /* Partner: menu in basso, comodo con il pollice */
  .shell.partner .nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    flex-direction: row;
    justify-content: space-around;
    gap: 0;
    background: #1d1682;
    padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.25);
  }
  .shell.partner .nav a {
    flex: 1;
    text-align: center;
    padding: 0.7rem 0.1rem;
    font-size: 0.8rem;
    border-radius: 8px;
  }
  .shell.partner .main {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
  }

  /* Amministratore: menu scorrevole sotto la barra */
  .shell.admin .sidebar {
    flex-wrap: wrap;
  }
  .shell.admin .nav {
    order: 3;
    width: 100%;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.25rem;
    padding-bottom: 0.25rem;
  }
  .shell.admin .nav a {
    white-space: nowrap;
    padding: 0.55rem 0.8rem;
  }

  .main {
    padding: 1rem 1rem 2rem;
  }
  .card {
    padding: 0.9rem 0.9rem;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .stats .stat:first-child {
    grid-column: 1 / -1;
  }
  .stat .value {
    font-size: 1.4rem;
  }
  .stats .stat:first-child .value {
    font-size: 1.9rem;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .service button {
    width: 100%;
  }
  .form-row {
    grid-template-columns: 1fr;
  }

  /* Le tabelle diventano elenchi di schede */
  .table-wrap {
    overflow: visible;
  }
  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }
  thead {
    display: none;
  }
  tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.3rem 0.8rem;
    margin-bottom: 0.65rem;
    background: #fff;
  }
  td,
  td.num {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.4rem 0;
    border-bottom: 1px dashed var(--line);
    text-align: right;
  }
  td:last-child {
    border-bottom: none;
  }
  td:empty {
    display: none;
  }
  td[data-label]:not([data-label=''])::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: left;
    flex-shrink: 0;
  }
  td .inline {
    justify-content: flex-end;
    width: 100%;
  }
  .cell-input,
  .cell-input.wide {
    min-width: 0;
    max-width: none;
    flex: 1;
    text-align: right;
  }

  /* Gli elenchi a schede non hanno bisogno di un secondo riquadro */
  .card:has(> .table-wrap) {
    background: none;
    border: none;
    padding: 0;
  }
  .card:has(> .table-wrap) > h2 {
    margin-top: 0.25rem;
  }
  td input[type='checkbox'] {
    width: 24px;
    height: 24px;
    min-height: 0;
  }

  /* Finestre a tutta larghezza dal basso */
  .overlay {
    place-items: end center;
    padding: 0;
  }
  .modal {
    max-width: none;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom));
  }
  .modal .actions {
    flex-direction: column-reverse;
  }
  .modal .actions button,
  .modal .actions .btn,
  .modal a.btn {
    width: 100%;
  }
  .modal a.btn {
    display: block;
    text-align: center;
    margin-bottom: 0.5rem;
  }
  #toasts {
    left: 1rem;
    right: 1rem;
    bottom: calc(5.5rem + env(safe-area-inset-bottom));
  }
  .toast {
    max-width: none;
  }
  .login-card {
    padding: 1.5rem 1.25rem;
  }
}

.methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}
button.method {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.7rem 0.8rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  text-align: left;
}
button.method .small {
  color: var(--muted);
  font-weight: 400;
}
button.method[aria-pressed='true'] {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px var(--primary);
}
button.method:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
@media (max-width: 640px) {
  .methods {
    grid-template-columns: 1fr;
  }
}

.ship-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}
.ship-option > div {
  min-width: 0;
}
ul.events {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.card form h2 {
  margin-top: 1rem;
}
.card form h2:first-child {
  margin-top: 0;
}

.combo {
  position: relative;
}
.combo-list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(20, 33, 61, 0.18);
  max-height: 16rem;
  overflow-y: auto;
}
.combo-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
}
.combo-list li:hover,
.combo-list li[aria-selected='true'] {
  background: var(--primary-soft);
}

/* Aspetto Punto Semplice */
.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.15rem;
  letter-spacing: 0.1px;
}
.brand-mark strong {
  font-weight: 800;
}
.brand-mark .brand-text {
  font-weight: 400;
}
.brand-dot {
  width: 1.7em;
  height: 1.7em;
  flex: none;
}
.dot-outer {
  fill: var(--primary);
}
.dot-inner {
  fill: #fff;
}
.brand .brand-sub {
  display: block;
  margin-top: 0.2rem;
  font-weight: 400;
  font-size: 0.8rem;
  color: #a9b6d3;
}
.brand-mark.big {
  font-size: 1.6rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.tagline {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.login-card {
  box-shadow: 0 10px 30px rgba(20, 33, 61, 0.12);
  border: 0;
}
.card {
  border: 0;
  box-shadow: 0 1px 2px rgba(20, 33, 61, 0.06), 0 4px 14px rgba(20, 33, 61, 0.05);
}
.lead {
  margin: -0.5rem 0 1rem;
  color: var(--muted);
  font-size: 1.05rem;
}
.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.quick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.quick-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20, 33, 61, 0.06), 0 4px 14px rgba(20, 33, 61, 0.05);
}
.quick-item .icon {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0.55rem;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}
.quick-item:hover {
  box-shadow: 0 2px 4px rgba(20, 33, 61, 0.1), 0 8px 20px rgba(20, 33, 61, 0.1);
}
@media (max-width: 640px) {
  .quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quick-item {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
    padding: 0.9rem 0.6rem;
    font-size: 0.92rem;
  }
  .shell.partner .nav a {
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.7rem;
  }
  .shell.partner .nav a .icon {
    width: 1.35rem;
    height: 1.35rem;
  }
  .sidebar .brand-mark {
    font-size: 1rem;
  }
}

.sidebar .brand-mark {
  color: #fff;
}
.brand .brand-mark .brand-text {
  display: inline;
  font-size: 1.15rem;
  color: #fff;
}
.brand-mark.big .brand-text {
  font-size: inherit;
  color: var(--text);
}
@media (max-width: 640px) {
  .brand .brand-mark .brand-text {
    font-size: 1rem;
  }
}

.brand-logo {
  width: 2.1em;
  height: 2.1em;
  flex: none;
  border-radius: 28%;
  display: block;
}

.trust {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0.25rem 0 0.75rem;
}
.trust strong {
  color: var(--text);
}
.stars {
  display: inline-flex;
  gap: 1px;
}
.star {
  width: 1.05rem;
  height: 1.05rem;
  fill: #f2a900;
}
.pillars {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}
.pillar {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ---------- Struttura ordinata: barra in alto + menu + contenuto ---------- */
.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: calc(0.6rem + env(safe-area-inset-top, 0px)) 1.25rem 0.6rem;
  background: #1d1682;
  color: #fff;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}
.topbar .brand-sub {
  margin: 0;
  padding-left: 0.9rem;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  white-space: nowrap;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.topbar .who {
  display: flex;
  flex-direction: column;
  text-align: right;
  font-size: 0.8rem;
  color: #c9c6f2;
  line-height: 1.25;
}
.topbar .who strong {
  color: #fff;
  font-size: 0.9rem;
}
.wallet-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem 0.4rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.wallet-chip:hover,
.wallet-chip[aria-current='page'] {
  background: var(--primary);
}
.wallet-chip .icon {
  width: 1.4rem;
  height: 1.4rem;
}
.body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
  flex: 1;
}
.body > .nav {
  position: sticky;
  top: 4.2rem;
  margin: 1.25rem 0 0 1rem;
  padding: 0.6rem;
  gap: 2px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20, 33, 61, 0.06), 0 4px 14px rgba(20, 33, 61, 0.05);
}
.body > .nav a {
  color: var(--text);
  font-weight: 500;
}
.body > .nav a:hover {
  background: var(--primary-soft);
}
.body > .nav a.active {
  background: var(--primary);
  color: #fff;
}
.nav-group {
  margin: 0.7rem 0.75rem 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-group:first-child {
  margin-top: 0.2rem;
}
.logout-mobile {
  display: none;
}
@media (max-width: 820px) {
  .body {
    grid-template-columns: 1fr;
  }
  .body > .nav {
    position: static;
    top: auto;
    margin: 0.75rem 1rem 0;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .nav-group {
    display: none;
  }
  .topbar .who span {
    display: none;
  }
}
@media (max-width: 640px) {
  .topbar {
    padding: calc(0.55rem + env(safe-area-inset-top, 0px)) 0.9rem 0.55rem;
  }
  .topbar .brand-sub,
  .topbar .who,
  .topbar .logout {
    display: none;
  }
  .logout-mobile {
    display: block;
    margin-top: 0.5rem;
    width: 100%;
  }
  .shell.partner .body > .nav {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    z-index: 30;
    flex-wrap: nowrap;
    justify-content: space-around;
    gap: 0;
    background: #1d1682;
    border-radius: 0;
    padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.25);
  }
  .shell.partner .body > .nav a {
    color: #d3dcf0;
    flex: 1;
    justify-content: center;
  }
  .shell.partner .body > .nav a.active {
    background: var(--primary);
    color: #fff;
  }
  .shell.admin .body > .nav {
    order: -1;
    width: auto;
    margin: 0;
    padding: 0.4rem 0.6rem;
    border-radius: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    box-shadow: none;
    background: var(--surface);
  }
  .shell.admin .body > .nav a {
    white-space: nowrap;
  }
  .shell.partner .main {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }
}

/* ---------- Assistente ---------- */
.chat-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(20, 33, 61, 0.3);
}
.chat-fab:hover {
  background: var(--primary-dark);
}
.chat-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 70;
  width: min(380px, calc(100vw - 2rem));
  height: min(560px, calc(100vh - 2.5rem));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(20, 33, 61, 0.35);
  overflow: hidden;
}
.chat-panel[hidden] {
  display: none;
}
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  background: #1d1682;
  color: #fff;
}
.chat-head > div {
  display: flex;
  flex-direction: column;
}
.chat-head .small {
  color: #c9c6f2;
}
.chat-close {
  background: transparent;
  color: #fff;
  min-height: 0;
  padding: 0.3rem;
  border: 0;
}
.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--bg);
}
.bubble {
  max-width: 85%;
  padding: 0.6rem 0.85rem;
  border-radius: 16px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bubble.assistant {
  align-self: flex-start;
  background: var(--surface);
  border-bottom-left-radius: 4px;
}
.bubble.user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.bubble.typing {
  color: var(--muted);
  font-style: italic;
}
.bubble.error {
  background: var(--bad-soft);
  color: var(--bad);
}
.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0.9rem 0.6rem;
  background: var(--bg);
}
.chat-chips:empty {
  display: none;
}
.chat-chips .chip {
  padding: 0.4rem 0.75rem;
  min-height: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary-dark);
  border: 1px solid var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
}
.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-top: 1px solid var(--line);
}
.chat-form textarea {
  flex: 1;
  min-height: 44px;
  max-height: 7rem;
  resize: none;
  border-radius: 14px;
}
.chat-send {
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chat-note {
  margin: 0;
  padding: 0 0.9rem 0.6rem;
  color: var(--muted);
  text-align: center;
}
@media (max-width: 640px) {
  .shell.partner ~ .chat-fab,
  .chat-fab {
    right: 1rem;
    bottom: calc(5.2rem + env(safe-area-inset-bottom, 0px));
    padding: 0.7rem;
  }
  .chat-fab span {
    display: none;
  }
  .chat-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: min(85vh, 640px);
    border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}
.chat-form textarea {
  font: inherit;
}

.account-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.2rem 0.4rem 0.2rem 0.2rem;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
}
.account-link:hover,
.account-link[aria-current='page'] {
  background: rgba(255, 255, 255, 0.14);
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  flex: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.avatar .icon {
  width: 1.3rem;
  height: 1.3rem;
}
@media (max-width: 640px) {
  .account-link {
    padding: 0;
  }
}

.avatar {
  overflow: hidden;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar.big {
  width: 5.5rem;
  height: 5.5rem;
  background: var(--primary-soft);
  color: var(--primary);
}
.avatar.big .icon {
  width: 2.6rem;
  height: 2.6rem;
}
.photo-row {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.photo-row > div {
  min-width: 0;
}

/* ---------- Grafiche ---------- */
.gfx-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.gfx-preview {
  position: sticky;
  top: 5rem;
}
.gfx-frame {
  display: flex;
  justify-content: center;
  padding: 0.75rem;
  margin-bottom: 0.9rem;
  background: var(--bg);
  border-radius: 12px;
}
.gfx-canvas {
  max-width: 100%;
  max-height: 70vh;
  height: auto;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(20, 33, 61, 0.2);
}
.gfx-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
button.gfx-opt {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 600;
}
button.gfx-opt[aria-pressed='true'] {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
  box-shadow: inset 0 0 0 1px var(--primary);
}
@media (max-width: 900px) {
  .gfx-layout {
    grid-template-columns: 1fr;
  }
  .gfx-preview {
    position: static;
  }
}
.quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Sezione Marketing separata */
.nav a.nav-extra:not(.active) {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 700;
}
@media (max-width: 640px) {
  .shell.partner .body > .nav a.nav-extra {
    margin-left: 0.35rem;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0 10px 10px 0;
  }
  .shell.partner .body > .nav a.nav-extra:not(.active) {
    background: transparent;
    color: #ffc2e0;
  }
}

/* ---------- Visure e certificati ---------- */
.visure-group h2 {
  margin: 1.4rem 0 0.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}
.visura {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.visura-main {
  min-width: 0;
}
.visura h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}
.visura .desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.visura-side {
  flex: none;
  text-align: right;
}
.visura-side .price {
  font-weight: 800;
}
@media (max-width: 640px) {
  .visura {
    flex-direction: column;
    align-items: stretch;
  }
  .visura-side {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    text-align: left;
  }
}

.visure-chips {
  margin-top: 0.75rem;
}
@media (max-width: 640px) {
  .visure-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.4rem;
  }
  .visure-chips .gfx-opt {
    flex: none;
    white-space: nowrap;
  }
}

.main, .body > .main { min-width: 0; }

.visura-actions { display: flex; gap: 0.4rem; justify-content: flex-end; margin-top: 0.3rem; }
@media (max-width: 640px) { .visura-actions { margin-top: 0; } }

/* scheda visura */
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.detail-side { position: sticky; top: 5rem; }
.detail-list { margin: 0; padding-left: 1.2rem; }
.detail-list li { margin: 0.25rem 0; }
.price-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.price-row.total { font-weight: 800; border-bottom: 0; font-size: 1.1rem; }
a.plain { color: inherit; text-decoration: none; }
a.plain:hover { text-decoration: underline; }
.visura.related { text-decoration: none; color: inherit; }
.visura.related:hover { border-color: var(--primary); }
.chip { display: inline-block; padding: 0.2rem 0.7rem; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; font-size: 0.85rem; }
@media (max-width: 820px) { .detail-grid { grid-template-columns: 1fr; } .detail-side { position: static; order: -1; } }

.detail-h { margin: 1.1rem 0 0.4rem; font-size: 1.05rem; text-wrap: balance; }
.detail-notes { margin: 0.5rem 0; padding: 0.6rem 0.9rem; border-left: 4px solid var(--primary); background: var(--primary-soft); border-radius: 0 10px 10px 0; }
.detail-notes p { margin: 0.35rem 0; font-size: 0.93rem; }

/* ricerca negli elenchi */
.with-search { display: block; }
.list-search { width: 100%; max-width: 28rem; margin: 0 0 0.8rem; }
.with-search > .table-wrap { margin-top: 0; }
[hidden] { display: none !important; }

/* Avvisi e comunicazioni */
.bell-chip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: 999px; background: rgba(255, 255, 255, 0.14); color: #fff; text-decoration: none; }
.bell-chip:hover, .bell-chip[aria-current='page'] { background: var(--primary); }
.bell-chip .icon { width: 1.35rem; height: 1.35rem; }
.bell-badge { position: absolute; top: -0.2rem; right: -0.2rem; min-width: 1.1rem; height: 1.1rem; padding: 0 0.25rem; border-radius: 999px; background: var(--primary); color: #fff; font-size: 0.7rem; font-weight: 800; line-height: 1.1rem; text-align: center; box-shadow: 0 0 0 2px #1f1a6b; }
.note-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.note-list { display: flex; flex-direction: column; }
.note { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.8rem 0.25rem; border-top: 1px solid var(--line); color: inherit; text-decoration: none; min-width: 0; }
.note:first-child { border-top: 0; }
a.note:hover { background: var(--primary-soft); }
.note-icon { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 999px; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; }
.note-icon .icon { width: 1.2rem; height: 1.2rem; }
.note-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; overflow-wrap: anywhere; }
.note.unread .note-text strong::before { content: ''; display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 999px; background: var(--primary); margin-right: 0.45rem; }
.pref-list { display: flex; flex-direction: column; gap: 0.25rem; margin: 0.5rem 0; }
.pref-row { display: flex; align-items: center; gap: 0.6rem; min-height: 2.6rem; }
.pref-row input { width: 1.25rem; height: 1.25rem; flex: none; }

.low-alert { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.4rem 1rem; background: var(--warn-soft); color: var(--warn); font-size: 0.85rem; text-decoration: none; text-align: center; }
.low-alert .icon { width: 1.1rem; height: 1.1rem; flex: none; }
.low-alert strong { text-decoration: underline; }
.wallet-chip.low { box-shadow: 0 0 0 2px #f0b24a; }

/* Loghi dei partner */
.partner-strip { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.partner-title { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.partner-logos { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.75rem 1.5rem; }
.partner-logos img { height: 28px; width: auto; max-width: 100%; opacity: 0.8; }
.service-logo { display: block; align-self: flex-start; justify-self: start; height: 20px; width: auto; max-width: 60%; object-fit: contain; margin-bottom: 0.5rem; opacity: 0.85; }
.partner-logos img { object-fit: contain; flex: none; }

.brand-full {
  display: block;
  width: min(260px, 80%);
  height: auto;
  margin: 0 0 0.6rem;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 5px 12px;
}
.brand-pill-img {
  display: block;
  height: 46px;
  width: auto;
}
@media (max-width: 640px) {
  .brand-pill {
    padding: 4px 9px;
  }
  .brand-pill-img {
    height: 36px;
  }
}

.checklist, .todo {
  list-style: none;
  margin: 0;
  padding: 0;
}
.checklist li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.checklist li:last-child {
  border-bottom: none;
}
.checklist .tick {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
}
.checklist li.done .tick {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.checklist li.done span:last-child {
  color: var(--muted);
  text-decoration: line-through;
}
.todo li a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.todo li:last-child a {
  border-bottom: none;
}
.todo li a .icon {
  color: var(--primary);
  flex: none;
}

.start-closed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.7rem;
  font-weight: 700;
}

.signal-qr {
  display: block;
  width: 220px;
  max-width: 100%;
  height: auto;
  margin: 0.8rem 0;
  padding: 0.6rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  image-rendering: pixelated;
}

/* ===== Aspetto morbido e trasparente, in linea con www.puntosemplice.it ===== */
:root {
  --ps-indigo: #1d1682;
  --ps-purple: #811f85;
  --ps-magenta: #ea2889;
  --ps-grad: linear-gradient(266deg, #ea2889 0%, #811f85 42%, #1d1682 100%);
  --ps-grad-rev: linear-gradient(90deg, #1d1682 0%, #811f85 55%, #ea2889 100%);
  --glass: rgba(255, 255, 255, 0.62);
  --glass-line: rgba(255, 255, 255, 0.75);
  --radius: 22px;
}
body {
  background: #e9e4f2;
  background-image: linear-gradient(160deg, #b9b3d9 0%, #d9c6e3 38%, #f4c3dc 100%);
  background-attachment: fixed;
  min-height: 100vh;
}
.sidebar {
  background: linear-gradient(200deg, rgba(29, 22, 130, 0.94) 0%, rgba(129, 31, 133, 0.9) 100%);
  border-radius: 0 28px 28px 0;
  box-shadow: 8px 0 40px rgba(29, 22, 130, 0.18);
}
.nav a { border-radius: 999px; transition: background 0.15s ease; }
.nav a:hover { background: rgba(255, 255, 255, 0.14); }
.nav a.active { background: rgba(255, 255, 255, 0.2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.topbar { background: linear-gradient(90deg, rgba(29, 22, 130, 0.95), rgba(129, 31, 133, 0.92)); }

.card, .stat, .quick-item, .service, .login-card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(29, 22, 130, 0.08);
}
.stat { padding: 1.15rem 1.3rem; }
.stat .value {
  background: var(--ps-grad-rev);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.main > div > h1:first-child, .main h1 {
  background: var(--ps-grad-rev);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-size: 1.9rem;
  letter-spacing: -0.01em;
}
.lead { color: #4b4a73; }
.quick-item { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.quick-item:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(129, 31, 133, 0.16); background: rgba(255, 255, 255, 0.82); }
.quick-item .icon { color: var(--ps-purple); }

button, .btn {
  background: var(--ps-grad);
  border: 0;
  border-radius: 999px;
  padding: 0.6rem 1.3rem;
  box-shadow: 0 6px 18px rgba(129, 31, 133, 0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
button:hover, .btn:hover { background: var(--ps-grad); filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(129, 31, 133, 0.3); }
button.secondary, .btn.secondary {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ps-indigo);
  box-shadow: inset 0 0 0 1px rgba(29, 22, 130, 0.35);
}
button.secondary:hover, .btn.secondary:hover { background: rgba(255, 255, 255, 0.95); filter: none; }
button.danger { background: var(--bad); box-shadow: none; }
button.method { background: rgba(255, 255, 255, 0.7); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
button.method[aria-pressed='true'] { box-shadow: inset 0 0 0 2px var(--ps-purple); }
button:disabled { filter: grayscale(0.6) opacity(0.6); transform: none; box-shadow: none; }

input, select, textarea { background: rgba(255, 255, 255, 0.8); border-radius: 14px; }
table { background: transparent; }
th { background: rgba(255, 255, 255, 0.45); }
.badge { border-radius: 999px; }
.pillar { background: rgba(255, 255, 255, 0.7); border-radius: 999px; color: var(--ps-indigo); }
.checklist li.done .tick { background: var(--ps-grad); color: #fff; }
a { color: var(--ps-purple); }
.service:hover { box-shadow: 0 14px 36px rgba(129, 31, 133, 0.14); }

@media (max-width: 760px) {
  .sidebar { border-radius: 0 24px 24px 0; }
  .main h1 { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.nav, .body > .nav {
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid var(--glass-line);
  border-radius: 24px;
  box-shadow: 0 8px 30px rgba(29, 22, 130, 0.08);
}
.nav a.active { background: var(--ps-grad); color: #fff; box-shadow: 0 6px 16px rgba(129, 31, 133, 0.25); }
.body > .nav { background: var(--glass); }

/* Schermata di accesso */
.login-wrap {
  background:
    radial-gradient(60% 50% at 15% 10%, rgba(234, 40, 137, 0.22), transparent 70%),
    radial-gradient(55% 55% at 90% 85%, rgba(29, 22, 130, 0.22), transparent 70%);
}
.login-card {
  max-width: 440px;
  padding: 2.25rem 2rem 1.75rem;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 24px 70px rgba(29, 22, 130, 0.18);
}
.login-card .brand-mark, .login-card .brand { justify-content: center; }
.login-card .tagline {
  text-align: center;
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #1a1a3a;
  margin: 0.5rem 0 1rem;
  text-wrap: balance;
}
.login-card .tag-grad {
  background: var(--ps-grad-rev);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.login-card .trust { justify-content: center; text-align: center; }
.login-card h1 { font-size: 1.5rem; margin-top: 0.5rem; }
.login-card button[type='submit'] { width: 100%; padding: 0.75rem 1.3rem; }
@media (max-width: 480px) {
  .login-card { padding: 1.75rem 1.25rem 1.5rem; border-radius: 26px; }
  .login-card .tagline { font-size: 1.3rem; }
}
.login-card .tag-line, .login-card .tag-grad { display: block; white-space: nowrap; }

/* Logo Trustpilot sopra le stelle */
.trust { flex-wrap: wrap; row-gap: 0.35rem; }
.trust .trust-logo { display: block; flex: 0 0 100%; line-height: 0; }
.trust .trust-logo img { height: 26px; width: auto; display: block; margin: 0 auto; }
.main .trust .trust-logo img, .card .trust .trust-logo img { margin: 0; }

/* Logo e stelle sulla stessa riga */
.trust { display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; }
.trust-row { display: flex; align-items: center; gap: 0.6rem; }
.trust-row .trust-logo { flex: none; display: block; line-height: 0; }
.trust-row .trust-logo img { height: 26px; width: auto; display: block; margin: 0; }
.trust-row .stars { display: inline-flex; gap: 2px; }
.trust-text { display: flex; flex-wrap: wrap; gap: 0 0.5rem; }
.login-card .trust { align-items: center; }
.login-card .trust-text { justify-content: center; text-align: center; }

/* Social */
.socials { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid rgba(29, 22, 130, 0.1); text-align: center; }
.social-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 0.6rem; }
.social-pill {
  display: inline-block;
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 0 0 1px rgba(29, 22, 130, 0.25);
  color: var(--ps-indigo);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.social-pill:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1px var(--ps-purple), 0 6px 16px rgba(129, 31, 133, 0.18); color: var(--ps-purple); }
.socials p { margin: 0; }

/* Scelte (grafiche, metodi di pagamento): col cursore sopra la scritta diventa bianca e si legge bene */
button.gfx-opt, button.method {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(29, 22, 130, 0.2);
}
button.gfx-opt[aria-pressed='true'] { background: rgba(253, 230, 241, 0.85); color: var(--primary-dark); box-shadow: inset 0 0 0 2px var(--ps-purple); }
button.gfx-opt:hover:not(:disabled), button.gfx-opt:focus-visible,
button.method:hover:not(:disabled), button.method:focus-visible {
  background: var(--ps-grad);
  color: #fff;
  box-shadow: 0 6px 18px rgba(129, 31, 133, 0.25);
}
button.gfx-opt:hover:not(:disabled) *, button.method:hover:not(:disabled) *,
button.method:hover:not(:disabled) .small { color: #fff; }

/* Barra in basso su telefono: sottile, trasparente, scritte su una riga */
.nav-label .short { display: none; }
@media (max-width: 640px) {
  .nav-label .long { display: none; }
  .nav-label .short { display: inline; }
  .shell.partner .body > .nav {
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    backdrop-filter: blur(18px) saturate(1.2);
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 22px 22px 0 0;
    padding: 0.3rem 0.35rem calc(0.25rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 28px rgba(29, 22, 130, 0.14);
  }
  .shell.partner .body > .nav a {
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.35rem 0.1rem 0.3rem;
    min-width: 0;
    border-radius: 16px;
    color: var(--ps-indigo);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.1;
    white-space: nowrap;
    text-align: center;
  }
  .shell.partner .body > .nav a .icon { width: 1.3rem; height: 1.3rem; }
  .shell.partner .body > .nav a.active { background: var(--ps-grad); color: #fff; box-shadow: 0 4px 12px rgba(129, 31, 133, 0.28); }
  .shell.partner .body > .nav a:hover:not(.active) { background: rgba(129, 31, 133, 0.1); }
  .main { padding-bottom: 5.5rem; }
}
@media (max-width: 640px) {
  .shell.partner .body > .nav a.nav-extra { margin-left: 0; border-left: 0; border-radius: 16px; }
  .shell.partner .body > .nav a.nav-extra:not(.active) { background: transparent; color: var(--primary-dark); font-weight: 700; }
}

/* Portale Namirial incorporato */
.portal-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.75rem 0 1rem; }
.portal-frame {
  width: 100%;
  height: calc(100vh - 16rem);
  min-height: 520px;
  border: 0;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(29, 22, 130, 0.12);
}
.portal-demo { display: grid; place-content: center; text-align: center; gap: 0.4rem; padding: 2rem; background: var(--glass); }
.portal-help { margin-top: 0.6rem; }

/* Portachiavi */
.vault-list { display: grid; gap: 0.6rem; margin-bottom: 0.4rem; }
.vault-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.7rem 0.9rem; border-radius: 16px; background: rgba(255, 255, 255, 0.6); box-shadow: inset 0 0 0 1px rgba(29, 22, 130, 0.1); }
.vault-item .inline { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* Registrazione */
.signup-line { text-align: center; margin: 0.9rem 0 0; font-size: 0.92rem; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.login-card .pref-row { align-items: flex-start; gap: 0.6rem; margin: 0.4rem 0; }
.login-card .pref-row input { margin-top: 0.2rem; width: auto; }

/* Centra la foto profilo */
.crop-box { display: grid; justify-items: center; gap: 0.75rem; }
.crop-frame { position: relative; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--ps-purple), 0 10px 30px rgba(29, 22, 130, 0.25); background: #fff; }
.crop-canvas { display: block; cursor: grab; touch-action: none; border-radius: 50%; }
.crop-canvas:active { cursor: grabbing; }
.crop-controls { display: flex; align-items: center; gap: 0.6rem; width: 100%; max-width: 300px; }
.crop-controls input[type=range] { flex: 1; padding: 0; background: transparent; accent-color: var(--ps-purple); }

/* Foto profilo: tutto centrato (foto, pulsanti, testo) */
.photo-row { flex-direction: column; justify-content: center; text-align: center; gap: 0.9rem; }
.photo-row > div { display: grid; justify-items: center; gap: 0.5rem; }
.photo-row .inline { justify-content: center; }
.photo-row .muted { margin: 0; max-width: 34ch; }

/* servizi online */
.seg-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.seg { background: rgba(255,255,255,0.55); color: var(--primary-dark); border: 1px solid rgba(124,92,255,0.25); border-radius: 999px; padding: 0.45rem 0.95rem; font-weight: 600; box-shadow: none; }
.seg.active, .seg:hover { background: linear-gradient(135deg, var(--primary), var(--accent, #e85d9e)); color: #fff; border-color: transparent; }
.row-actions { display: inline-flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }

.privacy-card { max-width: 640px; text-align: left; }
.privacy-card h2 { font-size: 1.05rem; margin: 1.1rem 0 0.3rem; }
.privacy-card p { margin: 0 0 0.5rem; }

button.danger { color: #fff; }
.inline > input[type='month'] { width: auto; flex: 0 1 14rem; }

/* In scadenza: si nota subito quando ci sono clienti da avvisare */
.due-alert { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.45rem 1rem; background: #ffe3b8; color: #7a4300; font-size: 0.88rem; font-weight: 600; text-decoration: none; text-align: center; }
.due-alert .icon { width: 1.1rem; height: 1.1rem; flex: none; }
.due-alert strong { text-decoration: underline; }
.nav a.nav-due:not(.active) { background: #fff0d6; color: #7a4300; font-weight: 700; }
.nav a.nav-due:hover:not(.active) { background: #ffe3b8; }
.due-count { margin-left: auto; min-width: 1.4rem; padding: 0 0.4rem; border-radius: 999px; background: #e8890c; color: #fff; font-size: 0.75rem; font-weight: 800; line-height: 1.4rem; text-align: center; }
.card.due-card { border: 2px solid #f0a53a; background: rgba(255, 244, 224, 0.82); }
.card.due-card h2 { color: #7a4300; }
@media (max-width: 640px) {
  .shell.partner .body > .nav a.nav-due:not(.active) { background: transparent; color: #a65a00; }
  .shell.partner .body > .nav a.nav-due { position: relative; }
  .nav-due .due-count { position: absolute; top: 0; right: 18%; margin: 0; min-width: 1rem; font-size: 0.6rem; line-height: 1rem; padding: 0 0.25rem; }
}
.card.due-card > p:last-child { margin-top: 1rem; }
.dl-chips { margin: 0 0 1rem; }

.cust-add { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.6rem; align-items: center; }
@media (max-width: 640px) { .cust-add { grid-template-columns: 1fr; } }

.start-card { border: 1px solid var(--primary-soft); }
.start-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.start-head h2 { margin: 0; }
.start-bar { height: 10px; border-radius: 999px; background: var(--primary-soft); overflow: hidden; margin: 0.6rem 0 1rem; }
.start-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #6a3fb5); transition: width 0.3s ease; }
.start-next { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 0.9rem 1rem; border-radius: 14px; background: var(--primary-soft); margin-bottom: 0.9rem; }
.start-next > div { min-width: 0; flex: 1 1 14rem; }
@media (max-width: 640px) { .start-next .btn { width: 100%; text-align: center; } }
.start-meta { display: flex; align-items: center; gap: 0.75rem; }

.why-small { padding: 0.8rem 1.1rem; }
.why-small .why-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap; }
.why-small .pillars { margin: 0; }
.why-small p { margin: 0.4rem 0 0; }

.pad2-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.7rem; margin: 0.8rem 0 1rem; }
.pad2-grid .quick-item { text-decoration: none; }
.pad2-grid .quick-item > span { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
