/* ProjectConfigurator - interfaccia touch a schede.
   Bersagli di tocco >= 48px, scelte a riquadri, stepper +/- al posto dei campi numerici. */
:root {
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --border: #dcdad2;
  --border-strong: #b4b2a9;
  --text: #2c2c2a;
  --muted: #6b6a65;
  /* colori Kintech: giallo per riempimenti e selezioni, nero per testi e icone */
  --brand: #fdc300;
  --brand-dark: #e0aa00;
  --brand-soft: #fff5d1;
  --ink: #1a1a1a;
  --accent: var(--ink);
  --accent-dark: #000000;
  --accent-soft: var(--brand-soft);
  --hw: #f1efe8; --hw-b: #888780; --hw-t: #444441;
  --sw: #e1f5ee; --sw-b: #0f6e56; --sw-t: #085041;
  --lb: #faece7; --lb-b: #993c1d; --lb-t: #712b13;
  --danger: #a32d2d;
  --danger-soft: #fcebeb;
  --ok: #3b6d11;
  --radius: 14px;
  --tap: 48px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
h1 { font-size: 24px; font-weight: 600; margin: 0 0 4px; }
h2 { font-size: 20px; font-weight: 600; margin: 0 0 4px; }
h3 { font-size: 17px; font-weight: 600; margin: 0; }
.lead { color: var(--muted); margin: 0 0 20px; }

/* ---------- barra superiore ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  height: 60px; padding: 0 16px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 700; font-size: 18px; color: var(--accent); white-space: nowrap; }
#nav { flex: 1; display: flex; gap: 4px; overflow-x: auto; }
#userbox { display: flex; gap: 10px; align-items: center; color: var(--muted); white-space: nowrap; }
@media (max-width: 640px) { #userbox .uname { display: none; } }

/* ---------- pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px;
  border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: 12px; cursor: pointer; font-weight: 500;
  user-select: none; touch-action: manipulation;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); border-color: var(--brand-dark); color: var(--ink); font-weight: 600; }
.btn.primary:active { background: var(--brand-dark); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn.danger { color: var(--danger); border-color: #f0c0c0; background: var(--danger-soft); }
.btn.icon { width: var(--tap); padding: 0; }
.btn.big { min-height: 60px; font-size: 18px; padding: 0 28px; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn svg { width: 22px; height: 22px; flex: none; }
.navbtn { min-height: 44px; padding: 0 14px; border-radius: 10px; border: none; background: none; cursor: pointer; color: var(--muted); font-weight: 500; }
.navbtn.on { background: var(--brand-soft); color: var(--ink); box-shadow: inset 0 -3px 0 var(--brand); }

/* ---------- campi ---------- */
.field { margin-bottom: 18px; }
.field > label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input {
  width: 100%; min-height: 54px; padding: 0 16px;
  border: 1.5px solid var(--border-strong); border-radius: 12px; background: #fff;
  font-size: 18px;
}
.input:focus, textarea.input:focus { outline: none; border-color: var(--brand-dark); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.input { padding: 14px 16px; min-height: 96px; resize: vertical; line-height: 1.4; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1.5px solid var(--border-strong);
  background: #fff; cursor: pointer; font-size: 15px;
}
.chip.on { background: var(--brand); color: var(--ink); border-color: var(--brand-dark); font-weight: 600; }

/* ---------- riquadri di scelta ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  min-height: 120px; padding: 18px; text-align: left;
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
  cursor: pointer; touch-action: manipulation;
}
.tile:active { transform: scale(.985); }
.tile .ico { width: 40px; height: 40px; color: var(--accent); }
.tile .t { font-size: 18px; font-weight: 600; }
.tile .d { font-size: 14px; color: var(--muted); }
.tile.on { border-color: var(--brand); background: var(--brand-soft); }
.tile.on::after {
  content: ""; position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12l5 5 9-10'/></svg>") center/16px no-repeat;
}
.tile.add { border-style: dashed; align-items: center; justify-content: center; color: var(--accent); }
.tile.small { min-height: 92px; }

/* segmentato (es. Esistente / Nuova) */
.seg { display: inline-flex; background: var(--surface-2); border: 1.5px solid var(--border-strong); border-radius: 12px; padding: 3px; }
.seg button { min-height: 44px; padding: 0 18px; border: none; background: none; border-radius: 9px; cursor: pointer; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--brand); color: var(--ink); font-weight: 600; }

/* stepper */
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--border-strong); border-radius: 12px; overflow: hidden; background: #fff; }
.stepper button { width: var(--tap); height: var(--tap); border: none; background: var(--surface-2); cursor: pointer; font-size: 24px; color: var(--accent); }
.stepper button:active { background: var(--accent-soft); }
.stepper .v { min-width: 52px; text-align: center; font-size: 20px; font-weight: 600; }
.stepper.sm button { width: 42px; height: 42px; font-size: 20px; }
.stepper.sm .v { min-width: 38px; font-size: 17px; }

