/* Bluclad CRM — mobile first. Su schermi larghi la barra in basso diventa una colonna a sinistra. */
:root {
  --bg: #f3f5f8; --surface: #fff; --surface-2: #eef1f5; --text: #14202e; --muted: #5d6b7c; --line: #dde3ea;
  --brand: #0b2a4a; --accent: #1d5fa8; --accent-soft: #e3edf9; --ok: #1d7a4a; --ok-soft: #e2f4ea;
  --err: #b42318; --err-soft: #fde8e6; --warn: #b25e09;
  --hot: #d9480f; --warm: #e8a20c; --cold: #8aa0b6;
  --radius: 14px; --nav-h: 64px; --shadow: 0 1px 2px rgba(16, 32, 50, .06), 0 2px 8px rgba(16, 32, 50, .04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e141b; --surface: #17202a; --surface-2: #1f2a36; --text: #e6edf4; --muted: #95a3b3; --line: #2a3644;
    --brand: #0b2a4a; --accent: #6aa8ec; --accent-soft: #1b2f47; --ok: #5fcf92; --ok-soft: #173326;
    --err: #ff8a7a; --err-soft: #3a1d1a; --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
}
a { color: var(--accent); text-decoration: none; }
html, body { overflow-x: hidden; }
body.no-nav { padding: 0; }   /* login: niente menu, barra a tutta larghezza */
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; word-break: break-all; }
pre { white-space: pre-wrap; word-break: break-all; font: 13px ui-monospace, Menlo, monospace; background: var(--surface-2); padding: 10px; border-radius: 8px; }
h2 { font-size: 15px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h2 .ic { width: 18px; height: 18px; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 14px; text-align: center; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); margin: 0; }

/* ---------- testata e navigazione ---------- */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: var(--brand); color: #fff; min-height: 56px;
}
.top h1 { font-size: 19px; margin: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-back, .top-act { color: #fff; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; margin: -4px; }
.top-back:active, .top-act:active { background: rgba(255, 255, 255, .15); }
.nav {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: flex; background: var(--surface);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--nav-h); color: var(--muted); font-size: 11px; font-weight: 600; }
.nav a.on { color: var(--accent); }
.nav .brand { display: none; }
.nav-new .ic { background: var(--accent); color: #fff; border-radius: 50%; padding: 6px; width: 36px; height: 36px; }
.main { padding: 16px; max-width: 980px; margin: 0 auto; overflow-x: clip; }
.main > * { min-width: 0; }

@media (min-width: 960px) {
  body.has-nav { padding: 0 0 0 220px; }
  .nav { top: 0; right: auto; width: 220px; flex-direction: column; border-top: 0; border-right: 1px solid var(--line); padding: 12px; gap: 2px; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; height: 44px; padding: 0 12px; border-radius: 10px; font-size: 15px; }
  .nav a.on { background: var(--accent-soft); }
  .nav .brand { display: flex; color: var(--text); font-size: 16px; margin-bottom: 12px; }
  .nav .brand img { width: 28px; height: 28px; border-radius: 7px; }
  .nav-new .ic { width: 22px; height: 22px; padding: 3px; }
  .top { padding-left: 24px; }
  .main { padding: 24px; }
}

/* ---------- elementi base ---------- */
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); color: inherit; }
select { text-overflow: ellipsis; }
a.card:active { background: var(--surface-2); }
.block { margin: 22px 0; }
.list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.grid2 { display: grid; gap: 0 20px; }
@media (min-width: 760px) { .grid2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; background: var(--ok-soft); color: var(--ok); font-weight: 500; }
.flash-err { background: var(--err-soft); color: var(--err); }
.flash a { color: inherit; text-decoration: underline; }
.big-code { font-size: 18px; display: inline-block; margin: 6px 0; user-select: all; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer;
}
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger { color: var(--err); border-color: var(--err); background: transparent; }
.btn-block { width: 100%; }
.btn:active { transform: translateY(1px); }

