/* Gestionale Leti's Mind — tema Leti's Mind + tema Splendidamente (solo nella sua scheda) */
/* Font del brand splendidamente: Poppins (titoli e cifre) + Open Sauce Sans (testi) — ospitati sul sito */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/poppins-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: italic; font-weight: 400; font-display: swap; src: url('fonts/poppins-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/poppins-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/poppins-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Open Sauce Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/open-sauce-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Open Sauce Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/open-sauce-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Open Sauce Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/open-sauce-sans-latin-600-normal.woff2') format('woff2'); }

/* Hanken Grotesk: testi del brand Leti's Mind (e titoli finché non arriva Helotypo) */
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 300; font-display: swap; src: url('fonts/hanken-grotesk-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/hanken-grotesk-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/hanken-grotesk-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/hanken-grotesk-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/hanken-grotesk-latin-800-normal.woff2') format('woff2'); }

/* ===== Tema Leti's Mind (brand identity nov 2026) ===== */
:root {
  --prugna: #8A003C;          /* bordeaux principale */
  --prugna-scuro: #6E0030;
  --prugna-soft: #A25277;
  --vino: #990042;
  --magenta: #8A003C;         /* pulsanti e link: bordeaux pieno */
  --btn-hover: #6E0030;
  --btn-ombra: rgba(138,0,60,.45);
  --punto: #E8336A;           /* fucsia: punto dei titoli e piccoli tocchi */
  --rosa: #FBE3EB;
  --beige: #F1E1D8;
  --panna: #FFFAE6;
  --lampone: #B51E57;
  --crema: #F9F3EE;
  --carta: #FFFFFF;
  --linea: #EEDFD8;
  --linea-2: #F5ECE7;
  --testo: #5C0A2E;
  --muted: #9C7F8A;
  --entrata: #8A003C;
  --entrata-bg: #FBE3EB;
  --uscita: #8A6F66;
  --uscita-bg: #F1E1D8;
  --terra: #2C5A52; --acqua: #4AA6B5; --aria: #D9A9C9; --fuoco: #8E2346;
  --titoli: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --display: 'Helotypo', 'Hanken Grotesk', system-ui, sans-serif;
  --peso-display: 800;
  --sans: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --r: 22px;
  --ombra: 0 1px 2px rgba(138,0,60,.04), 0 12px 30px -18px rgba(138,0,60,.22);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; }
body {
  margin: 0; color: var(--testo); font: 400 15px/1.55 var(--sans);
  background-color: var(--crema);
}
/* la grana carta resta solo nella sezione Splendidamente */
body.tema-spl {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.38 0 0 0 0 0.11 0 0 0 0 0.25 0 0 0 0.055 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
body { -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--magenta); }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 500; }
h1 { font-family: var(--display); font-weight: var(--peso-display); font-size: 2.3rem; color: var(--vino, var(--prugna)); letter-spacing: -.04em; line-height: 1.05; }
h2 { font-family: var(--display); font-weight: var(--peso-display); font-size: 1.2rem; color: var(--vino, var(--prugna)); letter-spacing: -.025em; }
h3 { font-size: .72rem; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: 12px; }
.titolo { font-family: var(--titoli); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.center { text-align: center; }
.eyebrow { margin: 0 0 6px; font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--prugna-soft); }

/* ---------- Header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(247,241,232,.9); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 14px 20px 6px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.wordmark { font-family: var(--titoli); font-weight: 600; font-size: 1.55rem; letter-spacing: -.03em; color: var(--prugna); line-height: 1; }
.brand-sub { padding-left: 16px; border-left: 1px solid var(--linea); font-size: .66rem; line-height: 1.35; letter-spacing: .14em; text-transform: uppercase; color: var(--prugna-soft); }
.brand-sub em { font-family: var(--titoli); font-style: normal; font-weight: 500; font-size: .82rem; letter-spacing: 0; text-transform: none; color: var(--prugna); }
.account { text-decoration: none; border-radius: 50%; }
.account.on .avatar, .account:hover .avatar { background: var(--prugna); color: #fff; border-color: var(--prugna); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--carta); border: 1px solid var(--linea); color: var(--prugna); display: grid; place-items: center; font-family: var(--titoli); font-weight: 600; font-size: .85rem; flex: none; }
.avatar-lg { width: 44px; height: 44px; font-size: .9rem; background: var(--crema); }
.schede { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.schede::-webkit-scrollbar { display: none; }
.schede-in { max-width: 1120px; margin: 0 auto; padding: 4px 20px 10px; display: flex; gap: 4px; }
.schede a { font-family: var(--titoli); color: var(--prugna); text-decoration: none; padding: 8px 15px; border-radius: 999px; font-size: .86rem; white-space: nowrap; transition: background .15s; }
.schede a:hover { background: rgba(97,29,65,.06); }
.schede a.on { background: var(--prugna); color: #fff; }
.schede a[href*="splendidamente"] { margin-left: auto; }
.elementi { display: grid; grid-template-columns: repeat(4, 1fr); height: 3px; }
.elementi i { display: block; }
.terra { background: var(--terra); } .acqua { background: var(--acqua); } .aria { background: var(--aria); } .fuoco { background: var(--fuoco); }

main { width: 100%; max-width: 1120px; margin: 0 auto; padding: 34px 20px 60px; flex: 1; }

/* ---------- Footer ---------- */
.piede { text-align: center; padding: 26px 20px 34px; color: var(--prugna-soft); font-size: .78rem; letter-spacing: .04em; }
.piede em { font-family: var(--titoli); font-style: italic; color: var(--prugna); }