/* ---------- pagine ---------- */
main { padding: 0; }
.page { max-width: 1100px; margin: 0 auto; padding: 24px 16px 140px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.error { color: var(--danger); background: var(--danger-soft); padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; }
.center { max-width: 420px; margin: 8vh auto; }

/* elenco progetti */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.pcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; cursor: pointer; min-height: 130px; display: flex; flex-direction: column; gap: 6px; }
.pcard:active { transform: scale(.99); }
.pcard .t { font-size: 18px; font-weight: 600; }
.pcard .meta { font-size: 14px; color: var(--muted); }
.pcard .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.badge { display: inline-block; font-size: 13px; padding: 3px 10px; border-radius: 12px; background: var(--brand-soft); color: var(--ink); border: 1px solid var(--brand); font-weight: 600; }

/* ---------- editor a schede ---------- */
.steps {
  position: sticky; top: 60px; z-index: 15; background: var(--bg);
  display: flex; gap: 6px; overflow-x: auto; padding: 12px 16px; border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.steps::-webkit-scrollbar { display: none; }
.step {
  flex: none; display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 18px 0 8px; border-radius: 26px; border: 1.5px solid var(--border);
  background: var(--surface); cursor: pointer; font-weight: 500; color: var(--muted);
}
.step .n { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1.5px solid var(--border-strong); font-weight: 700; font-size: 15px; }
.step.on { border-color: var(--brand); color: var(--ink); background: var(--brand-soft); font-weight: 600; }
.step.on .n { background: var(--brand); color: var(--ink); border-color: var(--brand-dark); }
.step.done .n { background: var(--sw); border-color: var(--sw-b); color: var(--sw-t); }

.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--border);
}
.bottombar .info { flex: 1; min-width: 0; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottombar .dirty { color: var(--danger); font-weight: 600; }

/* sedi e aree */
.sitecard { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.sitecard .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sitecard .row .input { flex: 1 1 200px; }
.sitechips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; }
.sitechips .chip { flex: none; min-height: 48px; font-size: 16px; }
.areacard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.areahead { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.areahead .ico { width: 34px; height: 34px; color: var(--accent); flex: none; }
.areahead .grow { flex: 1; min-width: 0; }
.areabody { padding: 16px; }
.areaopts { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; margin-bottom: 14px; }
.areaopts .field { margin: 0; }

.lines { display: flex; flex-direction: column; gap: 8px; }
.line { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 6px 6px 14px; border-radius: 12px; border: 1.5px solid; }
.line.HARDWARE { background: var(--hw); border-color: var(--hw-b); color: var(--hw-t); }
.line.SOFTWARE { background: var(--sw); border-color: var(--sw-b); color: var(--sw-t); }
.line.LABOUR, .line.SERVICE { background: var(--lb); border-color: var(--lb-b); color: var(--lb-t); }
.line.optional { border-style: dashed; }
.line .name { flex: 1; min-width: 0; font-weight: 500; }
.line .stepper { border-color: transparent; }
.overrides { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.ovchip { display: inline-flex; align-items: center; gap: 4px; padding: 0 4px 0 12px; min-height: 38px; border-radius: 19px; background: var(--brand-soft); color: var(--ink); border: 1px solid var(--brand); }
.ovchip button { width: 34px; height: 34px; border: none; background: none; cursor: pointer; color: var(--accent-dark); font-size: 18px; }

/* foglio a comparsa (selezione articoli / tipo area) */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 900px; max-height: 85vh; border-radius: 20px 20px 0 0; display: flex; flex-direction: column; }
.sheet .sh-head { display: flex; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--border); }
.sheet .sh-head h2 { flex: 1; margin: 0; }
.sheet .sh-body { overflow-y: auto; padding: 16px; }
.sheet .cat { font-size: 14px; font-weight: 700; color: var(--muted); margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.sheet .cat:first-child { margin-top: 0; }

/* note */
.notecard { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.notecard textarea { flex: 1; }
.autonote { background: #faeeda; border: 1.5px solid #854f0b; color: #633806; border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.autonote b { display: block; margin-bottom: 4px; }

/* schema */
.schemabar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.schemabar .spacer { flex: 1; }
.svgbox { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; padding: 10px; touch-action: pan-x pan-y; }
.svgbox svg { display: block; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
td.q { text-align: right; font-weight: 600; font-size: 18px; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; border: 1px solid; }
.dot.HARDWARE { background: var(--hw); border-color: var(--hw-b); }
.dot.SOFTWARE { background: var(--sw); border-color: var(--sw-b); }
.dot.LABOUR, .dot.SERVICE { background: var(--lb); border-color: var(--lb-b); }

/* utenti */
.ucard { display: grid; grid-template-columns: 1fr; gap: 10px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; z-index: 50;
  background: var(--text); color: #fff; padding: 14px 20px; border-radius: 12px; max-width: 90vw; font-size: 16px;
}
.toast.err { background: var(--danger); }

/* barra superiore: home, utenti, lingua, esci */
.navbtn { display: inline-flex; align-items: center; gap: 8px; }
.navbtn svg { width: 22px; height: 22px; }
#userbox .seg button { min-height: 36px; padding: 0 12px; }
#userbox .btn { min-height: 44px; }
@media (max-width: 640px) {
  .hide-sm, .navbtn span { display: none; }
  .brand { font-size: 16px; }
}

.tile:disabled { opacity: .45; pointer-events: none; }

/* modal (sostituiscono le finestre di conferma del browser) */
.modal-bg { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 18px; padding: 24px; width: 100%; max-width: 460px; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.modal h2 { margin: 0 0 10px; }
.modal p { margin: 0 0 22px; color: var(--muted); font-size: 16px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.modal-actions .btn { min-height: 52px; flex: 1 1 140px; }

/* logo Kintech */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 40px; width: auto; display: block; }
.brand-name { font-weight: 600; font-size: 16px; color: var(--muted); padding-left: 12px; border-left: 1px solid var(--border); }
.login-logo { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto 20px; }
@media (max-width: 640px) { .brand-name { display: none; } .brand-logo { height: 32px; } }

/* dettagli Kintech: barra superiore con filo giallo, icone dei riquadri accese in giallo quando selezionati */
.topbar { box-shadow: inset 0 -3px 0 var(--brand); border-bottom: none; }
.tile.on .ico { color: var(--ink); }
.tile.add:active, .tile:active { border-color: var(--brand); }

/* schede sedi: piu larghe, azioni su una riga */
.sites-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-bottom: 16px; }
.sitecard .row .btn.primary { white-space: nowrap; }

/* schede sedi piu grandi */
.sites-grid { grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 18px; }
@media (max-width: 480px) { .sites-grid { grid-template-columns: 1fr; } }
.sitecard { padding: 22px; gap: 16px; }
.seg-wide { display: flex; width: 100%; }
.seg-wide button { flex: 1; min-height: 52px; padding: 0 10px; white-space: normal; line-height: 1.2; }

/* ---------- scheda Sedi: tre viste ---------- */
.toolbar-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.addrow { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 8px; }
.addrow .btn { border-style: dashed; }
.spill { display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 14px; font-size: 13px; font-weight: 600;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border-strong); white-space: nowrap; }
.spill.on { background: var(--brand-soft); color: var(--ink); border-color: var(--brand); }
.sname { font-size: 18px; font-weight: 600; }
.ssum { font-size: 14px; color: var(--muted); }

/* A - lista a righe */
.sitelist { display: flex; flex-direction: column; gap: 10px; }
.siterow { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 10px 12px 10px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.siterow:active { border-color: var(--brand); background: var(--brand-soft); }
.sicon { width: 52px; height: 52px; border-radius: 12px; background: var(--brand-soft); display: grid; place-items: center; flex: none; }
.sicon .ico { width: 30px; height: 30px; color: var(--ink); }
.sinfo { flex: 1; min-width: 0; }
.sinfo .ssum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { color: var(--muted); display: grid; place-items: center; }
.chev .ico { width: 24px; height: 24px; }
@media (max-width: 640px) { .siterow .spill { display: none; } }

/* B - come lo schema */
.sitetree { display: flex; flex-direction: column; align-items: center; }
.treenode { display: inline-flex; align-items: center; gap: 10px; min-height: 60px; padding: 0 24px; border-radius: var(--radius);
  background: var(--brand-soft); border: 2px solid var(--brand); font-size: 18px; font-weight: 600; }
.treenode .ico { width: 28px; height: 28px; }
.treebus { width: 2px; height: 24px; background: var(--border-strong); }
.treekids { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; width: 100%;
  border-top: 2px solid var(--border-strong); padding-top: 22px; }
.treekid { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-height: 160px;
  padding: 16px; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.treekid:active { border-color: var(--brand); }
.treekid .ico { width: 40px; height: 40px; color: var(--ink); }
.treeline { position: absolute; top: -24px; left: 50%; width: 2px; height: 22px; background: var(--border-strong); }

/* C - riquadri + pannello */
.sitetiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.sitetiles .tile { min-height: 150px; }
.sitetiles .tile .ico { color: var(--ink); }
.sitepanel { border: 2px solid var(--brand); }

/* modulo sede (foglio e pannello) */
.siteform-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.siteform-actions .btn.primary { flex: 1 1 220px; }

/* magazzino principale = nodo centrale */
.mainwh { border: 2px solid var(--brand) !important; background: var(--brand-soft) !important; }
.mainwh .sicon { background: var(--surface); }
button.treenode { cursor: pointer; font: inherit; color: inherit; flex-wrap: wrap; justify-content: center; }

.treeadd { border-style: dashed; color: var(--muted); justify-content: center; }
.treeadd .ico { color: var(--ink); }

/* utenti: righe compatte con iniziali */
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--brand); color: var(--ink); display: grid; place-items: center;
  font-weight: 700; font-size: 17px; flex: none; }
.userrow.off { opacity: .6; }
.userrow.off .avatar { background: var(--surface-2); border: 1px solid var(--border-strong); }

.chip .ico { width: 16px; height: 16px; vertical-align: -3px; }

/* reparti e hardware gia' in possesso */
.dept { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 10px 0 2px; }
.dept:first-child { margin-top: 0; }
.line.owned { background: var(--surface) !important; border-style: dotted; }
.ownedtag { font-size: 12px; font-weight: 600; color: var(--muted); }
.ownbtn { min-height: 38px; font-size: 13px; }
tr.deptrow td { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding-top: 16px; }

/* reparti: fascia grande e colorata */
.dept { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; margin: 18px 0 8px;
  border-radius: 12px; font-size: 18px; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--ink);
  border: 1.5px solid; }
.dept:first-child { margin-top: 4px; }
.dept .ico { width: 26px; height: 26px; flex: none; }
.dept .dcount { margin-left: auto; min-width: 34px; height: 30px; padding: 0 10px; border-radius: 15px; display: grid; place-items: center;
  font-size: 15px; background: var(--surface); border: 1px solid currentColor; }
.dept-HW { background: var(--hw); border-color: var(--hw-b); color: var(--hw-t); }
.dept-SW { background: var(--sw); border-color: var(--sw-b); color: var(--sw-t); }
.dept-LB { background: var(--lb); border-color: var(--lb-b); color: var(--lb-t); }
tr.deptrow td { padding: 14px 0 6px; text-transform: none; letter-spacing: 0; }
tr.deptrow .dept { margin: 0; }

/* nota per articolo: visibile solo se scritta */
.line .name { display: flex; flex-direction: column; }
.linenote { font-size: 13px; font-weight: 500; font-style: italic; opacity: .85; }
.notebtn { opacity: .45; }
.notebtn.has { opacity: 1; }

/* reparto extra (voci libere) e pulsanti di aggiunta per reparto */
:root { --ex: #fbeaf0; --ex-b: #993556; --ex-t: #72243e; }
.line.EXTRA { background: var(--ex); border-color: var(--ex-b); color: var(--ex-t); }
.dept-EX { background: var(--ex); border-color: var(--ex-b); color: var(--ex-t); }
.dot.EXTRA { background: var(--ex); border-color: var(--ex-b); }
.addrow .btn.dept-HW, .addrow .btn.dept-SW, .addrow .btn.dept-LB, .addrow .btn.dept-EX { border-style: solid; font-weight: 600; }
.addrow .btn.dept-HW { background: var(--hw); border-color: var(--hw-b); color: var(--hw-t); }
.addrow .btn.dept-SW { background: var(--sw); border-color: var(--sw-b); color: var(--sw-t); }
.addrow .btn.dept-LB { background: var(--lb); border-color: var(--lb-b); color: var(--lb-t); }
.addrow .btn.dept-EX { background: var(--ex); border-color: var(--ex-b); color: var(--ex-t); }
.ovchip small { font-weight: 600; opacity: .8; }

/* profili creati dagli utenti: cestino nel riquadro */
.tile .profdel { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--danger-soft); color: var(--danger); }
.tile .profdel .ico { width: 18px; height: 18px; color: var(--danger); }
#ppreview .line { min-height: 44px; }
#ppreview .line b { margin-left: auto; padding-right: 10px; }

/* casella con etichetta (es. mostra password) */
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 4px 0 12px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); }
#userbox .uname { gap: 8px; max-width: 220px; }
#userbox .uname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
