/* Console STARTHINK: blu notte e verde acqua, sfondo e scritte a scelta di ogni utente, 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; max-height: calc(100vh - var(--top-h) - 1rem); overflow-y: auto; }
.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=time], 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); }

/* Pagina di accesso sempre nera, con il logo bianco */
body.guest { background: #000; color: #ededed; }
body.guest .guest-brand .logo-light { display: none; }
body.guest .guest-brand .logo-dark { display: inline-block; }

/* Scelta delle caselle nella Posta */
.caselle { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem; margin-bottom: 1.25rem; }
.caselle-gruppo { grid-column: 1 / -1; margin: .5rem 0 -.1rem; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.casella { position: relative; display: flex; flex-direction: column; gap: .1rem; min-width: 0; padding: .6rem 2.6rem .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); text-decoration: none; }
.casella:hover { border-color: var(--muted); }
.casella.active { border-color: var(--teal); box-shadow: inset 3px 0 0 var(--teal); }
.casella-nome { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.casella-nome .icon { vertical-align: -2px; }
.casella-mail { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.casella .count { position: absolute; top: 50%; right: .7rem; transform: translateY(-50%); min-width: 1.5rem; text-align: center; background: #d64545; color: #fff; border-radius: 999px; font-size: .75rem; font-weight: 600; padding: .1rem .45rem; }
.casella-errore .casella-mail::before { content: "⚠ "; color: #d64545; }
@media (max-width: 600px) {
  .caselle { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .4rem; }
  .casella-tutte { grid-column: 1 / -1; }
  .casella { padding: .5rem 2.3rem .5rem .65rem; }
  .casella-nome { font-size: .9rem; }
}

/* ---------- Aspetto scelto da ogni utente: sfondo (html[data-bg]) e scritte (html[data-ink]) ---------- */
/* Il tema chiaro o scuro (data-theme) dà i colori di base; lo sfondo scelto cambia le tinte di pagina, riquadri e menu. */
:root[data-bg="notte"]    { --bg: #0e1a2b; --surface: #15253b; --surface-2: #1b2e48; --line: #2a3f5e; --side-bg: #0a1422; }
:root[data-bg="oceano"]   { --bg: #14304f; --surface: #1a3b60; --surface-2: #21476f; --line: #2f5680; --side-bg: #0e2540; }
:root[data-bg="petrolio"] { --bg: #0f3138; --surface: #153d45; --surface-2: #1b4952; --line: #2a5a63; --side-bg: #0a262c; }
:root[data-bg="grafite"]  { --bg: #1e2328; --surface: #262c32; --surface-2: #2e353c; --line: #3a434c; --side-bg: #16191d; }
:root[data-bg="prugna"]   { --bg: #251b30; --surface: #2e223b; --surface-2: #382a47; --line: #4a3a5c; --side-bg: #1c1425; }
:root[data-bg="nebbia"]   { --bg: #d9e0e6; --surface: #e9eef2; --surface-2: #d0d9e0; --line: #bac6cf; }
:root[data-bg="salvia"]   { --bg: #d5e2dc; --surface: #e6efea; --surface-2: #cadbd3; --line: #b2c8bd; }
:root[data-bg="sabbia"]   { --bg: #e7e0d2; --surface: #f1ece2; --surface-2: #e0d7c5; --line: #cfc4ae; }
:root[data-bg="custom"][data-theme="scuro"] {
  --bg: var(--bg-base, #0e1a2b);
  --surface: color-mix(in srgb, var(--bg) 91%, white);
  --surface-2: color-mix(in srgb, var(--bg) 84%, white);
  --line: color-mix(in srgb, var(--bg) 74%, white);
  --side-bg: color-mix(in srgb, var(--bg) 72%, black);
}
:root[data-bg="custom"][data-theme="chiaro"] {
  --bg: var(--bg-base, #f3f6f9);
  --surface: color-mix(in srgb, var(--bg) 60%, white);
  --surface-2: color-mix(in srgb, var(--bg) 94%, black);
  --line: color-mix(in srgb, var(--bg) 84%, black);
}
:root[data-ink="bianco"]   { --ink: #f3f6fa; }
:root[data-ink="perla"]    { --ink: #c9d3df; }
:root[data-ink="tiffany"]  { --ink: #a6e8e0; }
:root[data-ink="crema"]    { --ink: #f1e5c6; }
:root[data-ink="nero"]     { --ink: #161b20; }
:root[data-ink="blu"]      { --ink: #1b3561; }
:root[data-ink="bordeaux"] { --ink: #5c1a2b; }
:root[data-ink="custom"]   { --ink: var(--ink-base, #e2e9f2); }
:root[data-ink]:not([data-ink="auto"]) { --muted: color-mix(in srgb, var(--ink) 72%, var(--bg)); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.ui-sub { margin: .35rem 0 .3rem; font-size: .75rem; color: var(--muted); }
.ui-sw { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 2px solid var(--line); padding: 0; font: inherit; font-size: .8rem; font-weight: 700; color: var(--ink); background: var(--surface-2); }
.ui-sw:hover { transform: scale(1.08); }
.ui-sw.on { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 40%, transparent); }
.ui-bg-notte { background: #0e1a2b; } .ui-bg-oceano { background: #14304f; } .ui-bg-petrolio { background: #0f3138; } .ui-bg-grafite { background: #1e2328; }
.ui-bg-prugna { background: #251b30; } .ui-bg-chiaro { background: #f3f6f9; } .ui-bg-nebbia { background: #d9e0e6; } .ui-bg-salvia { background: #d5e2dc; } .ui-bg-sabbia { background: #e7e0d2; }
.ui-ink-bianco { background: #f3f6fa; } .ui-ink-perla { background: #c9d3df; } .ui-ink-tiffany { background: #a6e8e0; } .ui-ink-crema { background: #f1e5c6; }
.ui-ink-nero { background: #161b20; } .ui-ink-blu { background: #1b3561; } .ui-ink-bordeaux { background: #5c1a2b; }
.ui-pick { display: flex; align-items: center; gap: .5rem; margin: 0 0 .5rem; padding: .3rem .5rem; border: 1px dashed var(--line); border-radius: 10px; cursor: pointer; font-size: .82rem; }
.ui-pick.on { border-style: solid; border-color: var(--primary); }
.ui-pick input { width: 30px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; }

/* Prodotti e magazzino */
.prodotti { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .75rem; }
.prodotto { display: flex; flex-direction: column; gap: .35rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); min-width: 0; }
.prodotto:hover { border-color: var(--primary); }
.prodotto-nome { font-weight: 600; font-size: 1.05rem; overflow-wrap: anywhere; }
.prod-formato { display: inline-block; align-self: flex-start; padding: .05rem .5rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .8rem; font-weight: 600; vertical-align: middle; }
.prodotto-dati { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .75rem; font-size: .88rem; margin-top: .2rem; }
.prod-numeri { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem 1rem; margin: .75rem 0; }
.prod-numeri > div { display: grid; align-content: start; }
.prod-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; flex-wrap: wrap; }
.prod-cerca { flex-wrap: wrap; margin-bottom: 1rem; }
.vendite { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.vendita { padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); display: grid; gap: .25rem; }
.vendita.on { border-color: var(--primary); }
.vendita-riga { display: flex; justify-content: space-between; gap: .3rem 1rem; flex-wrap: wrap; }
.vendita-azioni { display: flex; gap: .4rem; justify-content: flex-end; margin: 0; }
@media (max-width: 600px) { .prod-numeri { grid-template-columns: 1fr 1fr; } .prod-numeri .kpi-val { font-size: 1.3rem; } }

/* Importi da pagare nella lista delle attività */
.att-soldi { display: flex; flex-wrap: wrap; gap: .75rem 2.5rem; padding: .8rem 1.1rem; margin-bottom: 1rem; }
.att-soldi > div { display: grid; }
.att-importo { font-weight: 700; }
.prodotto-ultima { border-top: 1px solid var(--line); padding-top: .35rem; margin-top: .15rem; }
.prodotto-top { display: flex; gap: .75rem; align-items: flex-start; }
.prodotto-titolo { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.prod-foto { width: 64px; height: 64px; flex: none; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.prod-foto-grande { width: 110px; height: 110px; }
.prod-foto-vuota { display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.prod-head-txt { flex: 1; min-width: 12rem; }
/* Presentazioni e compensi */
.pill-info { background: var(--info-bg); color: var(--info-ink); }
.pill-off { background: var(--surface-2); color: var(--muted); }
.input-sm { max-width: 8rem; }
.pres-base { margin-top: 1rem !important; flex-wrap: wrap; }
@media (max-width: 600px) { .prod-cerca input[type=search] { flex: 1 1 100%; width: 100%; } }

/* Riepilogo presentazioni: caselle dei campi del foglio */
.riep-campi { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem .8rem; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.riep-campi legend { padding: 0 .35rem; font-weight: 600; }
.riep-campi .check { margin: 0; }
.riep-tab td { min-width: 7.5rem; } .riep-tab td:first-child { min-width: 6.5rem; }
/* Scheda della struttura: sezioni del modulo e gruppi di caselle */
.form-sez { margin: 1.2rem 0 .5rem; font-size: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
form > .form-sez:first-of-type { border-top: 0; padding-top: 0; margin-top: .3rem; }
.form-coppia { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; }
.pres-caselle { border: 1px solid var(--line); border-radius: 10px; padding: .5rem .9rem .7rem; margin: 0 0 .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.4rem; }
.pres-caselle legend { padding: 0 .35rem; font-weight: 600; }
.pres-caselle .check { margin: 0; }
.check-altro { display: flex; align-items: center; gap: .5rem; margin: 0; flex: 1 1 24rem; }
.check-altro input { flex: 1; margin: 0; max-width: none; min-width: 12rem; }
.form-sotto { margin: .4rem 0 .5rem; font-weight: 600; font-size: .9rem; color: var(--muted); }
/* Moduli in PDF caricati nel progetto */
.pdf-elenco { list-style: none; margin: 0 0 1rem; padding: 0; }
.pdf-elenco li { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.pdf-elenco li a { font-weight: 600; display: inline-flex; align-items: center; gap: .4rem; }
.pdf-elenco li form { margin-left: auto; }
.pdf-carica { align-items: flex-end; }
.riep-testi label { flex: 1 1 22rem; margin: 0; }

/* Tasto «Aggiorna» in alto, accanto alla campanella */
.top-aggiorna + .top-bell { margin-left: .25rem; }
.top-install:not([hidden]) + .top-aggiorna { margin-left: .5rem; }
.top-aggiorna.gira svg { animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* Documenti caricati: estensione accanto al nome, rinomina, link da condividere */
.doc-ext { color: var(--muted); font-weight: 400; }
.pdf-elenco .doc-azioni { display: inline-flex; flex-wrap: wrap; gap: .25rem; align-items: center; margin-left: auto; }
.pdf-elenco .doc-azioni form { display: inline; }
.doc-rinomina { display: inline-block; }
.doc-rinomina summary { list-style: none; cursor: pointer; }
.doc-rinomina summary::-webkit-details-marker { display: none; }
.doc-rinomina[open] form { display: flex; gap: .35rem; align-items: center; margin-top: .35rem; }
.doc-rinomina[open] input[type=text] { min-width: 16rem; }
.doc-link { display: block; flex-basis: 100%; word-break: break-all; color: var(--muted); }

/* Asili nido: barra per affidare, tabella, giri */
.asili-affida { position: sticky; top: .5rem; z-index: 5; flex-wrap: wrap; gap: .6rem; align-items: center; }
table.asili td { vertical-align: top; }
table.asili td:first-child, table.asili th:first-child { width: 2rem; }
.giro-lista { margin: 0; padding-left: 1.4rem; display: grid; gap: .55rem; }

/* Attività effettuate e Compensi: una riga per struttura */
table.pres-tab td { vertical-align: top; }
table.pres-tab .pill { margin-left: .25rem; }

/* Riepilogo: già inviato al partner (verde) o da inviare (rosso) */
.inv-si, .inv-no { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.inv-si { background: var(--ok-bg); color: var(--ok-ink); }
.inv-no { background: var(--err-bg); color: var(--err-ink); }
table.pres-tab tr.riga-aperta > td { padding: .4rem .5rem .9rem; background: var(--surface-2); }
table.pres-tab .pres-scheda { margin: 0; }
/* Asili nido: zone da affidare ai commerciali */
.zona-affida { gap: .4rem; flex-wrap: wrap; margin: 0; }
.zona-affida select { min-width: 9rem; }
table.zone td { vertical-align: middle; }
table.zone td:first-child { white-space: nowrap; }
/* Asili e attività: righe colorate per stato (contattato verde, contratto attivato viola) */
tr.riga-contattata > td { background: rgba(46, 160, 90, .16); }
tr.riga-contattata > td:first-child { box-shadow: inset 4px 0 0 #2ea05a; }
tr.riga-contratto > td { background: rgba(140, 90, 230, .22); }
tr.riga-contratto > td:first-child { box-shadow: inset 4px 0 0 #8c5ae6; }
tr.riga-no > td { opacity: .6; }
.pill-contratto { background: #8c5ae6; color: #fff; }
.filtro-check { display: inline-flex; align-items: center; gap: .35rem; margin: 0; white-space: nowrap; }
.legenda-righe { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: 0 0 .6rem; }
.legenda-righe span::before { content: ''; display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.legenda-righe .l-contattata::before { background: #2ea05a; }
.legenda-righe .l-contratto::before { background: #8c5ae6; }
.pill-err { background: var(--err-bg); color: var(--err-ink); }
/* Promozione prodotti: scheda campagna con anteprima di email e pagina del sito */
.promo-testa { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.promo-anteprime { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; }
.promo-cornice { width: 100%; height: 720px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* Messaggio per il partner: anteprima di ciò che parte */
.invio-anteprima { border-left: 4px solid var(--teal); }
.invio-testata { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 12px; }
.invio-testata dt { font-weight: 600; }
.invio-testata dd { margin: 0; overflow-wrap: anywhere; }
.invio-allegato { display: inline-flex; align-items: center; gap: 4px; margin: 0 14px 4px 0; }
.invio-corpo { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-bottom: 8px; }

/* Promozione prodotti: galleria dei modelli di campagna */
.promo-galleria { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 16px; margin-bottom: 28px; }
.promo-modello { display: flex; flex-direction: column; padding: 12px; }
.promo-modello h3 { margin: 12px 0 4px; }
.promo-modello p { margin: 0 0 12px; flex: 1; }
.promo-mini { height: 300px; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.promo-mini iframe { width: calc(100% / .38); height: calc(300px / .38); border: 0; transform: scale(.38); transform-origin: 0 0; pointer-events: none; }
.promo-modello-azioni { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Negozio online: foto e descrizioni per il sito */
.prod-galleria { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; margin: .75rem 0; }
.prod-galleria figure { margin: 0; display: flex; flex-direction: column; gap: .3rem; }
.prod-galleria img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.prod-galleria form { display: flex; gap: .25rem; flex-wrap: wrap; align-items: center; }
.prod-descr { margin-top: .75rem; line-height: 1.55; }
.prod-descr summary { cursor: pointer; font-weight: 600; }
.prod-descr-breve { font-size: 1.02rem; }
.prod-cat-scelta { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; }
.prod-import summary { cursor: pointer; }
.prod-import .inline-form input[type=url] { min-width: min(100%, 22rem); }
.prod-descr img { max-width: 100%; height: auto; border-radius: 8px; }
.prod-scheda { border-top: 1px solid var(--line); padding-top: .6rem; }
.prod-schede-mod { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; }
.prod-scheda-mod { display: grid; grid-template-columns: minmax(10rem, 1fr) 3fr; gap: .2rem 1rem; padding: .4rem 0; border-bottom: 1px dashed var(--line); }
.prod-scheda-mod:last-child { border-bottom: 0; }
@media (max-width: 640px) { .prod-scheda-mod { grid-template-columns: 1fr; } }

/* Sito web del progetto: stato, interruttore, colori, temi, anteprima */
.sw-stato { display: flex; gap: .8rem; align-items: flex-start; }
.sw-pallino { width: 12px; height: 12px; border-radius: 50%; background: #3fb07f; margin-top: .35rem; flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, #3fb07f 25%, transparent); }
.sw-pallino.on { background: #e0a43a; box-shadow: 0 0 0 4px color-mix(in srgb, #e0a43a 25%, transparent); }
.sw-interruttore { display: flex; gap: .8rem; align-items: flex-start; font-weight: 400; margin-bottom: 1rem; cursor: pointer; }
.sw-interruttore input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-slitta { flex: none; width: 46px; height: 26px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); position: relative; transition: background .25s; margin-top: .1rem; }
.sw-slitta::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .25s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.sw-interruttore input:checked + .sw-slitta { background: var(--teal); }
.sw-interruttore input:checked + .sw-slitta::after { transform: translateX(20px); }
.sw-interruttore input:focus-visible + .sw-slitta { outline: 2px solid var(--teal); outline-offset: 2px; }
.sw-colori { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; margin: .5rem 0 1rem; }
.sw-colore { display: flex; align-items: center; gap: .6rem; font-weight: 400; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 10px; }
.sw-colore input[type=color] { width: 42px; height: 32px; padding: 0; border: 0; background: none; cursor: pointer; }
.sw-temi { display: grid; gap: .5rem; }
.sw-tema { display: grid; grid-template-columns: auto minmax(12rem, 1.2fr) auto minmax(10rem, 1.5fr) auto; gap: .4rem .8rem; align-items: center; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 12px; }
.sw-tema.on { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.sw-tema .check { margin: 0; }
.sw-periodo { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.sw-periodo input { width: 4.4rem; text-align: center; }
.sw-tavolozza { display: inline-flex; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.sw-tavolozza i { width: 14px; height: 28px; display: block; }
@media (max-width: 860px) { .sw-tema { grid-template-columns: auto 1fr; } .sw-tema .sw-msg { grid-column: 1 / -1; } }
.sw-anteprima-barra { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.sw-schermi { display: grid; grid-template-columns: 1fr 300px; gap: 1rem; align-items: start; }
.sw-schermi figure { margin: 0; display: grid; gap: .3rem; }
.sw-frame { width: 100%; height: 620px; border: 1px solid var(--line); border-radius: 14px; background: #000; }
.sw-tel .sw-frame { height: 620px; border-radius: 28px; border-width: 6px; }
@media (max-width: 900px) { .sw-schermi { grid-template-columns: 1fr; } .sw-tel { max-width: 320px; } }
.sw-c-natale-scuro{background:#3a0f17}
.sw-c-natale-chiaro{background:#fdf6ee}
.sw-c-natale-primario{background:#b3263a}
.sw-c-natale-accento{background:#e0b85c}
.sw-c-capodanno-scuro{background:#14121c}
.sw-c-capodanno-chiaro{background:#fbf7ef}
.sw-c-capodanno-primario{background:#8c7ad6}
.sw-c-capodanno-accento{background:#e6c36a}
.sw-c-san_valentino-scuro{background:#3b0d1e}
.sw-c-san_valentino-chiaro{background:#fff3f5}
.sw-c-san_valentino-primario{background:#e0567a}
.sw-c-san_valentino-accento{background:#f3b6c3}
.sw-c-festa_donna-scuro{background:#2d2a12}
.sw-c-festa_donna-chiaro{background:#fffbea}
.sw-c-festa_donna-primario{background:#e4c32b}
.sw-c-festa_donna-accento{background:#9fb86a}
.sw-c-pasqua-scuro{background:#2f3a2e}
.sw-c-pasqua-chiaro{background:#fbfaf3}
.sw-c-pasqua-primario{background:#a8c99a}
.sw-c-pasqua-accento{background:#f2c6d3}
.sw-c-festa_mamma-scuro{background:#3a1f2b}
.sw-c-festa_mamma-chiaro{background:#fff6f8}
.sw-c-festa_mamma-primario{background:#d98ba4}
.sw-c-festa_mamma-accento{background:#f0cfa0}
.sw-c-estate-scuro{background:#0f3442}
.sw-c-estate-chiaro{background:#fffaf2}
.sw-c-estate-primario{background:#f08a5d}
.sw-c-estate-accento{background:#4fc3c7}
.sw-c-black_friday-scuro{background:#0b0b0d}
.sw-c-black_friday-chiaro{background:#f5f1e8}
.sw-c-black_friday-primario{background:#1c1c20}
.sw-c-black_friday-accento{background:#d4af37}
.sw-msg { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; }
/* Sito web: pagine e blog */
.sw-pg-azioni { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; }
.sw-pg-bottoni { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.sw-pg-lista { padding: 0; }
.sw-pg-riga { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; padding: .75rem 1rem; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.sw-pg-riga:last-child { border-bottom: 0; }
.sw-pg-riga:hover { background: var(--surface-2); }
.sw-pg-segni { margin-left: auto; display: flex; gap: .3rem; flex-wrap: wrap; }
.sw-pg-testa { margin-bottom: .6rem; }
.sw-copertina { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.sw-copertina img, .sw-copertina-vuota { width: 160px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.sw-copertina-vuota { display: grid; place-items: center; font-size: .8rem; color: var(--muted); background: var(--surface-2); }
.sw-copertina > div { display: grid; gap: .5rem; flex: 1 1 260px; min-width: 0; }
.sw-condividi { display: grid; gap: .9rem; }
.bv-form { display: grid; gap: 1rem; }
.bv-email { margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem 1rem; display: grid; gap: .7rem; min-width: 0; }
.bv-filtri { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .8rem; }
.bv-filtri input[type=search] { margin-left: auto; max-width: 240px; padding: .4rem .7rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit; }
.bv-azioni .inline-form { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.sw-cond-bottoni { display: flex; flex-wrap: wrap; gap: .5rem; }
.sw-cond-griglia { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.sw-cond-griglia > div { display: grid; gap: .45rem; align-content: start; min-width: 0; }
.sw-cond-testo { margin: 0; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: .88rem; overflow-wrap: anywhere; }
.sw-cond-avviso { margin: 0; padding: .5rem .75rem; border-radius: 8px; background: color-mix(in srgb, orange 14%, transparent); }
.sw-lingue { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.sw-lingue fieldset { margin: 0; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem 1rem; display: grid; gap: .7rem; }
.sw-lingue legend { padding: 0 .4rem; font-weight: 600; }
.sw-testo { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem; line-height: 1.55; }
@media (max-width: 900px) { .sw-lingue { grid-template-columns: 1fr; } }
/* certificazioni e fornitori */
.spese-grid > .card { margin: 0; }
.qual-scheda-testa { display: flex; gap: 1rem; align-items: center; }
.qual-foto { width: 88px; height: 88px; object-fit: cover; border-radius: 12px; background: #fff; flex: none; }
.qual-schede { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.qual-scheda-mini { display: flex; flex-direction: column; gap: .35rem; margin: 0; text-decoration: none; color: var(--ink); }
.qual-scheda-mini:hover { border-color: var(--teal); }
.qual-storia { list-style: none; margin: 0 0 1rem; padding: 0; border-left: 2px solid var(--line); }
.qual-ev { display: grid; grid-template-columns: auto 6.5rem 1fr auto; gap: .2rem .8rem; align-items: start; padding: .6rem 0 .6rem .9rem; position: relative; }
.qual-ev-ico { margin-left: -1.55rem; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--teal); }
.qual-ev-documento .qual-ev-ico { color: var(--ok-ink); background: var(--ok-bg); }
.qual-ev-fornitura .qual-ev-ico { color: var(--info-ink); background: var(--info-bg); }
.qual-ev-data { color: var(--muted); font-variant-numeric: tabular-nums; padding-top: .2rem; }
@media (max-width: 640px) { .qual-ev { grid-template-columns: auto 1fr; } .qual-ev-data { grid-column: 2; } .qual-ev-txt, .qual-ev .btn { grid-column: 2; } }
/* Beauty in Anteprima (campagne) */
.ant-campi { margin: 0; padding: 0; border: 0; min-width: 0; }
.ant-mini { display: block; width: 100%; max-width: 8rem; height: 6px; margin-top: .3rem; margin-left: auto; accent-color: var(--teal); }
.txt-late { color: var(--err-ink); }
.ant-cal td { vertical-align: middle; }
.ant-media-griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; margin: 0 0 1rem; }
.ant-media-griglia.ant-frames { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .5rem; }
.ant-media-voce { margin: 0; display: flex; flex-direction: column; gap: .3rem; min-width: 0; padding: .4rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.ant-media-voce img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 6px; background: #fff; }
.ant-media-voce figcaption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.ant-frames .ant-media-voce figcaption { font-size: .7rem; }
.ant-file { display: grid; place-items: center; aspect-ratio: 1; padding: .5rem; text-align: center; font-size: .8rem; overflow-wrap: anywhere; border-radius: 6px; background: var(--surface); }
.ant-media-azioni { display: flex; flex-wrap: wrap; gap: .2rem; margin: 0; }
.ant-anteprime { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 1rem; align-items: start; }
.ant-anteprime iframe { display: block; width: 100%; height: 720px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
@media (max-width: 1100px) { .ant-anteprime { grid-template-columns: 1fr; } .ant-if-mob { max-width: 390px; } }

/* Contratti: guadagno o utile in perdita */
.contr-neg { color: var(--danger); }
.ant-email { min-width: 14rem; overflow-wrap: break-word; }

/* Recensioni */
.rec-card { display: grid; gap: .5rem; }
.rec-testa { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.rec-stelle { color: #c79a3e; letter-spacing: .05em; margin: 0 .3rem; }
.rec-stelle .muted { color: var(--line, #ddd); }
.rec-testo { margin: 0; white-space: normal; }
.rec-azioni { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.rec-azioni form { margin: 0; }
.rec-risposta textarea { width: 100%; margin: .4rem 0; }
.tabs-sm a { font-size: .85rem; }

/* Negozio e ordini */
.neg-ordine { display: grid; gap: 1rem; }
.neg-azioni { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.neg-azioni form { margin: 0; }
.neg-oppure { flex-basis: 100%; margin: .2rem 0 0; }
.neg-spediamo { border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; }
.neg-numeri { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; margin: .8rem 0; }
.neg-numeri div { display: flex; flex-direction: column; min-width: 90px; }
.neg-numeri strong { font-size: 1.4rem; }
.neg-numeri span { font-size: .8rem; color: var(--muted, #888); }
.neg-passo { border: 1px solid var(--line); border-radius: 12px; padding: .6rem 1rem; margin: .5rem 0; }
.neg-passo summary { cursor: pointer; }
.neg-passo[open] summary { margin-bottom: .6rem; }
.input-corto { width: 6rem !important; display: inline-block; }
.neg-storico { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.neg-copia { display: inline-block; padding: .3rem .5rem; border-radius: 6px; background: var(--info-bg); word-break: break-all; user-select: all; }
form.inline { display: inline; margin: 0; }
/* Negozio e ordini → Marketing */
.mkt-sezioni { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 1rem; }
.mkt-mappa th, .mkt-mappa td { vertical-align: middle; }
.mkt-mappa th:first-child { min-width: 14rem; }
.mkt-prod { text-align: center; font-size: .78rem; font-weight: 500; max-width: 7rem; }
.mkt-foto { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 .8rem; }
.mkt-foto label { display: flex; align-items: center; gap: .3rem; }
.mkt-foto img { border-radius: 10px; object-fit: cover; }
.mkt-canali { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.mkt-testo { max-width: 28rem; }
.mkt-conta { font-size: 1.1rem; }
.sw-prompt { margin: .2rem 0 .8rem; padding: .8rem 1rem; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-2); }
.sw-prompt p { margin: 0 0 .5rem; }
.sw-prompt .form-actions { margin-top: .4rem; flex-wrap: wrap; }
.sw-prompt textarea { width: 100%; margin-top: .6rem; font-size: .85rem; }
