/* Portale prenotazioni voce — grafica "blu clinico", direzione A "istituzionale" (approvata il 2026-10-21):
   menu blu notte, barra del titolo bianca, IBM Plex Sans, angoli stretti, dati densi. Icone del menu: Lucide. */
:root {
  --bg: #F1F3F6; --card: #fff; --text: #172231; --muted: #5B6878; --faint: #8592A2;
  --line: #D8DEE6; --line-soft: #E8ECF1; --line-strong: #C9D3DF; --head-bg: #F5F7FA;
  --primary: #1F4E9A; --primary-dark: #173B75; --primary-soft: #E8EFF9; --primary-tint: #F4F7FC; --today: #F5F9FE;
  --notte: #0E2141; --notte-2: #1A3159;
  --voce-bg: #E3F0FA; --voce-text: #0F3A6E; --voce-line: #9CC2E5; --voce-bar: #3E86C8;
  --danger: #C62828; --danger-soft: #FBECEA; --danger-text: #9A2A1C;
  --ok: #1B6B34; --ok-soft: #E5F3EA; --warn: #8A5300; --warn-soft: #FFF3E0;
  --radius: 6px; --radius-sm: 4px;
  --shadow-lg: 0 12px 32px rgba(16, 35, 58, .10), 0 2px 6px rgba(16, 35, 58, .05);
  --ring: 0 0 0 3px rgba(31, 78, 154, .18);
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; }
p, .lead, .hint { text-wrap: pretty; }