/* ---------- Card ---------- */
.card { background: var(--carta); border: 1px solid var(--linea); border-radius: var(--r); padding: 24px; margin: 0 0 20px; box-shadow: var(--ombra); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.count { font-size: .78rem; color: var(--muted); background: var(--crema); border-radius: 999px; padding: 2px 10px; }
.form-card { max-width: 640px; margin: 0 auto; padding: 28px; }
.form-card h1 { margin-bottom: 20px; }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; font-size: .82rem; letter-spacing: .04em; color: var(--prugna-soft); }
.back:hover { color: var(--magenta); }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--magenta); color: #fff; border: 0; border-radius: 999px;
  padding: 10px 20px; font: 500 .9rem var(--titoli); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .12s, box-shadow .15s, background .15s;
  box-shadow: 0 6px 16px -8px var(--btn-ombra);
}
.btn:hover { background: var(--btn-hover); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-big { padding: 13px 26px; font-size: .95rem; }
.btn-full { width: 100%; }
.btn-small { padding: 6px 14px; font-size: .78rem; box-shadow: none; }
.btn-dark { background: var(--prugna); box-shadow: none; }
.btn-dark:hover { background: var(--prugna-scuro); }
.btn-ghost { background: transparent; color: var(--prugna); box-shadow: inset 0 0 0 1px var(--linea); }
.btn-ghost:hover { background: var(--crema); }
.btn-danger { background: transparent; color: var(--uscita); box-shadow: inset 0 0 0 1px #EBC6D1; }
.btn-danger:hover { background: var(--uscita-bg); }
.plus { font-size: 1.2em; line-height: 0; font-weight: 400; }

/* ---------- Form ---------- */
label { display: block; margin: 0 0 16px; font-size: .74rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--prugna-soft); }
input, select, textarea {
  display: block; width: 100%; min-width: 0; max-width: 100%; margin-top: 7px; padding: 12px 14px;
  font: 400 .95rem var(--sans); letter-spacing: 0; text-transform: none; color: var(--testo);
  background: #fff; border: 1px solid var(--linea); border-radius: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #BBA9B3; }
input:focus, select:focus, textarea:focus { border-color: var(--prugna-soft); box-shadow: 0 0 0 4px rgba(97,29,65,.07); }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23611D41' stroke-width='1.5'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; }
input[type=date] { -webkit-appearance: none; appearance: none; min-height: 47px; }
input[type=file] { padding: 10px; font-size: .85rem; background: #fff; }
input[type=file]::file-selector-button { font: 500 .8rem var(--sans); border: 0; border-radius: 999px; padding: 7px 14px; margin-right: 10px; background: var(--prugna); color: #fff; cursor: pointer; }
.importo-input { font-family: var(--titoli); font-weight: 600; font-size: 1.35rem; padding: 9px 14px; color: var(--prugna); }
label.check { display: flex; align-items: center; gap: 10px; font-size: .88rem; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--testo); }
label.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--prugna); }
fieldset { border: 0; padding: 0; margin: 0 0 12px; }
legend { font-family: var(--titoli); font-weight: 600; font-size: 1.05rem; color: var(--prugna); margin-bottom: 10px; }
.grid2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; }
.grid2 > * { min-width: 0; }
.azioni { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.facolt { font-weight: 400; text-transform: none; letter-spacing: 0; color: #B3A1AB; }
.ricevuta-box { border: 1px dashed #DCC9BA; border-radius: 16px; padding: 16px; margin-bottom: 18px; background: rgba(247,241,232,.6); }
.ricevuta-box .lbl { display: block; font-size: .74rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--prugna-soft); margin-bottom: 8px; }
.ricevuta-box p { margin: 4px 0 8px; }
.ricevuta-box a { font-weight: 500; }
.meta { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--linea-2); }
.elimina { margin-top: 12px; }

/* switch entrata/uscita */
.switch { display: grid; grid-template-columns: 1fr 1fr; background: var(--crema); border: 1px solid var(--linea); border-radius: 999px; padding: 4px; margin-bottom: 22px; }
.switch label { margin: 0; position: relative; letter-spacing: 0; text-transform: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; margin: 0; padding: 0; left: 0; top: 0; }
.switch span { display: block; text-align: center; padding: 10px; border-radius: 999px; cursor: pointer; font-size: .92rem; font-weight: 500; color: var(--muted); transition: all .15s; }
.switch input:checked + span { background: var(--uscita); color: #fff; box-shadow: 0 6px 14px -8px rgba(160,40,79,.7); }
.is-entrata .switch input:checked + span { background: var(--entrata); box-shadow: 0 6px 14px -8px rgba(47,107,97,.7); }

/* messaggi */
.flash { padding: 12px 16px; border-radius: 14px; margin: 0 0 20px; background: var(--entrata-bg); color: var(--entrata); font-weight: 500; font-size: .9rem; border: 1px solid #CBE0D9; }
.flash-err { background: var(--uscita-bg); color: var(--uscita); border-color: #EFCAD5; }

/* ---------- Movimenti ---------- */
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 24px; }

.kpi { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.kpi-box { background: var(--carta); border: 1px solid var(--linea); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--ombra); display: flex; flex-direction: column; justify-content: space-between; min-height: 118px; }
.kpi-lbl { display: flex; align-items: center; gap: 8px; font-size: .7rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; }
.kpi-box b { font-family: var(--titoli); font-weight: 600; font-size: 1.7rem; letter-spacing: -.02em; margin-top: 10px; }
.kpi-note { font-size: .78rem; margin-top: 4px; }
.kpi-box.saldo {
  position: relative; overflow: hidden; border: 0; color: #fff;
  background: radial-gradient(120% 140% at 100% 100%, #7E2A57 0%, var(--prugna) 45%, var(--prugna-scuro) 100%);
  box-shadow: 0 18px 36px -18px rgba(97,29,65,.65);
}
.kpi-box.saldo::after {
  content: ''; position: absolute; right: -18px; bottom: -26px; width: 210px; height: 120px;
  background: url("img/marchio-bianco.png") no-repeat right bottom / contain; opacity: .08; pointer-events: none;
}
.kpi-box.saldo .kpi-lbl { color: rgba(255,255,255,.65); }
.kpi-box.saldo b { color: #fff; font-size: 2.2rem; }
.kpi-box.saldo .kpi-note { color: rgba(255,255,255,.6); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-entrata { background: var(--entrata); } .dot-uscita { background: var(--uscita); }
.pos { color: var(--entrata); }
.neg { color: var(--uscita); }

.filtri { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 20px; }
.filtri select, .filtri input { width: auto; flex: 1 1 150px; margin: 0; padding: 10px 14px; font-size: .86rem; background-color: var(--carta); }
.filtri select { padding-right: 34px; }
.link-export { margin-left: auto; font-size: .84rem; font-weight: 500; text-decoration: none; color: var(--prugna); padding: 8px 4px; border-bottom: 1px solid var(--linea); }
.link-export:hover { color: var(--magenta); border-color: var(--magenta); }

.lista { display: flex; flex-direction: column; }
.mese-sep { font-family: var(--titoli); font-weight: 500; color: var(--prugna-soft); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; padding: 20px 4px 8px; }
.mese-sep:first-child { padding-top: 0; }
.riga {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 16px; align-items: center;
  padding: 12px 10px; margin: 0 -10px; border-radius: 14px; text-decoration: none; color: inherit; transition: background .12s;
}
.riga + .riga { box-shadow: 0 -1px 0 var(--linea-2); }
.riga:hover { background: var(--crema); box-shadow: none; }
.riga:hover + .riga { box-shadow: none; }
.r-data { width: 52px; height: 52px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; background: var(--uscita-bg); color: var(--uscita); }
.r-data.entrata { background: var(--entrata-bg); color: var(--entrata); }
.r-data b { font-family: var(--titoli); font-size: 1.15rem; font-weight: 600; }
.r-data small { font-size: .62rem; text-transform: uppercase; letter-spacing: .12em; margin-top: 3px; }
.r-desc { min-width: 0; }
.r-desc b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-desc small { color: var(--muted); font-size: .8rem; }
.clip { color: var(--prugna); font-weight: 500; }
.clip::before { content: '◦ '; color: var(--magenta); }
.r-imp { font-family: var(--titoli); font-weight: 600; white-space: nowrap; font-size: .95rem; }

.empty { text-align: center; padding: 30px 10px; }
.empty .titolo { font-size: 1.2rem; color: var(--prugna); margin: 0 0 4px; }
.empty .muted { margin: 0; }

.percat { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; }
.pc-row { margin-bottom: 14px; }
.pc-top { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; }
.pc-top em { font-style: normal; font-size: .72rem; color: var(--muted); margin-left: 4px; }
.pc-top b { font-weight: 500; white-space: nowrap; }
.pc-bar { height: 6px; border-radius: 999px; background: var(--linea-2); margin-top: 6px; overflow: hidden; }
.pc-bar i { display: block; height: 100%; border-radius: 999px; background: var(--uscita); }
.pc-bar.entrata i { background: var(--entrata); }

/* ---------- Categorie e utenti ---------- */
.intro { margin: 8px 0 24px; max-width: 560px; }
.cat-list { display: flex; flex-direction: column; }
.cat-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; }
.cat-list .cat-row + .cat-row { border-top: 1px solid var(--linea-2); }
.cat-row input, .cat-row select { width: auto; margin: 0; padding: 9px 14px; }
.cat-row input[name=nome] { flex: 1 1 220px; }
.cat-row > .muted.small { min-width: 125px; text-align: right; }
.cat-row input[name=username], .cat-row input[type=password] { flex: 1 1 160px; }
.cat-row.nuova select { flex: 0 0 130px; }
.user-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 0; }
.user-row + .user-row { border-top: 1px solid var(--linea-2); }
.user-who { display: flex; align-items: center; gap: 12px; }
.user-who .avatar { width: 40px; height: 40px; font-size: 1.15rem; background: var(--crema); }
form.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline input { width: 180px; margin: 0; padding: 8px 14px; }

/* ---------- Login / installazione ---------- */
.auth-page main { display: flex; align-items: center; justify-content: center; padding-top: 48px; }
.auth { width: 100%; max-width: 420px; text-align: center; }
.auth-logo { width: 240px; height: auto; margin: 0 auto 18px; display: block; }
.elementi-mini { width: 120px; height: 3px; margin: 0 auto 26px; border-radius: 3px; overflow: hidden; }
.auth-card { text-align: left; padding: 30px; }
.auth-card h1 { font-size: 1.8rem; margin-bottom: 4px; }
.auth-card > .muted { margin: 0 0 22px; }
.auth-card .btn-full { margin-top: 6px; }

/* pulsante + fisso (telefono) */
.fab { display: none; }

@media (max-width: 760px) {
  .brand-sub { display: none; }
  .kpi { grid-template-columns: 1fr 1fr; }
  .kpi-box.saldo { grid-column: 1 / -1; }
  .percat { grid-template-columns: 1fr; gap: 10px; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  h1 { font-size: 1.75rem; }
  .top-in { padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
  .brand img { height: 38px; }
  nav { width: 100%; justify-content: space-between; }
  nav a { padding: 7px 12px; font-size: .82rem; }
  nav a.esci { margin-left: 0; }
  .esci-txt { display: none; }
  main { padding: 22px 14px 110px; }
  .head-row { margin-bottom: 18px; }
  .head-row .btn { display: none; }
  .kpi { gap: 10px; }
  .kpi-box { padding: 16px; min-height: 0; }
  .kpi-box b { font-size: 1.35rem; }
  .kpi-box.saldo b { font-size: 1.9rem; }
  .card { padding: 18px; }
  .form-card { padding: 20px; }
  .filtri select { flex: 1 1 calc(50% - 8px); }
  .filtri input { flex: 1 1 100%; }
  .link-export { margin-left: 0; }
  .riga { grid-template-columns: 46px 1fr; gap: 4px 12px; }
  .r-data { width: 46px; height: 46px; grid-row: span 2; }
  .r-imp { grid-column: 2; font-size: .92rem; }
  .cat-row > .muted.small { min-width: 0; text-align: left; flex: 1 1 100%; order: 3; }
  .fab {
    display: flex; position: fixed; right: 18px; bottom: calc(22px + env(safe-area-inset-bottom)); width: 60px; height: 60px; border-radius: 50%;
    background: var(--magenta); color: #fff; font-size: 2rem; font-weight: 300; line-height: 1; align-items: center; justify-content: center;
    text-decoration: none; box-shadow: 0 12px 26px -8px var(--btn-ombra); z-index: 30;
  }
}

/* cifre allineate */
.kpi-box b, .r-data b, .importo-input { font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
.r-imp, .pc-top b { font-variant-numeric: tabular-nums; }
.btn-salva.modificato { background: var(--magenta); color: #fff; box-shadow: none; }
.link-elimina { background: none; border: 0; padding: 6px 4px; font: 400 .78rem var(--sans); color: var(--muted); cursor: pointer; text-decoration: underline; text-decoration-color: var(--linea); text-underline-offset: 3px; }
.link-elimina:hover { color: var(--uscita); text-decoration-color: currentColor; }
@media (max-width: 640px) { .brand img { height: 42px; } }

/* ======================= v5 · Leti's Mind ======================= */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.logo-sezione { height: 44px; width: auto; display: block; margin-bottom: 8px; }
.grid-2col { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; align-items: start; }
.grid-2col > .card, .grid-2col > div > .card { margin-bottom: 20px; }
.span-2 { grid-column: 1 / -1; margin-top: -6px; margin-bottom: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.grid3 > * { min-width: 0; }
.kpi-4 { grid-template-columns: 1.3fr 1fr 1fr 1fr; }
.kpi-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-box b small { font-size: .55em; color: var(--muted); font-weight: 500; margin-left: 2px; }
.kpi-box.saldo b small { color: rgba(255,255,255,.6); }
.kpi-note a { color: inherit; }
.avviso { background: #FFF6E6; border: 1px solid #F1DDB6; color: #7A5418; border-radius: 14px; padding: 12px 16px; font-size: .88rem; margin: 0 0 18px; }
.avviso a { color: inherit; font-weight: 600; }
.tag-auto { color: var(--prugna-soft); font-weight: 500; }
fieldset[disabled] { opacity: .6; }

/* sotto-schede e navigazione mesi */
.sotto-schede { display: flex; gap: 6px; flex-wrap: nowrap; scrollbar-width: none; margin: 0 0 18px; padding: 4px; background: var(--carta); border: 1px solid var(--linea); border-radius: 999px; width: fit-content; max-width: 100%; overflow-x: auto; }
.sotto-schede a { font-family: var(--titoli); text-decoration: none; color: var(--prugna-soft); font-size: .85rem; padding: 8px 16px; border-radius: 999px; white-space: nowrap; }
.sotto-schede a.on { background: var(--crema); color: var(--prugna); font-weight: 500; box-shadow: inset 0 0 0 1px var(--linea); }
.nav-mese { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 16px; background: var(--carta); border: 1px solid var(--linea); border-radius: 999px; padding: 4px; }
.nav-mese a { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; text-decoration: none; color: var(--prugna); font-size: 1.2rem; }
.nav-mese a:hover { background: var(--crema); }
.nav-mese b { font-family: var(--titoli); font-weight: 600; color: var(--prugna); min-width: 150px; text-align: center; }
.nav-anno { margin: 0; } .nav-anno b { min-width: 60px; }
.nav-mese.mini { margin: 0; padding: 2px; } .nav-mese.mini a { width: 28px; height: 28px; }
.chip { display: inline-block; text-decoration: none; padding: 8px 14px; border-radius: 999px; font-size: .84rem; color: var(--prugna); background: var(--carta); border: 1px solid var(--linea); font-family: var(--titoli); }
.chip.on { background: var(--prugna); color: #fff; border-color: var(--prugna); }

/* pill e badge */
.pill { border: 0; border-radius: 999px; padding: 7px 12px; font: 500 .78rem var(--titoli); cursor: pointer; white-space: nowrap; transition: filter .15s; }
.pill:hover { filter: brightness(.96); }
.pill-ok { background: var(--entrata-bg); color: var(--entrata); }
.pill-ko { background: var(--uscita-bg); color: var(--uscita); }
.pill-wait { background: var(--crema); color: var(--prugna); box-shadow: inset 0 0 0 1px var(--linea); }
.pill-off { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--linea); }
.badge { display: inline-block; font: 500 .66rem var(--titoli); letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--crema); color: var(--prugna); border: 1px solid var(--linea); white-space: nowrap; }
.badge-attiva { background: var(--entrata-bg); color: var(--entrata); border-color: #CBE0D9; }
.badge-attesa { background: #FFF3DC; color: #8A5A10; border-color: #F1DDB6; }
.badge-chiusa { background: #EFE9EC; color: var(--muted); border-color: #E2D8DD; }

/* affiancamenti: tabella del mese */
.ac-tab { display: flex; flex-direction: column; }
.ac-row { display: grid; grid-template-columns: minmax(150px, 1.2fr) minmax(220px, 2fr) 170px 150px; gap: 14px; align-items: center; padding: 12px 0; }
.ac-row + .ac-row { border-top: 1px solid var(--linea-2); }
.ac-head { padding-top: 0; font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 500; }
.ac-nome { text-decoration: none; color: inherit; min-width: 0; }
.ac-nome b { display: block; font-weight: 500; }
.ac-nome small { color: var(--muted); font-size: .78rem; }
.ac-nome:hover b { color: var(--magenta); }
.ac-calls { display: flex; gap: 8px; flex-wrap: wrap; }
.ac-pag button, .ac-fatt button { width: 100%; }
.call { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 40px; border-radius: 12px; cursor: pointer;
  font: 600 .82rem var(--titoli); border: 1.5px solid var(--linea); background: #fff; color: var(--muted); margin: 0; letter-spacing: 0; text-transform: none; transition: all .15s; }
.call .call-sel { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; width: 100%; height: 100%; }
.call.stato-fatta { background: var(--entrata); border-color: var(--entrata); color: #fff; }
.call.stato-rimandata { background: #FFF3DC; border-color: #E7B95C; color: #8A5A10; border-style: dashed; }
.call.stato-persa { background: var(--uscita-bg); border-color: var(--uscita); color: var(--uscita); }
.call.stato-persa::after { content: ''; position: absolute; left: 10px; right: 10px; top: 50%; height: 1.5px; background: var(--uscita); transform: rotate(-20deg); }
.call:focus-within { box-shadow: 0 0 0 4px rgba(97,29,65,.12); }
.call.mini { width: 16px; height: 14px; border-radius: 4px; vertical-align: -2px; margin: 0 4px 0 12px; cursor: default; }
.call.mini::after { left: 2px; right: 2px; }
.legenda { margin: 16px 0 0; font-size: .76rem; color: var(--muted); line-height: 2; }
.legenda .call.mini:first-child { margin-left: 0; }

.rinnovi { display: flex; flex-direction: column; }
.rin-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 0; }
.rin-row + .rin-row, .card-head + .rin-row ~ .rin-row { border-top: 1px solid var(--linea-2); }
.rin-azioni { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
form.inline select { width: auto; margin: 0; padding: 7px 34px 7px 12px; font-size: .84rem; }
.riga-cliente { grid-template-columns: auto 1fr auto; }
.r-imp small { display: block; font-weight: 500; font-size: .76rem; text-align: right; }

.inline-lbl { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .7rem; }
.inline-lbl input, .inline-lbl select { width: 110px; margin: 0; padding: 8px 12px; }
.mese-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--linea-2); }
.card-head + .mese-row { border-top: 0; }
.mese-row .mese-nome { flex: 1 1 150px; text-decoration: none; color: inherit; }
.mese-row .mese-nome b { display: block; font-weight: 500; }
.mese-row .mese-nome small { color: var(--muted); font-size: .78rem; }
.mese-row input[type=date] { width: 150px; margin: 0; padding: 8px 10px; }
.mese-row .check { margin: 0; }
.mese-row .w-num { width: 110px; margin: 0; padding: 8px 12px; }
.mese-row .w-note { flex: 1 1 140px; width: auto; margin: 0; padding: 8px 12px; }
.mese-row .inline-lbl input { width: 90px; }
.aggiungi-mesi { margin-top: 12px; padding-top: 14px; border-top: 1px dashed var(--linea); }
.aggiungi-mesi input[type=month] { width: 170px; }

/* pazienti */
.card-riservata { position: relative; }
.lucchetto { font: 500 .66rem var(--titoli); letter-spacing: .1em; text-transform: uppercase; color: var(--prugna-soft); padding: 3px 10px 3px 24px; border-radius: 999px; background: var(--crema)
  url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='12' viewBox='0 0 10 12'><rect x='1' y='5' width='8' height='6.5' rx='1.5' fill='%238C5A76'/><path d='M3 5V3.5a2 2 0 0 1 4 0V5' fill='none' stroke='%238C5A76' stroke-width='1.3'/></svg>") no-repeat 10px center; }
.area-clinica { font-size: .95rem; line-height: 1.6; background: #FFFEFB; min-height: 220px; resize: vertical; }
.nota-box { border: 1px solid var(--linea); border-radius: 16px; padding: 14px 16px; margin: 6px 0 16px; background: rgba(247,241,232,.5); }
.nota-box .card-head { margin-bottom: 8px; }
.nota-box .lbl { font-size: .74rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--prugna-soft); }
.pag-box, .fattura-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; border: 1px solid var(--linea); border-radius: 16px; padding: 12px 14px; margin-bottom: 8px; background: #fff; }
.pag-box .check, .fattura-box .check { margin: 0; }
.pag-box input:not([type=checkbox]), .fattura-box input:not([type=checkbox]) { width: auto; flex: 1 1 140px; margin: 0; padding: 9px 12px; }
.fattura-box { margin-bottom: 16px; }
#form-mov:not(.is-entrata) .solo-entrata { display: none; }
.riga-semplice { padding: 9px 0; border-top: 1px solid var(--linea-2); text-decoration: none; color: inherit; display: flex; }
.riga-semplice:first-of-type { border-top: 0; }
a.riga-semplice:hover span { color: var(--magenta); }
.pc-top em { font-style: normal; color: var(--muted); font-size: .78rem; margin-left: 6px; }

/* documenti */
.doc-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--linea-2); text-decoration: none; color: inherit; }
.card-head + .doc-row, .card-head + p + .doc-row { border-top: 0; }
.doc-row b { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-row small { color: var(--muted); font-size: .78rem; white-space: nowrap; }
a.doc-row:hover b { color: var(--magenta); }
.doc-row-full .doc-tit { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.doc-row-full .doc-tit b { display: block; }
.doc-row-full .doc-tit small { white-space: normal; }
.doc-row-full .doc-tit:hover b { color: var(--magenta); }
.card.chiuso { display: none; }
.card.chiuso:target { display: block; }

/* tasse */
.scad-row { display: grid; grid-template-columns: 52px 1fr auto auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--linea-2); }
.card-head + .scad-row, .card-head + p + .scad-row { border-top: 0; }
.scad-row .r-desc small a { color: var(--prugna); font-weight: 500; }
.scad-row.scaduta .r-data { background: var(--uscita); color: #fff; }
.scad-azioni { display: flex; gap: 10px; align-items: center; }
.scad-row.pagata { grid-template-columns: auto 1fr auto auto; opacity: .75; }
details.pagate { margin-top: 10px; border-top: 1px dashed var(--linea); padding-top: 10px; }
details summary { cursor: pointer; font-family: var(--titoli); color: var(--prugna); font-size: .9rem; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: '›'; display: inline-block; margin-right: 8px; transition: transform .15s; }
details[open] summary::before { transform: rotate(90deg); }
details summary h2 { display: inline; }
#parametri details form { margin-top: 16px; }
#parametri h3 { margin: 8px 0 10px; }
.param-row { padding: 8px 0; border-top: 1px solid var(--linea-2); }
.param-row .param-nome { flex: 1 1 220px; font-size: .9rem; }
.param-row select { width: auto; margin: 0; padding: 8px 34px 8px 12px; }
.param-row .inline-lbl input { width: 80px; }
#parametri .btn { margin-top: 14px; }
.prospetto { margin-top: 18px; border-top: 1px solid var(--linea); }
.prospetto > div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--linea-2); font-size: .9rem; }
.prospetto > div b { font-family: var(--titoli); font-weight: 500; white-space: nowrap; }
.prospetto > div.tot { background: var(--crema); margin: 0 -24px; padding: 11px 24px; border-bottom: 0; }
.prospetto > div.tot b { font-weight: 600; color: var(--prugna); }
.prospetto > div.tot + .tot { margin-top: 2px; }

/* finanze */
.tab-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -6px; padding: 0 6px; }
.tab td, .tab th { white-space: nowrap; font-size: .88rem; }
.tab tfoot td { border-top: 1.5px solid var(--linea); font-weight: 600; font-family: var(--titoli); }
.tab tr.vuota td { color: #C8B9C1; }
.tab tr.corrente td { background: rgba(247,241,232,.7); }
.tab-servizi td:first-child, .tab-servizi th:first-child { position: sticky; left: 0; background: var(--carta); }

/* panoramica */
.mini-kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.mini-kpi > div { background: var(--crema); border-radius: 14px; padding: 12px 14px; }
.mini-kpi b { display: block; font-family: var(--titoli); font-weight: 600; font-size: 1.25rem; color: var(--prugna); }
.mini-kpi b small { font-size: .62em; color: var(--muted); }
.mini-kpi b.pos { color: var(--entrata); } .mini-kpi b.neg { color: var(--uscita); }
.mini-kpi span { font-size: .74rem; color: var(--muted); }
.card h3 { margin: 16px 0 6px; }

@media (max-width: 900px) {
  .ac-row { grid-template-columns: 1fr auto; gap: 10px 12px; }
  .ac-head { display: none; }
  .ac-calls { grid-column: 1 / -1; order: 3; }
  .ac-pag { grid-column: 2; grid-row: 1; }
  .ac-fatt { grid-column: 1 / -1; order: 4; }
  .ac-fatt button { width: auto; }
  .kpi-4 { grid-template-columns: 1fr 1fr; }
  .kpi-4 .saldo { grid-column: 1 / -1; }
  .grid-2col { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 640px) {
  .top-in { padding: 10px 14px 4px; flex-wrap: nowrap; }
  .wordmark { font-size: 1.3rem; }
  .brand-sub { display: none; }
  .schede-in { padding: 4px 14px 8px; }
  .schede a { padding: 7px 12px; font-size: .82rem; }
  .schede a[href*="splendidamente"] { margin-left: 0; }
  .head-actions .btn-ghost { display: none; }
  .kpi-3 { grid-template-columns: 1fr 1fr; }
  .kpi-3 > :first-child { grid-column: 1 / -1; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .grid3 > :first-child { grid-column: 1 / -1; }
  .ac-fatt { order: 4; }
  .call { width: 54px; height: 44px; }
  .scad-row { grid-template-columns: 46px 1fr; }
  .scad-row .r-imp { grid-column: 2; }
  .scad-azioni { grid-column: 2; }
  .scad-row .r-data { grid-row: span 3; }
  .scad-row.pagata { grid-template-columns: 1fr; }
  .mini-kpi { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .mini-kpi > div { padding: 10px; }
  .mini-kpi b { font-size: 1rem; }
  .sotto-schede { width: 100%; }
  .nav-mese { display: flex; justify-content: space-between; }
  .prospetto > div.tot { margin: 0 -18px; padding: 11px 18px; }
  .rin-row form.inline { width: 100%; }
  .rin-row form.inline select { flex: 1; }
  .mese-row .inline-lbl input { width: 80px; }
}
.auth-wordmark { font-family: var(--titoli); font-weight: 600; font-size: 2.4rem; letter-spacing: -.035em; color: var(--prugna); margin-bottom: 14px; }

/* tabelle */
.tab { width: 100%; border-collapse: collapse; }
.tab th, .tab td { padding: 10px 10px; border-top: 1px solid var(--linea-2); text-align: left; }
.tab th { border-top: 0; font: 500 .68rem var(--titoli); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding-bottom: 8px; }
.tab td:first-child, .tab th:first-child { padding-left: 0; }
.tab td:last-child, .tab th:last-child { padding-right: 0; }
.num { text-align: right !important; white-space: nowrap; }
.tab tbody tr:hover td { background: rgba(247,241,232,.6); }

/* ======================= Tema Leti's Mind: dettagli di brand ======================= */
/* titoli sempre chiusi dal punto colorato */
body:not(.tema-spl) main h1::after { content: '.'; color: var(--punto); }
.eyebrow { color: var(--prugna); font-weight: 500; letter-spacing: .22em; }
.eyebrow a { color: inherit; }
.top { background: rgba(249,243,238,.92); box-shadow: 0 1px 0 var(--linea); }
.logo-lm { height: 44px; width: auto; display: block; }
.btn { color: var(--crema); }
.btn-ghost { box-shadow: inset 0 0 0 1.5px var(--prugna); color: var(--prugna); }
.btn-ghost:hover { background: var(--rosa); }
.btn-dark { background: var(--vino); }
.chip { border: 1.5px solid var(--prugna); background: transparent; color: var(--prugna); }
.chip.on { background: var(--prugna); color: var(--crema); }
.badge { background: var(--rosa); border-color: transparent; color: var(--prugna); }
.badge-attiva { background: var(--prugna); color: var(--crema); border-color: transparent; }
.badge-attesa { background: var(--panna); color: var(--lampone); border-color: #F3E6B5; }
.badge-chiusa { background: var(--beige); color: var(--uscita); border-color: transparent; }
.count { background: var(--rosa); color: var(--prugna); font-weight: 600; }
.card { border-color: transparent; }
.kpi-box { border-color: transparent; }
.kpi-lbl { color: var(--prugna); font-weight: 500; letter-spacing: .2em; }
.kpi-box b { font-family: var(--titoli); font-weight: 600; }
.dot-entrata { background: var(--prugna); } .dot-uscita { background: var(--uscita); }
/* riquadro principale bordeaux con la "m maxi" tono su tono, tagliata dal bordo */
body:not(.tema-spl) .kpi-box.saldo { background: var(--prugna); box-shadow: 0 18px 36px -20px rgba(138,0,60,.7); }
body:not(.tema-spl) .kpi-box.saldo::after {
  content: ''; position: absolute; right: -6%; bottom: -34%; width: 62%; aspect-ratio: 1101 / 830; height: auto;
  background: #A10F50; opacity: 1;
  -webkit-mask: url("img/lm/m-maxi.png") no-repeat center / contain; mask: url("img/lm/m-maxi.png") no-repeat center / contain;
}
body:not(.tema-spl) .kpi-box.saldo > * { position: relative; z-index: 1; }
.kpi-box.saldo .kpi-lbl { color: rgba(249,243,238,.75); }
.kpi-box.saldo b { color: var(--crema); }
.kpi-box.saldo b.neg, .kpi-box.saldo b.pos { color: var(--crema); }
.flash { background: var(--rosa); color: var(--prugna); border-color: transparent; }
.flash-err { background: var(--beige); color: var(--lampone); }
.avviso { background: var(--panna); border-color: #F3E6B5; color: var(--vino); }
.sotto-schede { background: transparent; border: 1.5px solid var(--linea); }
.sotto-schede a.on { background: var(--prugna); color: var(--crema); box-shadow: none; }
.nav-mese { border: 1.5px solid var(--linea); background: transparent; }
.nav-mese a:hover { background: var(--rosa); }
.schede a.on { color: var(--crema); }
.avatar { background: var(--rosa); border-color: transparent; color: var(--prugna); font-weight: 600; }
.account.on .avatar, .account:hover .avatar { background: var(--prugna); color: var(--crema); }
.r-data { background: var(--beige); color: var(--uscita); }
.r-data.entrata { background: var(--rosa); color: var(--prugna); }
.r-data b { font-family: var(--titoli); font-weight: 600; }
.mini-kpi > div { background: var(--crema); }
.prospetto > div.tot { background: var(--rosa); }
.prospetto > div.tot b { color: var(--prugna); }
.area-clinica { background: #fff; }
.lucchetto { background-color: var(--rosa); color: var(--prugna); }
.tab tr.corrente td { background: rgba(251,227,235,.45); }
/* pagamenti: fatto = pieno bordeaux, in attesa = contorno, in ritardo = lampone */
.pill-ok { background: var(--prugna); color: var(--crema); }
.pill-wait { background: transparent; color: var(--prugna); box-shadow: inset 0 0 0 1.5px var(--prugna); }
.pill-ko { background: transparent; color: var(--lampone); box-shadow: inset 0 0 0 1.5px var(--lampone); }
.pill-off { color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--linea); }
/* call: fatta = piena, rimandata = rosa tratteggiata, persa = beige barrata */
.call { border-color: var(--linea); color: var(--muted); }
.call.stato-fatta { background: var(--prugna); border-color: var(--prugna); color: var(--crema); }
.call.stato-rimandata { background: var(--rosa); border-color: var(--punto); color: var(--lampone); }
.call.stato-persa { background: var(--beige); border-color: var(--uscita); color: var(--uscita); }
.call.stato-persa::after { background: var(--uscita); }
.piede { padding: 30px 20px 36px; }
.piede .firma { font-weight: 300; text-transform: uppercase; letter-spacing: .3em; font-size: .68rem; color: var(--prugna-soft); }
.auth-logo { width: 220px; height: auto; margin: 0 auto 26px; }
.auth-page { background: var(--crema) url("img/lm/m-maxi.png") no-repeat right -120px bottom -160px / 640px auto; }
.auth-page::before { content: none; }
.elementi-sezione { height: 3px; border-radius: 3px; overflow: hidden; margin: -10px 0 26px; }

/* ======================= Tema Splendidamente (solo la sua scheda) ======================= */
body.tema-spl main {
  --prugna: #611D41; --prugna-scuro: #4A1531; --prugna-soft: #8C5A76; --vino: #611D41;
  --magenta: #C2185B; --btn-hover: #AD1452; --btn-ombra: rgba(194,24,91,.6); --punto: #C2185B;
  --rosa: #F3E7EC; --beige: #EFE4D6; --crema: #F7F1E8; --carta: #FFFCF7; --linea: #EADFD1; --linea-2: #F2EADF;
  --testo: #2E1626; --muted: #8E7A86;
  --entrata: #2F6B61; --entrata-bg: #E3EFEB; --uscita: #A0284F; --uscita-bg: #F7E4EA;
  --titoli: 'Poppins', system-ui, sans-serif; --display: 'Poppins', system-ui, sans-serif; --peso-display: 600;
  --sans: 'Open Sauce Sans', 'Poppins', system-ui, sans-serif;
  font-family: var(--sans);
}
body.tema-spl main h1 { letter-spacing: -.025em; font-size: 2.1rem; }
body.tema-spl main .btn { color: #fff; }
body.tema-spl main .card, body.tema-spl main .kpi-box { border-color: var(--linea); }
body.tema-spl main .kpi-box.saldo { background: radial-gradient(120% 140% at 100% 100%, #7E2A57 0%, var(--prugna) 45%, var(--prugna-scuro) 100%); }
body.tema-spl main .kpi-box.saldo::after { content: ''; position: absolute; right: -18px; bottom: -26px; width: 210px; height: 120px;
  background: url("img/marchio-bianco.png") no-repeat right bottom / contain; opacity: .08; pointer-events: none; }
body.tema-spl main .r-data { background: var(--uscita-bg); color: var(--uscita); }
body.tema-spl main .r-data.entrata { background: var(--entrata-bg); color: var(--entrata); }
body.tema-spl main .dot-entrata { background: var(--entrata); }
body.tema-spl main .chip { border: 1px solid var(--linea); background: var(--carta); }
body.tema-spl main .flash { background: var(--entrata-bg); color: var(--entrata); }
body.tema-spl main .flash-err { background: var(--uscita-bg); color: var(--uscita); }
body.tema-spl main .switch input:checked + span { background: var(--uscita); }
body.tema-spl main .is-entrata .switch input:checked + span { background: var(--entrata); }
body.tema-spl main .btn-ghost { color: var(--prugna); box-shadow: inset 0 0 0 1px var(--linea); }
body.tema-spl main .btn-dark { background: var(--prugna); }
@media (max-width: 640px) { .logo-lm { height: 36px; } .auth-page { background-size: 380px auto; background-position: right -90px bottom -90px; } }
.grid-2col > *, .grid-2col > div > .card { min-width: 0; }
.btn-danger { color: var(--lampone); background: transparent; box-shadow: inset 0 0 0 1.5px var(--lampone); }
.btn-danger:hover { background: var(--beige); }
.scad-row.scaduta .r-data { background: var(--lampone); color: var(--crema); }

/* ===== Panoramica: netto diviso per area ===== */
.kpi-aree { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.kpi-aree .kpi-box.saldo { min-height: 190px; text-decoration: none; }
.kpi-2 { grid-template-columns: 1fr 1fr; }
.kpi-prog { display: block; margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(249,243,238,.22);
  font-size: .8rem; color: rgba(249,243,238,.8); position: relative; z-index: 1; }
.kpi-prog strong { font-weight: 600; color: var(--crema); font-variant-numeric: lining-nums tabular-nums; }
.kpi-prog span { opacity: .75; }
body:not(.tema-spl) .kpi-box.saldo > img.logo-angolo { position: absolute; top: 16px; right: 20px; height: 40px; width: auto; opacity: .95; z-index: 1; }
.area-spl .kpi-lbl { padding-right: 130px; }
/* Riquadro Splendidamente: colori e marchio del suo brand */
body:not(.tema-spl) .kpi-box.saldo.area-spl {
  background: radial-gradient(120% 140% at 100% 100%, #7E2A57 0%, #611D41 45%, #4A1531 100%);
  box-shadow: 0 18px 36px -20px rgba(74,21,49,.75); font-family: 'Open Sauce Sans', var(--sans); }
body:not(.tema-spl) .kpi-box.saldo.area-spl::after {
  -webkit-mask: none; mask: none; background: url("img/marchio-bianco.png") no-repeat right bottom / contain;
  inset: auto -18px -26px auto; width: 210px; height: 120px; opacity: .1; }
.kpi-box.saldo.area-spl b { font-family: 'Poppins', sans-serif; font-weight: 600; color: #fff; }
.kpi-box.saldo.area-spl .kpi-lbl { color: rgba(255,255,255,.75); letter-spacing: .14em; }
.kpi-box.saldo.area-spl .kpi-note, .kpi-box.saldo.area-spl .kpi-prog { color: rgba(255,255,255,.72); }
.kpi-box.saldo.area-spl .kpi-prog strong { color: #fff; }
.kpi-box.saldo.area-spl:hover { transform: translateY(-2px); transition: transform .2s; }
@media (max-width: 760px) {
  .kpi-aree { grid-template-columns: 1fr; gap: 10px; margin-bottom: 10px; }
  .kpi-aree .kpi-box.saldo { min-height: 0; }
  body:not(.tema-spl) .kpi-box.saldo > img.logo-angolo { height: 32px; top: 12px; right: 14px; }
  .area-spl .kpi-lbl { padding-right: 104px; }
  .kpi-2 { grid-template-columns: 1fr 1fr; }
}

/* =====================================================================
   v3 · Navigazione a icone, Dashboard e Planner
   ===================================================================== */
.svg-i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* barra in alto: icone al posto del menu scritto */
.top { background: rgba(255,255,255,.92); border-bottom: 1px solid var(--linea); }
.top-in { padding: 12px 20px; }
.top-icone { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.top-icone a { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: var(--prugna); position: relative; text-decoration: none; transition: background .15s; }
.top-icone a .svg-i { width: 21px; height: 21px; }
.top-icone a:hover { background: var(--rosa); }
.top-icone a.on { background: var(--prugna); color: var(--crema); }
.top-icone a.ico-spl.on { background: #611D41; }
.top-icone a[data-t]:hover::after { content: attr(data-t); position: absolute; top: 48px; left: 50%; transform: translateX(-50%); background: var(--testo); color: #fff; font-size: .72rem; padding: 4px 9px; border-radius: 8px; white-space: nowrap; pointer-events: none; z-index: 5; }
.top-icone .sep { width: 1px; height: 24px; background: var(--linea); margin: 0 6px; }
.top .avatar { width: 40px; height: 40px; background: var(--rosa); border-color: transparent; font-size: .95rem; }
.schede { display: none; }

/* barra in basso, solo sul telefono */
.barra-mobile { display: none; position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); background: #fff; border-radius: 22px; box-shadow: 0 12px 34px -12px rgba(138,0,60,.4), 0 0 0 1px var(--linea); padding: 7px; justify-content: space-around; z-index: 30; }
.barra-mobile a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .62rem; font-weight: 500; color: var(--muted); padding: 5px 9px; border-radius: 15px; text-decoration: none; min-width: 58px; }
.barra-mobile a .svg-i { width: 22px; height: 22px; color: var(--prugna); }
.barra-mobile a.on { background: var(--prugna); color: var(--crema); }
.barra-mobile a.on .svg-i { color: var(--crema); }
@media (max-width: 760px) {
  .top-icone { display: none; }
  .top .account { margin-left: auto; }
  .barra-mobile { display: flex; }
  main { padding-bottom: 120px; }
  .piede { padding-bottom: 110px; }
}

/* ---------- Dashboard ---------- */
.saluto { margin: 4px 0 24px; }
.saluto h1 { margin: 4px 0 8px; }
.saluto p:last-child { margin: 0; color: var(--muted); }
.saluto p b { color: var(--testo); font-weight: 600; }
.saluto a { color: var(--prugna); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.tile { background: var(--carta); border-radius: var(--r); box-shadow: var(--ombra); padding: 20px; display: flex; flex-direction: column; gap: 14px; min-height: 168px; position: relative; overflow: hidden; color: var(--testo); text-decoration: none; transition: transform .2s, box-shadow .2s; }
a.tile:hover, .tile.big:hover { transform: translateY(-3px); box-shadow: 0 1px 2px rgba(138,0,60,.05), 0 22px 40px -22px rgba(138,0,60,.45); }
.tile-ico { width: 58px; height: 58px; border-radius: 18px; background: var(--rosa); color: var(--prugna); display: grid; place-items: center; position: relative; flex: none; }
.tile-ico .svg-i { width: 30px; height: 30px; }
.tile-ico::after { content: ''; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--punto); right: 9px; top: 9px; }
.tile h3 { margin: auto 0 0; font-size: 1.08rem; font-weight: 600; letter-spacing: -.01em; color: var(--testo); }
.tile .dato { font-size: .82rem; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.tile .dato b { color: var(--prugna); font-weight: 600; }
.tbadge { position: absolute; top: 18px; right: 18px; background: var(--punto); color: #fff; font-size: .72rem; font-weight: 600; min-width: 24px; height: 24px; border-radius: 12px; display: grid; place-items: center; padding: 0 7px; }
.tile.big { grid-column: span 2; grid-row: span 2; background: var(--prugna); color: var(--crema); padding: 26px; }
.tile.big::before { content: ''; position: absolute; right: -8%; bottom: -30%; width: 70%; aspect-ratio: 1101/830; background: #A10F50; pointer-events: none;
  -webkit-mask: url('img/lm/m-maxi.png') no-repeat center / contain; mask: url('img/lm/m-maxi.png') no-repeat center / contain; }
.tile.big > * { position: relative; z-index: 1; }
.tile.big > .tile-link { position: absolute; inset: 0; z-index: 1; }
.tile.big .oggi-mini, .tile.big .tile-ico { z-index: 2; }
.tile.big .tile-ico { background: rgba(249,243,238,.14); color: var(--crema); }
.tile.big h3 { font-size: 1.5rem; font-weight: 800; margin: 0; color: var(--crema); }
.tile.big .dato { color: rgba(249,243,238,.78); }
.oggi-mini { margin-top: auto; display: flex; flex-direction: column; gap: 9px; max-width: 420px; }
.oggi-mini small { opacity: .65; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; }
.om-riga { display: flex; align-items: center; gap: 10px; font-size: .95rem; margin: 0; }
.om-cb { width: 20px; height: 20px; border: 1.6px solid rgba(249,243,238,.75); border-radius: 6px; flex: none; background: transparent; padding: 0; cursor: pointer; position: relative; }
.om-riga.fatto .om-cb { background: var(--crema); border-color: var(--crema); }
.om-riga.fatto .om-cb::after { content: ''; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid var(--prugna); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.om-riga.fatto span { text-decoration: line-through; opacity: .6; }
.om-riga.iniziato .om-cb { background: linear-gradient(135deg, rgba(249,243,238,.8) 50%, transparent 50%); }
.om-vuoto { margin: 0; opacity: .75; font-size: .9rem; }
.btn-chiaro { align-self: flex-start; margin-top: 6px; background: var(--crema); color: var(--prugna); border-radius: 999px; padding: 9px 18px; font-weight: 600; font-size: .88rem; text-decoration: none; }
.tile.spl { grid-column: span 2; background: radial-gradient(120% 140% at 100% 100%, #7E2A57 0%, #611D41 45%, #4A1531 100%); color: #fff; }
.tile.spl::after { content: ''; position: absolute; right: -20px; bottom: -30px; width: 230px; height: 130px; background: url('img/marchio-bianco.png') no-repeat right bottom / contain; opacity: .1; pointer-events: none; }
.tile.spl .logo-spl { height: 52px; width: auto; align-self: flex-start; }
.tile.spl h3 { font-family: 'Poppins', var(--sans); font-weight: 500; color: #fff; }
.tile.spl .dato { color: rgba(255,255,255,.75); } .tile.spl .dato b { color: #fff; }
.riepilogo { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin: 20px 0 10px; }
.riepilogo .box { background: var(--carta); border-radius: var(--r); box-shadow: var(--ombra); padding: 20px 22px; text-decoration: none; color: var(--testo); display: block; }
.riepilogo .lbl { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--prugna); font-weight: 500; display: block; }
.riepilogo b { display: block; font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; margin: 8px 0 2px; font-variant-numeric: lining-nums tabular-nums; }
.riepilogo b small { font-size: .6em; color: var(--muted); font-weight: 500; }
.riepilogo span:last-child { font-size: .8rem; color: var(--muted); }
@media (max-width: 860px) {
  .tiles { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  .tile.big, .tile.spl { grid-column: 1 / -1; grid-row: auto; }
  .riepilogo { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 560px) {
  .tile { min-height: 140px; padding: 16px; gap: 10px; }
  .tile-ico { width: 48px; height: 48px; border-radius: 15px; }
  .tile-ico .svg-i { width: 25px; height: 25px; }
  .tile h3 { font-size: .98rem; }
  .tile.big { padding: 20px; }
}

/* ---------- Planner ---------- */
.pl-head { align-items: flex-end; flex-wrap: wrap; }
.viste { display: inline-flex; background: var(--carta); border-radius: 999px; padding: 4px; box-shadow: var(--ombra); }
.viste a { padding: 8px 18px; border-radius: 999px; font-weight: 500; font-size: .9rem; color: var(--prugna); text-decoration: none; }
.viste a.on { background: var(--prugna); color: var(--crema); }
.giorno-nav { display: flex; align-items: center; gap: 12px; margin: -6px 0 18px; flex-wrap: wrap; }
.freccia { width: 38px; height: 38px; border-radius: 50%; background: var(--carta); box-shadow: var(--ombra); display: grid; place-items: center; color: var(--prugna); font-size: 1.15rem; text-decoration: none; flex: none; }
.data-grande { font-size: 1.2rem; font-weight: 600; color: var(--testo); }
.btn-oggi { padding: 7px 14px; border-radius: 999px; border: 1.4px solid var(--prugna); color: var(--prugna); font-weight: 600; font-size: .84rem; text-decoration: none; }
.settimana-pill { display: flex; gap: 5px; margin-left: auto; }
.settimana-pill a { width: 32px; height: 32px; border-radius: 50%; border: 1.4px solid var(--linea); display: grid; place-items: center; font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--carta); text-decoration: none; }
.settimana-pill a.oggi { border-color: var(--punto); color: var(--punto); }
.settimana-pill a.on { background: var(--prugna); border-color: var(--prugna); color: var(--crema); }
.sett-stat { margin-left: auto; font-size: .85rem; color: var(--muted); }
.sett-stat b { color: var(--prugna); }

.p-grid { display: grid; grid-template-columns: 300px minmax(0,1fr) 300px; gap: 18px; align-items: start; }
.pl-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.card.pl-card { margin: 0; padding: 20px 22px; }
.pl-card h2 { font-size: 1.1rem; font-weight: 800; margin: 0 0 14px; color: var(--prugna); letter-spacing: -.01em; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-family: var(--titoli); }
.pl-card h2 small { font-size: .74rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.pl-card h2 small a { color: var(--prugna); }
.mini-lbl, label.mini-lbl { display: block; font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0; }
.occhiello { font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--prugna); font-weight: 500; }
.vuoto { margin: 0 0 6px; }

/* energia */
.batteria { display: inline-flex; gap: 4px; padding: 4px; border: 1.6px solid var(--prugna); border-radius: 11px; position: relative; margin: 10px 0 8px; }
.batteria::after { content: ''; position: absolute; right: -6px; top: 50%; transform: translateY(-50%); width: 4px; height: 12px; border-radius: 0 3px 3px 0; background: var(--prugna); }
.batteria button { width: 32px; height: 24px; border-radius: 6px; background: var(--linea); border: 0; padding: 0; cursor: pointer; transition: background .15s, transform .1s; }
.batteria button:hover { background: #E4C3CF; }
.batteria button.on { background: var(--prugna); }
.batteria button:active { transform: scale(.92); }
.energia-txt { font-size: .8rem; color: var(--muted); }
.campo-lbl, label.campo-lbl { display: block; font-size: .78rem; color: var(--muted); margin: 14px 0 6px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.pl-card .campo { margin: 0; background: var(--crema); border-color: transparent; resize: vertical; font-size: .93rem; padding: 10px 12px; }
.pl-card .campo:focus { background: #fff; border-color: var(--linea); }
.nota-salva { font-size: .72rem; color: var(--muted); margin: 6px 0 0; min-height: 1em; }

/* impegni */
.impegno { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--linea-2); align-items: center; }
.impegno:last-of-type { border-bottom: 0; }
.impegno .ora { font-weight: 600; font-variant-numeric: tabular-nums; font-size: .88rem; }
.impegno .cosa { border-left: 3px solid var(--prugna); padding-left: 10px; min-width: 0; }
.impegno .cosa a { color: inherit; text-decoration: none; }
.impegno .cosa b { display: block; font-weight: 600; font-size: .92rem; }
.impegno .cosa span { font-size: .77rem; color: var(--muted); }
.impegno.call .cosa { border-color: var(--punto); }
.impegno.mio .cosa { border-color: var(--uscita); }
.impegno form { margin: 0; }
.x { border: 0; background: none; color: #C9B3BC; font-size: 1.2rem; cursor: pointer; padding: 0 4px; }
.x:hover { color: var(--prugna); }
.add-impegno { margin-top: 10px; }
.add-impegno summary { cursor: pointer; color: var(--prugna); font-weight: 600; font-size: .86rem; list-style: none; }
.add-impegno summary::-webkit-details-marker { display: none; }
.add-impegno form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.add-impegno input, .add-impegno select { margin: 0; padding: 9px 11px; font-size: .88rem; }
.riga-imp { display: grid; grid-template-columns: 96px minmax(0,1fr); gap: 8px; }
.add-impegno .btn { align-self: flex-start; padding: 8px 16px; }

/* scrittura veloce */
.add { display: flex; align-items: center; gap: 10px; background: var(--crema); border: 1.6px dashed #E4CBD4; border-radius: 16px; padding: 6px 8px 6px 10px; margin: 0 0 6px; transition: border-color .15s, background .15s; }
.add:focus-within { border-color: var(--prugna); border-style: solid; background: #fff; }
.add .piu { width: 28px; height: 28px; border-radius: 50%; background: var(--prugna); color: var(--crema); display: grid; place-items: center; font-weight: 600; flex: none; border: 0; cursor: pointer; font-size: 1.05rem; padding: 0; }
.add input { margin: 0; border: 0; background: transparent; padding: 8px 2px; box-shadow: none !important; font-size: .95rem; }
.add-hint { font-size: .74rem; color: var(--muted); margin: 0 0 16px 4px; line-height: 2; }
.add-hint b { color: var(--prugna); font-weight: 600; background: var(--rosa); padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.entro .add { margin-top: 10px; }

.sez { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; }
.sez .mini-lbl { color: var(--prugna); }
.sez::after { content: ''; flex: 1; height: 1px; background: var(--linea); }
.task { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--linea-2); position: relative; }
.task:last-child { border-bottom: 0; }
.task form { margin: 0; }
.task .t { flex: 1; min-width: 0; }
.t-tit { font-size: .96rem; color: var(--testo); text-decoration: none; word-wrap: break-word; }
.tmeta { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.tchip { font-size: .7rem; padding: 2px 8px; border-radius: 999px; background: var(--crema); color: var(--muted); font-weight: 500; white-space: nowrap; text-decoration: none; }
a.tchip:hover { color: var(--prugna); }
.tchip.lm { background: var(--rosa); color: var(--prugna); }
.tchip.sp { background: #EDE0E7; color: #611D41; }
.tchip.auto { background: var(--panna); color: #8A6A1F; border: 1px solid #F1E3B5; }
.tchip.rip::before { content: '↻ '; }
.priorita .task { background: linear-gradient(90deg, rgba(251,227,235,.6), rgba(251,227,235,0) 75%); border-radius: 12px; padding-left: 10px; border-bottom: 0; margin-bottom: 4px; }
.num { font-weight: 800; color: var(--punto); min-width: 12px; font-size: .9rem; }
.prio-vuota { font-size: .8rem; color: var(--muted); margin: 6px 0 4px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--linea); }
.stella { border: 0; background: none; padding: 4px; color: #E7D6DD; cursor: pointer; display: grid; }
.stella .svg-i { width: 18px; height: 18px; }
.stella.on { color: var(--punto); }
.stella.on .svg-i { fill: currentColor; }

/* i 4 segni dell'Uniplanner */
.cb { width: 22px; height: 22px; border-radius: 7px; border: 1.8px solid var(--prugna); flex: none; position: relative; display: grid; place-items: center; background: #fff; padding: 0; cursor: pointer; font: inherit; }
button.cb:disabled { cursor: default; }
.cb.fatto { background: var(--prugna); }
.cb.fatto::after { content: ''; width: 5px; height: 10px; border: solid var(--crema); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.cb.iniziato::after { content: ''; position: absolute; inset: 3px; background: linear-gradient(135deg, var(--prugna) 50%, transparent 50%); border-radius: 3px; }
.cb.spostato::after { content: '→'; font-size: .85rem; font-weight: 600; color: var(--prugna); line-height: 1; }
.cb.lasciato { border-color: #CDB6BF; }
.cb.lasciato::after { content: ''; width: 12px; height: 1.8px; background: #CDB6BF; transform: rotate(-45deg); }
.task.fatto .t-tit, .gc-task.fatto .gc-tit { text-decoration: line-through; color: var(--muted); }
.task.lasciato .t-tit, .gc-task.lasciato .gc-tit { color: #BFA8B1; text-decoration: line-through; }
.task.spostato .t-tit, .gc-task.spostato .gc-tit { color: var(--muted); }
.pl-legenda { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--linea); font-size: .76rem; color: var(--muted); }
.pl-legenda span { display: inline-flex; align-items: center; gap: 7px; }
.pl-legenda .cb, .menu-pop .cb { width: 16px; height: 16px; border-radius: 5px; border-width: 1.5px; cursor: default; }
.pl-legenda .cb.fatto::after, .menu-pop .cb.fatto::after { width: 3px; height: 7px; }
.pl-legenda .cb.spostato::after, .menu-pop .cb.spostato::after { font-size: .65rem; }
.pl-legenda .cb.lasciato::after, .menu-pop .cb.lasciato::after { width: 9px; }

/* menu ⋯ */
.menu-t { position: relative; }
.menu-t summary { list-style: none; cursor: pointer; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #B79AA6; }
.menu-t summary::-webkit-details-marker { display: none; }
.menu-t summary:hover, .menu-t[open] summary { background: var(--rosa); color: var(--prugna); }
.menu-pop { position: absolute; right: 0; top: 34px; z-index: 15; background: #fff; border-radius: 16px; box-shadow: 0 18px 40px -14px rgba(92,10,46,.35), 0 0 0 1px var(--linea); padding: 6px; width: 230px; }
.menu-gruppo { padding: 4px 0; border-bottom: 1px solid var(--linea-2); display: flex; flex-direction: column; }
.menu-gruppo:last-child { border-bottom: 0; }
.menu-pop button, .menu-pop a { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 10px; font: 400 .88rem var(--sans); color: var(--testo); cursor: pointer; text-decoration: none; }
.menu-pop button:hover, .menu-pop a:hover { background: var(--crema); }
.menu-pop .rosso { color: var(--uscita); }
.menu-sposta { display: flex; gap: 6px; padding: 2px 6px 6px; }
.menu-sposta input { margin: 0; padding: 6px 8px; font-size: .82rem; min-height: 0; border-radius: 10px; }
.menu-sposta button { width: auto; background: var(--prugna); color: var(--crema); font-weight: 600; font-size: .78rem; padding: 6px 10px; }
.menu-sposta button:hover { background: var(--prugna-scuro); }
.menu-prio { flex-direction: row; align-items: center; gap: 4px; padding: 6px 10px; }
.menu-prio span { font-size: .78rem; color: var(--muted); margin-right: auto; }
.menu-prio button { width: 30px; height: 30px; padding: 0; justify-content: center; border: 1.4px solid var(--linea); font-weight: 600; }
.menu-prio button.on { background: var(--prugna); border-color: var(--prugna); color: var(--crema); }

/* suggerite */
.suggerite { background: var(--panna); border: 1px solid #F1E3B5; box-shadow: none; }
.suggerite h2 { color: #7A5A12; }
.suggerite .task { border-bottom-color: #F1E3B5; flex-wrap: wrap; gap: 8px 12px; }
.suggerite .t-tit { font-size: .9rem; }
.sug-ico { width: 30px; height: 30px; border-radius: 10px; background: #fff; display: grid; place-items: center; color: #A27C1E; flex: none; }
.sug-ico .svg-i { width: 17px; height: 17px; }
.azioni-auto { display: flex; gap: 6px; width: 100%; padding-left: 42px; }
.mini-btn { font: 600 .74rem var(--sans); padding: 6px 11px; border-radius: 999px; border: 1.4px solid var(--prugna); color: var(--prugna); background: transparent; white-space: nowrap; cursor: pointer; }
.mini-btn.pieno { background: var(--prugna); color: var(--crema); }
.mini-btn.ghost { border-color: #EADBB0; color: #9C8350; }
.nota-auto { font-size: .74rem; color: #8A6A1F; margin: 10px 0 0; }

/* reminder e due minuti per me */
.rem { display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--linea-2); }
.rem:last-child { border-bottom: 0; }
.rem i { width: 9px; height: 9px; border-radius: 50%; border: 1.6px solid var(--prugna); flex: none; }
.rem input { margin: 0; border: 0; padding: 10px 0; background: transparent; box-shadow: none !important; font-size: .92rem; }
.dueminuti { background: var(--rosa); box-shadow: none; }
.dueminuti h2 { font-size: 1rem; margin: 12px 0 10px; }
.emozioni { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.emozioni label { margin: 0; letter-spacing: 0; text-transform: none; font-size: .82rem; font-weight: 400; cursor: pointer; }
.emozioni input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.emozioni span { display: inline-block; padding: 6px 12px; border-radius: 999px; background: #fff; color: var(--testo); transition: background .15s; }
.emozioni input:checked + span { background: var(--prugna); color: var(--crema); }
.emozioni input:focus-visible + span { outline: 2px solid var(--prugna); outline-offset: 2px; }
.dueminuti .campo { background: #fff; }

/* settimana */
.sett-obiettivo { display: flex; align-items: center; gap: 16px; margin-bottom: 16px !important; }
.sett-obiettivo .mini-lbl { white-space: nowrap; color: var(--prugna); }
.sett-obiettivo .campo { flex: 1; }
.settimana { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 10px; align-items: start; }
.giorno-col { background: var(--carta); border-radius: 18px; box-shadow: var(--ombra); padding: 12px 10px; min-height: 260px; display: flex; flex-direction: column; gap: 6px; transition: box-shadow .15s, background .15s; }
.giorno-col.oggi { box-shadow: 0 0 0 2px var(--prugna), var(--ombra); }
.giorno-col.passato { background: rgba(255,255,255,.65); }
.giorno-col.drop { background: var(--rosa); }
.gc-head { display: flex; align-items: baseline; gap: 6px; text-decoration: none; color: var(--prugna); padding: 0 4px 6px; border-bottom: 1px solid var(--linea-2); }
.gc-g { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 500; }
.gc-n { font-size: 1.25rem; font-weight: 800; margin-left: auto; }
.en-dot { width: 10px; height: 10px; border-radius: 50%; align-self: center; }
.gc-imp { font-size: .74rem; background: var(--crema); border-radius: 8px; padding: 4px 7px; border-left: 3px solid var(--prugna); color: var(--testo); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-imp.call { border-color: var(--punto); } .gc-imp.mio { border-color: var(--uscita); }
.gc-lista { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 40px; }
.gc-task { display: flex; align-items: flex-start; gap: 7px; padding: 6px 4px; border-radius: 10px; cursor: grab; }
.gc-task:hover { background: var(--crema); }
.gc-task.trascina { opacity: .4; }
.gc-task.prio { background: rgba(251,227,235,.6); }
.gc-task form { margin: 0; }
.gc-task .cb { width: 17px; height: 17px; border-radius: 5px; border-width: 1.5px; margin-top: 1px; }
.gc-task .cb.fatto::after { width: 3px; height: 7px; }
.gc-task .cb.spostato::after { font-size: .65rem; }
.gc-task .cb.lasciato::after { width: 9px; }
.gc-tit { font-size: .82rem; color: var(--testo); text-decoration: none; line-height: 1.35; min-width: 0; word-wrap: break-word; }
.gc-tit .num { font-size: .75rem; margin-right: 4px; }
.gc-tit .tmeta { margin-top: 3px; }
.gc-add input { margin: 0; padding: 7px 8px; font-size: .8rem; border-radius: 10px; background: var(--crema); border-color: transparent; }
.gc-add input:focus { background: #fff; }
.dnd-hint { margin: 10px 2px 18px; }
.rito { background: var(--panna); border: 1px solid #F1E3B5; box-shadow: none; max-width: 760px; }
.rito h2 { margin-top: 8px; color: #7A5A12; font-size: 1.05rem; }
.indietro { list-style: none; padding: 0; margin: 0 0 14px; }
.indietro li { padding: 7px 0; border-bottom: 1px solid #F1E3B5; font-size: .9rem; }
.indietro li span { color: #9C8350; font-size: .78rem; margin-right: 8px; }

/* colori dell'energia */
.en1 { background: #F5ECE7; } .en2 { background: #F7D5E1; } .en3 { background: #EEA8C1; } .en4 { background: #CC4C7C; } .en5 { background: #8A003C; }

/* mese */
.mese-grid-wrap { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 18px; align-items: start; }
.mese-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 6px; }
.mg-h { text-align: center; font-size: .72rem; font-weight: 600; color: var(--muted); padding-bottom: 4px; }
.mg-d { aspect-ratio: 1 / .9; border-radius: 14px; background: var(--crema); padding: 8px; display: flex; flex-direction: column; text-decoration: none; color: var(--testo); position: relative; transition: transform .15s; }
.mg-d:hover { transform: scale(1.04); }
.mg-d.fuori { opacity: .35; }
.mg-d.oggi { box-shadow: 0 0 0 2px var(--prugna); }
.mg-d.en4, .mg-d.en5 { color: #fff; }
.mg-n { font-weight: 700; font-size: .95rem; }
.mg-c { margin-top: auto; font-size: .72rem; font-weight: 600; opacity: .8; }
.mg-s { position: absolute; top: 9px; right: 8px; display: flex; gap: 2px; }
.mg-s i { width: 5px; height: 5px; border-radius: 50%; background: var(--punto); }
.mg-d.en4 .mg-s i, .mg-d.en5 .mg-s i { background: #fff; }
.en-legenda { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 16px; font-size: .76rem; color: var(--testo); }
.en-legenda > i { width: 18px; height: 14px; border-radius: 4px; }
.en-legenda .mg-s { position: static; }
.en-legenda .sep-l { width: 1px; height: 14px; background: var(--linea); margin: 0 6px; }

/* modifica attività */
.form-att .switch-quando { display: inline-flex; background: var(--crema); border-radius: 999px; padding: 4px; margin-bottom: 16px; }
.switch-quando label { margin: 0; text-transform: none; letter-spacing: 0; font-size: .88rem; cursor: pointer; }
.switch-quando input { position: absolute; opacity: 0; width: 1px; pointer-events: none; }
.switch-quando span { display: block; padding: 7px 16px; border-radius: 999px; color: var(--prugna); }
.switch-quando input:checked + span { background: var(--prugna); color: var(--crema); }
.ripeti { background: var(--crema); border-radius: 16px; padding: 14px 16px !important; margin: 6px 0 18px !important; }
.ripeti legend { display: flex; align-items: center; gap: 8px; float: left; width: 100%; margin-bottom: 10px; }
.ripeti select { margin-top: 0; }
.rip-sett { display: flex; gap: 6px; margin-top: 10px; }
.g-pill { margin: 0; }
.g-pill input { position: absolute; opacity: 0; width: 1px; pointer-events: none; }
.g-pill span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1.4px solid var(--linea); color: var(--muted); font-weight: 600; letter-spacing: 0; cursor: pointer; }
.g-pill input:checked + span { background: var(--prugna); border-color: var(--prugna); color: var(--crema); }
.rip-mese { margin: 10px 0 0; text-transform: none; letter-spacing: 0; font-size: .88rem; color: var(--testo); display: flex; align-items: center; gap: 8px; }
.rip-mese input { width: 80px; margin: 0; }

/* attività dentro le schede di pazienti e clienti */
.att-collegate .task { padding: 8px 0; }

@media (max-width: 1060px) {
  .p-grid { grid-template-columns: minmax(0,1fr) 300px; }
  .col-sx { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .settimana { grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (max-width: 860px) {
  .p-grid, .col-sx, .mese-grid-wrap { grid-template-columns: minmax(0,1fr); }
  .col-sx { display: flex; }
  .p-grid { gap: 14px; } .pl-col { gap: 14px; }
  .settimana { grid-template-columns: minmax(0,1fr); }
  .giorno-col { min-height: 0; }
  .gc-task { cursor: default; }
}
@media (max-width: 560px) {
  .viste { width: 100%; } .viste a { flex: 1; text-align: center; padding: 8px 10px; }
  .settimana-pill { margin-left: 0; width: 100%; justify-content: space-between; }
  .sett-stat { margin-left: 0; width: 100%; }
  .card.pl-card { padding: 18px 16px; }
  .sett-obiettivo { flex-direction: column; align-items: stretch; gap: 8px; }
  .mg-d { padding: 5px; border-radius: 10px; }
  .mg-n { font-size: .8rem; } .mg-c { font-size: .62rem; }
  .mese-grid { gap: 4px; }
  .menu-pop { width: 220px; }
}
.tile h3 { text-transform: none; }
.menu-t summary::before, .add-impegno summary::before { content: none; display: none; }
.gc-tit { flex: 1; display: block; }
.gc-tit .tmeta { display: flex; }
.mg-d.en1 { background: #F5ECE7; } .mg-d.en2 { background: #F7D5E1; } .mg-d.en3 { background: #EEA8C1; } .mg-d.en4 { background: #CC4C7C; } .mg-d.en5 { background: #8A003C; }

/* =====================================================================
   v4 · Sedute: registrazione, resoconto, quadro generale, report, Claude
   ===================================================================== */
.link-btn { background: none; border: 0; padding: 4px 0; font: 600 .84rem var(--sans); color: var(--prugna); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.link-btn:hover { text-decoration: underline; }
.link-btn .svg-i, .btn .svg-i, h2 .svg-i { width: 17px; height: 17px; }
h2 .svg-i { vertical-align: -3px; margin-right: 4px; color: var(--punto); }
.btn .svg-i { vertical-align: -3px; margin-right: 4px; }
.link-rosso { background: none; border: 0; padding: 6px 0 0; font: 500 .8rem var(--sans); color: var(--uscita); cursor: pointer; text-decoration: underline; }
.flash-nota { background: var(--panna); border: 1px solid #F1E3B5; color: #7A5A12; border-radius: 14px; padding: 10px 14px; font-size: .86rem; margin: 0 0 14px; }
.rec-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--crema); margin-right: 6px; box-shadow: 0 0 0 3px rgba(249,243,238,.3); }
.head-actions form { margin: 0; }
.stato-res { font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--panna); color: #8A6A1F; border: 1px solid #F1E3B5; white-space: nowrap; }
.stato-res.ok { background: var(--rosa); color: var(--prugna); border-color: transparent; }
.tag-prop { font-size: .64rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #8A6A1F; background: var(--panna); border: 1px solid #F1E3B5; padding: 1px 7px; border-radius: 999px; margin-left: 6px; }

/* linguette con le date delle sedute */
.linguette { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; margin: 0 0 12px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.linguette a { flex: none; display: inline-flex; align-items: baseline; gap: 6px; padding: 9px 14px; border-radius: 14px 14px 4px 4px; background: var(--carta); box-shadow: var(--ombra); color: var(--testo); text-decoration: none; border-bottom: 3px solid transparent; position: relative; }
.linguette a small { font-size: .68rem; color: var(--muted); font-weight: 600; }
.linguette a b { font-weight: 600; font-size: .92rem; white-space: nowrap; }
.linguette a:hover { background: var(--rosa); }
.linguette a.on { background: var(--prugna); color: var(--crema); border-bottom-color: var(--punto); }
.linguette a.on small { color: rgba(249,243,238,.7); }
.linguette a.futura:not(.on) { background: transparent; box-shadow: inset 0 0 0 1.4px var(--linea); }
.linguette a .pt { width: 7px; height: 7px; border-radius: 50%; background: #E3B34A; align-self: center; }
.linguette a .pt.ok { background: var(--punto); }
.linguette a.on .pt.ok { background: var(--crema); }
.linguette a.nuova { background: transparent; box-shadow: inset 0 0 0 1.4px var(--linea); color: var(--prugna); font-weight: 600; padding: 9px 16px; }
.card .linguette { margin: 0 -4px 6px; padding-left: 4px; }
.card .linguette a { box-shadow: none; background: var(--crema); }
.card .linguette a.on { background: var(--prugna); }

.seduta-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.seduta-grid.percorso { grid-template-columns: minmax(0, 1fr) 380px; }
.sed-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.sed-col > .card { margin: 0; }
.card-head h2 { display: flex; align-items: center; }

/* registratore */
#registratore { display: flex; flex-direction: column; gap: 12px; }
#registratore > div { display: none; flex-direction: column; gap: 12px; }
#registratore[data-fase="fermo"] .reg-pronto, #registratore[data-fase="interrotta"] .reg-interrotta, #registratore[data-fase="da_trascrivere"] .reg-attesa,
#registratore[data-fase="registro"] .reg-vivo, #registratore[data-fase="trascrivo"] .reg-vivo, #registratore[data-fase="salvo"] .reg-vivo, #registratore[data-fase="salvata"] .reg-vivo, #registratore[data-fase="claude"] .reg-vivo { display: flex; }
#registratore:not([data-fase]) > .reg-pronto { display: flex; }
#registratore p { margin: 0; }
.consenso-txt { font-size: .95rem; line-height: 1.55; }
.reg-scelta { display: inline-flex; background: var(--crema); border-radius: 999px; padding: 4px; align-self: flex-start; }
.reg-scelta label { margin: 0; text-transform: none; letter-spacing: 0; font-size: .88rem; cursor: pointer; }
.reg-scelta input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.reg-scelta span { display: block; padding: 7px 16px; border-radius: 999px; color: var(--prugna); }
.reg-scelta input:checked + span { background: var(--prugna); color: var(--crema); }
.btn-reg { align-self: flex-start; display: inline-flex; align-items: center; gap: 12px; background: var(--prugna); color: var(--crema); border: 0; border-radius: 999px; padding: 16px 30px 16px 22px; font: 800 1.1rem var(--sans); cursor: pointer; box-shadow: 0 16px 30px -16px rgba(138,0,60,.7); transition: transform .15s; }
.btn-reg:hover { transform: translateY(-2px); }
.btn-reg:disabled { opacity: .6; cursor: wait; }
.btn-reg i { width: 18px; height: 18px; border-radius: 50%; background: var(--punto); box-shadow: 0 0 0 4px rgba(232,51,106,.3); }
.reg-qui { font-size: .86rem; }
.reg-nota em { font-style: normal; font-weight: 600; color: var(--testo); }
.reg-fatta { display: flex; align-items: center; gap: 10px; font-size: .95rem; }
.reg-fatta i { width: 22px; height: 22px; border-radius: 50%; background: var(--prugna); flex: none; position: relative; }
.reg-fatta i::after { content: ''; position: absolute; left: 8px; top: 4px; width: 5px; height: 10px; border: solid var(--crema); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.reg-ancora summary { font-size: .86rem; }
.reg-ancora[open] { display: flex; flex-direction: column; gap: 12px; }
.reg-riga { display: flex; align-items: center; gap: 14px; }
.reg-led { width: 14px; height: 14px; border-radius: 50%; background: var(--punto); flex: none; animation: batti 1.2s ease-in-out infinite; }
#registratore.in-pausa .reg-led, #registratore:not([data-fase="registro"]) .reg-led { animation: none; background: var(--linea); }
@keyframes batti { 0%, 100% { box-shadow: 0 0 0 0 rgba(232,51,106,.5); } 50% { box-shadow: 0 0 0 9px rgba(232,51,106,0); } }
.reg-tempo { font: 800 2.2rem var(--sans); letter-spacing: -.02em; color: var(--prugna); font-variant-numeric: tabular-nums; }
.reg-stato { color: var(--muted); font-size: .92rem; }
.reg-livello { height: 6px; border-radius: 3px; background: var(--linea); overflow: hidden; min-width: 120px; flex: 1; }
.reg-livello i { display: block; height: 100%; width: 0; background: var(--punto); border-radius: 3px; transition: width .12s; }
.btn-stop { background: var(--testo); color: #fff; display: inline-flex; align-items: center; gap: 10px; }
.btn-stop i { width: 12px; height: 12px; border-radius: 3px; background: #fff; }
#registratore:not([data-fase="registro"]) .reg-comandi, #registratore:not([data-fase="registro"]) .reg-livello { display: none; }
.reg-avviso { display: none; font-size: .86rem; padding: 10px 14px; border-radius: 14px; background: var(--panna); border: 1px solid #F1E3B5; color: #7A5A12; }
.reg-avviso.on { display: block; }
.reg-avviso.err { background: #FDECEC; border-color: #F4C7C7; color: #8E2B2B; }

/* resoconto */
.res-vuoto { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.res-vuoto p { margin: 0; }
.res-form-wrap > summary { margin-bottom: 12px; }
.res-form { display: flex; flex-direction: column; gap: 14px; }
.res-sez label { display: block; margin: 0 0 6px; font: 800 .92rem var(--titoli, var(--sans)); letter-spacing: -.005em; text-transform: none; color: var(--prugna); }
.res-sez textarea { margin: 0; background: var(--crema); border-color: transparent; font-size: .95rem; line-height: 1.55; resize: vertical; min-height: 54px; }
.res-sez textarea:focus { background: #fff; border-color: var(--linea); }
.res-in_breve textarea { font-weight: 500; font-size: 1rem; background: var(--rosa); }
.res-sez.allerta { background: #FDECEC; border: 1px solid #F4C7C7; border-radius: 16px; padding: 12px 14px; }
.res-sez.allerta label { color: #8E2B2B; }
.res-sez.allerta textarea { background: #fff; }
.res-piede { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--linea-2); }
.res-piede form { margin: 0; }
.ai-attesa { display: flex; align-items: center; gap: 14px; background: var(--rosa); border-radius: 16px; padding: 16px 18px; margin-bottom: 12px; }
.ai-attesa strong { display: block; color: var(--prugna); }
.ai-attesa .ai-sotto { font-size: .82rem; color: var(--muted); }
.ai-nascosta { display: none; }
.ai-lavora .ai-nascosta { display: flex; }
.ai-lavora .res-vuoto, .ai-lavora .res-form-wrap, .ai-lavora .res-piede { display: none; }
.ai-giro { width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(138,0,60,.18); border-top-color: var(--prugna); animation: giro 0.9s linear infinite; flex: none; }
@keyframes giro { to { transform: rotate(360deg); } }

/* trascrizione */
.tr-corpo p, .dialogo p { margin: 0 0 10px; font-size: .93rem; line-height: 1.6; }
.tr-testo { margin-top: 6px; }
.tr-testo > summary { margin-bottom: 10px; }
.tr-corpo, .dialogo { max-height: 520px; overflow-y: auto; padding: 14px 16px; background: var(--crema); border-radius: 16px; }
.turno b { display: inline-block; min-width: 74px; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.turno-d b { color: var(--prugna); }
.turno-p { padding-left: 14px; border-left: 3px solid var(--rosa); }
.tr-mano { flex: 1 1 100%; }
.tr-mano summary { font-size: .84rem; }
.tr-mano textarea { margin-top: 10px; font-size: .9rem; }

/* proposte di Claude */
.proposte { background: var(--panna); border: 1px solid #F1E3B5; box-shadow: none; }
.proposte .card-head h2 { color: #7A5A12; }
.proposte .card-head h2 .svg-i { color: #A27C1E; }
.prop { background: #fff; border-radius: 16px; padding: 12px 14px; margin: 0 0 10px; display: flex; flex-direction: column; gap: 8px; }
.prop-tit { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.prop-tit b { color: var(--prugna); }
.prop-motivo { margin: 0; font-size: .8rem; color: #8A6A1F; }
.prop textarea { margin: 0; font-size: .9rem; line-height: 1.5; background: var(--crema); border-color: transparent; }
.prop-ora summary { font-size: .78rem; }
.prop-ora div { font-size: .82rem; color: var(--muted); padding: 8px 0 0; }
.prop .azioni, .prop-att { margin: 0; }
.prop-att { display: flex; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid #F1E3B5; }
.prop-att:last-child { border-bottom: 0; }
.prop-att > span { flex: 1; font-size: .9rem; min-width: 0; }
.prop-att small { display: block; color: #9C8350; font-size: .74rem; }

/* scheda paziente: pagina della seduta, quadro generale, report */
.pagina-seduta { border-top: 1px solid var(--linea-2); padding-top: 16px; }
.ps-testa { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.ps-testa h3 { font: 800 1.35rem var(--titoli, var(--sans)); color: var(--prugna); text-transform: none; letter-spacing: -.01em; margin: 4px 0 0; }
.ps-testa h3 small { font: 500 .85rem var(--sans); color: var(--muted); margin-left: 6px; }
.ps-testa .eyebrow { margin: 0; }
.ps-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 14px; align-items: center; }
.ps-sez { margin: 0 0 14px; }
.ps-sez h4, .q-tit h4, .foglio-blocco h4 { margin: 0 0 4px; font: 800 .86rem var(--titoli, var(--sans)); color: var(--prugna); text-transform: none; letter-spacing: 0; }
.ps-sez p, .ps-sez ul, .ps-sez ol, .q-testo p, .q-testo ul { margin: 0 0 6px; font-size: .94rem; line-height: 1.55; }
.ps-sez ul, .ps-sez ol, .q-testo ul, .q-testo ol, .bolla ul, .bolla ol, .foglio ul, .foglio ol, .report-anteprima ul { padding-left: 20px; }
.ps-sez.breve { background: var(--rosa); border-radius: 16px; padding: 12px 16px; }
.ps-sez.breve p { font-weight: 500; font-size: 1rem; }
.ps-sez.allerta { background: #FDECEC; border: 1px solid #F4C7C7; border-radius: 16px; padding: 12px 16px; }
.ps-sez.allerta h4 { color: #8E2B2B; }
.ps-vuota { margin: 6px 0; }
.q-sez { padding: 12px 0; border-bottom: 1px solid var(--linea-2); }
.q-sez:last-child { border-bottom: 0; padding-bottom: 0; }
.q-tit { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.q-tit small { font-size: .7rem; color: var(--muted); white-space: nowrap; }
.q-vuota { margin: 0; font-size: .86rem; color: #C1AAB3; font-style: italic; }
.q-mod summary { font-size: .78rem; margin-top: 4px; }
.q-mod form { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 8px; }
.q-mod textarea { margin: 0; font-size: .9rem; line-height: 1.5; }
.q-storia { margin-top: 12px; padding: 10px 12px; background: var(--crema); border-radius: 12px; }
.q-storia div { padding: 8px 0; border-bottom: 1px solid var(--linea-2); }
.q-storia div:last-child { border-bottom: 0; }
.q-storia small { color: var(--muted); font-size: .72rem; }
.q-storia p { margin: 2px 0 0; font-size: .84rem; color: var(--muted); }
.report-anteprima { max-height: 250px; overflow: hidden; position: relative; font-size: .9rem; line-height: 1.55; margin-bottom: 12px; }
.report-anteprima::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 60px; background: linear-gradient(transparent, var(--carta)); }
.report-anteprima h3, .report-anteprima h4 { font: 800 .9rem var(--titoli, var(--sans)); color: var(--prugna); text-transform: none; letter-spacing: 0; margin: 10px 0 4px; }
.report-anteprima p { margin: 0 0 6px; }
.consenso-riga { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.consenso-riga p { margin: 0; }

/* chat */
.chat-lista { display: flex; flex-direction: column; gap: 10px; max-height: 460px; overflow-y: auto; padding: 4px 2px 8px; }
.chat-mini .chat-lista { max-height: 300px; }
.chat-grande .chat-lista { max-height: none; min-height: 240px; }
.chat-vuota { margin: 0; }
.bolla { max-width: 88%; padding: 10px 14px; border-radius: 18px; font-size: .93rem; line-height: 1.55; word-wrap: break-word; }
.bolla-utente { align-self: flex-end; background: var(--prugna); color: var(--crema); border-bottom-right-radius: 6px; white-space: pre-wrap; }
.bolla-claude { align-self: flex-start; background: var(--crema); border-bottom-left-radius: 6px; }
.bolla-claude p { margin: 0 0 8px; } .bolla-claude > :last-child { margin-bottom: 0; }
.bolla-claude h3, .bolla-claude h4, .bolla-claude h5 { font: 800 .92rem var(--titoli, var(--sans)); color: var(--prugna); text-transform: none; letter-spacing: 0; margin: 8px 0 4px; }
.bolla-claude ul, .bolla-claude ol { margin: 0 0 8px; }
.bolla-errore { align-self: flex-start; background: #FDECEC; color: #8E2B2B; border: 1px solid #F4C7C7; }
.bolla-attesa { align-self: flex-start; background: var(--crema); display: flex; gap: 5px; padding: 14px 16px; }
.bolla-attesa i { width: 7px; height: 7px; border-radius: 50%; background: var(--prugna); opacity: .3; animation: punti 1.2s infinite; }
.bolla-attesa i:nth-child(2) { animation-delay: .2s; } .bolla-attesa i:nth-child(3) { animation-delay: .4s; }
@keyframes punti { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chat-spunti { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chat-spunti button { font: 500 .8rem var(--sans); padding: 7px 12px; border-radius: 999px; border: 1.4px solid var(--linea); background: #fff; color: var(--prugna); cursor: pointer; }
.chat-spunti button:hover { background: var(--rosa); border-color: transparent; }
.chat-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 6px 0 0; }
.chat-form textarea { flex: 1; margin: 0; min-height: 46px; resize: none; border-radius: 22px; padding: 11px 16px; font-size: .95rem; }
.chat-invia { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--prugna); color: var(--crema); font-size: 1.2rem; font-weight: 700; cursor: pointer; flex: none; }
.chat-form.attesa .chat-invia { opacity: .4; pointer-events: none; }
.chat-prof { flex: 1 1 100%; font-size: .78rem; color: var(--muted); margin: 0; }

/* account */
.passi { margin: 8px 0 14px; padding-left: 20px; font-size: .9rem; line-height: 1.6; }
.passi li { margin-bottom: 6px; }
.prova-trascrizione { margin-top: 20px; padding: 16px 18px; background: var(--crema); border-radius: 18px; }
.prova-trascrizione h3 { font: 800 .95rem var(--titoli, var(--sans)); color: var(--prugna); text-transform: none; letter-spacing: 0; margin: 0 0 6px; }
.prova-trascrizione .azioni { align-items: center; }
.prova-esito { display: none; margin: 10px 0 0; padding: 12px 14px; background: #fff; border-radius: 14px; font-size: .95rem; line-height: 1.55; }
.prova-esito.on { display: block; }
code { background: var(--crema); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
#dati details > summary { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
#dati details > summary h2 { display: inline; }
#dati details[open] > summary { margin-bottom: 14px; }

/* report stampabile */
.foglio { background: #fff; border-radius: var(--r); box-shadow: var(--ombra); padding: 44px 52px; max-width: 820px; margin: 16px auto 0; }
.foglio-testa { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 18px; margin-bottom: 22px; border-bottom: 2px solid var(--prugna); }
.foglio-testa div { text-align: right; font-size: .82rem; color: var(--muted); }
.foglio-testa strong { display: block; color: var(--prugna); font-size: .95rem; }
.foglio h1 { margin: 4px 0 6px; }
.foglio-meta { color: var(--muted); font-size: .86rem; margin: 0 0 22px; }
.foglio-corpo h3, .foglio-sez, .foglio-seduta h3 { font: 800 1.08rem var(--titoli, var(--sans)); color: var(--prugna); text-transform: none; letter-spacing: -.01em; margin: 22px 0 8px; }
.foglio-sez { font-size: 1.25rem; margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--linea); }
.foglio p, .foglio li { font-size: .95rem; line-height: 1.6; }
.foglio p { margin: 0 0 8px; }
.foglio ul, .foglio ol { margin: 0 0 10px; }
.foglio-blocco { margin-bottom: 12px; }
.foglio-seduta { break-inside: avoid-page; }
.foglio-piede { margin-top: 34px; padding-top: 12px; border-top: 1px solid var(--linea); font-size: .72rem; color: var(--muted); text-align: center; }
.report-barra { align-items: center; margin: 10px 0 6px; }
@media print {
  @page { margin: 16mm 15mm; }
  body { background: #fff !important; }
  .top, .barra-mobile, .piede, .no-stampa, .flash { display: none !important; }
  main { padding: 0 !important; max-width: none !important; margin: 0 !important; }
  .foglio { box-shadow: none; border-radius: 0; padding: 0; max-width: none; margin: 0; }
  h1::after { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 1060px) {
  .seduta-grid, .seduta-grid.percorso { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .reg-tempo { font-size: 1.8rem; }
  .btn-reg { width: 100%; justify-content: center; }
  .foglio { padding: 26px 20px; }
  .foglio-testa { flex-direction: column; align-items: flex-start; }
  .foglio-testa div { text-align: left; }
  .bolla { max-width: 96%; }
  .ps-testa .btn { width: 100%; text-align: center; }
  .top-icone a { width: 38px; }
}
#registratore.reg-consenso > div { display: flex; flex-direction: row; flex-wrap: wrap; }
@media (max-width: 760px) {
  .head-row .btn.btn-inizia { display: inline-flex; align-items: center; justify-content: center; width: 100%; }
  .head-row:has(.btn-inizia) { flex-direction: column; align-items: stretch; }
  .head-row:has(.btn-inizia) .head-actions, .head-row:has(.btn-inizia) .head-actions form { width: 100%; }
}
