/* Console STARTHINK: blu notte e verde acqua (bozza grafica di JERRY), tema chiaro/scuro, responsive */
:root {
  --red: #d62828;
  --navy: #0f2540;
  --teal: #13808f;
  --teal-soft: #e3f3f5;
  --bg: #f3f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --ink: #0b1526;
  --muted: #5b6678;
  --line: #dde2ea;
  --primary: #13808f;
  --primary-on: #ffffff;
  --danger: #c62828;
  --ok-bg: #e3f4e8; --ok-ink: #1b5e20;
  --warn-bg: #fff4dc; --warn-ink: #8a5a00;
  --err-bg: #fde7e7; --err-ink: #8e1b1b;
  --info-bg: #e6eefb; --info-ink: #1d3c78;
  --side-bg: #0f2540;
  --side-ink: #dbe4ef;
  --side-muted: #8a9bb3;
  --side-hover: rgba(255, 255, 255, .07);
  --side-active: #13808f;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(11, 21, 38, .06), 0 2px 8px rgba(11, 21, 38, .05);
  --side-w: 264px;
  --top-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0e1626; --surface: #152036; --surface-2: #1c2942; --ink: #e5eaf3; --muted: #9aa6ba; --line: #2a3853;
    --primary: #3fb6c4; --primary-on: #08121f; --danger: #ef6b6b; --teal-soft: #173a40;
    --ok-bg: #173a24; --ok-ink: #9be0ae; --warn-bg: #3d3115; --warn-ink: #f5cf7a;
    --err-bg: #42191c; --err-ink: #ffb3b3; --info-bg: #1a2c4d; --info-ink: #b8cdf6;
    --side-bg: #0a1a2e; --side-active: #13808f; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="scuro"] {
  --bg: #0e1626; --surface: #152036; --surface-2: #1c2942; --ink: #e5eaf3; --muted: #9aa6ba; --line: #2a3853;
  --primary: #3fb6c4; --primary-on: #08121f; --danger: #ef6b6b; --teal-soft: #173a40;
  --ok-bg: #173a24; --ok-ink: #9be0ae; --warn-bg: #3d3115; --warn-ink: #f5cf7a;
  --err-bg: #42191c; --err-ink: #ffb3b3; --info-bg: #1a2c4d; --info-ink: #b8cdf6;
  --side-bg: #0a1a2e; --side-active: #13808f; --shadow: none; color-scheme: dark;
}
html[data-zoom="90"] { font-size: 90%; }
html[data-zoom="110"] { font-size: 110%; }
html[data-zoom="120"] { font-size: 120%; }
html[data-zoom="135"] { font-size: 135%; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--primary); }
h1 { font-size: 1.55rem; margin: 0 0 .75rem; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
img { max-width: 100%; height: auto; }
code { background: var(--surface-2); padding: 0 .3em; border-radius: 4px; }

.muted { color: var(--muted); }
.small, small { font-size: .85rem; }
.mt0 { margin-top: 0; } .mt1 { margin-top: 1rem; } .mb0 { margin-bottom: 0; } .mt-xs { margin-top: .35rem; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }

/* ---- Struttura: menu laterale a tutta altezza, barra in alto, contenuto ---- */
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; width: var(--side-w); z-index: 40;
  background: var(--side-bg); color: var(--side-ink); overflow-y: auto; padding: 0 .75rem 2rem;
}
.side-brand { display: grid; gap: .15rem; padding: 1.3rem .6rem 1.2rem; color: var(--side-muted); text-decoration: none; font-size: .88rem; }
.side-brand img { width: 150px; height: auto; }
.side-nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; }
.side-title { margin: 1.1rem .7rem .35rem; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--side-muted); }
.side-link { display: flex; align-items: center; gap: .75rem; padding: .62rem .8rem; border-radius: 10px; color: var(--side-ink); text-decoration: none; }
.side-link .ico { width: 1.25rem; height: 1.25rem; }
.side-link:hover { background: var(--side-hover); }
.side-link.active { background: var(--side-active); color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.side-link.is-soon { color: var(--side-muted); }
.side-link em { margin-left: auto; font-style: normal; font-size: .62rem; padding: 0 .35rem; border: 1px solid currentColor; border-radius: 999px; opacity: .75; white-space: nowrap; }
.side-ext { margin-left: auto; width: .9rem; height: .9rem; opacity: .6; }
.side-lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; background: var(--prj, var(--muted)); flex: none; margin: 0 .3em; vertical-align: middle; }
.side-pdot { width: .65rem; height: .65rem; border-radius: 50%; background: var(--prj, var(--side-muted)); flex: none; margin: 0 .3rem; box-shadow: 0 0 0 2px rgba(255, 255, 255, .45); }
.side-sec summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .75rem; padding: .62rem .8rem; border-radius: 10px; color: var(--side-ink); }
.side-sec summary .ico { width: 1.25rem; height: 1.25rem; }
.side-sec summary:hover { background: var(--side-hover); }
.side-sec summary::-webkit-details-marker { display: none; }
.side-caret { margin-left: auto; width: 1rem; height: 1rem; opacity: .6; transition: transform .15s; transform: rotate(-90deg); }
.side-sec[open] .side-caret { transform: none; }
.side-sec .side-link { padding-left: 2.6rem; }
.side-sec .side-link .ico { display: none; }
.side-backdrop { display: none; }