/* layout: menu laterale blu notte fermo a sinistra, contenuto fluido; su telefono il menu si impila sopra */
.layout { display: flex; flex-wrap: wrap; min-height: 100vh; }
nav.side { flex: 0 0 240px; background: var(--notte); padding: 16px 10px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; align-self: flex-start; min-height: 100vh; max-height: 100vh; overflow-y: auto; }
nav.side .brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 18px; margin-bottom: 6px; border-bottom: 1px solid rgba(255, 255, 255, .08); color: #fff; font-weight: 700; font-size: 15px; line-height: 1.2; }
nav.side .brand .marchio { flex: none; width: 34px; height: 34px; display: inline-flex; }
nav.side .brand .marchio svg { width: 34px; height: 34px; }
nav.side .brand .marchio rect { fill: #fff; }
nav.side .brand .marchio path { stroke: var(--notte); }
nav.side .brand .testo { min-width: 0; }
nav.side .brand:hover { text-decoration: none; color: #fff; }
nav.side .brand small { display: block; font-weight: 400; font-size: 12px; color: #8496B3; margin-top: 3px; }
nav.side .gruppo { padding: 14px 12px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #6C7FA0; }
nav.side a.item { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: var(--radius-sm); color: #C3CEDF; font-size: 14px; }
nav.side a.item svg { width: 18px; height: 18px; flex: none; color: #7F92B1; }
nav.side a.item:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
nav.side a.item:hover svg { color: #C3CEDF; }
nav.side a.item.active { background: var(--primary); color: #fff; font-weight: 500; }
nav.side a.item.active svg { color: #fff; }
nav.side .user { margin-top: auto; padding: 14px 8px 2px; border-top: 1px solid rgba(255, 255, 255, .08); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font-size: 13px; color: #C3CEDF; }
nav.side .user .avatar { width: 34px; height: 34px; font-size: 13px; background: var(--notte-2); color: #fff; }
nav.side .user .chi { min-width: 0; }
nav.side .user strong { display: block; color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
nav.side .user .muted { display: block; font-size: 12px; color: #8496B3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
nav.side .user form { margin: 0; }
nav.side .user button.secondary { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .25); }
nav.side .user button.secondary:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: 14px; letter-spacing: .02em; }

/* contenuto: barra del titolo bianca a tutta larghezza, il resto con margini laterali */
main { flex: 999 1 560px; min-width: 0; padding: 0 0 40px; }
main > * { margin-left: 32px; margin-right: 32px; }
main > form { margin-left: 0; margin-right: 0; padding: 0 32px; }
main > form > .pagehead, main > form > .barra-salva { margin-left: -32px; margin-right: -32px; }
main > .flash { margin-top: 18px; }
@media (max-width: 720px) {
  nav.side { position: static; min-height: 0; max-height: none; flex-basis: 100%; padding: 12px; flex-direction: row; flex-wrap: wrap; gap: 2px; }
  nav.side .brand { flex-basis: 100%; padding-bottom: 10px; }
  nav.side .gruppo { display: none; }
  nav.side .user { margin-top: 6px; flex-basis: 100%; padding: 10px 4px 0; }
  main > * { margin-left: 16px; margin-right: 16px; }
  main > form { margin-left: 0; margin-right: 0; padding: 0 16px; }
  main > form > .pagehead, main > form > .barra-salva { margin-left: -16px; margin-right: -16px; }
}

/* titoli e testata di pagina */
h1 { font-size: 20px; font-weight: 600; line-height: 1.25; margin: 0 0 18px; color: #111C2B; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; color: #111C2B; }
h3 { font-size: 14px; font-weight: 600; margin: 22px 0 10px; color: #111C2B; }
.card h2 { margin-top: 0; }
.card h2 + .lead { margin: -6px 0 16px; }
.card > h3 { padding-top: 18px; border-top: 1px solid var(--line-soft); }
.lead, .sottotitolo { font-size: 13.5px; color: var(--muted); }
.lead { margin: 0 0 14px; }
.pagehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin: 0 0 24px; padding: 14px 32px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.pagehead h1 { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pagehead .sottotitolo { margin-top: 2px; font-size: 13px; }
.pagehead .azioni { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pagehead .azioni input, .pagehead .azioni select { width: auto; }
@media (max-width: 720px) { .pagehead { position: static; padding: 14px 16px; } }
.briciole { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.briciole a { color: var(--muted); }
.briciole a:hover { color: var(--primary); }

/* schede, form, bottoni */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.card[id] { scroll-margin-top: 92px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 200px; }
label { display: block; font-size: 13px; font-weight: 600; color: #2B3745; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time],
input[type=datetime-local], input[type=search], input[type=tel], select, textarea {
  width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; font-size: 14px; color: var(--text); background: #fff;
  transition: border-color .12s, box-shadow .12s;
}
input:hover, select:hover, textarea:hover { border-color: #B3BFCD; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: #9AA5B3; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 16px; height: 16px; vertical-align: -3px; margin: 0 6px 0 0; }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: none; box-shadow: var(--ring); }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.field { margin-bottom: 16px; }
.field > label:has(input[type=radio]), .field > label:has(input[type=checkbox]) { font-weight: 500; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; line-height: 1.45; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 7px 14px; border-radius: var(--radius-sm); border: 1px solid var(--primary); background: var(--primary); color: #fff; font: inherit; font-size: 14px; font-weight: 500; line-height: 1.2; cursor: pointer; transition: background .12s, border-color .12s, color .12s; white-space: nowrap; }
button:hover, .btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); text-decoration: none; color: #fff; }
button:disabled { opacity: .6; cursor: default; }
.btn.secondary, button.secondary { background: #fff; color: #23324A; border-color: var(--line-strong); }
.btn.secondary:hover, button.secondary:hover { background: #F3F6FA; border-color: #B3BFCD; color: #13203A; }
.btn.danger, button.danger { background: #fff; color: var(--danger); border-color: #E7B9B3; }
.btn.danger:hover, button.danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn.small, button.small { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn svg, button svg { width: 16px; height: 16px; flex: none; }
@media (pointer: coarse) { button, .btn, input, select { min-height: 44px; } .btn.small, button.small { min-height: 38px; } }

/* tabelle, etichette, avvisi */
.tabella { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; background: var(--head-bg); border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
tr:hover td { background: var(--today); }
tr.selezionata td { background: var(--primary-soft); }
tr.selezionata td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
tr.riga-link { cursor: pointer; }
tr.riga-link:hover td { background: var(--primary-tint); }
.badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 3px; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; line-height: 1.5; background: #E9EFF8; color: #2C4A7A; white-space: nowrap; vertical-align: 1px; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.off { background: #EEF1F5; color: var(--muted); }
.badge.danger { background: var(--danger-soft); color: var(--danger-text); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.flash { padding: 11px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; background: var(--ok-soft); color: #17532A; border: 1px solid #BFE0C9; font-size: 14px; }
.flash.error { background: var(--danger-soft); color: var(--danger-text); border-color: #F0C4BD; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; }
.inline { display: inline; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; }
pre.prompt { white-space: pre-wrap; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; background: var(--notte); color: #E3E9F2; padding: 18px 20px; border-radius: var(--radius); max-height: 70vh; overflow: auto; }
.voce-riga { display: flex; gap: 8px; align-items: stretch; } .voce-riga select { flex: 1; min-width: 0; }
.row > .field:has(.voce-riga) { flex: 1.6; min-width: 280px; }
hr { border: 0; border-top: 1px solid var(--line-soft); margin: 20px 0; }

/* contatori: una striscia unica di numeri */
.kpi-riga { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.kpi { padding: 14px 20px; border-right: 1px solid var(--line-soft); min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; line-height: 1.3; }
.kpi b { font-size: 26px; font-weight: 500; line-height: 1.15; font-variant-numeric: tabular-nums; color: #111C2B; }
.card.pannello .kpi-riga { margin: 0; border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; }

/* agenda */
.agenda-scroll { overflow-x: auto; }
.agenda { display: grid; grid-template-columns: 60px repeat(var(--giorni, 5), minmax(0, 1fr)); min-width: 760px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.agenda .head { background: #fff; padding: 10px 8px 9px; font-size: 13px; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
.agenda .head strong { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: 1px; }
.agenda .head span { display: block; font-size: 16px; font-weight: 600; color: var(--text); }
.agenda .head.oggi { box-shadow: inset 0 -3px 0 var(--primary); }
.agenda .head.oggi strong, .agenda .head.oggi span { color: var(--primary); }
.agenda .col { position: relative; border-left: 1px solid var(--line-soft); height: var(--altezza);
  background:
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--ora-px) / 2 - 1px), #F3F5F8 calc(var(--ora-px) / 2 - 1px), #F3F5F8 calc(var(--ora-px) / 2), transparent calc(var(--ora-px) / 2), transparent calc(var(--ora-px) - 1px), var(--line-soft) calc(var(--ora-px) - 1px), var(--line-soft) var(--ora-px)); }
.agenda .col.oggi { background-color: var(--today); }
.agenda .col.chiuso { background: repeating-linear-gradient(45deg, #F2F4F7 0 7px, #fff 7px 14px); }
.agenda .ore { position: relative; height: var(--altezza); }
.agenda .ore span { position: absolute; right: 10px; font-size: 11.5px; color: var(--faint); transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.agenda .ore span:first-child { transform: none; }
.agenda .app { position: absolute; left: 4px; right: 4px; border-radius: 3px; padding: 4px 8px; font-size: 12px; line-height: 1.3; overflow: hidden; color: #fff; background: var(--primary); border: 1px solid var(--primary-dark); z-index: 1; }
.agenda .app strong { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda .app.voce { background: #fff; color: var(--voce-text); border-color: var(--voce-line); box-shadow: inset 3px 0 0 var(--voce-bar); padding-left: 10px; }
.agenda .app.annullato { background: #F1F3F6; color: var(--muted); text-decoration: line-through; border-color: var(--line); box-shadow: none; }
.agenda .app small { display: block; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda .app:hover { filter: brightness(1.05); text-decoration: none; z-index: 2; }
.agenda .libero { position: absolute; left: 4px; right: 4px; border-radius: 3px; }
.agenda .libero:hover { background: rgba(31, 78, 154, .08); box-shadow: inset 0 0 0 1px rgba(31, 78, 154, .25); }
.agenda .adesso { position: absolute; left: 0; right: 0; border-top: 2px solid var(--danger); z-index: 3; pointer-events: none; }
.agenda .adesso::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.legenda { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 14px; }
.legenda span { display: inline-flex; align-items: center; gap: 7px; }
.legenda i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; }
.legenda i.web { background: var(--primary); }
.legenda i.voce { background: #fff; border: 1px solid var(--voce-line); box-shadow: inset 3px 0 0 var(--voce-bar); }
.legenda i.ora { height: 2px; background: var(--danger); border-radius: 0; }
.legenda .nota { margin-left: auto; }

/* elenco + dettaglio (chiamate, aziende, costi) */
.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split .elenco { flex: 3 1 520px; min-width: 0; }
.split .dettaglio { flex: 2 1 360px; min-width: 0; }
@media (min-width: 900px) { .split .dettaglio.stretto { flex: 1 1 320px; max-width: 400px; } }
@media (min-width: 1100px) { .split > .dettaglio.card { position: sticky; top: 92px; max-height: calc(100vh - 112px); overflow-y: auto; } }
.card.pannello { padding: 0; overflow: hidden; }
.card.pannello > h2 { padding: 16px 20px 0; }
.card.pannello .testata { padding: 16px 20px; background: #FAFBFC; border-bottom: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.card.pannello .testata .chi { display: flex; align-items: center; gap: 12px; min-width: 0; }
.card.pannello .testata strong { font-size: 15px; font-weight: 600; display: block; color: #111C2B; }
.card.pannello .fascia { padding: 12px 20px; background: var(--primary-tint); border-bottom: 1px solid var(--line-soft); font-size: 13.5px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 18px; }
.card.pannello .fascia.tecnico { background: #FAFBFC; display: block; }
.fascia.tecnico dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 13px; }
.fascia.tecnico dt { color: var(--muted); }
.fascia.tecnico dd { margin: 0; min-width: 0; font-variant-numeric: tabular-nums; }
.fascia.tecnico .titolo { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.card.pannello .pie { padding: 11px 20px; border-top: 1px solid var(--line-soft); background: #FAFBFC; font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.card.pannello .pie.admin { background: var(--warn-soft); color: #6B4A12; border-top-color: #F3D9A8; }
.card.pannello .tabella table td:first-child a { font-weight: 600; }
.card.pannello .tabella th:first-child, .card.pannello .tabella td:first-child { padding-left: 20px; }
.card.pannello .tabella th:last-child, .card.pannello .tabella td:last-child { padding-right: 20px; }
.trascrizione { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.trascrizione .turno { max-width: 86%; padding: 8px 12px 9px; border-radius: 6px; font-size: 14px; line-height: 1.5; }
.trascrizione .turno .ruolo { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 2px; }
.trascrizione .turno.assistant { background: #EDF2F9; color: var(--text); border-bottom-left-radius: 2px; align-self: flex-start; }
.trascrizione .turno.assistant .ruolo { color: var(--primary); }
.trascrizione .turno.user { background: #fff; border: 1px solid var(--line); border-bottom-right-radius: 2px; align-self: flex-end; }
.trascrizione .tool { align-self: center; font-size: 12px; color: var(--muted); padding: 2px 10px; text-align: center; background: #F1F4F8; border-radius: 3px; font-family: var(--mono); max-width: 100%; overflow-wrap: anywhere; }

/* guida centralino: passi numerati su una linea verticale */
.guida section { position: relative; padding: 18px 0 8px 46px; }
.guida section::before { content: ""; position: absolute; left: 14px; top: 50px; bottom: -14px; width: 2px; background: var(--line-soft); }
.guida section:last-of-type::before { display: none; }
.guida h3 { margin: 2px 0 10px; padding: 0; border: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.guida .passo { position: absolute; left: 0; top: 16px; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 14px; font-weight: 600; flex: none; box-shadow: 0 0 0 4px #fff; }
.guida ul, .guida ol { margin: 6px 0 10px; padding-left: 20px; }
.guida li { margin: 5px 0; }
.guida li::marker { color: var(--faint); }
.guida p { margin: 6px 0 10px; }
.guida .tabella { border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 8px 0 12px; }
code { font-family: var(--mono); font-size: 12.5px; background: #F1F4F8; border: 1px solid #E1E6EE; border-radius: 3px; padding: 1px 5px; color: #13203A; white-space: nowrap; }
table.dati th { width: 300px; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--muted); font-weight: 400; background: transparent; border-bottom-color: var(--line-soft); white-space: normal; }
table.dati tr:hover td { background: transparent; }
.schede { display: inline-flex; gap: 2px; padding: 3px; background: #E6EAF0; border-radius: 6px; }
.schede .btn, .schede .btn.secondary { min-height: 30px; padding: 5px 14px; border: 0; background: transparent; color: var(--muted); }
.schede .btn:hover { background: rgba(255, 255, 255, .6); color: var(--text); }
.schede .btn:not(.secondary) { background: #fff; color: var(--primary); box-shadow: 0 1px 2px rgba(16, 35, 58, .12); }

/* riquadri di aiuto "?" */
details.aiuto { margin: 4px 0 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--primary-tint); }
details.aiuto[open] { background: #fff; }
details.aiuto summary { cursor: pointer; padding: 10px 14px; font-weight: 600; color: var(--primary); list-style: none; display: flex; align-items: center; gap: 10px; }
details.aiuto summary::-webkit-details-marker { display: none; }
details.aiuto summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
details.aiuto[open] summary::after { transform: rotate(-135deg); }
details.aiuto .q { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 13px; font-weight: 700; flex: none; }
details.aiuto ol { margin: 0; padding: 0 18px 12px 40px; font-size: 14px; }
details.aiuto li { margin: 7px 0; }
details.aiuto p { padding: 0 14px 12px; margin: 0; }

.q-mini { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; min-height: 0; padding: 0; margin-left: 4px; border-radius: 50%; border: 1px solid var(--line-strong); background: #fff; color: var(--primary); font-size: 11px; font-weight: 700; line-height: 1; vertical-align: 1px; cursor: pointer; }
.q-mini:hover, .q-mini[aria-expanded="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.aiuto-campo { margin: 6px 0 8px; padding: 9px 12px; background: var(--primary-tint); border: 1px solid #D6E2F2; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.5; color: var(--text); font-weight: 400; }

/* impostazioni a due colonne: titolo e spiegazione a sinistra, campi a destra */
.card.sezione { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 36px; padding: 22px 24px; }
.card.sezione > .intro h2 { margin-bottom: 6px; }
.card.sezione > .intro .lead { margin: 0 0 12px; font-size: 13px; }
@media (min-width: 1080px) { .card.sezione { grid-template-columns: 250px minmax(0, 1fr); } .card.sezione > .intro .lead { margin: 0; } }
.barra-salva { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 6px; margin-bottom: -40px; padding: 12px 32px; background: rgba(255, 255, 255, .95); backdrop-filter: blur(6px); border-top: 1px solid var(--line); }
.barra-salva .muted { margin-right: auto; font-size: 13px; }
@media (max-width: 720px) { .barra-salva { padding: 12px 16px; } }

/* accesso */
body.pagina-login { background: radial-gradient(1200px 520px at 50% -10%, #DCE6F4 0, rgba(220, 230, 244, 0) 70%), var(--bg); min-height: 100vh; }
main.login { display: block; max-width: 420px; margin: 0 auto; padding: 9vh 16px 40px; }
main.login > * { margin-left: 0; margin-right: 0; }
.login .marchio { text-align: center; margin-bottom: 22px; }
.login .marchio h1 { margin: 0; font-size: 24px; }
.login .marchio p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.login .marchio .croce { width: 52px; height: 52px; margin-bottom: 12px; }
.login .marchio .croce rect { fill: var(--notte); }
.login .marchio .ecg { display: block; width: 100%; max-width: 320px; height: 40px; margin: 14px auto 0; overflow: visible; }
.login .marchio .ecg path { opacity: .5; }
.login .card { padding: 26px 28px; box-shadow: var(--shadow-lg); border-color: #E3E8EF; }
.login button { width: 100%; min-height: 42px; font-size: 15px; }
.login .profilo { border: 0; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 8px; }
.login .profilo legend { font-size: 13px; font-weight: 600; color: #2B3745; margin-bottom: 8px; padding: 0; }
.login .profilo label { display: grid; grid-template-columns: 16px 1fr; align-items: center; column-gap: 10px; margin: 0; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; transition: border-color .12s, background .12s; }
.login .profilo label:hover { border-color: #A9B8CB; }
.login .profilo label:has(input:checked) { border-color: var(--primary); background: var(--primary-tint); box-shadow: inset 0 0 0 1px var(--primary); }
.login .profilo input { margin: 0; }
.login .profilo small { grid-column: 2; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 14px; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; }

/* --- amministratore del servizio: aziende --------------------------------------------- */
.banner-admin { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 7px 32px; background: var(--warn-soft); color: #6B4A12; border-bottom: 1px solid #F3D9A8; font-size: 13px; }
main > .banner-admin { margin: 0; }
.banner-admin form { margin: 0; }
@media (max-width: 720px) { .banner-admin { padding: 8px 16px; } }
.credenziali { border-color: #BFD0EA; background: var(--primary-tint); box-shadow: 0 0 0 3px rgba(31, 78, 154, .06); }
.credenziali dl.cred { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 24px; margin: 0; }
.credenziali dl.cred div { margin: 0; }
.credenziali dt { font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.credenziali dd { margin: 3px 0 0; font-size: 15px; word-break: break-all; }
.credenziali code { font-size: 14px; white-space: normal; }
.credenziali code.password { font-size: 22px; font-weight: 600; letter-spacing: .06em; color: var(--primary-dark); user-select: all; background: #fff; padding: 3px 10px; }
table tr.sospesa td { color: var(--muted); }
table tr.sospesa td a strong { color: var(--muted); }
.lista-ip { list-style: none; padding: 0; margin: 6px 0 0; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.lista-ip li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
.lista-ip li form { margin-left: auto; }
.lista-ip li:last-child { border-bottom: 0; }
.sep { display: flex; align-items: center; gap: 10px; margin: 22px 0 14px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.sep::after { content: ""; flex: 1; border-top: 1px solid var(--line-soft); }
.elenco-pile { display: flex; flex-direction: column; gap: 18px; }
.elenco-pile > .card { margin: 0; }

/* Linea DF: numeri autorizzati con "tutti i dati" o un solo cliente del gestionale (azienda.html) */
.numeri-mcp table { margin-bottom: 10px; }
.numeri-mcp td { vertical-align: top; }
.numeri-mcp input.numero { width: 150px; }
.cliente-mcp { position: relative; min-width: 260px; }
.cliente-mcp .scelto { margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cliente-mcp .suggerimenti { position: absolute; z-index: 20; left: 0; right: 0; margin: 2px 0 0; padding: 4px 0; list-style: none;
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: 0 6px 18px rgba(15, 30, 55, .12);
  max-height: 240px; overflow-y: auto; }
.cliente-mcp .suggerimenti li { padding: 7px 12px; cursor: pointer; font-size: 14px; }
.cliente-mcp .suggerimenti li:hover { background: #F3F6FA; }
.cliente-mcp .suggerimenti li.muted { cursor: default; }
.cliente-mcp .cred-mcp { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; font-weight: 400; }
