/* Gestionale FCM TECH — stile unico, senza framework.
   Colori brand (SPEC §1): lime #8DC63F → verde #3AAA35, blu #1F5FA8, blu scuro #16365C. */
:root {
  --lime: #8dc63f;
  --verde: #3aaa35;
  --verde-scuro: #2b8a28;
  --blu: #1f5fa8;
  --blu-scuro: #16365c;
  --blu-chiaro: #e8f0fa;
  --rosso: #c93c3c;
  --rosso-chiaro: #fdecec;
  --arancio: #d9761c;
  --arancio-chiaro: #fdf1e4;
  --giallo: #b8930a;
  --giallo-chiaro: #fdf8e1;
  --verde-chiaro: #eaf6e9;
  --viola: #6d45b5;
  --viola-chiaro: #f1ecfa;
  --grigio: #6b7685;
  --grigio-chiaro: #f0f2f5;
  --testo: #1b2430;
  --testo-2: #4c5866;
  --bordo: #dce1e8;
  --sfondo: #f5f7fa;
  --carta: #ffffff;
  --raggio: 10px;
  --ombra: 0 1px 2px rgba(22, 54, 92, 0.06), 0 2px 8px rgba(22, 54, 92, 0.05);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;
  --menu: 236px;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font: 15px/1.45 var(--font);
  color: var(--testo);
  background: var(--sfondo);
}
a {
  color: var(--blu);
}
h1,
h2,
h3 {
  color: var(--blu-scuro);
  line-height: 1.2;
}
h1 {
  font-size: 1.5rem;
  margin: 0;
}
h2 {
  font-size: 1.08rem;
  margin: 0;
}
h3 {
  font-size: 0.98rem;
  margin: 0.8rem 0 0.4rem;
}
code {
  font-family: var(--mono);
  font-size: 0.92em;
}
:focus-visible {
  outline: 3px solid rgba(31, 95, 168, 0.45);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- layout ---------- */
.app {
  display: grid;
  grid-template-columns: var(--menu) 1fr;
  min-height: 100vh;
}
.menu {
  align-self: start;
  background: var(--blu-scuro);
  color: #dbe6f3;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.menu-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 12px;
  color: #fff;
  text-decoration: none;
}
.menu-logo img {
  width: 38px;
  height: 38px;
  background: #fff;
  border-radius: 8px;
  padding: 3px;
}
.menu-logo strong {
  display: block;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
}
.menu-logo small {
  color: #9fb4cd;
  font-size: 0.75rem;
}
.menu nav {
  display: flex;
  flex-direction: column;
  padding: 6px 8px;
  gap: 2px;
}
.menu nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #dbe6f3;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 500;
}
.menu nav a:hover {
  background: rgba(255, 255, 255, 0.08);
}
.menu nav a.attivo {
  background: linear-gradient(90deg, var(--verde), var(--lime));
  color: #0d2a10;
}
.menu nav a .icona {
  width: 20px;
  text-align: center;
}
.menu nav a.chiamata {
  margin: 6px 0 8px;
  background: var(--verde);
  color: #fff;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}
.menu nav a.chiamata:hover {
  background: var(--verde-scuro);
}
.menu nav a.chiamata.attivo {
  background: var(--lime);
  color: #0d2a10;
}
.menu-utente {
  margin-top: auto;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
}
.menu-utente .nome {
  color: #fff;
  font-weight: 600;
}
.menu-utente button {
  margin-top: 6px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #dbe6f3;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
}
.badge-menu {
  margin-left: auto;
  background: var(--rosso);
  color: #fff;
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 0 7px;
  line-height: 18px;
  font-weight: 700;
}
.ambiente {
  background: var(--arancio);
  color: #fff;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px;
  letter-spacing: 0.08em;
}
.contenuto {
  min-width: 0;
  overflow-x: hidden;
}
.griglia > *, .pila > * {
  min-width: 0;
}
.barra-mobile {
  display: none;
}
.pagina {
  padding: 22px 28px 48px;
  max-width: 1440px;
}
.pagina-testa {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.sottotitolo {
  margin: 4px 0 0;
  color: var(--testo-2);
}
.azioni {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.griglia {
  display: grid;
  gap: 16px;
}
.g2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.g3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.g4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.g-12-8 {
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}
.span2 {
  grid-column: span 2;
}
.pila {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.riga {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.riga-spazio {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.muto {
  color: var(--testo-2);
}
.piccolo {
  font-size: 0.85rem;
}
.forte {
  font-weight: 700;
}
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.nowrap {
  white-space: nowrap;
}

/* ---------- card ---------- */
.card {
  background: var(--carta);
  border: 1px solid var(--bordo);
  border-radius: var(--raggio);
  padding: 16px 18px;
  box-shadow: var(--ombra);
  min-width: 0;
}
.card-testa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.card-evidenza {
  border-left: 4px solid var(--verde);
}
.card + .card {
  margin-top: 0;
}

/* ---------- numeri cruscotto ---------- */
.numeri {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.numero {
  background: var(--carta);
  border: 1px solid var(--bordo);
  border-radius: var(--raggio);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--ombra);
}
.numero-link:hover {
  border-color: var(--blu);
}
.numero-titolo {
  font-size: 0.8rem;
  color: var(--testo-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.numero-valore {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--blu-scuro);
  font-variant-numeric: tabular-nums;
}
.numero-nota {
  font-size: 0.8rem;
  color: var(--testo-2);
}

/* ---------- bottoni ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  min-height: 38px;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primario {
  background: var(--blu);
  color: #fff;
}
.btn-primario:hover:not(:disabled) {
  background: var(--blu-scuro);
}
.btn-verde {
  background: var(--verde);
  color: #fff;
}
.btn-verde:hover:not(:disabled) {
  background: var(--verde-scuro);
}
.btn-secondario {
  background: #fff;
  color: var(--blu-scuro);
  border-color: var(--bordo);
}
.btn-secondario:hover:not(:disabled) {
  border-color: var(--blu);
  color: var(--blu);
}
.btn-pericolo {
  background: #fff;
  color: var(--rosso);
  border-color: #efc3c3;
}
.btn-pericolo:hover:not(:disabled) {
  background: var(--rosso-chiaro);
}
.btn-testo {
  background: none;
  color: var(--blu);
  padding: 4px 6px;
  min-height: 0;
}
.btn-piccolo {
  padding: 4px 10px;
  min-height: 30px;
  font-size: 0.86rem;
}
.btn-largo {
  width: 100%;
}
.btn-grande {
  font-size: 1.05rem;
  padding: 12px 20px;
  min-height: 48px;
}
.btn-x {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--testo-2);
}
.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: gira 0.7s linear infinite;
}
@keyframes gira {
  to {
    transform: rotate(360deg);
  }
}
.link-piccolo {
  background: none;
  border: none;
  color: var(--blu);
  cursor: pointer;
  font-size: 0.86rem;
  padding: 4px 0;
}

/* ---------- form ---------- */
.campo {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.campo-etichetta {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--testo-2);
}
.obbligatorio {
  color: var(--rosso);
}
.campo-aiuto {
  font-size: 0.8rem;
  color: var(--testo-2);
}
.campo-msg-errore {
  font-size: 0.8rem;
  color: var(--rosso);
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
input[type="month"],
input:not([type]),
select,
textarea {
  font: inherit;
  color: inherit;
  border: 1px solid #c7ced8;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  min-height: 38px;
  width: 100%;
}
textarea {
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--blu);
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 95, 168, 0.15);
}
.campo-errore input,
.campo-errore select,
.campo-errore textarea {
  border-color: var(--rosso);
}
.form-griglia {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px 14px;
}
.form-griglia .largo {
  grid-column: 1 / -1;
}
.spunta {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  cursor: pointer;
}
.spunta input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: none;
}
.scelte {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}
.scelta {
  border: 2px solid var(--bordo);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #fff;
  position: relative;
}
.scelta input {
  position: absolute;
  opacity: 0;
}
.scelta-attiva {
  border-color: var(--blu);
  background: var(--blu-chiaro);
}
.scelta:focus-within {
  box-shadow: 0 0 0 3px rgba(31, 95, 168, 0.2);
}
.scelta-titolo {
  font-weight: 700;
  color: var(--blu-scuro);
}
.scelta-testo {
  font-size: 0.84rem;
  color: var(--testo-2);
}
.scelta-disabilitata {
  opacity: 0.5;
  cursor: not-allowed;
}
.filtri {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 14px;
}
.filtri .campo {
  min-width: 150px;
  flex: 1 1 150px;
  max-width: 240px;
}
.filtri .campo.cerca {
  max-width: 320px;
  flex-basis: 240px;
}

/* ---------- badge / avvisi ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-blu {
  background: var(--blu-chiaro);
  color: var(--blu);
  border-color: #c9daf0;
}
.badge-verde {
  background: var(--verde-chiaro);
  color: var(--verde-scuro);
  border-color: #c8e6c6;
}
.badge-giallo {
  background: var(--giallo-chiaro);
  color: #8a6d00;
  border-color: #f0e2a6;
}
.badge-arancio {
  background: var(--arancio-chiaro);
  color: #a95510;
  border-color: #f4d3b1;
}
.badge-rosso {
  background: var(--rosso-chiaro);
  color: var(--rosso);
  border-color: #f2c4c4;
}
.badge-grigio {
  background: var(--grigio-chiaro);
  color: var(--grigio);
  border-color: var(--bordo);
}
.badge-viola {
  background: var(--viola-chiaro);
  color: var(--viola);
  border-color: #dccff2;
}
.pallino {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
}
.avviso {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid;
  align-items: flex-start;
  margin: 0 0 10px;
}
.avviso:last-child {
  margin-bottom: 0;
}
.avviso-icona {
  line-height: 1.3;
}
.avviso-titolo {
  display: block;
  margin-bottom: 1px;
}
.avviso-testo {
  font-size: 0.92rem;
}
.avviso-errore {
  background: var(--rosso-chiaro);
  border-color: #f0c0c0;
  color: #7a1f1f;
}
.avviso-attenzione {
  background: var(--arancio-chiaro);
  border-color: #f2cfa8;
  color: #6b3a0b;
}
.avviso-info {
  background: var(--blu-chiaro);
  border-color: #c9daf0;
  color: #18406f;
}
.avviso-ok {
  background: var(--verde-chiaro);
  border-color: #c8e6c6;
  color: #1d5b1b;
}
.caricamento {
  color: var(--testo-2);
  padding: 14px 0;
  display: flex;
  gap: 8px;
  align-items: center;
}
.vuoto {
  color: var(--testo-2);
  padding: 16px;
  text-align: center;
  background: var(--grigio-chiaro);
  border-radius: 8px;
}

/* ---------- tabelle ---------- */
.tabella-wrap {
  overflow-x: auto;
  margin: 0 -4px;
}
.tabella {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.tabella th {
  text-align: left;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--testo-2);
  font-weight: 600;
  border-bottom: 1px solid var(--bordo);
  padding: 8px;
  white-space: nowrap;
}
.tabella td {
  padding: 9px 8px;
  border-bottom: 1px solid #edf0f4;
  vertical-align: top;
}
.tabella tfoot td {
  font-weight: 700;
  border-top: 2px solid var(--bordo);
  border-bottom: none;
}
.tabella-cliccabile tbody tr {
  cursor: pointer;
}
.tabella-cliccabile tbody tr:hover {
  background: #f6f9fd;
}
.tabella .sub {
  display: block;
  color: var(--testo-2);
  font-size: 0.82rem;
}
.tabella-compatta td {
  padding: 5px 8px;
}

/* ---------- dl ---------- */
.dl {
  margin: 0;
  display: grid;
  gap: 0;
}
.dl-riga {
  display: grid;
  grid-template-columns: minmax(120px, 40%) 1fr;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed #e6eaf0;
}
.dl-riga:last-child {
  border-bottom: none;
}
.dl dt {
  color: var(--testo-2);
  font-size: 0.88rem;
}
.dl dd {
  margin: 0;
  font-weight: 500;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ---------- schede ---------- */
.schede {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 2px solid var(--bordo);
  margin-bottom: 14px;
  overflow-x: auto;
}
.scheda {
  background: none;
  border: none;
  padding: 9px 14px;
  font: inherit;
  font-weight: 600;
  color: var(--testo-2);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
}
.scheda-attiva {
  color: var(--blu);
  border-bottom-color: var(--verde);
}

/* ---------- modale ---------- */
.modale {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.modale-larga {
  width: min(900px, calc(100vw - 24px));
}
.modale::backdrop {
  background: rgba(22, 54, 92, 0.45);
}
.modale-testa {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--bordo);
}
.modale-corpo {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modale-piede {
  padding: 12px 18px;
  border-top: 1px solid var(--bordo);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- toast ---------- */
.toasts {
  position: fixed;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 3000;
  max-width: min(420px, calc(100vw - 32px));
}
.toast {
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  font-weight: 500;
}
.toast-ok {
  background: var(--verde-scuro);
}
.toast-errore {
  background: var(--rosso);
}
.toast-info {
  background: var(--blu-scuro);
}

/* ---------- copiabile (WebCAT) ---------- */
.copiabile {
  display: grid;
  grid-template-columns: 190px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px dashed #e6eaf0;
}
.copiabile-etichetta {
  color: var(--testo-2);
  font-size: 0.88rem;
}
.copiabile-valore {
  background: var(--grigio-chiaro);
  padding: 5px 8px;
  border-radius: 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

/* ---------- timeline ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 14px;
  border-left: 2px solid var(--bordo);
}
.timeline li {
  position: relative;
  padding: 0 0 12px 12px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--blu);
}
.timeline li.evento::before {
  border-color: var(--verde);
}
.timeline .quando {
  font-size: 0.8rem;
  color: var(--testo-2);
}

/* ---------- ricerca cliente ---------- */
.risultati {
  border: 1px solid var(--bordo);
  border-radius: 8px;
  margin-top: 6px;
  max-height: 300px;
  overflow-y: auto;
  background: #fff;
}
.risultato {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px solid #edf0f4;
  background: #fff;
  padding: 9px 12px;
  cursor: pointer;
  font: inherit;
}
.risultato:hover,
.risultato:focus {
  background: var(--blu-chiaro);
}
.risultato strong {
  color: var(--blu-scuro);
}
.selezionato {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  background: var(--verde-chiaro);
  border: 1px solid #c8e6c6;
  border-radius: 8px;
  padding: 10px 12px;
}
.passo {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.passo-n {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blu);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: none;
}
.passo-fatto .passo-n {
  background: var(--verde);
}
.sla-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--blu-scuro);
  color: #fff;
  border-radius: 10px;
  padding: 12px 16px;
}
.sla-box .grande {
  font-size: 1.35rem;
  font-weight: 700;
}
.sla-box .muto {
  color: #b7c8dd;
}
.barra-azioni {
  position: sticky;
  bottom: 0;
  background: rgba(245, 247, 250, 0.96);
  border-top: 1px solid var(--bordo);
  padding: 12px 0;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  backdrop-filter: blur(4px);
  z-index: 5;
}

/* ---------- pianificazione ---------- */
.agenda {
  display: grid;
  gap: 1px;
  background: var(--bordo);
  border: 1px solid var(--bordo);
  border-radius: 8px;
  overflow: hidden;
}
.agenda-cella {
  background: #fff;
  padding: 8px;
  min-height: 70px;
  min-width: 0;
}
.agenda-testa {
  background: var(--grigio-chiaro);
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--blu-scuro);
  padding: 8px;
}
.agenda-oggi {
  background: #f4faf3;
}
.agenda-festivo {
  background: repeating-linear-gradient(45deg, #fafafa, #fafafa 6px, #f1f1f1 6px, #f1f1f1 12px);
}
.appuntamento {
  text-decoration: none;
  border-left: 4px solid var(--blu);
  background: var(--blu-chiaro);
  border-radius: 6px;
  padding: 5px 7px;
  margin-bottom: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: left;
  border-top: none;
  border-right: none;
  border-bottom: none;
  font-family: inherit;
  color: inherit;
}
.appuntamento:hover {
  filter: brightness(0.97);
}
.appuntamento .muto {
  display: block;
  overflow-wrap: anywhere;
}
.appuntamento strong {
  display: block;
  color: var(--blu-scuro);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mappa {
  height: 520px;
  border-radius: 10px;
  border: 1px solid var(--bordo);
  background: #e9edf1;
  z-index: 0;
}
.mappa-piccola {
  height: 300px;
}
.marker-fcm {
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.marker-fcm span {
  transform: rotate(45deg);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
}
.marker-sede {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--blu-scuro);
  border: 2px solid var(--lime);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.legenda {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--testo-2);
  margin-top: 8px;
}
.legenda span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.lista-pianificare {
  max-height: 520px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.voce-pianificare {
  border: 1px solid var(--bordo);
  border-left: 5px solid var(--grigio);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}
.voce-pianificare.attiva {
  border-color: var(--blu);
  box-shadow: 0 0 0 2px rgba(31, 95, 168, 0.2);
}
.tappa {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--bordo);
}
.tappa-n {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blu);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- grafici ---------- */
.grafico {
  width: 100%;
  height: auto;
  display: block;
}
.grafico text {
  font-family: var(--font);
  fill: var(--testo-2);
  font-size: 12px;
}
.grafico .asse {
  stroke: #c7ced8;
}
.grafico .griglia-linea {
  stroke: #edf0f4;
}
.grafico .etichetta-valore {
  fill: var(--testo);
  font-weight: 600;
}

/* ---------- login ---------- */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(circle at 20% 10%, #eaf6e9 0, transparent 40%), radial-gradient(circle at 90% 90%, #e8f0fa 0, transparent 45%), var(--sfondo);
}
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--bordo);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(22, 54, 92, 0.1);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-logo {
  width: 220px;
  height: auto;
  align-self: center;
}
.login-card h1 {
  text-align: center;
  font-size: 1.25rem;
}
.login-card .sottotitolo {
  text-align: center;
  margin-top: -6px;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.elenco-avvisi {
  margin: 4px 0 0;
  padding-left: 18px;
}

/* scelta della password (invito / recupero) */
.password-campo {
  position: relative;
  display: flex;
}
.password-campo input {
  flex: 1;
  padding-right: 92px;
}
.password-vedi {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--grigio-chiaro);
  border: 1px solid var(--bordo);
  border-radius: 6px;
  color: var(--blu-scuro);
  font: inherit;
  font-size: 0.8rem;
  padding: 4px 10px;
  cursor: pointer;
}
.robustezza {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--testo-2);
  margin-top: -4px;
}
.robustezza-barre {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: 132px;
  flex: none;
}
.robustezza-barre span {
  height: 6px;
  border-radius: 3px;
  background: var(--bordo);
}
.robustezza-0 .robustezza-barre span:nth-child(-n + 1),
.robustezza-1 .robustezza-barre span:nth-child(-n + 1) {
  background: var(--rosso);
}
.robustezza-2 .robustezza-barre span:nth-child(-n + 2) {
  background: var(--arancio);
}
.robustezza-3 .robustezza-barre span:nth-child(-n + 3) {
  background: var(--lime);
}
.robustezza-4 .robustezza-barre span {
  background: var(--verde);
}
.robustezza-0 .robustezza-testo,
.robustezza-1 .robustezza-testo {
  color: var(--rosso);
}
.robustezza-4 .robustezza-testo,
.robustezza-3 .robustezza-testo {
  color: var(--verde-scuro);
}
.separatore {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--testo-2);
  font-size: 0.82rem;
  margin: 6px 0;
}
.separatore::before,
.separatore::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--bordo);
}

/* ---------- pagine pubbliche ---------- */
.pubblica {
  min-height: 100vh;
  background: var(--sfondo);
}
.pubblica-testa {
  background: #fff;
  border-bottom: 4px solid;
  border-image: linear-gradient(90deg, var(--blu), var(--verde), var(--lime)) 1;
  padding: 12px 16px;
}
.pubblica-testa .contenitore {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pubblica-testa img {
  height: 46px;
  width: auto;
}
.pubblica-testa a {
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.contenitore {
  max-width: 760px;
  margin: 0 auto;
}
.pubblica main {
  padding: 16px;
}
.pubblica .card {
  margin-bottom: 14px;
}
.documento {
  font-size: 0.96rem;
}
.documento p {
  margin: 0 0 10px;
  white-space: pre-line;
}
.documento .intestazione {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.tariffe {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 14px;
}
.tariffe td {
  padding: 9px 4px;
  border-bottom: 1px solid #edf0f4;
}
.tariffe td.prezzo {
  text-align: right;
  white-space: nowrap;
  font-weight: 700;
  color: var(--blu-scuro);
  font-variant-numeric: tabular-nums;
}
.condizioni {
  background: var(--grigio-chiaro);
  border-radius: 8px;
  padding: 12px 14px;
}
.condizioni ol {
  margin: 6px 0 0;
  padding-left: 22px;
}
.condizioni li {
  margin-bottom: 6px;
}
.firma-box {
  border: 2px dashed #b9c3cf;
  border-radius: 10px;
  background: #fff;
  position: relative;
  touch-action: none;
}
.firma-box canvas {
  display: block;
  width: 100%;
  height: 180px;
  cursor: crosshair;
}
.firma-box .suggerimento {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9aa6b4;
  pointer-events: none;
  font-size: 0.95rem;
}
.slot-lista {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 2px solid var(--bordo);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
  width: 100%;
}
.slot:hover {
  border-color: var(--verde);
}
.slot-attivo {
  border-color: var(--verde);
  background: var(--verde-chiaro);
}
.slot .giorno {
  font-weight: 700;
  color: var(--blu-scuro);
  text-transform: capitalize;
}
.slot .fascia {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--verde-scuro);
  white-space: nowrap;
}
.piede-pubblico {
  text-align: center;
  font-size: 0.8rem;
  color: var(--testo-2);
  padding: 20px 16px 30px;
}

.miniatura {
  display: block;
  padding: 0;
  border: 1px solid var(--bordo);
  border-radius: 8px;
  background: #fff;
  cursor: zoom-in;
  width: 100%;
  overflow: hidden;
}
.miniatura img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: contain;
}
.barra {
  position: relative;
  height: 10px;
  background: var(--grigio-chiaro);
  border-radius: 999px;
  overflow: visible;
  margin: 4px 0;
}
.barra-riempita {
  height: 100%;
  border-radius: 999px;
}
.barra-verde {
  background: var(--verde);
}
.barra-giallo {
  background: #e0b20f;
}
.barra-rosso {
  background: var(--rosso);
}
.barra-soglia {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: var(--blu-scuro);
  opacity: 0.5;
}
.spazio-compatto {
  display: flex;
  gap: 14px;
  min-width: 260px;
}
.spazio-voce {
  flex: 1;
  min-width: 110px;
}

/* ---------- stampa ---------- */
@media print {
  .menu,
  .barra-mobile,
  .azioni,
  .barra-azioni,
  .toasts,
  .no-stampa {
    display: none !important;
  }
  .app {
    display: block;
  }
  .card {
    box-shadow: none;
    break-inside: avoid;
  }
  body {
    background: #fff;
  }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .g4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .g3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .g-12-8 {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }
  .menu {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 270px;
    z-index: 2000;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .menu.aperto {
    transform: none;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.4);
  }
  .barra-mobile {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--blu-scuro);
    color: #fff;
    padding: 8px 12px;
    position: sticky;
    top: 0;
    z-index: 1000;
  }
  .barra-mobile button {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 1.1rem;
  }
  .pagina {
    padding: 16px 16px 40px;
  }
  .g2,
  .g3,
  .g4 {
    grid-template-columns: 1fr;
  }
  .span2 {
    grid-column: auto;
  }
  .copiabile {
    grid-template-columns: 1fr auto;
  }
  .copiabile-etichetta {
    grid-column: 1 / -1;
  }
  .mappa {
    height: 380px;
  }
  .dl-riga {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
