/* ===== Tema Tiffany (ripreso dal logo dello studio) ===== */
:root {
  --tiffany: #81D8D0;          /* colore del logo */
  --tiffany-light: #E8F7F5;    /* sfondi chiari */
  --tiffany-dark: #0E7C7B;     /* pulsanti e link: testo bianco leggibile (contrasto 5:1) */
  --tiffany-deep: #0A5F5E;     /* hover */
  --navy: #0B2A3C;             /* testo su Tiffany (contrasto ~9:1) */
  --primary: var(--tiffany-dark);
  --primary-dark: var(--tiffany-deep);
  --primary-light: var(--tiffany-light);
  --side-bg: var(--tiffany);
  --side-ink: var(--navy);
  --side-muted: #1F4A5E;
  --side-line: rgba(11, 42, 60, .15);
}
body { background: #F4FAF9; }

/* Menu laterale */
.sidebar { background: var(--tiffany); border-right: 1px solid #6CC9C0; color: var(--navy); }
.side-brand { color: var(--navy); font-weight: 700; }
.side-brand img, .mobilebar .brand img, .guest-brand img, .portal-head img {
  background: #fff; border-radius: 50%; padding: 3px;
  box-shadow: 0 0 0 2px var(--tiffany-dark), 0 2px 6px rgba(11, 42, 60, .18);
}
.side-group { color: #1F4A5E; }
.side-link { color: var(--navy); }
.side-link:hover { background: rgba(255, 255, 255, .45); color: var(--navy); }
.side-link.active { background: #fff; color: var(--navy); box-shadow: inset 4px 0 0 var(--tiffany-dark), 0 1px 4px rgba(11, 42, 60, .15); }
.side-link.is-soon:hover { background: none; }
.side-me, .side-me small { color: var(--navy); }
.side-me small { opacity: .75; }
.side-user .btn { background: #fff; color: var(--navy); border-color: #fff; font-weight: 600; }
.side-user .btn:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Barra in alto su cellulare */
.mobilebar { background: var(--tiffany); border-bottom-color: #6CC9C0; }
.mobilebar .brand { color: var(--navy); font-weight: 700; }
.burger { background: #fff; border-color: #fff; color: var(--navy); }

/* Elementi principali */
a { color: var(--tiffany-dark); }
.btn-primary { background: var(--tiffany-dark); border-color: var(--tiffany-dark); color: #fff; }
.btn-primary:hover { background: var(--tiffany-deep); border-color: var(--tiffany-deep); }
.btn:hover { border-color: var(--tiffany-dark); }
.tabs a.active { color: var(--tiffany-deep); border-bottom-color: var(--tiffany-dark); }
.stat strong { color: var(--tiffany-deep); }
.howto { background: var(--tiffany-light); border-color: var(--tiffany); }
.alert-info { background: var(--tiffany-light); border-color: var(--tiffany); color: var(--tiffany-deep); }
.slot { background: var(--tiffany-light); border-left-color: var(--tiffany-dark); }
input:focus, select:focus, textarea:focus { outline-color: var(--tiffany-dark); border-color: var(--tiffany-dark); }
label.pill:has(input:checked) { border-color: var(--tiffany-dark); background: var(--tiffany-light); }
.pager a.active { background: var(--tiffany-dark); border-color: var(--tiffany-dark); }
.badge-avvocato { background: var(--tiffany-light); color: var(--tiffany-deep); border-color: var(--tiffany); }
.badge-admin { background: var(--navy); border-color: var(--navy); }

/* Pagina di accesso e pagina cliente */
body.guest { background: linear-gradient(160deg, var(--tiffany) 0%, #B9E9E4 45%, #F4FAF9 100%); }
.guest-brand h1 { color: var(--navy); }
body.portal { background: #F4FAF9; }
.portal-head { background: var(--tiffany); border-bottom-color: #6CC9C0; }
.portal-head strong, .portal-head span { color: var(--navy); }
.dropzone { border-color: var(--tiffany); background: #F4FBFA; }
.dropzone:hover, .dropzone.is-over { border-color: var(--tiffany-dark); background: var(--tiffany-light); }
.dropzone strong { color: var(--navy); }
.progress span { background: var(--tiffany-dark); }

/* Home: riquadri riepilogativi */
.dash-head { margin-bottom: 1.5rem; }
.dash-group { margin-bottom: 2rem; }
.dash-group h2 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .06em; color: #1F4A5E; margin: 0 0 .75rem; }
.tiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.tile {
  display: flex; align-items: center; gap: 1rem; padding: 1.25rem 1.25rem; min-height: 120px;
  background: #fff; border: 1px solid var(--edge); border-radius: 16px; text-decoration: none; color: var(--navy);
  box-shadow: 0 1px 3px rgba(11, 42, 60, .06); transition: transform .12s, box-shadow .12s, border-color .12s;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(11, 42, 60, .12); border-color: var(--tiffany); }
.tile-icon {
  flex: none; width: 64px; height: 64px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
  font-size: 2rem; background: var(--tiffany-light);
}
.tile-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tile-num { font-size: 2.4rem; line-height: 1; font-weight: 800; color: var(--tiffany-deep); }
.tile-label { font-size: .92rem; margin-top: .3rem; color: #1F4A5E; }
.tile-hint { margin-top: .35rem; color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-go { font-size: 1.8rem; color: var(--tiffany); }
.tile.is-zero .tile-num { color: #9AAAB4; }
.tile.is-hot { border-color: #F2B33D; background: #FFF9EC; }
.tile.is-hot .tile-icon { background: #FDE7B8; }
.tile.is-hot .tile-num { color: #B9650E; }
.tile.is-hot .tile-go { color: #F2B33D; }
/* Riquadri che chiedono attenzione (prenotazioni da confermare, documenti da scaricare...): si illuminano a impulsi */
.tile.is-hot { animation: tile-attention 1.6s ease-in-out infinite; }
.tile.is-hot:hover, .tile.is-hot:focus-visible { animation-play-state: paused; }
/* Voce del menu (e blocco chiuso) con qualcosa da approvare: lampeggia finche' non si fa (es. Fatture da approvare) */
.side-link.is-blink, .side-group.is-blink { animation: menu-attention 1.4s ease-in-out infinite; border-radius: 10px; }
.side-link.is-blink:hover, .side-group.is-blink:hover { animation-play-state: paused; }
@keyframes menu-attention {
  0%, 100% { background-color: transparent; box-shadow: none; }
  50% { background-color: rgba(242, 179, 61, .28); box-shadow: 0 0 0 2px rgba(242, 179, 61, .6); }
}
@media (prefers-reduced-motion: reduce) { .side-link.is-blink, .side-group.is-blink { animation: none; background-color: rgba(242, 179, 61, .22); } }
/* Prenotazioni: riquadro e scheda «Da confermare» lampeggiano finche' c'e' una prenotazione da confermare */
.stat.is-blink { animation: tile-attention 1.6s ease-in-out infinite; }
.tabs a.is-blink { animation: menu-attention 1.4s ease-in-out infinite; border-radius: 8px 8px 0 0; }
.stat.is-blink:hover, .tabs a.is-blink:hover { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .stat.is-blink, .tabs a.is-blink { animation: none; background-color: rgba(242, 179, 61, .22); } }
/* Modello grafico delle fatture: modulo a sinistra, esempio largo a destra; una colonna sola su tablet e cellulare */
.inv-tpl-grid { display: grid; gap: 1rem; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); align-items: start; }
.inv-tpl-grid > * { min-width: 0; }
.inv-tpl-grid .form-grid { grid-template-columns: auto minmax(0, 1fr); }   /* Colore stretto accanto a Carattere, senza uscire dal riquadro */
.inv-tpl-grid select { min-width: 0; max-width: 100%; }
.inv-tpl-preview { position: sticky; top: 1rem; }
@media (max-width: 1250px) { .inv-tpl-grid { grid-template-columns: minmax(0, 1fr); } .inv-tpl-preview { position: static; } }
/* altezza pari al foglio A4 rimpicciolito alla larghezza del riquadro, cosi' si vede tutto senza scorrere */
.inv-tpl-frame { display: block; width: 100%; height: auto; aspect-ratio: 210 / 305; max-height: 1150px; border: 1px solid var(--edge, #ccc); border-radius: 10px; background: #fff; }
@keyframes tile-attention {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 179, 61, 0); }
  50% { box-shadow: 0 0 0 5px rgba(242, 179, 61, .55), 0 0 18px 2px rgba(242, 179, 61, .45); }
}
@media (prefers-reduced-motion: reduce) { .tile.is-hot { animation: none; box-shadow: 0 0 0 3px rgba(242, 179, 61, .55); } }
.tile { min-width: 0; }
@media (max-width: 520px) { .tiles { grid-template-columns: minmax(0, 1fr); } .tile { min-height: 96px; } .tile-num { font-size: 2rem; } }

/* Costruttore della lista (console) */
.list-builder { border: 1px solid var(--edge); border-radius: var(--radius); padding: 1rem; margin: 1rem 0; background: #FAFDFC; }
.list-rows { display: flex; flex-direction: column; gap: .4rem; margin: .5rem 0 .75rem; }
.list-row { display: grid; grid-template-columns: auto 2fr 1.5fr auto auto; gap: .4rem; align-items: center; }
.list-row input, .list-row select { margin: 0; }
.list-row .drag { color: var(--muted); cursor: default; padding: 0 .2rem; }
@media (max-width: 760px) { .list-row { grid-template-columns: 1fr auto; } .list-row .drag { display: none; } .list-row input[name="item_label[]"] { grid-column: 1 / -1; } }

/* Lista documenti nella scheda (console) */
.checklist-item { border-left: 5px solid var(--edge); padding: .85rem 1.1rem; margin-bottom: .6rem; }
.checklist-item.is-done { border-left-color: #2ECC71; }
.checklist-item.is-missing { border-left-color: var(--danger); background: #FFF8F7; }
.ci-head { display: flex; align-items: center; gap: .75rem; }
.ci-head form { margin: 0; }
.ci-icon { font-size: 1.2rem; }
.ci-title { flex: 1; min-width: 0; }
.ci-title strong { display: block; color: var(--navy); }
.ci-state { font-size: .82rem; font-weight: 700; color: var(--ok); white-space: nowrap; }
.checklist-item.is-missing .ci-state { color: var(--danger); }
.checklist-item.is-optional .ci-state { color: var(--muted); font-weight: 400; }
.ci-files { margin-top: .5rem; }
.ci-files td { border-bottom-color: #EEF2F3; }

/* Lista documenti richiesti (pagina cliente) */
.section-h { font-size: 1.15rem; margin: 1.5rem 0 .25rem; }
.progress-box { background: #fff; border: 1px solid var(--edge); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1rem 0; }
.progress-box.is-complete { border-color: #A9DFBF; background: #F3FBF6; }
.progress-text { margin-bottom: .5rem; }
.progress.big { height: 10px; border-radius: 5px; }
.progress-box.is-complete .progress span { background: #2ECC71; }
.item-card { border-left: 5px solid var(--edge); padding: 1rem 1.1rem; margin-bottom: .75rem; transition: border-color .15s, background .15s; }
.item-card.is-missing { border-left-color: #E8A33D; }
.item-card.is-done { border-left-color: #2ECC71; }
.item-card.is-over { background: var(--tiffany-light); }
.item-head { display: flex; align-items: center; gap: .85rem; }
.item-status { flex: none; width: 2rem; height: 2rem; border-radius: 50%; border: 2px solid var(--edge); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; }
.item-card.is-done .item-status { background: #2ECC71; border-color: #2ECC71; }
.item-card.is-missing .item-status { border-color: #E8A33D; }
.item-title { flex: 1; min-width: 0; }
.item-title strong { display: block; font-size: 1.05rem; color: var(--navy); }
.item-title small { display: block; }
.item-state { display: inline-block; font-size: .8rem; margin-top: .2rem; color: var(--muted); }
.item-card.is-done .item-state { color: var(--ok); font-weight: 600; }
.item-card.is-missing .item-state { color: #B9770E; font-weight: 600; }
.item-btn { cursor: pointer; white-space: nowrap; }
.item-files:not(:empty) { margin-top: .6rem; padding-left: 2.85rem; }
details.others summary { cursor: pointer; padding: .25rem 0 .75rem; }
.modal { border: 0; border-radius: 14px; padding: 1.5rem; max-width: 440px; width: calc(100% - 2rem); box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.modal::backdrop { background: rgba(11, 42, 60, .45); }
.missing-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.missing-list li { padding: .3rem 0; font-weight: 600; color: var(--danger); }
@media (max-width: 520px) {
  .item-head { flex-wrap: wrap; }
  .item-btn { width: 100%; text-align: center; }
  .item-files:not(:empty) { padding-left: 0; }
}

[hidden] { display: none !important; }
/* Linguetta laterale "Installa app" */
.install-tab { position: fixed; right: 0; top: 55%; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; }
.install-tab-btn { display: flex; align-items: center; gap: .4rem; writing-mode: vertical-rl; background: var(--navy); color: #fff; border: 0; font: inherit; font-weight: 700; font-size: .8rem; letter-spacing: .03em; padding: .9rem .5rem; border-radius: 10px 0 0 10px; box-shadow: 0 4px 14px rgba(0,0,0,.18); cursor: pointer; animation: install-pulse 1.6s ease-in-out 4; }
.install-tab-btn:hover { background: #12405A; }
.install-tab-btn span[aria-hidden] { writing-mode: horizontal-tb; }
.install-tab-close { margin-top: .25rem; width: 1.5rem; height: 1.5rem; padding: 0; border: 0; border-radius: 50% 0 0 50%; background: rgba(0,0,0,.45); color: #fff; font-size: .9rem; line-height: 1; cursor: pointer; }
@keyframes install-pulse { 0%, 100% { box-shadow: 0 4px 14px rgba(0,0,0,.18); } 50% { box-shadow: 0 0 0 6px rgba(129,216,208,.6), 0 4px 14px rgba(0,0,0,.18); } }
@media (prefers-reduced-motion: reduce) { .install-tab-btn { animation: none; } }

.push-btn { margin-bottom: .5rem; background: #fff; border-color: var(--tiffany); color: var(--navy); font-weight: 600; }
.push-btn.is-on { background: transparent; border-color: rgba(11,42,60,.2); font-weight: 400; }

/* Campi di ricerca, telefono, link e numeri con lo stesso aspetto degli altri */
input[type=search], input[type=tel], input[type=url], input[type=number], input[type=datetime-local], input[type=date], input[type=time], textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .6rem .7rem; border: 1px solid var(--edge); border-radius: 6px; font: inherit; color: inherit; background: #fff; }
.inline-form input[type=search] { margin: 0; width: auto; flex: 1 1 200px; }

/* ---------- Numeretti "da vedere" ---------- */
.side-count { margin-left: auto; min-width: 1.35rem; height: 1.35rem; padding: 0 .4rem; border-radius: 999px; background: #E2574C; color: #fff;
  font-size: .72rem; font-weight: 800; line-height: 1.35rem; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.2); animation: count-pop .35s ease-out; }
.side-count-sec { margin-left: .4rem; }
.side-sec > summary .side-count-sec + * { margin-left: 0; }
.side-sec[open] > summary .side-count-sec { display: none; } /* blocco aperto: i numeri sono gia' sulle voci */
.burger { position: relative; }
.burger-count { position: absolute; top: -6px; right: -6px; min-width: 1.2rem; height: 1.2rem; padding: 0 .3rem; border-radius: 999px; background: #E2574C; color: #fff; font-size: .68rem; font-weight: 800; line-height: 1.2rem; }
@keyframes count-pop { from { transform: scale(.4); } to { transform: scale(1); } }

/* ---------- Menu a blocchi ---------- */
.side-site { font-size: .75rem; color: #1F4A5E; padding: .6rem .65rem .2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-sec { margin-top: .35rem; border-top: 1px solid rgba(11, 42, 60, .12); }
.side-sec:first-of-type { border-top: 0; }
.side-sec > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .4rem; padding: .7rem .65rem .35rem; user-select: none; border-radius: 6px; }
.side-sec > summary::-webkit-details-marker { display: none; }
.side-sec > summary::after { content: '▾'; margin-left: auto; font-size: .8rem; transition: transform .15s; }
.side-sec:not([open]) > summary::after { transform: rotate(-90deg); }
.side-sec > summary:hover { background: rgba(255, 255, 255, .35); }
.side-sec > summary.has-active { color: var(--navy); }
.side-sec .side-link { margin-left: .25rem; }

/* ---------- Interruttori acceso/spento ---------- */
.sw-form { margin: 0; }
.sw { display: flex; gap: .7rem; align-items: center; width: 100%; height: auto; min-height: 0; text-align: left; white-space: normal; line-height: 1.3; background: #fff; border: 1px solid var(--edge); border-radius: 10px; padding: .6rem .8rem; margin: 0; cursor: pointer; font: inherit; color: var(--ink); box-shadow: none; }
.sw:hover { background: #fff; color: var(--ink); }
div.sw { cursor: default; }
.sw:hover { border-color: var(--tiffany); }
.sw:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.sw-track { flex: none; position: relative; width: 42px; height: 24px; border-radius: 999px; background: #C9D3DA; transition: background .15s; }
.sw-dot { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.sw.is-on .sw-track { background: var(--ok); }
.sw.is-on .sw-dot { left: 21px; }
.sw-text { display: flex; flex-direction: column; min-width: 0; }
.sw-text small { color: var(--muted); font-size: .8rem; }
.sw-row { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: .8rem 0; }
.sw.sw-mini { width: auto; border: 0; padding: .1rem; background: none; gap: .4rem; }
.sw-mini .sw-track { width: 34px; height: 20px; }
.sw-mini .sw-dot { width: 14px; height: 14px; }
.sw-mini.is-on .sw-dot { left: 17px; }
.sw-mini .sw-text small { font-size: .75rem; white-space: nowrap; }

.alert-warning { background: var(--warn-light); border-color: #F5CBA7; color: var(--warn); }
.grid2 { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* ---------- Sedi ---------- */
.sedi-summary { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.sedi-list { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); align-items: start; }
.sede { margin: 0; min-width: 0; }
.sede.is-off { opacity: .65; }
.sede-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.sede details, .mat details { border-top: 1px solid var(--edge); padding-top: .6rem; }
.sede summary, .mat summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.sede-form { margin-top: .6rem; }
.sede-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* ---------- Materie ---------- */
.mat-layout { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.mat-list { display: grid; gap: .75rem; }
.mat { margin: 0; padding: .9rem 1rem; }
.mat.is-off { background: #F6F8F9; }
.mat.is-off .mat-name { color: var(--muted); text-decoration: line-through; }
.mat-head { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; }
.mat-name { font-weight: 700; font-size: 1.05rem; margin-right: auto; }
.mat-count { color: var(--muted); font-size: .85rem; }
.mat details { margin-top: .6rem; }
.mat-subs { list-style: none; padding: 0; margin: .5rem 0; }
.mat-subs li { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; padding: .35rem 0; border-top: 1px dashed var(--edge); }
.mat-subs li.is-off .rename input { color: var(--muted); text-decoration: line-through; }
.mat-subs .rename { display: flex; gap: .35rem; flex: 1 1 220px; margin: 0; }
.mat-subs .rename input { margin: 0; padding: .35rem .5rem; }
.mat-rename { display: flex; gap: .35rem; margin: .5rem 0; }
.mat-rename input { margin: 0; }
.mat-preview { position: sticky; top: 1rem; margin: 0; }
.mat-preview ol { padding-left: 1.2rem; margin: .5rem 0 0; }
.mat-preview li { margin: .3rem 0; font-weight: 600; }
.mat-preview li ul { font-weight: 400; color: var(--muted); padding-left: 1rem; font-size: .88rem; }
.mat-filter { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; }
@media (max-width: 900px) {
  .mat-layout { grid-template-columns: 1fr; }
  .mat-preview { position: static; }
}

/* ---------- Rubrica contatti ---------- */
.cl-role { font-size: .74rem; }
.cl-cliente { background: #E9F7F7; color: #1F8585; border-color: #A3E0E0; }
.cl-collaboratore { background: #EEF4FF; color: #2E5AAC; border-color: #BCD0F5; }
.cl-professionista { background: #FFF6E5; color: #8A5A00; border-color: #F3D9A4; }
.cl-roles { border: 0; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.cl-roles legend { margin-bottom: .4rem; }
.cl-role-opt { display: flex; gap: .55rem; align-items: flex-start; border: 1px solid var(--edge); border-radius: 10px; padding: .55rem .7rem; margin: 0; cursor: pointer; font-weight: 400; }
.cl-role-opt input { width: auto; margin-top: .2rem; }
.cl-role-opt span { display: flex; flex-direction: column; }
.cl-role-opt small { color: var(--muted); font-size: .76rem; }
.cl-role-opt:has(input:checked) { border-color: var(--navy); background: #F3FBFA; }

.cl-c0 { background: #F3EEFF; color: #5B3FD0; border-color: #D3C6F7; }
.cl-c1 { background: #EAF7EE; color: #1E7A3E; border-color: #B7E2C4; }
.cl-c2 { background: #FDEEF3; color: #A3245A; border-color: #F2C1D4; }
.cl-c3 { background: #EEF6FB; color: #23628A; border-color: #BFDCEE; }
.cl-c4 { background: #F5F2EA; color: #6B5A2E; border-color: #E2D7B8; }
.ct-type-list { display: grid; gap: .8rem; max-width: 900px; }
.ct-type { margin: 0; }
.ct-type-form { display: grid; gap: .6rem; grid-template-columns: 90px minmax(140px, 1fr) minmax(200px, 2fr) auto; align-items: end; margin: 0; }
.ct-type-form label { margin: 0; font-size: .85rem; }
.ct-type-form input { margin-top: .2rem; }
.ct-type-icon input { text-align: center; font-size: 1.2rem; }
.ct-type-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .5rem; }
@media (max-width: 700px) {
  .ct-type-form { grid-template-columns: 80px minmax(0, 1fr); }
  .ct-type-hint, .ct-type-form .btn { grid-column: 1 / -1; }
}

/* ---------- Richieste di contatto ---------- */
.ct-list { display: grid; gap: .5rem; }
.ct-row { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: 1rem; align-items: center; margin: 0; padding: .75rem 1rem; color: var(--ink); text-decoration: none; }
.ct-row:hover { border-color: var(--tiffany); }
.ct-row.is-new { border-left: 4px solid var(--tiffany-dark, #4DB6AC); background: #F6FCFB; }
.ct-row.is-new .ct-who strong::before { content: '● '; color: var(--tiffany-dark, #4DB6AC); }
.ct-who, .ct-msg { display: flex; flex-direction: column; min-width: 0; }
.ct-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-topic { font-size: .78rem; font-weight: 700; color: var(--tiffany-deep, #1F8585); }
.ct-side { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; text-align: right; }
.ct-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.ct-main, .ct-side-col { display: grid; gap: 1rem; min-width: 0; }
.ct-main > .card, .ct-side-col > .card { margin: 0; }
.ct-message { white-space: normal; line-height: 1.6; background: #F9FBFC; border: 1px solid var(--edge); border-radius: 10px; padding: .9rem 1rem; overflow-wrap: anywhere; }
.ct-reply-sent { border-left: 4px solid var(--ok); }
.ct-preview { border: 1px solid #C5E9E5; border-radius: 12px; overflow: hidden; margin: .5rem 0 .8rem; background: #fff; }
.ct-preview-head { background: #D6F2EF; padding: .6rem 1rem; font-weight: 700; font-size: .9rem; color: #2E4A4F; }
.ct-preview-head small { font-weight: 400; text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; }
.ct-preview-body { padding: .9rem 1rem; font-size: .92rem; line-height: 1.55; }
.ct-preview-body p { margin: 0 0 .7rem; }
.ct-preview-foot { background: #EAF8F6; color: #6B8A8C; font-size: .75rem; padding: .5rem 1rem; }
.ct-tpl-list { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); margin-bottom: 1rem; }
.ct-tpl { display: grid; gap: .3rem; }
.ct-tpl input, .ct-tpl textarea { margin: 0; }
@media (max-width: 900px) {
  .ct-grid { grid-template-columns: 1fr; }
  .ct-row { grid-template-columns: minmax(0, 1fr); gap: .3rem; }
  .ct-side { flex-direction: row; justify-content: space-between; }
}

/* ---------- Videochiamate ---------- */
.vc-status { border-left: 5px solid var(--edge); }
.vc-status.is-on { border-left-color: var(--ok); }
.vc-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; }
.vc-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; }
.vc-guide ol { padding-left: 1.2rem; }
.vc-guide li { margin-bottom: .8rem; line-height: 1.5; }
.vc-copy { display: block; margin: .4rem 0; padding: .5rem .7rem; background: #F3FBFA; border: 1px dashed var(--tiffany); border-radius: 6px; word-break: break-all; user-select: all; }
.meet-card { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; align-items: center; border-left: 5px solid var(--tiffany); }
.btn-lg { font-size: 1.05rem; padding: .7rem 1.2rem; }

/* ---------- News: cruscotto ---------- */
.nw-tiles { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 1rem; }
.nw-tile { display: flex; gap: .7rem; align-items: center; background: #fff; border: 1px solid var(--edge); border-radius: 12px; padding: .8rem 1rem; color: var(--ink); text-decoration: none; min-width: 0; }
.nw-tile:hover { border-color: var(--tiffany); }
.nw-tile.active { border-color: var(--navy); box-shadow: inset 4px 0 0 var(--navy); }
.nw-tile-ic { font-size: 1.6rem; }
.nw-tile strong { font-size: 1.3rem; margin-right: .2rem; }
.nw-tile small { display: block; color: var(--muted); font-size: .78rem; }
.nw-filter { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.nw-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.nw-chip { display: inline-block; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--edge); background: #fff; color: var(--ink); text-decoration: none; font-size: .85rem; white-space: nowrap; }
.nw-chip:hover { border-color: var(--tiffany); }
.nw-chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.nw-chip.on .muted { color: rgba(255,255,255,.7); }
.nw-list { display: grid; gap: .6rem; }
.nw-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 1rem; align-items: center; margin: 0; padding: .7rem; color: var(--ink); text-decoration: none; }
.nw-row:hover { border-color: var(--tiffany); }
.nw-thumb { width: 96px; height: 64px; border-radius: 8px; background: var(--tiffany-light, #E9F7F7); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; overflow: hidden; }
.nw-thumb img { width: 100%; height: 100%; object-fit: cover; }
.nw-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.nw-meta { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.nw-sector { font-size: .78rem; font-weight: 700; color: var(--tiffany-deep, #1F8585); }
.nw-title { font-size: 1rem; line-height: 1.3; }
.nw-excerpt { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nw-side { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; text-align: right; }
.empty-state { text-align: center; padding: 2rem 1rem; }
@media (max-width: 640px) {
  .nw-row { grid-template-columns: 64px minmax(0, 1fr); }
  .nw-thumb { width: 64px; height: 48px; font-size: 1.4rem; }
  .nw-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
}

.nw-image-status { margin: .2rem 0 .4rem; padding: .45rem .6rem; border-radius: 8px; background: #F3FBFA; }
.nw-image-status.is-ok { background: var(--ok-light); color: var(--ok); font-weight: 600; }
.nw-image-status.is-error { background: var(--danger-light); color: var(--danger); font-weight: 600; }

/* ---------- News: galleria nell'editor ---------- */
.nw-gallery { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: .7rem; }
.nw-gallery:empty { display: none; }
.nw-gal-item { border: 1px solid var(--edge); border-radius: 10px; padding: .4rem; background: #fff; display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.nw-gal-item.is-new { border-style: dashed; border-color: var(--tiffany); }
.nw-gal-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.nw-gal-item input[type=text] { margin: 0; padding: .35rem .5rem; font-size: .82rem; }
.nw-gal-tools { display: flex; justify-content: space-between; align-items: center; gap: .3rem; }
.nw-gal-tools input[type=number] { width: 3.6rem; margin: 0; padding: .2rem .3rem; }
.nw-gal-tools label { margin: 0; display: flex; align-items: center; gap: .25rem; }

/* ---------- News: scrivi con Claude ---------- */
.nw-write { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.nw-write > .card { margin: 0; }
.nw-steps { padding-left: 1.2rem; }
.nw-steps li { margin-bottom: .5rem; line-height: 1.45; }
@media (max-width: 900px) { .nw-write { grid-template-columns: 1fr; } }

/* ---------- News: editor ---------- */
.nw-editor-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.nw-editor-main, .nw-editor-side { display: grid; gap: 1rem; min-width: 0; }
.nw-editor-main > .card, .nw-editor-side > .card { margin: 0; }
.nw-editor .h3 { font-size: 1.05rem; }
.nw-title-input { font-size: 1.25rem; font-weight: 700; }
.nw-count { float: right; font-size: .78rem; color: var(--muted); font-weight: 400; }
.nw-count.is-over { color: var(--warn); font-weight: 700; }
.rich-wrap { margin-top: .5rem; }
.rich-wrap .label { display: block; font-weight: 600; margin-bottom: .35rem; }
.rich-toolbar { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; padding: .4rem; border: 1px solid var(--edge); border-bottom: 0; border-radius: 8px 8px 0 0; background: #F6F8F9; position: sticky; top: 0; z-index: 2; }
.rich-toolbar button { background: #fff; border: 1px solid var(--edge); border-radius: 6px; padding: .3rem .55rem; font: inherit; font-size: .82rem; cursor: pointer; color: var(--ink); }
.rich-toolbar button:hover { border-color: var(--tiffany); background: var(--tiffany-light, #E9F7F7); }
.rich-toolbar .sep { width: 1px; height: 1.4rem; background: var(--edge); margin: 0 .2rem; }
.rich { min-height: 360px; max-height: 70vh; overflow-y: auto; border: 1px solid var(--edge); border-radius: 0 0 8px 8px; padding: 1rem 1.2rem; background: #fff; line-height: 1.65; font-size: 1rem; }
.rich:focus { outline: 2px solid var(--tiffany); outline-offset: -1px; }
.rich.is-empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.rich h2 { font-size: 1.3rem; margin: 1.2rem 0 .4rem; }
.rich h3 { font-size: 1.1rem; margin: 1rem 0 .3rem; }
.rich p { margin: 0 0 .8rem; }
.rich ul, .rich ol { margin: 0 0 .8rem; padding-left: 1.4rem; }
.rich blockquote { margin: 0 0 .8rem; padding: .5rem 1rem; border-left: 4px solid var(--tiffany); background: #F6F8F9; font-style: italic; }
.rich a { color: var(--tiffany-deep, #1F8585); text-decoration: underline; }
.nw-modes { display: grid; gap: .4rem; margin-bottom: .8rem; }
.nw-mode { display: flex; gap: .55rem; align-items: flex-start; border: 1px solid var(--edge); border-radius: 10px; padding: .55rem .7rem; cursor: pointer; margin: 0; font-weight: 400; }
.nw-mode input { margin-top: .2rem; width: auto; }
.nw-mode span { display: flex; flex-direction: column; }
.nw-mode small { color: var(--muted); font-size: .78rem; }
.nw-mode.on { border-color: var(--navy); background: #F3FBFA; }
.nw-when { padding: 0 .2rem .2rem 1.8rem; }
.nw-when input { margin: 0; }
.nw-image { border-radius: 10px; overflow: hidden; background: #F6F8F9; margin-bottom: .6rem; }
.nw-image img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.nw-image-empty { aspect-ratio: 16 / 9; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: .9rem; }
.nw-file { display: inline-block; cursor: pointer; border: 1px dashed var(--tiffany-dark, #4DB6AC); border-radius: 8px; padding: .45rem .8rem; font-weight: 600; margin-bottom: .3rem; }
.nw-file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.nw-file:focus-within { outline: 2px solid var(--navy); }
.nw-card-preview { border: 1px solid var(--edge); border-radius: 12px; overflow: hidden; background: #fff; }
.nw-cp-img { aspect-ratio: 16 / 9; background: #E9F7F7; display: flex; align-items: center; justify-content: center; font-size: 2.6rem; }
.nw-cp-img img { width: 100%; height: 100%; object-fit: cover; }
.nw-cp-body { padding: .7rem .8rem .9rem; }
.nw-cp-sector { font-size: .75rem; font-weight: 700; color: #28A8A8; }
.nw-cp-title { font-family: Georgia, serif; font-size: 1.05rem; font-weight: 700; line-height: 1.3; margin: .2rem 0; }
.nw-cp-excerpt { font-size: .82rem; color: var(--muted); }
@media (max-width: 1000px) {
  .nw-editor-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   CELLULARE: la console si adatta agli schermi piccoli
   ============================================================ */
@media (max-width: 700px) {
  .content { padding: .9rem .8rem 5rem; }
  h1 { font-size: 1.3rem; }
  .page-head { gap: .6rem; }
  .page-head > .btn, .page-head .actions-bar { width: 100%; }
  .page-head .actions-bar .btn, .page-head > .btn { flex: 1 1 auto; text-align: center; }
  .card { padding: .9rem; }

  /* Riquadri numerici compatti: 2-3 per riga invece di uno sotto l'altro */
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
  .stat { padding: .6rem .5rem; text-align: center; }
  .stat strong { font-size: 1.35rem; }
  .stat span { font-size: .72rem; line-height: 1.2; display: block; }
  .nw-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .nw-tile { padding: .55rem .6rem; gap: .45rem; }
  .nw-tile-ic { font-size: 1.2rem; }
  .nw-tile strong { font-size: 1.05rem; }
  .nw-tile small { display: none; }

  /* Home: riquadri compatti, due per riga */
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: .5rem !important; }
  .tile { padding: .65rem .6rem !important; gap: .5rem !important; align-items: flex-start !important; }
  .tile-icon { width: 2.1rem !important; height: 2.1rem !important; font-size: 1.15rem !important; flex: none; }
  .tile-num { font-size: 1.35rem !important; line-height: 1.1; }
  .tile-label { font-size: .78rem !important; line-height: 1.25; }
  .tile-hint, .tile-go { display: none !important; }
  .tile.is-zero { opacity: .7; }

  /* Ricerche e filtri a tutta larghezza */
  .inline-form { flex-wrap: wrap; }
  .inline-form input[type=text], .inline-form input[type=search], .inline-form select { flex: 1 1 100%; min-width: 0; width: 100%; margin: 0; }
  .inline-form .btn { flex: 1 1 auto; }
  .nw-filter { flex-direction: column; align-items: stretch; }
  .nw-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .3rem; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nw-chip { flex: none; }
  .tabs { scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs a { white-space: nowrap; }

  /* Tabelle -> schede una sotto l'altra, con il nome di ogni dato */
  .table-wrap { overflow: visible; background: none; border: 0; padding: 0; box-shadow: none; }
  table.stackable, table.stackable tbody { display: block; }
  table.stackable thead { display: none; }
  table.stackable tr { display: block; background: #fff; border: 1px solid var(--edge); border-radius: 12px; padding: .55rem .8rem; margin-bottom: .6rem; box-shadow: 0 1px 2px rgba(11,42,60,.05); }
  table.stackable.clickable tr { cursor: pointer; }
  table.stackable td { display: block; border: 0; padding: .3rem 0; text-align: right; min-width: 0; overflow-wrap: anywhere; }
  table.stackable td::after { content: ''; display: block; clear: both; }
  table.stackable td::before { content: attr(data-label); float: left; max-width: 45%; margin-right: .7rem; text-align: left; font-size: .72rem; line-height: 1.9; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
  table.stackable td[data-label=""]::before, table.stackable td:not([data-label])::before { content: none; }
  /* Prima colonna = titolo della scheda (nome, data...): a tutta larghezza, senza etichetta */
  table.stackable td:first-child { text-align: left; font-size: 1rem; border-bottom: 1px solid var(--edge); padding-bottom: .45rem; margin-bottom: .2rem; }
  table.stackable td:first-child::before { content: none; }
  table.stackable td[colspan] { text-align: center; }
  table.stackable td[colspan]::before { content: none; }
  table.stackable td.actions { display: flex; justify-content: flex-end; flex-wrap: wrap; }
  .nw-filter > * { min-width: 0; max-width: 100%; }
  .nowrap { white-space: normal; }

  /* Liste a schede gia' esistenti */
  .nw-row { grid-template-columns: 56px minmax(0, 1fr); gap: .6rem; }
  .nw-thumb { width: 56px; height: 44px; }

  /* Pulsanti dei moduli piu' comodi da toccare */
  .btn { padding: .65rem 1rem; }
  .btn-sm { padding: .45rem .7rem; }
  input[type=text], input[type=password], input[type=email], input[type=search], input[type=tel], input[type=url], input[type=number], select, textarea { font-size: 16px; } /* niente zoom automatico su iPhone */

  /* Linguetta "Installa app": solo icona, piu' in basso, non copre il contenuto */
  .install-tab { top: auto; bottom: 5.5rem; }
  .install-tab-btn { padding: .55rem .45rem; font-size: 0; gap: 0; }
  .install-tab-btn span[aria-hidden] { font-size: 1.1rem; }
}

/* ============ Composizione documenti (preventivi e preavvisi di parcella) ============ */
.dc-rows { display: grid; gap: .45rem; margin-bottom: .6rem; }
.dc-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; gap: .45rem; align-items: center; }
.dc-row input { margin: 0; }
.dc-row .dc-amount { text-align: right; }
.dc-rates { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .6rem; }
.dc-rates input { text-align: right; }
.dc-sum { display: grid; grid-template-columns: 1fr auto; gap: .3rem .75rem; margin: .8rem 0 0; padding-top: .7rem; border-top: 1px solid var(--edge); }
.dc-sum dt { color: var(--muted); }
.dc-sum dd { margin: 0; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dc-sum [hidden] { display: none; }
.dc-sum .dc-total { color: var(--ink); font-weight: 700; font-size: 1.05rem; border-top: 1px solid var(--edge); padding-top: .35rem; }
.dc-totals { position: sticky; top: 1rem; }
.dc-form .stack { display: grid; gap: .45rem; margin-top: .4rem; }
.dc-logo-row { display: flex; gap: 1rem; align-items: center; }
.dc-logo-prev { width: 64px; height: 64px; object-fit: contain; border-radius: 50%; border: 1px solid var(--edge); background: #fff; flex: none; }
@media (max-width: 900px) { .dc-totals { position: static; } }
@media (max-width: 520px) {
  .dc-row { grid-template-columns: minmax(0, 1fr) 105px auto; }
  .dc-logo-row { flex-direction: column; align-items: flex-start; }
}.dc-mode { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; }
.dc-mode-opt { display: flex; align-items: center; gap: .45rem; margin: 0; padding: .5rem .8rem; border: 1px solid var(--edge); border-radius: 10px; background: #fff; font-weight: 600; cursor: pointer; }
.dc-mode-opt small { font-weight: 400; color: var(--muted); }
.dc-mode-opt:has(input:checked) { border-color: #81D8D0; background: #effaf8; }
[data-dc-pane] { margin-bottom: .4rem; }
[data-dc-pane][hidden] { display: none; }

/* Archivio mensile: tendina per scegliere i mesi da scaricare */
.arc-pick-form { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .5rem; }
.arc-pick { position: relative; }
.arc-pick > summary { list-style: none; display: inline-flex; align-items: center; gap: .5rem; min-width: 14rem; justify-content: space-between; }
.arc-pick > summary::-webkit-details-marker { display: none; }
.arc-pick > summary::after { content: '▾'; font-size: .8rem; transition: transform .15s; }
.arc-pick[open] > summary::after { transform: rotate(180deg); }
.arc-pick-list { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 100%; max-height: 18rem; overflow-y: auto;
  background: var(--surface, #fff); border: 1px solid var(--edge); border-radius: 10px; box-shadow: 0 6px 20px rgba(11, 42, 60, .18); padding: .3rem; }
.arc-pick-opt { display: flex; align-items: center; gap: .5rem; margin: 0; padding: .4rem .55rem; border-radius: 6px; cursor: pointer; white-space: nowrap; font-weight: 400; }
.arc-pick-opt:hover { background: rgba(129, 216, 208, .2); }
.arc-pick-opt small { margin-left: auto; padding-left: .8rem; }

/* E-mail: posta in arrivo */
.mail-tools { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.mail-tools .tabs { margin: 0; border-bottom: 0; }
.mail-tools form { margin: 0; }
.mail-text { white-space: normal; overflow-wrap: anywhere; line-height: 1.55; }
.mail-att { margin: 0 0 .5rem; padding-left: 1.1rem; overflow-wrap: anywhere; }
.text-danger { color: var(--danger, #B3261E); }

/* Home personalizzabile: dimensione dei riquadri e modalita' modifica */
.dash-head { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; justify-content: space-between; }
.dash-edit-bar { display: flex; gap: .4rem; flex-wrap: wrap; }
.dash-edit-note { margin: -.75rem 0 1rem; padding: .55rem .8rem; border: 1px dashed var(--tiffany, #81D8D0); border-radius: 10px; }
.dash-tools { display: flex; gap: .35rem; align-items: center; margin-bottom: .5rem; }
.dash-grip { cursor: grab; font-size: 1.2rem; padding: 0 .3rem; opacity: .7; }
.dash-blocks.is-editing .dash-group { outline: 2px dashed rgba(129, 216, 208, .55); outline-offset: 6px; border-radius: 12px; cursor: grab; }
.dash-blocks.is-editing .tile { pointer-events: none; }
.dash-group.is-dragging { opacity: .45; }
.dash-size-s .tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; }
.dash-size-s .tile { padding: .6rem .75rem; gap: .6rem; min-height: 0; }
.dash-size-s .tile-icon { width: 2.2rem; height: 2.2rem; font-size: 1.1rem; }
.dash-size-s .tile-num { font-size: 1.5rem; }
.dash-size-s .tile-label { font-size: .8rem; }
.dash-size-s .tile-hint { display: none; }
.dash-size-l .tiles { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.25rem; }
.dash-size-l .tile { padding: 1.4rem 1.5rem; min-height: 150px; }
.dash-size-l .tile-icon { width: 4rem; height: 4rem; font-size: 2rem; }
.dash-size-l .tile-num { font-size: 3.2rem; }
.dash-size-l .tile-label { font-size: 1.05rem; }
@media (max-width: 520px) {
  .dash-size-l .tiles { grid-template-columns: minmax(0, 1fr) !important; }
  .dash-size-l .tile-num { font-size: 2.2rem !important; }
  .dash-size-l .tile-label { font-size: .95rem !important; }
  .dash-size-s .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

/* E-mail: gestione completa (cartelle, elenco con selezione, lettura, scrittura) */
.mail-layout.has-folders { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1rem; align-items: start; }
.mail-folders { display: flex; flex-direction: column; gap: .15rem; padding: .5rem; margin: 0; position: sticky; top: 1rem; }
.mail-folders a { display: flex; align-items: center; gap: .45rem; padding: .45rem .6rem; border-radius: 8px; text-decoration: none; color: inherit; overflow-wrap: anywhere; }
.mail-folders a:hover { background: rgba(129, 216, 208, .14); }
.mail-folders a.active { background: rgba(129, 216, 208, .24); font-weight: 700; }
.mail-folders .side-count { margin-left: auto; }
.mail-bulk { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; margin-bottom: .6rem; }
.mail-bulk select { width: auto; max-width: 100%; margin: 0; }
.mail-row { display: flex; align-items: center; gap: .75rem; }
.mail-row > input[type="checkbox"] { width: 1.1rem; height: 1.1rem; flex: none; accent-color: var(--primary); }
.mail-open { flex: 1; min-width: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: 1rem; align-items: center; color: inherit; text-decoration: none; }
.mail-actions { margin-bottom: 1rem; }
.mail-actions form { margin: 0; }
.mail-actions select { width: auto; margin: 0; }
.mail-html { overflow-wrap: anywhere; overflow-x: auto; line-height: 1.5; }
.mail-html img { max-width: 100%; height: auto; }
.mail-html table { max-width: 100%; border-collapse: collapse; }
.mail-html td, .mail-html th { padding: .2rem .35rem; vertical-align: top; }
.mail-html blockquote { margin: .5rem 0; padding-left: .8rem; border-left: 3px solid var(--edge, #ccc); opacity: .85; }
.mail-textarea { font-family: inherit; line-height: 1.5; min-height: 12rem; }
.mail-part { font-family: inherit; font-size: .9em; line-height: 1.45; }
.mail-quoted { opacity: .85; }
.mail-fwd { border: 1px solid var(--edge, #ccc); border-radius: 10px; padding: .4rem .8rem; margin: .5rem 0; }
@media (max-width: 860px) {
  .mail-layout.has-folders { grid-template-columns: minmax(0, 1fr); }
  .mail-folders { position: static; flex-direction: row; flex-wrap: wrap; }
  .mail-open { grid-template-columns: minmax(0, 1fr); gap: .3rem; }
}

/* Risorse professionali (app/views/utility*.php) */
.is-dim { opacity: .6; }
.sede.is-dim { opacity: .8; }
.row-form input.ut-narrow { flex: 0 0 5rem; }
.row-form input.ut-confirm { flex: 0 1 12rem; }

/* Videochiamate immediate (menu Appuntamenti → Videochiamate) e schede delle impostazioni */
.mn-ready { border-left: 5px solid var(--ok); }
.mn-steps { margin: .2rem 0 .8rem; }
.mn-actions { flex-wrap: wrap; gap: .6rem; }
.mn-wa { background: #25D366; border-color: #25D366; color: #fff; }
.mn-row { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--edge); }
.mn-row:last-child { border-bottom: 0; }
.mn-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.mn-tabs a { padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--edge); text-decoration: none; }
.mn-tabs a.is-active { background: var(--tiffany); border-color: var(--tiffany); color: #0E1A2B; font-weight: 600; }
.mn-row.is-off { opacity: .55; }
.mn-sub { margin: 1rem 0 .4rem; }
form.inline { display: inline; margin: 0; }