.topbar {
  position: fixed; top: 0; right: 0; left: var(--side-w); height: var(--top-h); z-index: 30;
  display: flex; align-items: center; gap: .9rem; padding: 0 1.5rem;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.burger { display: none; background: none; border: 0; color: var(--ink); padding: .35rem; cursor: pointer; }
.burger .ico { width: 1.5rem; height: 1.5rem; }
.ctx-switch { position: relative; display: flex; align-items: center; margin: 0; }
.ctx-switch label { margin: 0; }
.ctx-ico { position: absolute; left: .75rem; color: var(--muted); pointer-events: none; }
.ctx-switch select { min-width: 13rem; max-width: 34vw; font-weight: 600; padding: .55rem .8rem .55rem 2.4rem; border-radius: 10px; margin: 0; }
.top-search { position: relative; flex: 1; max-width: 620px; display: flex; align-items: center; margin: 0; }
.search-ico { position: absolute; left: .85rem; color: var(--muted); pointer-events: none; }
.top-search input { width: 100%; padding: .6rem .9rem .6rem 2.5rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); font: inherit; }
.top-search input:focus { background: var(--surface); }
.user-menu { margin-left: auto; position: relative; }
.user-btn { display: flex; align-items: center; gap: .5rem; background: none; border: 0; border-radius: 999px; padding: .2rem .3rem; color: var(--ink); cursor: pointer; font: inherit; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--teal); color: #fff; display: inline-grid; place-items: center; font-size: .85rem; font-weight: 700; }
.user-caret { color: var(--muted); }
.user-panel { position: absolute; right: 0; top: calc(100% + .4rem); width: 270px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: .8rem; display: grid; gap: .45rem; }
.user-panel[hidden] { display: none; }
.user-panel form { margin: 0; }
.user-panel .btn { justify-content: flex-start; }
.user-who { margin: 0 0 .3rem; display: grid; }
.ui-prefs { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .5rem 0; }
.ui-title { margin: 0 0 .35rem; font-weight: 600; font-size: .85rem; }
.ui-row { display: flex; gap: .35rem; align-items: center; margin-bottom: .35rem; flex-wrap: wrap; }
.ui-row .btn.on { background: var(--primary); color: var(--primary-on); border-color: var(--primary); }

.content { padding: calc(var(--top-h) + 1.5rem) 2rem 3rem calc(var(--side-w) + 2rem); max-width: calc(var(--side-w) + 1320px); }
body.guest .content { padding: 2rem 1rem; margin: 0 auto; max-width: 900px; }

.ctx-banner {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  margin: 0 0 1.1rem; padding: .55rem .9rem; border-radius: var(--radius);
  background: var(--prj, var(--navy)); color: var(--prj-on, #fff);
}
.ctx-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; opacity: .85; border: 1px solid currentColor; border-radius: 4px; padding: 0 .4rem; }
.ctx-logo { height: 26px; width: auto; background: #fff; border-radius: 4px; padding: 2px; }

@media (max-width: 900px) {
  .burger { display: block; }
  .topbar { left: 0; padding: 0 .6rem; gap: .45rem; }
  .user-name, .user-caret { display: none; }
  .ctx-switch select { min-width: 0; max-width: 40vw; padding-left: 2.1rem; }
  .ctx-ico { left: .6rem; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; width: min(82vw, 290px); }
  body.side-open .sidebar { transform: none; }
  body.side-open .side-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 35; }
  .content { padding: calc(var(--top-h) + 1rem) 1rem 2.5rem; }
}
@media (max-width: 600px) {
  .top-search input { padding-right: .4rem; }
  .ctx-ico { display: none; }
  .ctx-switch select { padding-left: .6rem; }
  .top-search input::placeholder { color: transparent; }
  .ctx-switch select { max-width: 44vw; }
}

/* ---- Pagina d'accesso ---- */
.guest-box { max-width: 420px; margin: 0 auto; padding: 2.5rem 1rem; }
.guest-brand { text-align: center; margin-bottom: 1.25rem; }
.guest-brand img { width: 220px; }
.guest-brand p { margin: .3rem 0 0; }
.logo-dark { display: none; }
:root[data-theme="scuro"] .logo-light { display: none; } :root[data-theme="scuro"] .logo-dark { display: inline; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .logo-light { display: none; } :root[data-theme="auto"] .logo-dark { display: inline; } }

