@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* Stile allineato a neosguard.neossistemi.it e neoshelp.neossistemi.it */
:root {
  --blue: #1C5FA8; --blue-d: #154A84; --blue-l: #EAF2FB; --blue-ll: #F4F8FD;
  --orange: #F19300; --orange-d: #D98300; --orange-l: #FFF4E0; --red: #DF2121;
  --bg: #F8FAFC; --panel: #FFFFFF; --ink: #212529; --ink-2: #374151; --muted: #6B7280; --line: #E5E7EB; --line-2: #EEF1F5;
  --dark: #181D27;
  --ok: #0B7A43; --ok-bg: #E7F7EE; --ok-line: #A6E3C3;
  --warn: #A35B00; --warn-bg: #FFF4E0; --warn-line: #FCD9A0;
  --err: #B42318; --err-bg: #FDECEC; --err-line: #F7B4AE;
  --radius: 18px; --shadow: 0 1px 2px rgba(16,24,40,.04), 0 18px 36px -24px rgba(28,95,168,.28);
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2,.7,.2,1);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); } a:hover { color: var(--blue-d); }
h1, h2, h3 { margin: 0; line-height: 1.15; color: var(--blue); }
h1 { font-size: 34px; font-weight: 800; letter-spacing: -.3px; } h2 { font-size: 22px; font-weight: 700; } h3 { font-size: 17px; font-weight: 600; color: var(--ink); }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(28,95,168,.35); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }
.hidden { display: none !important; }