label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 5px; min-height: 46px; padding: 10px 12px; font-family: inherit; font-size: 16px; line-height: 1.3; /* 16px: iOS non zooma */
  color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
label.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 15px; font-weight: 500; }
label.check input { width: 22px; height: 22px; min-height: 0; margin: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; }
legend { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin-bottom: 10px; }
.form h2 { color: var(--text); text-transform: none; letter-spacing: 0; font-size: 17px; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 10px; }
@media (max-width: 380px) { .row2 { grid-template-columns: 1fr; } }

.badge, .pill, .temp { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.pill { background: var(--accent-soft); color: var(--accent); }
.pill-soft { background: var(--surface-2); color: var(--muted); }
.badge { background: var(--surface-2); color: var(--muted); }
.st-nuovo { background: var(--accent); color: #fff; }
.st-in_lavorazione, .st-contattato { background: var(--accent-soft); color: var(--accent); }
.st-qualificato, .st-offerta { background: #fff1d6; color: #8a5300; }
.st-vinto { background: var(--ok-soft); color: var(--ok); }
.st-perso, .st-scartato { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.temp::before { content: ""; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: currentColor; }
.temp { padding-left: 0; color: var(--muted); }
.temp.t-caldo { color: var(--hot); } .temp.t-tiepido { color: var(--warm); } .temp.t-freddo { color: var(--cold); }
@media (prefers-color-scheme: dark) { .st-qualificato, .st-offerta { background: #3a2a10; color: #f3c46b; } }

.avatar { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-weight: 700; font-size: 15px; color: #fff; background: var(--cold); }
.avatar.t-caldo { background: var(--hot); } .avatar.t-tiepido { background: var(--warm); }
.avatar.big { width: 56px; height: 56px; font-size: 19px; }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi strong { display: block; font-size: 30px; line-height: 1.1; color: var(--accent); }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 600; }
.row-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-link > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.row-link small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-link .late { color: var(--err); font-weight: 700; }
.menu .row-link > span:first-child { display: grid; grid-template-columns: 28px 1fr; column-gap: 10px; align-items: center; }
.menu .row-link .ic { grid-row: span 2; color: var(--accent); }
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 4px 10px; align-items: center; color: inherit; }
.bar-label { grid-column: 1 / -1; font-weight: 600; font-size: 15px; display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.bar-label small { font-weight: 400; color: var(--muted); font-size: 12px; }
.bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bar-n { text-align: right; font-size: 13px; font-weight: 700; color: var(--muted); }

/* ---------- elenco lead ---------- */
.search { margin-bottom: 10px; }
.search-box { position: relative; margin: 0; }
.search-box .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; }
.search-box input { padding-left: 40px; margin: 0; border-radius: 99px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .chip.on { background: var(--accent); border-color: var(--accent); color: #0e141b; } }
.filters { padding: 0; margin-bottom: 12px; }
.filters summary { padding: 12px 14px; display: flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; color: var(--muted); }
.filter-grid { padding: 0 14px 14px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 10px; }
.filter-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
.count { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.lead-card { display: flex; gap: 12px; align-items: flex-start; }
.lc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.lc-top strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-sub, .lc-meta { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-meta { color: var(--text); }
.lc-foot { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); margin-top: 2px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }

/* ---------- scheda lead ---------- */
.lead-head { display: grid; gap: 14px; }
.lh-id { display: flex; gap: 14px; align-items: center; }
.lh-company { font-weight: 700; font-size: 17px; }
.lh-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.lh-country { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; }
.lh-country .flag { font-size: 26px; line-height: 1; }
.lh-country small { display: block; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; }
.act:active { filter: brightness(.95); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 15px; }
.facts dt { color: var(--muted); font-size: 13px; padding-top: 2px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 420px) { .facts { grid-template-columns: 1fr; gap: 0; } .facts dd { margin-bottom: 8px; } }
.quick-update { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 10px; margin-top: 10px; align-items: end; }
.quick-update label:last-of-type { grid-column: 1; }
.quick-update .btn { margin-bottom: 12px; }
.note { white-space: normal; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: block; padding: 8px 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--text); font-size: 14px; font-weight: 600; }
.seg input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.activity-form textarea { margin: 0 0 10px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 14px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -21px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--muted); }
.tl-richiesta::before { background: var(--hot) !important; border-color: var(--hot) !important; }
.tl-chiamata::before, .tl-email::before, .tl-whatsapp::before, .tl-incontro::before { background: var(--accent) !important; border-color: var(--accent) !important; }
.tl-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; font-size: 14px; }
.tl-head .muted { font-size: 12px; }
.tl-body { margin-top: 3px; font-size: 15px; overflow-wrap: anywhere; }
.tl-sistema .tl-body, .tl-stato .tl-body { color: var(--muted); font-size: 14px; }
details.card > summary { cursor: pointer; font-weight: 600; }
.events { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; font-size: 14px; }
.events li { display: grid; gap: 1px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.events .muted { font-size: 12px; }
.danger-zone { margin: 30px 0 10px; text-align: center; }

/* ---------- campagne ---------- */
.intro { font-size: 14px; }
.camp-card { display: flex; flex-direction: column; gap: 6px; }
.camp-card .stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.camp-card .stats b { color: var(--text); font-size: 15px; }
.camp-card .code { align-self: flex-start; font-size: 12px; }
.inactive { opacity: .6; }
.camp-head { margin-bottom: 10px; }
.linkbox { display: grid; gap: 8px; margin-bottom: 10px; }
.linkbox p { margin: 0; font-size: 14px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { margin: 0; font: 13px ui-monospace, Menlo, monospace; }
.copy-row .btn { flex: none; }
.inline-test { margin-top: 8px; }

/* ---------- accesso ---------- */
.login { max-width: 400px; margin: 8vh auto 0; }
.login-logo { width: 56px; height: 56px; border-radius: 14px; display: block; margin: 0 auto 10px; }
.login p { text-align: center; }

/* ---------- aree ---------- */
.nav .brand span { display: flex; flex-direction: column; line-height: 1.15; }
.nav .brand small { font-size: 12px; font-weight: 600; color: var(--accent); }
.nav-switch { color: var(--muted) !important; }
@media (min-width: 960px) { .nav-switch { margin-top: auto; border-top: 1px solid var(--line); border-radius: 0 !important; } }
.areas { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .areas { grid-template-columns: 1fr 1fr; } }
.area { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-width: 2px; }
.area strong { font-size: 22px; }
.area-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.area-ic .ic { width: 28px; height: 28px; }
.area-tech .area-ic { background: #fff1d6; color: #8a5300; }
.area:hover { border-color: var(--accent); }
.area-nums { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.area-nums span { display: flex; flex-direction: column; }
.area-nums b { font-size: 24px; color: var(--text); }
.main.wide { max-width: 1400px; }

/* ---------- area tecnici ---------- */
.small { font-size: 13px; }
.nowrap { white-space: nowrap; flex: none; }
.late { color: var(--err); }
.ok-t { color: var(--ok); }
.cards-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.avatar.cust { background: var(--brand); border-radius: 12px; }
.avatar.sm { width: 36px; height: 36px; font-size: 13px; background: var(--accent); }
.avatar.xs { width: 26px; height: 26px; font-size: 11px; background: var(--muted); }
@media (prefers-color-scheme: dark) { .avatar.cust { background: #2c4d73; } .area-tech .area-ic { background: #3a2a10; color: #f3c46b; } }
.cust-card { display: flex; gap: 12px; align-items: flex-start; }
.badge.prob-aperto { background: var(--err-soft); color: var(--err); }
.badge.prob-risolto { background: var(--ok-soft); color: var(--ok); }
.badge.cat-problema { background: #fff1d6; color: #8a5300; }
.badge.cat-incontro, .badge.cat-task { background: var(--accent-soft); color: var(--accent); }
@media (prefers-color-scheme: dark) { .badge.cat-problema { background: #3a2a10; color: #f3c46b; } }
.act-warn { background: var(--err-soft); color: var(--err); }
.big-cta { min-height: 56px; font-size: 17px; margin-bottom: 8px; }
.alias { color: var(--muted); font-style: italic; font-size: 12px; }
.asset-card { display: flex; flex-direction: column; gap: 4px; }
.asset-head { display: grid; gap: 12px; }
.asset-head .btn { justify-self: start; }
.task-head { display: grid; gap: 10px; }
.task-title { font-size: 20px; color: var(--text); text-transform: none; letter-spacing: 0; margin: 0; }

/* layout scheda cliente: su schermo largo le visite a destra */
.cust-layout { display: grid; gap: 0 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .cust-layout { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); align-items: start; } .cust-main { margin-top: 0; } }

/* post (note dei tecnici) */
.feed { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .feed:not(.one-col) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1300px) { .feed:not(.one-col) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.post { display: grid; gap: 8px; border-left: 4px solid var(--accent); }
.post.cat-problema { border-left-color: var(--warm); }
.post.cat-problema.st-aperto { border-left-color: var(--err); }
.post.cat-problema.st-risolto { border-left-color: var(--ok); }
.post-head { display: flex; gap: 10px; align-items: center; }
.post-who { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.post-badges { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.post-title { font-weight: 700; font-size: 17px; color: var(--text); overflow-wrap: anywhere; }
.post-meta { font-size: 13px; }
.post-body { font-size: 15px; overflow-wrap: anywhere; }
.post .tags { margin: 0; }
.post-foot { border-top: 1px solid var(--line); padding-top: 8px; font-size: 14px; }
.post-foot a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.post-foot .ic { width: 18px; height: 18px; }
mark { background: #ffe58a; color: inherit; border-radius: 3px; padding: 0 1px; }
.resolution { padding: 8px 10px; border-radius: 10px; background: var(--ok-soft); color: var(--text); font-size: 15px; overflow-wrap: anywhere; }
.resolution b { color: var(--ok); }
.comments { list-style: none; margin: 0; padding: 8px 0 0; display: grid; gap: 8px; border-top: 1px dashed var(--line); }
.comments li { display: flex; gap: 8px; font-size: 14px; overflow-wrap: anywhere; }
.comments li > div { background: var(--surface-2); border-radius: 10px; padding: 6px 10px; flex: 1; min-width: 0; }
.asset-chip { gap: 4px; }
.asset-chip.src-ai, .asset-chip.src-testo { background: var(--surface-2); color: var(--text); border: 1px dashed var(--accent); }
.ai-mark { font-size: 9px; font-weight: 800; background: var(--accent); color: #fff; border-radius: 4px; padding: 0 3px; }
.matched { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
.feed-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 0 10px; margin-bottom: 10px; }
.feed-filters .filter-actions { grid-column: 1 / -1; }
.feed-sum { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-bottom: 14px; font-size: 14px; }
.feed-sum b { font-size: 18px; }
.feed-sum .tags { margin: 0; flex-basis: 100%; }

/* contatti, squadra */
.contact { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.contact > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.contact small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-acts { display: flex; gap: 6px; align-items: center; }
.contact-acts a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); }
.contact-acts .ic { width: 19px; height: 19px; }
.team-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; }
.link-btn { border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; padding: 4px 8px; cursor: pointer; }
.link-btn.small { font-size: 12px; text-decoration: underline; }
.inline-form { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.inline-form select { margin: 0; }
.inline-form .btn { flex: none; }
.inline-del { text-align: right; }
.danger-zone { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
details.card > summary { display: flex; align-items: center; gap: 6px; }

/* modulo visita: i campi del problema compaiono solo con «Problema tecnico» selezionato */
.seg-big { display: grid; grid-template-columns: 1fr 1fr; }
.seg-big span { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 6px; border-radius: 12px; font-size: 15px; text-align: center; }
.seg-big .ic { width: 20px; height: 20px; }
.act-form:has(input[name=category][value=incontro]:checked) .only-problem,
.act-form:has(input[name=category][value=problema]:checked) .only-meeting { display: none; }
.solution { background: var(--ok-soft); border-radius: 12px; padding: 12px 12px 2px; }
.solution legend { float: left; width: 100%; color: var(--ok); }

/* compiti */
.task-row { display: flex; gap: 12px; align-items: center; }
.task-row.done { opacity: .6; }
.task-check { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--muted); }
.task-check.on { background: var(--ok); border-color: var(--ok); }
.task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.task-body small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }

/* dashboard */
.dash-search input { min-height: 54px; font-size: 17px; }
.dash-grid { display: grid; gap: 0 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1350px) { .dash-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); } }
.dash-3 { display: grid; gap: 0 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .dash-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.block-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.block-head h2 { margin: 0; }
.chips.inline { margin: 0; padding: 0; }
.day-nav { display: flex; gap: 6px; align-items: center; }
.day-nav .btn { min-height: 40px; padding: 0 14px; font-size: 20px; }
.day-nav input { margin: 0; min-height: 40px; }
.tech-cols { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.tech-col.idle { opacity: .65; }
.tech-col-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tech-col-head strong { flex: 1; }
.day-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.day-list a { display: flex; gap: 8px; color: inherit; font-size: 14px; line-height: 1.35; }
.day-list small { display: block; }
.day-list small.city { display: inline; }
.day-list .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--accent); }
.day-list .cat-problema .dot { background: var(--err); }
.day-list .cat-task .dot { background: var(--ok); }
.table-wrap { overflow-x: auto; padding: 8px; }
.week { width: 100%; border-collapse: collapse; font-size: 14px; }
.week th, .week td { padding: 4px; text-align: center; }
.week tbody th { text-align: left; font-weight: 600; white-space: nowrap; }
.week thead th { font-size: 12px; color: var(--muted); font-weight: 600; }
.week .sel { background: var(--accent-soft); }
.heat { display: block; border-radius: 8px; padding: 6px 0; font-weight: 700; color: var(--muted); }
.heat.h1 { background: #d6e6f8; color: #14467d; } .heat.h2 { background: #9fc3ee; color: #0b2a4a; }
.heat.h3 { background: #5f9be0; color: #fff; } .heat.h4 { background: #1d5fa8; color: #fff; }
.bar.two { display: flex; }
.bar.two span { border-radius: 0; }
.bar .ok { background: var(--ok); } .bar .ko { background: var(--err); }
.legend { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; margin: 6px 0 0; }
.legend span { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.legend .ok { background: var(--ok); } .legend .ko { background: var(--err); margin-left: 8px; }
.kpi .ok { color: var(--ok); }
.kb-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }

/* preferenze notifiche */
.notify-pref { align-items: flex-start; }
.notify-pref span { display: flex; flex-direction: column; }
.notify-pref small { font-size: 13px; font-weight: 400; }

/* pulsanti principali della pagina */
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
@media (max-width: 480px) { .page-actions .btn { flex: 1; } }

/* capo dei tecnici: scelta tra visione manageriale e visione tecnico */
.view-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 14px; background: var(--surface-2); border-radius: 14px; max-width: 520px; }
.view-switch a { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 8px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; text-align: center; }
.view-switch a.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.view-switch .ic { width: 18px; height: 18px; }
@media (min-width: 960px) { .nav-view { margin-top: auto; } .nav-view + .nav-switch { margin-top: 0; } }

/* su telefono le voci secondarie del menu stanno in «Altro» */
@media (max-width: 959px) { .nav .nav-wide { display: none; } }