/* ---- Componenti ---- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.page-head h1 { margin: 0; }
.page-head p { margin: 0; width: 100%; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.narrow { max-width: 640px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.grid-2 > .card + .card { margin-top: 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.tile { position: relative; display: grid; gap: .3rem; padding: 1rem 1rem 1rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); overflow: hidden; }
.tile:hover { border-color: var(--prj, var(--primary)); }
.tile-bar { position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--prj, var(--primary)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; line-height: 1.2;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--primary); color: var(--primary-on); border-color: var(--primary); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn-ghost { background: none; border-color: transparent; }
.btn-sm { padding: .28rem .6rem; font-size: .85rem; }
.btn-block { width: 100%; }

label { display: block; margin-bottom: .8rem; font-weight: 500; }
label > input:not([type=checkbox]):not([type=radio]), label > select, label > textarea { display: block; margin-top: .3rem; }
label > input + small, label > select + small, label > textarea + small { display: block; margin-top: .25rem; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=tel], input[type=date], input[type=datetime-local], input[type=number], input:not([type]), select, textarea {
  width: 100%; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit;
}
input[type=color] { width: 4rem; height: 2.4rem; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; margin-bottom: .4rem; }
label.check input { width: auto; margin: 0; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 1rem; margin: .2rem 0 .4rem 1.6rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin: 1rem 0; min-width: 0; }
legend { font-weight: 600; padding: 0 .35rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 1rem; }
.span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.inline-form { display: flex; gap: .5rem; align-items: center; margin: 0; }
.inline-form select { width: auto; }
.code-input { font-size: 1.5rem; letter-spacing: .3em; text-align: center; }

.alert { padding: .7rem .9rem; border-radius: 8px; margin: 0 0 1rem; background: var(--info-bg); color: var(--info-ink); }
.alert-success { background: var(--ok-bg); color: var(--ok-ink); }
.alert-error { background: var(--err-bg); color: var(--err-ink); }
.alert-info { background: var(--info-bg); color: var(--info-ink); }

.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-size: .78rem; white-space: nowrap; margin: 1px 2px 1px 0; }
.badge-ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge-warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge-off { background: var(--surface-2); color: var(--muted); }
.tag { display: inline-block; padding: 0 .4rem; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); font-size: .75rem; white-space: nowrap; }

.table-wrap { overflow-x: auto; }
.card.table-wrap { padding: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .55rem .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
thead th { font-size: .8rem; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
td.center, th.center { text-align: center; }
td input[type=text] { min-width: 10rem; }
.actions { white-space: nowrap; text-align: right; }
.actions form { display: inline; margin: 0; }
.row-off td { color: var(--muted); }
.row-off td input[type=text] { opacity: .7; }
.perm-matrix th[scope=row] { font-weight: 500; white-space: nowrap; }
.perm-matrix input { width: 1.1rem; height: 1.1rem; }
.menu-edit .row-group td { background: var(--surface-2); }
.menu-edit .row-child td:nth-child(2) { padding-left: 2rem; }
.menu-title { display: flex; align-items: center; gap: .45rem; }
.menu-edit select { min-width: 11rem; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .55rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--teal); font-weight: 600; }

.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: .35rem 0; border-bottom: 1px solid var(--line); display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.plain-list li:last-child { border-bottom: 0; }
.plain-list .list-group { font-weight: 600; color: var(--muted); }
.plain-list .indent { padding-left: 1.25rem; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.logo-now { display: flex; align-items: center; gap: 1rem; margin-top: .5rem; }
.logo-preview { max-height: 60px; width: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px; }

.pager { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: 1rem; }
.pager a { padding: .3rem .65rem; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; }
.pager a.active { background: var(--primary); color: var(--primary-on); border-color: var(--primary); }

/* Verifica in due passaggi */
.twofa-steps { padding-left: 1.2rem; }
.twofa-steps li { margin-bottom: .6rem; }
.twofa-qr { background: #fff; padding: 8px; border-radius: 8px; display: inline-block; }
.twofa-qr svg { display: block; width: 200px; height: 200px; }
.twofa-secret { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; letter-spacing: .08em; word-break: break-all; }
.guest-setup { max-width: 520px; }

@media print { .sidebar, .topbar, .side-backdrop { display: none; } .content { padding: 0; } }

/* ---- Attività ---- */
.quick-add { display: grid; gap: .6rem; margin-bottom: 1rem; }
.quick-add label { margin: 0; }
.quick-title input { font-size: 1.05rem; padding: .7rem .8rem; }
.quick-opts { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.quick-opts select, .quick-opts input[type=date] { width: auto; }
.quick-opts .check { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.chip { display: inline-flex; gap: .4rem; align-items: center; padding: .35rem .8rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .9rem; }
.chip strong { font-size: 1rem; }
.chip-alert { background: var(--err-bg); color: var(--err-ink); border-color: transparent; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.filters input[type=search] { width: 14rem; padding: .45rem .65rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
.inline-form input[type=search] { width: 18rem; max-width: 100%; padding: .45rem .65rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
.filters select { width: auto; max-width: 13rem; }
.group-title { margin: 1.25rem 0 .5rem; }
.att-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.att-row { display: flex; gap: .75rem; align-items: flex-start; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.att-row:last-child { border-bottom: 0; }
.att-row.is-done .att-title { color: var(--muted); text-decoration: line-through; }
.att-check { margin: 0; }
.tick { width: 1.5rem; height: 1.5rem; flex: none; border-radius: 50%; border: 2px solid var(--muted); background: var(--surface); color: #fff; font-weight: 700; line-height: 1; display: inline-grid; place-items: center; cursor: pointer; padding: 0; font-size: .9rem; margin-top: .1rem; }
.tick:hover { border-color: var(--primary); }
.tick.on { background: #2e7d32; border-color: #2e7d32; }
.tick-off { cursor: default; opacity: .6; }
.tick-sm { width: 1.25rem; height: 1.25rem; border-radius: 5px; font-size: .8rem; }
.att-main { min-width: 0; flex: 1; }
.att-title { color: var(--ink); text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.att-title:hover { text-decoration: underline; }
.att-meta { display: flex; flex-wrap: wrap; gap: .25rem .35rem; margin-top: .25rem; align-items: center; }
.badge-info { background: var(--info-bg); color: var(--info-ink); }
.badge-late { background: var(--err-bg); color: var(--err-ink); font-weight: 600; }
.prio-3 { background: var(--warn-bg); color: var(--warn-ink); }
.prio-4 { background: var(--danger); color: #fff; }
.att-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.att-layout > div > .card + .card, .att-layout aside > * + * { margin-top: 1rem; }
@media (max-width: 1000px) { .att-layout { grid-template-columns: minmax(0, 1fr); } }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: .2rem 0 0; }
.ck-list { list-style: none; padding: 0; margin: 0; }
.ck-row { display: flex; align-items: center; gap: .6rem; padding: .3rem 0; margin: 0; }
.ck-text { flex: 1; overflow-wrap: anywhere; }
.ck-list .is-done .ck-text { color: var(--muted); text-decoration: line-through; }
.push-right { margin-left: auto; }
.inline-form input[type=text], .inline-form input[type=file] { flex: 1; min-width: 0; }
.timeline { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .75rem; }
.timeline li { border-left: 3px solid var(--primary); padding-left: .7rem; }
.timeline li.is-event { border-left-color: var(--line); }
.timeline li.is-event .pre { color: var(--muted); font-size: .9rem; }
.mini-list { list-style: none; padding: 0; margin: 0; }
.mini-list li { padding: .45rem 0; border-bottom: 1px solid var(--line); display: grid; gap: .2rem; }
.mini-list li:last-child { border-bottom: 0; }
.mini-meta { display: flex; flex-wrap: wrap; gap: .25rem; }
@media (max-width: 600px) {
  .quick-opts > * { flex: 1 1 auto; }
  .filters input[type=search], .filters select { flex: 1 1 45%; max-width: none; width: auto; }
  .att-row { padding: .7rem .75rem; }
}
.filters-box { margin-bottom: 1rem; }
.filters-box summary { list-style: none; margin-bottom: .6rem; }
.filters-box summary::-webkit-details-marker { display: none; }

/* ---- Anagrafica ---- */
.quick-opts .grow { flex: 2 1 16rem; width: auto; }
.quick-opts input[type=email], .quick-opts input[type=tel], .quick-opts input[type=text] { width: auto; flex: 1 1 10rem; }
.rel-line { display: flex; flex-wrap: wrap; gap: .25rem; margin: .1rem 0; }
.role-cliente { background: var(--ok-bg); color: var(--ok-ink); }
.role-potenziale { background: var(--info-bg); color: var(--info-ink); }
.role-partner, .role-sponsor { background: #efe6fb; color: #5b2a9a; }
.role-fornitore { background: var(--warn-bg); color: var(--warn-ink); }
:root[data-theme="scuro"] .role-partner, :root[data-theme="scuro"] .role-sponsor { background: #2f2347; color: #d7c2f7; }
.fase-vinta { background: var(--ok-bg); color: var(--ok-ink); font-weight: 600; }
.fase-persa { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.fase-aperta { border: 1px solid var(--line); background: var(--surface); }
.rel-box { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .9rem; margin: .6rem 0; }
.rel-box > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; list-style: none; }
.rel-box > summary::-webkit-details-marker { display: none; }
.rel-box > summary::before { content: "▸"; color: var(--muted); }
.rel-box[open] > summary::before { content: "▾"; }
.rel-new { border-style: dashed; }
.rel-form { margin-top: .8rem; }
.check-row { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; }
.contacts td { vertical-align: top; }

/* ---- Panoramica aziendale (dashboard) ---- */
.dash-head { align-items: flex-end; margin-bottom: 1.25rem; }
.dash-head h1 { font-size: 1.9rem; letter-spacing: -.01em; }
.dash-head p { width: auto; }
.dash-head .dash-date { margin-left: auto; }
.tono-teal { background: var(--teal-soft); color: var(--teal); }
.tono-amber { background: #fbf1df; color: #a86b00; }
.tono-blue { background: #e5effb; color: #1f5fae; }
.tono-red { background: var(--err-bg); color: var(--err-ink); }
.tono-purple { background: #efe8fa; color: #6b3fb0; }
:root[data-theme="scuro"] .tono-purple { background: #2f2347; color: #d6c3f7; }
.tono-gray { background: var(--surface-2); color: var(--muted); }
:root[data-theme="scuro"] .tono-amber { background: #3d3115; color: #f5cf7a; }
:root[data-theme="scuro"] .tono-blue { background: #1a2c4d; color: #b8cdf6; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .tono-amber { background: #3d3115; color: #f5cf7a; }
  :root[data-theme="auto"] .tono-blue { background: #1a2c4d; color: #b8cdf6; }
  :root[data-theme="auto"] .tono-purple { background: #2f2347; color: #d6c3f7; }
}
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; min-width: 0; }
a.kpi:hover { border-color: var(--teal); }
.kpi-ico { width: 3.2rem; height: 3.2rem; border-radius: 12px; display: grid; place-items: center; flex: none; }
.kpi-ico .ico { width: 1.6rem; height: 1.6rem; }
.kpi-txt { display: grid; min-width: 0; }
.kpi-lbl { color: var(--muted); font-size: .9rem; }
.kpi-val { font-size: 1.6rem; line-height: 1.2; }
.kpi-note { color: var(--muted); font-size: .78rem; }
.kpi-go { margin-left: auto; color: var(--muted); }
.kpi-off { box-shadow: none; background: transparent; border-style: dashed; }

.prj-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.prj-cards > .card + .card { margin-top: 0; }
.prj-card { display: flex; flex-direction: column; gap: .9rem; }
.prj-card-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; padding-bottom: .9rem; border-bottom: 1px solid var(--line); }
.prj-logo { width: 4rem; height: 4rem; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--prj, var(--teal)); color: var(--prj-on, #fff); font-size: 1.6rem; font-weight: 700; }
.prj-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: .45rem; }
.prj-logo.logo-piccolo { width: 4rem; height: 4rem; font-size: 1.6rem; }
.prj-logo.logo-medio { width: 5.5rem; height: 5.5rem; font-size: 2rem; }
.prj-logo.logo-grande { width: 7rem; height: 7rem; font-size: 2.6rem; }
.prj-logo.logo-molto { width: 9rem; height: 9rem; font-size: 3.2rem; }
.prj-logo.logo-intero { border-radius: 12px; width: 100%; background: #fff; border: 1px solid var(--line); padding: .4rem; }
.prj-logo.logo-intero img { width: 100%; height: 100%; padding: 0; object-fit: contain; }
.prj-logo.logo-intero.logo-piccolo { height: 4.5rem; }
.prj-logo.logo-intero.logo-medio { height: 6.5rem; }
.prj-logo.logo-intero.logo-grande { height: 8.5rem; }
.prj-logo.logo-intero.logo-molto { height: 11rem; }
.prj-card-title { min-width: 12rem; flex: 1; }
.prj-card-title h2 { margin: 0; font-size: 1.15rem; }
.prj-card-title p { margin: .1rem 0 0; font-size: .9rem; }
.prj-stats { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; flex: 1; }
.prj-stats li { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.prj-stats .ico { color: var(--muted); width: 1.2rem; height: 1.2rem; }
.prj-stats a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.txt-late { color: var(--danger); }
.btn-prj { background: var(--prj, var(--teal)); color: var(--prj-on, #fff); border-color: transparent; padding: .65rem 1rem; font-weight: 600; }
.btn-prj:hover { filter: brightness(1.08); border-color: transparent; }
.btn .ico { width: 1.05em; height: 1.05em; }

.dash-row { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 1rem; align-items: start; margin-bottom: 1rem; }
.dash-row > .card + .card { margin-top: 0; }
/* Scadenze a tutta larghezza: titolo, progetto, data e importo si leggono subito */
.dash-row > .dash-scad, .dash-row > .dash-scad ~ .card { grid-column: 1 / -1; }
.scad-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.scad-table th.num { text-align: right; }
.card-paga { border-left: 4px solid var(--teal); }
@media (max-width: 1100px) { .dash-row { grid-template-columns: minmax(0, 1fr); } }
.card-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.card-head h2 { margin: .1rem 0 .35rem; font-size: 1.2rem; }
.card-head p { margin: 0; }
.card-ico { width: 3rem; height: 3rem; border-radius: 50%; display: grid; place-items: center; flex: none; }
.card-ico .ico { width: 1.4rem; height: 1.4rem; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 8px; padding: 3px; gap: 2px; }
.seg a { padding: .3rem .9rem; border-radius: 6px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.seg a.on { background: var(--surface); color: var(--teal); font-weight: 600; box-shadow: inset 0 -2px 0 var(--teal); }
.table-box { border: 1px solid var(--line); border-radius: 10px; }
.scad-table td { font-size: .93rem; }
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .65rem; border-radius: 999px; background: var(--surface-2); font-size: .82rem; white-space: nowrap; }
.pill-late { background: var(--err-bg); color: var(--err-ink); font-weight: 600; }
.pill-warn { background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; }
.link-go { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--teal); }
:root[data-theme="scuro"] .link-go { color: var(--primary); }
.prio-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .55rem; }
.prio-list a { display: flex; align-items: center; gap: .85rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; }
.prio-list a:hover { border-color: var(--teal); }
.prio-list a > .ico:first-child { color: var(--teal); width: 1.3rem; height: 1.3rem; }
.prio-list a.is-late > .ico:first-child { color: var(--danger); }
.prio-list span { flex: 1; min-width: 0; }
.prio-go { color: var(--muted); }

.integr { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 2rem; }
.integr-title { display: flex; align-items: center; gap: 1rem; flex: none; }
.integr-title h2 { margin: 0; font-size: 1.1rem; }
.integr-item { display: flex; align-items: center; gap: .8rem; min-width: 0; flex: 1 1 13rem; padding-left: 1.5rem; border-left: 1px solid var(--line); }
.integr-item > div { display: grid; min-width: 0; }
.integr-dot { width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center; flex: none; border: 2px solid var(--line); color: var(--muted); }
.integr-dot.is-ok { background: #2e9d5b; border-color: #2e9d5b; color: #fff; }
@media (max-width: 700px) {
  .integr-item { border-left: 0; padding-left: 0; }
  .dash-head h1 { font-size: 1.5rem; }
  .dash-head .dash-date { margin-left: 0; }
  .scad-table th:nth-child(2), .scad-table td:nth-child(2) { display: none; }
}

/* Privacy e conformità siti */
.priv-group { border: 1px solid var(--line); border-radius: 10px; padding: .75rem 1rem 1rem; margin: 0 0 1rem; }
.priv-group legend { font-weight: 600; padding: 0 .4rem; color: var(--ink); }
.priv-funz { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem 1rem; }
.priv-field { display: flex; flex-direction: column; gap: .3rem; }
.priv-field > label:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .9rem; }
.priv-field > label:first-child .badge { font-size: .7rem; font-weight: 500; }
.priv-field input[type=text], .priv-field textarea, .priv-field select { width: 100%; }
.priv-field .check { display: flex; align-items: center; gap: .35rem; color: var(--muted); }

/* Richieste dai siti */
.top-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: 999px; color: var(--muted); margin-left: auto; }
.top-bell:hover { background: var(--bg-soft, rgba(0,0,0,.05)); color: var(--ink); }
.top-bell.has-new { color: var(--ink); }
.top-bell + .user-menu { margin-left: .25rem; }
.bell-count, .side-count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; border-radius: 999px; background: #d64545; color: #fff; font-size: .7rem; font-weight: 700; line-height: 1; }
.bell-count { position: absolute; top: .1rem; right: .05rem; }
.side-count { margin-left: auto; }
.alert-new { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; text-decoration: none; color: var(--ink); border-left: 4px solid #e0a106; }
.alert-new:hover { border-color: #e0a106; }
.alert-new .kpi-go { margin-left: auto; }
.msg-box { white-space: normal; background: var(--bg-soft, #f4f6fb); border-radius: 8px; padding: .9rem 1rem; margin: .75rem 0; line-height: 1.55; }
tr.is-new td:first-child { box-shadow: inset 3px 0 0 #e0a106; }
.tabs .count { display: inline-block; margin-left: .3rem; background: #d64545; color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 .4rem; }

/* Installazione e aggiornamenti */
.install-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.install-grid h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.05rem; }
.install-grid ol { padding-left: 1.2rem; margin: .5rem 0; }
.install-grid li { margin: .3rem 0; }
.install-grid .is-mine { border: 2px solid var(--teal); }
.install-grid .is-mine h2::after { content: "il tuo dispositivo"; font-size: .7rem; font-weight: 600; color: var(--teal); border: 1px solid var(--teal); border-radius: 999px; padding: .05rem .5rem; margin-left: auto; }
.alert-ok { border-left: 4px solid var(--teal); }
.agg-annulla summary { list-style: none; cursor: pointer; display: inline-block; }
.agg-annulla summary::-webkit-details-marker { display: none; }
.agg-annulla form { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.agg-annulla input { width: 11rem; }
.user-panel .btn[hidden], [data-install][hidden] { display: none; }

/* Campi aggiuntivi e promemoria */
.input-euro { display: flex; align-items: center; gap: .4rem; }
.input-euro input { flex: 1; text-align: right; }
.prom-card h2 { display: flex; align-items: center; gap: .4rem; font-size: 1.05rem; }
.alert-prom { margin-bottom: .6rem; }
.alert-prom form { margin: 0 0 0 auto; }

/* Staff del progetto */
.staff-grid { margin-top: 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.staff-grid > .card + .card { margin-top: 0; }
.staff-card { display: flex; flex-direction: column; gap: .6rem; }
.staff-head { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.staff-head h2 { font-size: 1.1rem; }
.staff-firma { border-left: 3px solid var(--prj, var(--teal)); padding: .4rem .7rem; background: var(--bg-soft, rgba(0,0,0,.03)); border-radius: 4px; line-height: 1.5; font-size: .92rem; }
.staff-azioni { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; }

/* Email */
.mail-bar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.mail-bar form { margin: 0; }
.mail-layout { display: block; }
.mail-layout.has-folders { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 1rem; align-items: start; }
.mail-folders { padding: .5rem; display: flex; flex-direction: column; }
.mail-folders a { display: flex; align-items: center; gap: .4rem; padding: .45rem .6rem; border-radius: 6px; text-decoration: none; color: var(--ink); }
.mail-folders a.active { background: var(--surface-2); font-weight: 600; }
.mail-tools { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; align-items: center; margin-bottom: .5rem; }
.mail-tools .tabs { margin-bottom: 0; border-bottom: 0; }
.mail-tools input[type=search] { min-width: 14rem; }
.mail-bulk { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; }
.mail-bulk select { width: auto; }
.mail-list { padding: 0; }
.mail-row { display: flex; align-items: center; gap: .6rem; padding: .55rem .9rem; border-bottom: 1px solid var(--line); }
.mail-row:last-child { border-bottom: 0; }
.mail-row.is-new { background: color-mix(in srgb, var(--teal) 6%, transparent); }
.mail-open { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) auto; gap: .2rem 1rem; align-items: center; text-decoration: none; color: var(--ink); }
.mail-who { display: flex; flex-direction: column; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-who small { overflow: hidden; text-overflow: ellipsis; }
.mail-subj { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-date { white-space: nowrap; }
.mail-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.mail-actions form { margin: 0; }
.mail-read { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; align-items: start; }
.mail-read > aside > .card + .card { margin-top: 1rem; }
.mail-html { overflow-x: auto; line-height: 1.5; }
.mail-html img { max-width: 100%; height: auto; }
.mail-text { white-space: normal; line-height: 1.55; overflow-wrap: anywhere; }
.mail-block { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; margin-bottom: .5rem; }
.mail-att { padding-left: 1.1rem; margin: 0; }
.mail-compose textarea.mail-textarea { min-height: 14rem; }
.mail-firma { margin: .25rem 0 .75rem; }
.mail-quote { border-left: 3px solid var(--line); padding: .3rem .7rem; color: var(--muted); max-height: 16rem; overflow: auto; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3rem .8rem; margin: 0 0 .5rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.segnaposti { columns: 2; margin-top: 0; }
.h-sez { font-size: 1.05rem; margin: 1.25rem 0 .5rem; }
.mb1 { margin-bottom: 1rem; }
@media (max-width: 860px) {
  .mail-layout.has-folders, .mail-read { grid-template-columns: 1fr; }
  .mail-folders { flex-direction: row; flex-wrap: wrap; }
  .mail-open { grid-template-columns: 1fr; }
  .segnaposti { columns: 1; }
}
@media (max-width: 640px) { .inline-form input[type=search] { width: auto; flex: 1; min-width: 0; } }
.auto-spam { list-style: none; margin: 0; padding: 0; }
.auto-spam li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.auto-spam li form { margin: 0; }
/* Avvisi e scadenze */
.badge-err { background: var(--err-bg); color: var(--err-ink); }
.pill-ok { background: var(--ok-bg); color: var(--ok-ink); }
.h-late { color: var(--danger); }
.ico-sm { width: .9em; height: .9em; vertical-align: -.1em; }
td.num, th.num { text-align: right; }
.scad-filtri { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin: 1rem 0; }
.scad-filtri .inline-form select { min-width: 12rem; }
.scad-scheda .kv { margin-bottom: 1rem; }
.scad-list { table-layout: fixed; width: 100%; }
.scad-list td { font-size: .93rem; vertical-align: middle; }
.scad-list th:first-child { width: 8.5rem; }
.scad-list th:last-child { width: 6.5rem; }
.scad-list th.num { width: 7.5rem; }
@media (max-width: 640px) {
  .scad-list, .scad-list tbody, .scad-list tr, .scad-list td { display: block; width: auto; }
  .scad-list thead { display: none; }
  .scad-list tr { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
  .scad-list td { padding: 0; border: 0; }
  .scad-list td:first-child, .scad-list td:nth-child(2) { flex-basis: 100%; }
  .scad-list td:empty { display: none; }
  .scad-list td.actions { margin-left: auto; }
}
/* Spese */
.spese-periodo { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1rem 0; }
.spese-periodo .btn.on { border-color: var(--teal); color: var(--teal); font-weight: 600; }
.spese-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.spese-barre ul { list-style: none; margin: 0; padding: 0; }
.spese-barre li { display: grid; grid-template-columns: 1fr auto; gap: .1rem .75rem; padding: .45rem 0; }
.spese-barre .sb-nome { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spese-barre .sb-val { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.spese-barre progress, .dash-spese progress { grid-column: 1 / -1; width: 100%; height: .5rem; appearance: none; border: 0; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.spese-barre progress::-webkit-progress-bar, .dash-spese progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
.spese-barre progress::-webkit-progress-value, .dash-spese progress::-webkit-progress-value { background: var(--teal); border-radius: 999px; }
.spese-barre progress::-moz-progress-bar, .dash-spese progress::-moz-progress-bar { background: var(--teal); border-radius: 999px; }
.spese-cerca { margin: 0 0 .75rem; }
.spese-importo { font-size: 1.6rem; font-weight: 700; margin: .25rem 0 1rem; }
.spese-list tfoot td { border-top: 2px solid var(--line); }
.spese-list th:first-child { width: 7rem; }
.spese-list th:last-child { width: 8rem; }
.dash-spese { margin-bottom: 1rem; }
.dash-spese-tot { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; margin: .5rem 0 1rem; }
.dash-spese-tot > div { display: grid; }
.dash-spese-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .5rem 2rem; }
.dash-spese h3 { font-size: .95rem; margin: 0 0 .25rem; color: var(--muted); font-weight: 600; }
.dash-spese ul { list-style: none; margin: 0; padding: 0; }
.dash-spese li { display: grid; grid-template-columns: 1fr auto; gap: .1rem .75rem; padding: .4rem 0; }
.dash-spese .sb-nome { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.dash-spese .sb-val { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.top-install { margin-left: auto; display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.top-install[hidden] { display: none; }
.top-install:not([hidden]) + .top-bell { margin-left: .5rem; }
@media (max-width: 640px) { .top-install-lbl { display: none; } }
@media (max-width: 640px) {
  .scad-table td:first-child { min-width: 9.5rem; }
  .scad-table .pill { white-space: normal; }
}
.ripeti-scelta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.ripeti-scelta select { flex: 1 1 10rem; }
.ripeti-n { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.ripeti-n[hidden] { display: none; }
.ripeti-n input { width: 5rem; }

/* Moduli e form */
.mod-campi { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .6rem; }
.mod-campi > .card { margin: 0; padding: .75rem 1rem; }
.mod-campo.is-testo { background: var(--surface-2); }
.mod-campo-head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; }
.mod-campo-head strong { min-width: 0; overflow-wrap: anywhere; }
.mod-campo-azioni { margin-left: auto; display: flex; gap: .3rem; flex-wrap: wrap; }
.mod-campo-form { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.code-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; white-space: pre-wrap; word-break: break-all; font-size: .85rem; }
.row-between { justify-content: space-between; }
.msg-campi { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: .35rem 1rem; margin: 0; }
.msg-campi dt { color: var(--muted); }
.msg-campi dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 560px) { .msg-campi { grid-template-columns: 1fr; } .msg-campi dd { margin-bottom: .4rem; } }
.mod-campo-form [hidden] { display: none !important; }

/* Impostazioni generali */
.matrice th, .matrice td { vertical-align: middle; }
.matrice .c { text-align: center; }
.matrice thead th.c { font-size: .8rem; white-space: nowrap; }
.matrice tbody th { font-weight: 500; white-space: nowrap; text-align: left; }
.matrice tbody th .ico { width: 16px; height: 16px; vertical-align: -3px; color: var(--muted); }
.matrice input[type=checkbox] { width: 18px; height: 18px; margin: 0; }
.imp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.imp-card { display: flex; flex-direction: column; gap: .3rem; text-decoration: none; color: inherit; margin: 0; }
.imp-card:hover { border-color: var(--teal); }
.imp-card .ico { width: 22px; height: 22px; color: var(--teal); }