/* ---------- animazioni ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fadeLeft { from { opacity: 0; transform: translateX(-36px); } to { opacity: 1; transform: none; } }
@keyframes fadeRight { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-14px) rotate(-2deg); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(241,147,0,.55); } 70% { box-shadow: 0 0 0 12px rgba(241,147,0,0); } 100% { box-shadow: 0 0 0 0 rgba(241,147,0,0); } }
@keyframes blob { 0%, 100% { border-radius: 42% 58% 63% 37% / 45% 41% 59% 55%; } 50% { border-radius: 58% 42% 38% 62% / 55% 59% 41% 45%; } }
@keyframes shine { from { background-position: -200% 0; } to { background-position: 200% 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity: 1; transform: none; } }
.reveal { opacity: 0; }
.reveal.in { animation: fadeUp .7s var(--ease) forwards; }
.reveal.l.in { animation-name: fadeLeft; } .reveal.r.in { animation-name: fadeRight; }
.d1 { animation-delay: .06s !important; } .d2 { animation-delay: .12s !important; } .d3 { animation-delay: .18s !important; } .d4 { animation-delay: .24s !important; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; } *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.side { width: 260px; flex: none; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; gap: 3px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; justify-content: center; padding: 4px 8px 18px; margin-bottom: 10px; border-bottom: 1px solid var(--line); text-decoration: none; }
.brand img { height: 56px; width: auto; max-width: 100%; object-fit: contain; }
.brand .brand-txt { font-weight: 800; font-size: 20px; color: var(--blue); letter-spacing: 1px; }
.brand .brand-txt b { color: var(--orange); }
.brand-sub { text-align: center; font-size: 11px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: -6px 0 10px; }
.nav-label { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: #9CA3AF; padding: 18px 14px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: 12px; color: #4B5563; text-decoration: none; font-weight: 500; font-size: 14px; transition: background .2s, color .2s, transform .2s; }
.nav a:hover { background: var(--blue-l); color: var(--blue); transform: translateX(3px); }
.nav a.on { background: var(--blue); color: #fff; box-shadow: 0 10px 20px -12px rgba(28,95,168,.9); transform: none; }
.nav svg { width: 19px; height: 19px; flex: none; }
.side-foot { margin-top: auto; padding: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.side-foot b { color: var(--ink); font-weight: 600; }
.side-foot button { background: none; border: 0; color: var(--orange-d); padding: 6px 0 0; cursor: pointer; text-align: left; font-size: 13px; font-weight: 600; }
.side-call { margin: 10px 4px 0; padding: 12px 14px; border-radius: 14px; background: var(--blue-ll); font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 600; letter-spacing: .5px; display: flex; gap: 10px; align-items: center; }
.side-call b { display: block; font-size: 14px; color: var(--ink); text-transform: none; letter-spacing: 0; }
.side-call svg { width: 22px; height: 22px; color: var(--blue); flex: none; }
.main { flex: 1; min-width: 0; padding: 30px clamp(16px, 3vw, 44px) 120px; display: flex; flex-direction: column; gap: 22px; }
.topbar { display: none; }
.mode-banner { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn); border-radius: 12px; padding: 10px 14px; font-size: 13px; }
@media (max-width: 900px) {
  .actionbar { left: 50%; max-width: calc(100vw - 24px); }
  .app { flex-direction: column; }
  .side { position: fixed; inset: 0 auto 0 0; z-index: 40; transform: translateX(-100%); transition: transform .25s var(--ease); }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .topbar { display: flex; align-items: center; gap: 10px; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 14px; position: sticky; top: 0; z-index: 30; }
  .topbar button { background: none; border: 0; color: var(--blue); min-width: 44px; min-height: 44px; cursor: pointer; }
  .topbar img { height: 38px; }
}

/* ---------- elementi ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; animation: fadeUp .6s var(--ease) both; }
.page-head .col { gap: 4px; }
.card { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1.5px solid transparent; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; background: #fff; transition: transform .2s, box-shadow .2s, background .2s, color .2s, border-color .2s; }
.btn svg { width: 18px; height: 18px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-p { background: var(--orange); color: #fff; text-transform: uppercase; letter-spacing: .4px; font-size: 13px; box-shadow: 0 10px 22px -12px rgba(241,147,0,.9); }
.btn-p:hover:not(:disabled) { background: var(--orange-d); color: #fff; transform: translateY(-2px); box-shadow: 0 16px 28px -14px rgba(241,147,0,.95); }
.btn-g { border-color: #CBD5E1; color: var(--ink-2); }
.btn-g:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); background: var(--blue-ll); }
.btn-b { background: var(--blue); color: #fff; } .btn-b:hover:not(:disabled) { background: var(--blue-d); color: #fff; transform: translateY(-2px); }
.btn-d { background: var(--err); color: #fff; }
.btn-q { background: transparent; border: 0; color: var(--ink-2); min-height: 36px; padding: 0 10px; }
.btn-q:hover { background: var(--blue-l); color: var(--blue); }
.btn-sm { min-height: 36px; padding: 0 13px; font-size: 13px; border-radius: 10px; }
.btn-shine { background: linear-gradient(110deg, var(--orange) 40%, #FFC15C 50%, var(--orange) 60%); background-size: 200% 100%; animation: shine 3.5s linear infinite; }
.chip { min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1.5px solid #CBD5E1; background: #fff; font-size: 13.5px; font-weight: 500; cursor: pointer; transition: all .2s; }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 0; }
.b-ok { background: var(--ok-bg); color: var(--ok); } .b-warn { background: var(--warn-bg); color: var(--warn); } .b-err { background: var(--err-bg); color: #8A1C14; } .b-off { background: #F1F3F6; color: #4B5563; } .b-dark { background: var(--blue); color: #fff; } .b-acc { background: var(--orange-l); color: var(--warn); }
.alert { border-radius: 12px; padding: 12px 14px; font-size: 14px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; text-align: left; animation: pop .35s var(--ease) both; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
button.alert { cursor: pointer; width: 100%; font: inherit; }
.a-err { background: var(--err-bg); border-color: var(--err-line); color: #7A271A; }
.a-warn { background: var(--warn-bg); border-color: var(--warn-line); color: #7A3E00; }
.a-ok { background: var(--ok-bg); border-color: var(--ok-line); color: #075E34; }
.a-info { background: var(--blue-ll); border-color: #C6DAF1; color: #17487F; }

/* ---------- form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field .lbl { font-size: 13.5px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.hint { font-size: 12.5px; color: var(--muted); }
.err-msg { font-size: 12.5px; color: var(--err); font-weight: 600; }
.inp { width: 100%; min-height: 46px; border: 1.5px solid #D9DEE5; border-radius: 12px; padding: 0 14px; background: #FBFCFE; font-size: 15px; transition: border-color .2s, box-shadow .2s, background .2s; }
textarea.inp { padding: 12px 14px; line-height: 1.55; resize: vertical; }
.inp:focus { outline: 0; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(28,95,168,.12); }
.inp.bad { border-color: var(--err); background: #FFFBFA; }
.inp.changed { border-color: var(--orange); background: #FFFDF8; }
.unit-wrap { display: flex; align-items: center; gap: 8px; }
.unit-wrap .unit { font-size: 13px; color: var(--muted); white-space: nowrap; }
.pw-wrap { display: flex; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); display: inline-block; flex: none; }
.switch { width: 52px; height: 30px; border-radius: 999px; border: 0; background: #CBD2DC; position: relative; cursor: pointer; flex: none; padding: 0; transition: background .25s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .25s cubic-bezier(.3,1.4,.5,1); box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.switch[aria-checked="true"] { background: var(--orange); }
.switch[aria-checked="true"]::after { left: 25px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 46px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--blue); }
.hr { height: 1px; background: var(--line); margin: 4px 0; }

/* ---------- tabelle ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
.tbl th { text-align: left; font-size: 11.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--blue-ll); }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr.click { cursor: pointer; transition: background .15s; }
.tbl tr.click:hover td { background: #FFF9EF; }
.thumb { width: 52px; height: 40px; object-fit: contain; display: block; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; transition: transform .25s, box-shadow .25s; }
.stat:hover { transform: translateY(-4px); }
.stat b { font-size: 28px; font-weight: 700; }

/* ---------- schede dispositivo ---------- */
.dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.dev-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .3s var(--ease), box-shadow .3s; text-decoration: none; color: inherit; }
.dev-card:hover { transform: translateY(-6px); box-shadow: 0 28px 44px -26px rgba(28,95,168,.55); color: inherit; }
.dev-card .pic { height: 150px; background: radial-gradient(circle at 50% 62%, #fff 0%, var(--blue-l) 72%); display: flex; align-items: center; justify-content: center; position: relative; }
.dev-card .pic img { height: 118px; max-width: 80%; object-fit: contain; transition: transform .45s var(--ease); }
.dev-card:hover .pic img { transform: scale(1.07) rotate(-3deg); }
.dev-card .pic .badge { position: absolute; top: 12px; left: 12px; box-shadow: 0 4px 10px -6px rgba(0,0,0,.3); }
.dev-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; }
.dev-card .ser { font-family: var(--mono); font-weight: 700; font-size: 14px; }
.dev-card .meta { font-size: 12.5px; color: var(--muted); }
.dev-card .act { display: flex; gap: 8px; margin-top: 10px; }
.dev-add { border: 2px dashed #C9D6E6; background: transparent; box-shadow: none; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; color: var(--blue); font-weight: 600; min-height: 290px; cursor: pointer; border-radius: var(--radius); transition: all .25s; }
.dev-add:hover { background: #fff; border-color: var(--orange); color: var(--orange-d); }
.dev-add .plus { width: 56px; height: 56px; border-radius: 50%; background: var(--orange); color: #fff; display: flex; align-items: center; justify-content: center; animation: pulse 2.2s infinite; }
.dev-add .plus svg { width: 28px; height: 28px; }

/* ---------- configuratore ---------- */
.dev-head { padding: 20px 22px; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; justify-content: space-between; animation: fadeUp .6s var(--ease) both; }
.dev-head .pic { width: 84px; height: 64px; object-fit: contain; }
.dev-head h1 { font-size: 26px; color: var(--ink); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { min-height: 48px; padding: 0 18px; background: none; border: 0; border-bottom: 3px solid transparent; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; transition: color .2s, border-color .2s; }
.tab:hover { color: var(--blue); }
.tab.on { color: var(--blue); border-bottom-color: var(--orange); }
.cfg { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.secnav { flex: 0 0 270px; position: sticky; top: 16px; padding: 10px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 32px); overflow-y: auto; animation: fadeLeft .6s var(--ease) both; }
.secnav button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 0 12px; border: 0; border-radius: 12px; background: none; text-align: left; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink-2); transition: background .2s, color .2s; }
.secnav button:hover { background: var(--blue-ll); color: var(--blue); }
.secnav button.on { background: var(--blue-l); color: var(--blue); font-weight: 600; box-shadow: inset 3px 0 0 var(--blue); }
.secnav svg { width: 18px; height: 18px; flex: none; }
.secnav .cnt { margin-left: auto; display: flex; gap: 4px; }
.cfg-main { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.cfg-main > .col:first-child h2 { font-size: 26px; font-weight: 800; }
.cmd { padding: 0; overflow: hidden; animation: fadeUp .5s var(--ease) both; }
.cmd:nth-child(3) { animation-delay: .05s; } .cmd:nth-child(4) { animation-delay: .1s; } .cmd:nth-child(5) { animation-delay: .15s; } .cmd:nth-child(n+6) { animation-delay: .2s; }
.cmd-head { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 18px 22px; }
.cmd-head .col { gap: 4px; }
.cmd-head h3 { color: var(--blue); font-size: 18px; font-weight: 700; }
.cmd-code { font-family: var(--mono); font-size: 11.5px; color: #9CA3AF; }
.cmd-body { padding: 4px 22px 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px 18px; }
.cmd.off .cmd-body { opacity: .5; }
.cmd-foot { display: flex; gap: 8px; padding: 0 22px 16px; flex-wrap: wrap; }
.field.wide { grid-column: 1 / -1; }
details.cmd > summary { list-style: none; cursor: pointer; }
details.cmd > summary::-webkit-details-marker { display: none; }
details.cmd[open] > summary { border-bottom: 1px solid var(--line-2); }
.mini-item { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.ab-spacer { height: 70px; }
.actionbar { position: fixed; left: calc(50% + 130px); bottom: 18px; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 10px; background: rgba(24,29,39,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; border-radius: 999px; padding: 7px 7px 7px 16px; box-shadow: 0 20px 44px -14px rgba(16,24,40,.6); max-width: calc(100vw - 300px); white-space: nowrap; transition: padding .45s var(--ease), gap .45s var(--ease); animation: barIn .5s var(--ease) both; }
@keyframes barIn { from { opacity: 0; transform: translate(-50%, 30px); } }
.actionbar.idle { padding: 7px 16px; }
.ab-st { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.ab-txt { opacity: .92; }
.pill { border: 0; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; font-family: inherit; }
.p-ok { background: #1E7F4F; color: #fff; } .p-err { background: #D92D20; color: #fff; cursor: pointer; } .p-warn { background: #F7B955; color: #4A2B00; cursor: pointer; }
.ab-acts { display: flex; gap: 6px; align-items: center; overflow: hidden; max-width: 760px; transition: max-width .45s var(--ease), opacity .3s; }
.actionbar.idle .ab-acts { max-width: 46px; }
.actionbar.idle .ab-acts > :not(.ab-more) { display: none; }
.ab-btn { background: rgba(255,255,255,.1); color: #fff; border: 0; border-radius: 999px; padding: 9px 14px; font-weight: 600; font-size: 13px; cursor: pointer; font-family: inherit; display: inline-flex; gap: 6px; align-items: center; transition: background .2s, transform .2s; }
.ab-btn svg { width: 16px; height: 16px; }
.ab-btn:hover:not(:disabled) { background: rgba(255,255,255,.2); }
.ab-btn:disabled { opacity: .4; cursor: not-allowed; }
.ab-btn.ab-pr { background: var(--orange); box-shadow: 0 6px 16px -6px rgba(241,147,0,.8); }
.ab-btn.ab-pr:hover:not(:disabled) { background: var(--orange-d); transform: translateY(-1px); }
.ab-btn.ab-pr:disabled { background: #5A4A2E; box-shadow: none; }
.ab-more { padding: 9px 13px; font-size: 16px; line-height: 1; }
.kbd { font-family: var(--mono); font-size: 10.5px; background: rgba(255,255,255,.2); border-radius: 5px; padding: 1px 5px; }
.ab-menu { position: absolute; right: 8px; bottom: 58px; background: #fff; color: var(--ink); border-radius: 14px; box-shadow: 0 22px 44px -12px rgba(16,24,40,.4); padding: 6px; display: none; min-width: 240px; }
.ab-menu.open { display: block; animation: pop .2s var(--ease) both; }
.ab-menu button { display: flex; width: 100%; border: 0; background: none; padding: 10px 12px; border-radius: 10px; text-align: left; cursor: pointer; font-family: inherit; font-size: 14px; gap: 10px; align-items: center; }
.ab-menu button:hover { background: var(--blue-ll); color: var(--blue); }
.ab-menu svg { width: 16px; height: 16px; }
.field { position: relative; }
.saved-tag { position: absolute; right: 2px; top: 0; font-size: 11.5px; font-weight: 600; color: var(--ok); display: inline-flex; align-items: center; gap: 5px; opacity: 0; transform: translateY(3px); transition: opacity .3s, transform .3s; pointer-events: none; background: #fff; padding: 0 4px; border-radius: 6px; }
.saved-tag.show { opacity: 1; transform: none; }
.saved-tag.ing { color: var(--muted); } .saved-tag.err { color: var(--err); }
.spin { width: 12px; height: 12px; border: 2px solid #CFE0F3; border-top-color: var(--blue); border-radius: 50%; animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.draft-banner { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-radius: 16px; background: linear-gradient(90deg, #FFF4E0, #FFFAF0); border: 1px solid var(--warn-line); animation: fadeUp .5s var(--ease) both; }
.dr-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--orange); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.toast { display: flex; gap: 12px; align-items: center; }
.toast.ok { border-left-color: #3DD68C; }
.toast-act { border: 0; background: none; color: var(--orange); font-weight: 700; cursor: pointer; font-family: inherit; font-size: 14px; white-space: nowrap; padding: 0; }
.meths { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.meth { border: 2px solid #E5E9EF; border-radius: 18px; padding: 16px; cursor: pointer; display: flex; gap: 14px; align-items: flex-start; text-align: left; background: #fff; font-family: inherit; color: inherit; transition: all .25s var(--ease); }
.meth:hover { border-color: #B9CFEA; transform: translateY(-2px); }
.meth.on { border-color: var(--blue); background: var(--blue-ll); box-shadow: 0 12px 26px -16px rgba(28,95,168,.6); }
.m-ic { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--blue-l); color: var(--blue); }
.meth.on .m-ic { background: var(--blue); color: #fff; }
.meth b { font-size: 16px; }
.m-tag { font-size: 11px; font-weight: 700; background: var(--orange-l); color: var(--warn); padding: 2px 8px; border-radius: 999px; margin-left: 8px; vertical-align: middle; }
.checks { display: flex; flex-direction: column; gap: 10px; }
.chk { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--line-2); border-radius: 16px; padding: 14px 16px; transition: all .3s; }
.chk .ci { width: 32px; height: 32px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; }
.chk.ok { background: #F6FCF8; border-color: #BFE8D0; } .chk.ok .ci { background: var(--ok); }
.chk.ko { background: #FFF8F7; border-color: #F7C9C4; } .chk.ko .ci { background: var(--err); }
.ops { display: flex; gap: 6px; flex-wrap: wrap; }
.op { border: 1.5px solid #E5E9EF; background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; font-family: inherit; font-weight: 600; }
.op:hover, .op.on { border-color: var(--blue); color: var(--blue); background: var(--blue-ll); }
.pw-field { max-width: 280px; } .apn-form, .chk-body { gap: 8px; } .t-err { color: var(--err); } .sms-sent { margin-top: 8px; }
.chk.wait { background: #FFFAF0; border-color: var(--warn-line); } .chk.wait .ci { background: #fff; border: 2px solid var(--orange); color: var(--orange); animation: pulse 1.6s infinite; }
.mini { display: flex; flex-direction: column; gap: 5px; border-left: 2px solid var(--line); margin-left: 4px; padding-left: 14px; font-size: 13px; }
.mini > div { display: flex; gap: 8px; align-items: center; } .m-d { color: var(--ok); } .m-w { color: var(--warn); } .m-x { color: var(--err); }
.dl-live { box-shadow: none; border: 1px solid var(--line-2); }
.searchbox { position: relative; }
.searchbox .inp { padding-left: 44px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") no-repeat 14px center; }
.searchbox .results { position: absolute; left: 0; right: 0; top: 52px; z-index: 25; max-height: 340px; overflow-y: auto; animation: pop .2s var(--ease) both; }
.searchbox .results button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: 11px 16px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.searchbox .results button:hover { background: var(--blue-ll); }
.diff { width: 100%; border-collapse: collapse; font-size: 14px; }
.diff td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.diff .from { color: #8A1C14; text-decoration: line-through; }
.diff .to { color: var(--ok); font-weight: 600; }
.sms { font-family: var(--mono); font-size: 13px; background: var(--blue-ll); border: 1px solid #D6E4F5; border-radius: 12px; padding: 12px 14px; word-break: break-all; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.raw { font-family: var(--mono); font-size: 12.5px; background: var(--dark); color: #D7DCE3; border-radius: 14px; padding: 16px; max-height: 480px; overflow: auto; white-space: pre; }
.drop { border: 2px dashed #C9D6E6; border-radius: 16px; padding: 30px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; background: var(--blue-ll); transition: all .2s; }
.drop svg { width: 30px; height: 30px; color: var(--blue); }
.drop.over { border-color: var(--orange); background: var(--orange-l); }

/* ---------- invio via web ---------- */
.dl-steps { list-style: none; margin: 0; padding: 0; position: relative; display: flex; flex-direction: column; }
.dl-steps::before { content: ""; position: absolute; left: 19px; top: 22px; bottom: 22px; width: 2px; background: var(--line); }
.dl-step { display: flex; gap: 16px; align-items: flex-start; padding: 10px 0; position: relative; opacity: .5; transition: opacity .4s; }
.dl-step b { display: block; font-size: 15px; } .dl-step span:not(.dl-ic) { font-size: 13px; color: var(--muted); }
.dl-ic { width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; flex: none; z-index: 1; font-weight: 700; color: var(--muted); transition: all .4s; }
.dl-step.done, .dl-step.now, .dl-step.fail { opacity: 1; }
.dl-step.done .dl-ic { background: var(--ok); border-color: var(--ok); color: #fff; }
.dl-step.now .dl-ic { border-color: var(--orange); color: var(--orange); animation: pulse 1.6s infinite; }
.dl-step.fail .dl-ic { background: var(--err); border-color: var(--err); color: #fff; }
.dl-result { display: flex; gap: 16px; align-items: center; border-radius: 16px; padding: 16px 18px; animation: pop .4s var(--ease) both; }
.dl-result .big { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; color: #fff; flex: none; }
.dl-result.ok { background: var(--ok-bg); color: #075E34; } .dl-result.ok .big { background: var(--ok); }
.dl-result.err { background: var(--err-bg); color: #7A271A; } .dl-result.err .big { background: var(--err); }
.dl-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.dl-opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1.5px solid #E5E9EF; border-radius: 14px; cursor: pointer; transition: all .2s; }
.dl-opt.on { border-color: var(--blue); background: var(--blue-ll); }
.dl-opt.disabled { opacity: .55; cursor: default; }
.dl-opt input { margin-top: 4px; accent-color: var(--blue); }

/* ---------- pagine pubbliche (accesso, registrazione) ---------- */
.pub { min-height: 100vh; display: flex; flex-direction: column; background: #fff; }
.pub-hdr { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px clamp(16px, 4vw, 48px); background: #fff; border-bottom: 1px solid var(--line); position: relative; z-index: 3; }
.pub-hdr img { height: 54px; width: auto; display: block; }
.pub-hdr nav { display: flex; gap: 28px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.pub-hdr nav a { color: #333; text-decoration: none; position: relative; }
.pub-hdr nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -6px; height: 2px; background: var(--blue); transition: right .3s; }
.pub-hdr nav a:hover::after, .pub-hdr nav a.on::after { right: 0; }
.pub-hdr nav a.on { color: var(--blue); }
.call { display: flex; align-items: center; gap: 10px; font-size: 11px; color: #777; font-weight: 600; text-transform: uppercase; }
.call b { display: block; font-size: 15px; color: var(--ink); text-transform: none; }
.call svg { width: 26px; height: 26px; color: #333; }
.login { flex: 1; display: grid; grid-template-columns: 1.1fr .9fr; background: linear-gradient(180deg, #fff 0%, var(--bg) 100%); position: relative; overflow: hidden; }
.blob { position: absolute; width: 580px; height: 580px; background: linear-gradient(135deg, var(--blue) 0%, #3A86D6 100%); opacity: .08; right: -150px; top: -170px; animation: blob 14s ease-in-out infinite; pointer-events: none; }
.blob.b2 { width: 400px; height: 400px; left: -130px; bottom: -150px; top: auto; right: auto; background: var(--orange); opacity: .07; animation-duration: 18s; }
.login-hero { padding: clamp(32px, 6vw, 72px) clamp(20px, 5vw, 64px); display: flex; flex-direction: column; justify-content: center; gap: 22px; position: relative; z-index: 1; }
.kicker { display: inline-flex; align-self: flex-start; gap: 8px; align-items: center; background: var(--blue-l); color: var(--blue); font-weight: 600; font-size: 13px; padding: 8px 14px; border-radius: 999px; }
.kicker i { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); display: inline-block; animation: pulse 2s infinite; }
.login-hero h1 { font-size: clamp(36px, 4.4vw, 56px); line-height: 1.05; font-weight: 800; }
.login-hero h1 span { display: block; color: var(--orange); font-size: clamp(18px, 2vw, 24px); font-weight: 700; margin-top: 12px; letter-spacing: 0; }
.login-hero p { font-size: 16px; line-height: 1.75; color: #555; max-width: 540px; }
.model-chips { display: flex; gap: 12px; flex-wrap: wrap; max-width: 560px; }
.model-chip { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 7px 14px 7px 8px; font-weight: 600; font-size: 13px; transition: transform .25s, box-shadow .25s; }
.model-chip:hover { transform: translateY(-4px); box-shadow: 0 14px 28px -16px rgba(28,95,168,.5); }
.model-chip img { width: 46px; height: 34px; object-fit: contain; }
.hero-product { position: absolute; right: -10px; bottom: 26px; width: min(300px, 28vw); filter: drop-shadow(0 30px 30px rgba(0,0,0,.25)); animation: float 6s ease-in-out infinite; pointer-events: none; }
.login-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; position: relative; z-index: 2; }
.login-card { width: 100%; max-width: 440px; padding: 34px; display: flex; flex-direction: column; gap: 16px; border-radius: 22px; box-shadow: 0 32px 64px -30px rgba(17,24,39,.4); }
.login-card h2 { color: var(--ink); font-size: 26px; }
.sep { display: flex; align-items: center; gap: 12px; color: #9CA3AF; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.sep::before, .sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pub-foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 18px; border-top: 1px solid var(--line); background: #fff; }
@media (max-width: 980px) { .login { grid-template-columns: 1fr; } .hero-product { display: none; } .pub-hdr nav, .pub-hdr .call { display: none; } }

/* ---------- modale e notifiche ---------- */
.mail-head { background: var(--blue); color: #fff; padding: 16px 20px; display: flex; gap: 10px; align-items: center; font-weight: 700; border-radius: var(--radius) var(--radius) 0 0; }
.mail-head svg { width: 22px; height: 22px; color: var(--orange); }
.a-ok.small { background: none; border: 0; color: var(--ok); font-weight: 600; padding: 0; }
.modal-back { position: fixed; inset: 0; background: rgba(24,29,39,.5); backdrop-filter: blur(3px); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeUp .2s ease both; }
.modal { width: 100%; max-width: 720px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .3s var(--ease) both; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-body { padding: 20px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.toasts { position: fixed; right: 16px; top: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast { background: var(--dark); color: #fff; border-radius: 14px; padding: 12px 16px; font-size: 14px; box-shadow: var(--shadow); animation: fadeRight .35s var(--ease) both; border-left: 4px solid var(--orange); }
.toast.err { background: #7A271A; border-left-color: #FDA29B; }
@media (max-width: 760px) {
  .main { padding-bottom: 90px; }
  .secnav { position: static; flex: 1 1 100%; flex-direction: row; overflow-x: auto; max-height: none; padding: 6px; }
  .secnav button { width: auto; flex: none; white-space: nowrap; min-height: 42px; }
  .actionbar { left: 50%; bottom: 10px; max-width: calc(100vw - 16px); padding-left: 12px; }
  .ab-txt, .ab-btn .lbl-long, .kbd { display: none; }
  .cmd-head { flex-wrap: wrap; }
  h1 { font-size: 26px; }
}
@media print { .side, .topbar, .actionbar, .ab-spacer, .tabs, .secnav, .btn, .mode-banner { display: none !important; } .main { padding: 0; } .card { box-shadow: none; } }

/* ============================================================ campi che dipendono da una scelta */
.not-used { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px dashed var(--line); border-radius: 14px; background: #FBFCFE; color: var(--muted); font-size: 13.5px; }
.not-used svg { flex: none; opacity: .7; }
.not-used.sm { padding: 9px 13px; margin-bottom: 2px; font-size: 13px; }
.lnk { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--blue); cursor: pointer; text-decoration: underline; }
.lnk:hover { color: var(--orange-d, #D98300); }
.cmd.unused { border-style: dashed; background: #FCFDFE; }

/* ============================================================ mappa delle geofence */
.mp-modal .modal-body { padding-bottom: 14px; }
.mp-search { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mp-search .grow { position: relative; flex: 1; min-width: 220px; }
.mp-sug { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-lg, 0 20px 40px -20px rgba(0,0,0,.35)); max-height: 240px; overflow: auto; }
.mp-sug button { display: block; width: 100%; text-align: left; border: 0; background: none; font: inherit; font-size: 13.5px; padding: 9px 13px; cursor: pointer; border-bottom: 1px solid #F3F5F8; }
.mp-sug button:last-child { border-bottom: 0; } .mp-sug button:hover { background: var(--blue-ll, #F4F8FD); }
.mp { position: relative; height: 440px; border-radius: 14px; border: 1px solid var(--line); overflow: hidden; background: #E8EEF3; touch-action: none; cursor: crosshair; }
.mp.grab { cursor: grabbing; }
.mp-tiles, .mp-ov, .mp-marks { position: absolute; inset: 0; }
.mp-tiles { overflow: hidden; }
.mp-t { position: absolute; width: 256px; height: 256px; user-select: none; pointer-events: none; }
.mp-ov, .mp-marks { pointer-events: none; width: 100%; height: 100%; }
.mp-circ { fill: rgba(28,95,168,.14); stroke: var(--blue); stroke-width: 2; }
.mp-poly { fill: rgba(241,147,0,.16); stroke: var(--orange); stroke-width: 2; }
.mp-spoke { stroke: var(--blue); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .7; }
.mp-mk { position: absolute; pointer-events: auto; cursor: grab; touch-action: none; }
.mp-mk.drag { cursor: grabbing; }
.mp-pin { width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.mp-handle { width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--orange); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.mp-vtx { width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--orange); border: 2px solid #fff; color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.mp-zoom { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 4px; }
.mp-zb { width: 32px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 9px; font-size: 18px; font-weight: 700; cursor: pointer; line-height: 1; }
.mp-attr { position: absolute; right: 0; bottom: 0; background: rgba(255,255,255,.82); font-size: 11px; padding: 2px 7px; border-radius: 8px 0 0 0; }
.mp-attr a { color: var(--muted); }
.mp-ctl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13.5px; }
.mp-ctl input[type=range] { accent-color: var(--orange); flex: 1; min-width: 170px; }
.mp-ctl .inp.sm, .inp.sm { width: 92px; }
.mp-vals { background: var(--blue-ll, #F4F8FD); border: 1px solid #D6E4F5; border-radius: 12px; padding: 10px 14px; font-size: 13px; color: var(--blue); font-family: var(--mono, ui-monospace, Consolas, monospace); word-break: break-word; }
.chip.sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; }
@media (max-width: 760px) { .mp { height: 320px; } }

/* ============================================================ barra delle azioni su schermi stretti */
/* Il testo di stato si accorcia da solo invece di spingere i pulsanti fuori dallo schermo. */
.ab-st { min-width: 0; }
.ab-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1200px) and (min-width: 901px) {
  .actionbar { left: calc(50% + 100px); max-width: calc(100vw - 280px); }
  .ab-txt { max-width: 190px; }
}
@media (max-width: 900px) {
  .ab-txt { max-width: 160px; }
  .ab-btn { padding: 9px 12px; }
}
@media (max-width: 620px) {
  /* Su telefono restano l'essenziale e il menu: salvataggio, annulla, altro. */
  .actionbar { gap: 6px; padding: 6px 6px 6px 12px; }
  .ab-acts { gap: 4px; }
  .ab-btn { padding: 9px 11px; }
  .pill { padding: 3px 8px; font-size: 11px; }
}

/* ============================================================ importazione con i clienti */
.badge.b-inv { background: #F3ECFB; color: #6B3FA0; }
.chk-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; background: #FBFCFE; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; cursor: pointer; }
.chk-row input { margin-top: 2px; flex: none; }
.chk-row .hint { display: block; }
.small { font-size: 12.5px; }
