[hidden] { display: none !important; }
:root { --bg: #14181f; --panel: #1e2530; --panel2: #262e3b; --line: #34405a; --ink: #e8edf5; --muted: #8d99ae; --green: #5fc67b; --red: #ff6b6b; --yellow: #ffcf5c; --blue: #6aa8ff; --purple: #b79cff; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 14px/1.45 "Segoe UI", system-ui, sans-serif; }
a { color: var(--blue); } .muted { color: var(--muted); } small { color: var(--muted); }
button, .btn { font: inherit; background: var(--panel2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 7px 13px; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { border-color: #5a6b8f; background: #2d3748; }
button.primary { background: var(--green); border-color: var(--green); color: #0d2a15; font-weight: 700; }
button.danger { background: #3a2226; border-color: #7a3a42; color: #ffb3b3; } button.danger:hover { background: #4d2a30; }
button.warn { background: #3a3220; border-color: #7a6a30; color: #ffe08a; }
button.small, .btn.small { padding: 3px 9px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; background: #10141b; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
textarea { min-height: 110px; resize: vertical; }
label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.center { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.card.narrow { width: min(380px, 100%); display: grid; gap: 10px; } .card h1 { margin: 0; font-size: 22px; }
.err { color: var(--red); min-height: 1.2em; }
#app { display: grid; grid-template-columns: 230px 1fr; min-height: 100%; }
#side { background: var(--panel); border-right: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; height: 100vh; }
.brand { font-size: 18px; font-weight: 800; } .brand small { display: block; font-weight: 400; font-size: 12px; }
#nav { display: grid; gap: 3px; flex: 1; align-content: start; overflow: auto; }
#nav button { text-align: left; background: transparent; border-color: transparent; display: flex; justify-content: space-between; align-items: center; }
#nav button.on { background: var(--panel2); border-color: var(--line); color: #fff; }
.me { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 6px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 9px; border-radius: 10px; width: fit-content; background: #2d3748; }
.r1 { background: #1f3a2a; color: #7fe09a; } .r2 { background: #3a3320; color: #ffd36a; } .r3 { background: #3d2848; color: #d9a8ff; }
.count { background: var(--red); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; }
#main { padding: 20px 24px 50px; min-width: 0; }
h2 { margin: 0 0 14px; font-size: 21px; } h3 { margin: 18px 0 8px; font-size: 15px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 24px; } .stat span { color: var(--muted); font-size: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; } .row > input, .row > select { width: auto; flex: 1 1 140px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } @media (max-width: 900px) { .cols2 { grid-template-columns: 1fr; } #app { grid-template-columns: 1fr; } #side { position: static; height: auto; } }
table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; } th { color: var(--muted); font-weight: 600; font-size: 12px; }
tr.click { cursor: pointer; } tr.click:hover { background: var(--panel2); }
.tbl { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: auto; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding: 10px 6px 0; }
.chart > div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; height: 100%; font-size: 10px; color: var(--muted); }
.bar { width: 100%; border-radius: 4px 4px 0 0; min-height: 2px; } .bar.u { background: var(--blue); } .bar.m { background: var(--green); } .bar.f { background: var(--red); }
.pill { font-size: 11px; padding: 1px 8px; border-radius: 10px; background: #2d3748; margin-right: 4px; display: inline-block; } .pill.red { background: #4d2a30; color: #ffb3b3; } .pill.yellow { background: #3a3320; color: #ffd36a; } .pill.green { background: #1f3a2a; color: #7fe09a; }
.line { padding: 7px 10px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 80px 120px 1fr auto; gap: 8px; align-items: baseline; } .line.flag { background: #3a2226; }
.line .t { color: var(--muted); font-size: 12px; } .line .u { font-weight: 700; cursor: pointer; } .line .u:hover { text-decoration: underline; }
.overlay { position: fixed; inset: 0; background: rgba(5,8,14,.7); display: flex; align-items: flex-start; justify-content: center; padding: 30px 12px; overflow: auto; z-index: 10; }
.card.wide { width: min(820px, 100%); } .mhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; } .mhead h2 { margin: 0; }
.form { display: grid; gap: 10px; } .acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.box { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 6px; align-content: start; } .box b { font-size: 13px; }
.code { font-family: ui-monospace, Consolas, monospace; background: #10141b; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
pre { white-space: pre-wrap; margin: 4px 0 0; font: inherit; color: #c8d1e0; }
.big { font-size: 15px; } .on { color: var(--green); } .off { color: var(--red); }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); padding: 10px 18px; border-radius: 10px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 30; max-width: 90%; }
#toast.show { opacity: 1; } #toast.bad { border-color: var(--red); }

/* ===== v126: pannello staff su telefono e tablet ===== */
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
img, canvas { max-width: 100%; }
@media (pointer: coarse) { input, select, textarea { font-size: 16px; } button { min-height: 40px; } }
@media (max-width: 800px) {
  #app { display: block !important; } #side { position: sticky; top: 0; z-index: 30; width: 100% !important; height: auto !important; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px !important; padding-top: max(8px, env(safe-area-inset-top)) !important; }
  #side .brand { flex: 0 0 auto; } #side nav { display: flex; gap: 4px; overflow-x: auto; flex: 1 1 100%; order: 3; padding-bottom: 4px; -webkit-overflow-scrolling: touch; } #side nav button, #side nav a { white-space: nowrap; flex: 0 0 auto; }
  #side .me { display: flex; gap: 6px; align-items: center; margin-left: auto; flex: 0 0 auto; }
  #main { padding: 10px !important; margin-left: 0 !important; width: 100% !important; }
  table { display: block; overflow-x: auto; max-width: 100%; } .cols2, .cols3 { grid-template-columns: 1fr !important; }
  .overlay > .card, .overlay > .card.wide { width: 100%; max-height: 92dvh; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; } .overlay { align-items: flex-end !important; padding: 0 !important; }
}
