/* ARVELL RP | Pannello staff */
:root {
  color-scheme: dark;
  --ink: #101416;
  --ink-2: #13181b;
  --panel: #171d21;
  --panel-2: #1c2328;
  --line: #263036;
  --line-soft: #1f272c;
  --text: #f0f0e6;
  --text-2: #b7c0b9;
  --muted: #88948f;
  --accent: #8bd5b3;
  --accent-strong: #5fdcaa;
  --accent-soft: rgba(139, 213, 179, .12);
  --ok: #8bd5b3;
  --warn: #d9b26f;
  --danger: #e07f7f;
  --info: #8fb4e8;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .28);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --display: Impact, "Arial Narrow", "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
}
* { box-sizing: border-box; }
/* L'attributo hidden vince sempre sugli stili di layout (es. .field e un flex). */
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--ink); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--mono); font-size: 12px; }
img { max-width: 100%; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.block { display: block; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.sep { display: inline-block; width: 1px; height: 12px; background: var(--line); margin: 0 8px; vertical-align: middle; }

/* STRUTTURA */
.shell { display: flex; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; width: 248px; flex: none; display: flex; flex-direction: column; background: var(--ink-2); border-right: 1px solid var(--line-soft); padding: 22px 14px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; border-bottom: 1px solid var(--line-soft); margin-bottom: 14px; }
.brand-symbol { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 0 14px rgba(139, 213, 179, .25)); }
.brand-text { display: flex; flex-direction: column; gap: 3px; }
.brand-wordmark { width: 118px; height: auto; display: block; }
.brand-text small { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: #6b7672; padding: 14px 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; transition: background .15s, color .15s; position: relative; }
.nav-link:hover { background: var(--panel); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }
.nav-link.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.sidebar-foot { border-top: 1px solid var(--line-soft); padding-top: 14px; }
.server-pill { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; background: var(--panel); border: 1px solid var(--line-soft); }
.server-pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 4px rgba(224, 127, 127, .14); flex: none; }
.server-pill.is-online i { background: var(--accent); box-shadow: 0 0 0 4px rgba(139, 213, 179, .14); animation: pulse 2.4s ease-in-out infinite; }
.server-pill strong { display: block; font-size: 13px; }
.server-pill small { color: var(--muted); font-size: 12px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(139, 213, 179, .04); } }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 18px; padding: 16px 28px; background: rgba(16, 20, 22, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-soft); }
.topbar-title h1 { margin: 0; font: italic 26px/1.05 var(--display); letter-spacing: .01em; }
.topbar-title p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.quick-search { margin-left: auto; display: flex; align-items: center; gap: 8px; width: min(420px, 38vw); padding: 0 12px; height: 38px; border-radius: 9px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.quick-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; }
.quick-search:focus-within { border-color: var(--accent); }
.user-box { display: flex; align-items: center; gap: 10px; }
.user-box form { margin: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.avatar-empty { display: grid; place-items: center; background: var(--panel); color: var(--muted); }
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta strong { font-size: 13px; }
.user-meta small { color: var(--accent); font-size: 11px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text-2); cursor: pointer; transition: .15s; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.menu-btn { display: none; }
.content { padding: 24px 28px 10px; display: flex; flex-direction: column; gap: 18px; }
.footer { padding: 18px 28px 26px; color: #66716d; font-size: 12px; }

/* CARD E GRIGLIE */
.card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -2px 0 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; }
.card-head h2 .icon { color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.link { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-size: 13px; font-weight: 500; }
.link .icon { width: 15px; height: 15px; }
.link:hover { color: var(--accent-strong); }
.back { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; align-self: flex-start; }
.back:hover { color: var(--accent); }
.sub { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 18px 0 8px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.kpi { display: flex; gap: 14px; align-items: center; background: linear-gradient(135deg, var(--panel), var(--panel-2)); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px; transition: border-color .15s, transform .15s; }
.kpi:hover { border-color: rgba(139, 213, 179, .35); transform: translateY(-1px); }
.kpi-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.kpi-icon .icon { width: 22px; height: 22px; }
.kpi-icon.kpi-danger { background: rgba(224, 127, 127, .12); color: var(--danger); }
.kpi small { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.kpi strong { display: block; font: italic 34px/1.05 var(--display); margin: 2px 0; }
.kpi em { font-style: normal; color: var(--text-2); font-size: 12px; }

/* BARRE DI SCORRIMENTO: sottili e in tinta col pannello */
* { scrollbar-width: thin; scrollbar-color: #33403f transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2c3735; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #3f4e4b; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* TABELLE: nessuno scorrimento verticale interno; gli elenchi lunghi sono divisi in pagine.
   Lo scorrimento orizzontale resta solo come riserva su schermi stretti. */
.table-wrap { overflow-x: auto; overflow-y: hidden; margin: 0 -20px; padding: 0 20px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .018); }
.table tbody tr:last-child td { border-bottom: 0; }
.trunc-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.id-tag { display: inline-flex; align-items: center; min-width: 26px; justify-content: center; padding: 1px 7px; border-radius: 6px; background: var(--ink); border: 1px solid var(--line); font: 600 12px var(--mono); color: var(--text-2); }
.who { display: inline-flex; flex-direction: column; line-height: 1.3; }
.who-name { font-weight: 600; }
a.who:hover .who-name { color: var(--accent); }
.who-sub { font-size: 12px; color: var(--muted); }

.copy { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; cursor: pointer; color: var(--text-2); }
.copy code { background: var(--ink); border: 1px solid var(--line-soft); padding: 2px 6px; border-radius: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.copy.trunc code { max-width: 140px; }
.copy .icon { width: 13px; height: 13px; opacity: 0; transition: opacity .15s; color: var(--accent); }
.copy:hover .icon { opacity: 1; }
.copy.copied code { border-color: var(--accent); color: var(--accent); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge .icon { width: 13px; height: 13px; }
.badge-ok { color: var(--ok); background: rgba(139, 213, 179, .1); border-color: rgba(139, 213, 179, .22); }
.badge-warn { color: var(--warn); background: rgba(217, 178, 111, .1); border-color: rgba(217, 178, 111, .22); }
.badge-danger { color: var(--danger); background: rgba(224, 127, 127, .1); border-color: rgba(224, 127, 127, .22); }
.badge-info { color: var(--info); background: rgba(143, 180, 232, .1); border-color: rgba(143, 180, 232, .22); }
.badge-muted { color: var(--text-2); background: rgba(255, 255, 255, .04); border-color: var(--line); }
.chip { display: inline-block; padding: 1px 8px; margin: 1px 0; border-radius: 6px; font-size: 12px; background: var(--ink); border: 1px solid var(--line-soft); color: var(--text-2); }
.chip-aggiunto { color: var(--ok); border-color: rgba(139, 213, 179, .25); }
.chip-rimosso { color: var(--danger); border-color: rgba(224, 127, 127, .25); }
.chip-modificato { color: var(--warn); border-color: rgba(217, 178, 111, .25); }

/* FILTRI */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
.field.grow { flex: 1 1 280px; }
.field span { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.field input, .field select { height: 38px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--ink); color: var(--text); font: inherit; outline: 0; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--ink); color: var(--text); font: inherit; outline: 0; resize: vertical; min-height: 64px; }
.field-inline { flex-direction: row; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--ink); color: var(--muted); }
.field-inline input { border: 0; height: auto; padding: 0; background: transparent; min-width: 260px; }
.filter-actions { display: flex; gap: 8px; }
.toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: 600 13px var(--font); cursor: pointer; transition: .15s; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #0d1411; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-block { width: 100%; height: 46px; font-size: 14px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line-soft); }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.pager-links { display: flex; gap: 6px; }
.pager-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--line); color: var(--text-2); }
.pager-btn:hover { border-color: var(--accent); color: var(--accent); }
.pager-btn.disabled { opacity: .35; pointer-events: none; }
.pager-sizes { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.pager-sizes .muted { margin-right: 4px; font-size: 12px; }
.pager-size { display: inline-grid; place-items: center; min-width: 34px; height: 28px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line); color: var(--text-2); font-size: 12px; }
.pager-size:hover { border-color: var(--accent); color: var(--accent); }
.pager-size.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pager { flex-wrap: wrap; }

/* AVVISI E STATI VUOTI */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; }
.notice .icon { margin-top: 1px; }
.notice-warn { border-color: rgba(217, 178, 111, .3); background: rgba(217, 178, 111, .07); color: #ead6b0; }
.notice-warn .icon { color: var(--warn); }
.notice-danger { border-color: rgba(224, 127, 127, .3); background: rgba(224, 127, 127, .07); color: #f1c9c9; }
.notice-danger .icon { color: var(--danger); }
.notice-ok { border-color: rgba(139, 213, 179, .3); background: var(--accent-soft); }
.notice-ok .icon, .notice-info .icon { color: var(--accent); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 30px 16px; color: var(--muted); }
.empty .icon { width: 30px; height: 30px; color: #4f5a56; margin-bottom: 4px; }
.empty strong { color: var(--text-2); }
.empty p { margin: 0; font-size: 13px; max-width: 420px; }

/* FEED */
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.feed li a { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 8px; border-bottom: 1px solid var(--line-soft); }
.feed li:last-child a { border-bottom: 0; }
.feed li a:hover, .feed li a.current { background: rgba(255, 255, 255, .025); }
.feed-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; flex: none; background: var(--ink); border: 1px solid var(--line-soft); }
.feed-icon .icon { width: 16px; height: 16px; }
.feed-body { flex: 1; min-width: 0; }
.feed-body small { display: block; color: var(--muted); font-size: 12px; }
.feed time { color: var(--muted); font-size: 12px; white-space: nowrap; }
/* Riga con piu link (nomi cliccabili + dettaglio evento) */
.feed li.feed-split { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 8px; border-bottom: 1px solid var(--line-soft); }
.feed li.feed-split:last-child { border-bottom: 0; }
.feed li.feed-split:hover { background: rgba(255, 255, 255, .025); }
.feed li.feed-split a { display: inline; padding: 0; border: 0; border-radius: 0; background: none; }
.feed li.feed-split a.feed-icon { display: grid; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--ink); }
.feed-sub { display: block !important; color: var(--muted); font-size: 12px; }
.feed-sub:hover, .feed-time:hover time { color: var(--accent); }
.name-link, .feed li.feed-split a.name-link { font-weight: 600; color: var(--text); border-bottom: 1px dashed rgba(139, 213, 179, .35); }
.name-link:hover, .feed li.feed-split a.name-link:hover { color: var(--accent); border-bottom-color: var(--accent); }
.name-link.is-plain { border-bottom: 0; }
.tone-ok { color: var(--ok); } .tone-warn { color: var(--warn); } .tone-danger { color: var(--danger); } .tone-info { color: var(--info); } .tone-muted { color: var(--text-2); }

/* DETTAGLI */
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 0; margin: 0; font-size: 13px; }
.kv dt, .kv dd { padding: 8px 0; border-bottom: 1px solid var(--line-soft); margin: 0; }
.kv dt { color: var(--muted); display: flex; align-items: center; gap: 7px; }
.kv dt .icon { width: 15px; height: 15px; color: #6b7672; }
.kv dd { min-width: 0; overflow-wrap: anywhere; }
.kv dd > div + div { margin-top: 4px; }
.kv dd .icon { width: 15px; height: 15px; color: var(--muted); }
.hero-card { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; background: linear-gradient(120deg, var(--panel-2), var(--panel) 60%); position: relative; overflow: hidden; }
.hero-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(139, 213, 179, .08), transparent 70%); pointer-events: none; }
.hero-card.tone-danger::after { background: radial-gradient(circle, rgba(224, 127, 127, .1), transparent 70%); }
.hero-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); flex: none; }
.hero-card.tone-danger .hero-icon { background: rgba(224, 127, 127, .12); color: var(--danger); }
.hero-card.tone-warn .hero-icon { background: rgba(217, 178, 111, .12); color: var(--warn); }
.hero-icon .icon { width: 28px; height: 28px; }
.hero-text { flex: 1 1 280px; min-width: 0; }
.hero-text h2 { margin: 6px 0 3px; font: italic 28px/1.1 var(--display); letter-spacing: .01em; }
.hero-text p { margin: 0; font-size: 13px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, auto); gap: 8px 28px; }
.hero-stats small, .facts small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.hero-stats strong { font-size: 16px; }
.hero-item .item-img { width: 64px; height: 64px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.facts strong { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.code { margin: 0; max-height: 460px; overflow: auto; padding: 14px; border-radius: 8px; background: var(--ink); border: 1px solid var(--line-soft); font: 12px/1.55 var(--mono); color: #c8d3cc; white-space: pre; }
.token-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.token-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px; border-radius: 7px; background: var(--ink); border: 1px solid var(--line-soft); min-width: 0; }
.token-row .copy code { max-width: 300px; border: 0; padding: 0; background: none; }

/* OGGETTI */
.item { display: inline-flex; align-items: center; gap: 10px; }
.item-img { width: 34px; height: 34px; object-fit: contain; border-radius: 7px; background: var(--ink); border: 1px solid var(--line-soft); padding: 3px; flex: none; }
.item-img-empty { display: inline-grid; place-items: center; color: #4f5a56; }
.item-img-empty .icon { width: 16px; height: 16px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.slot { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px; padding: 14px 8px 10px; border-radius: 9px; background: var(--ink); border: 1px solid var(--line-soft); }
.slot .item-img { width: 52px; height: 52px; border: 0; background: none; }
.slot strong { font-size: 12px; line-height: 1.25; }
.slot small { font-size: 11px; color: var(--muted); line-height: 1.3; overflow-wrap: anywhere; }
.slot-n { position: absolute; top: 6px; left: 8px; font: 600 10px var(--mono); color: #5d6864; }
.slot-q { font: 600 12px var(--mono); color: var(--accent); }
.slot-aggiunto { border-color: rgba(139, 213, 179, .55); box-shadow: inset 0 0 0 1px rgba(139, 213, 179, .2); }
.slot-rimosso { border-color: rgba(224, 127, 127, .55); box-shadow: inset 0 0 0 1px rgba(224, 127, 127, .2); }
.slot-modificato { border-color: rgba(217, 178, 111, .55); }
.slot-spostato { border-color: rgba(143, 180, 232, .4); }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.related + .related { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.related-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.related-head .link { margin-left: auto; }

/* ONLINE */
.live-dot { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.live-dot i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.live-dot.is-live i { background: var(--accent); animation: pulse 2.4s ease-in-out infinite; }
.live-dot.is-error i { background: var(--danger); }
.bars { display: flex; flex-direction: column; gap: 5px; min-width: 120px; }
.bar { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); }
.bar .icon { width: 13px; height: 13px; }
.bar-track { flex: 1; height: 4px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar-fill { display: block; width: 0; height: 100%; background: var(--accent); border-radius: 3px; }
.sub-line { margin-top: 4px; }
.bar.armor .bar-fill { background: var(--info); }
.bar.low .bar-fill { background: var(--danger); }

/* LOGIN */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; position: relative; overflow: hidden; }
.login-scene { position: fixed; inset: 0; z-index: -1; background: url("../asset.php?brand=scene") 60% center / cover no-repeat; filter: grayscale(.8) brightness(.38); }
.login-scene::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #101416 0%, rgba(16, 20, 22, .82) 45%, rgba(16, 20, 22, .55)); }
.login-card { width: min(440px, 100%); background: rgba(23, 29, 33, .92); border: 1px solid var(--line); border-radius: 14px; padding: 34px 32px 28px; box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.login-symbol { width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 0 20px rgba(139, 213, 179, .3)); }
.login-wordmark { width: 168px; height: auto; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; margin: 0 0 8px; }
.eyebrow .icon { width: 15px; height: 15px; }
.login-card h1 { margin: 0 0 10px; font: italic 44px/1 var(--display); }
.login-lead { margin: 0 0 22px; color: var(--text-2); font-size: 14px; }
.login-card .notice { margin-bottom: 18px; }
.login-foot { display: flex; align-items: center; gap: 7px; margin: 18px 0 0; color: var(--muted); font-size: 12px; }
.login-foot .icon { width: 14px; height: 14px; }

/* AZIONI */
.small { font-size: 12px; }
.grow-text { flex: 1 1 260px; margin: 0; align-self: center; font-size: 12px; }
.page-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions-compact { display: inline-flex; gap: 4px; margin-right: 4px; vertical-align: middle; }
.actions-compact .icon-btn { width: 30px; height: 30px; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12px; }
.btn-sm .icon { width: 15px; height: 15px; }
.btn-warn { color: var(--warn); border-color: rgba(217, 178, 111, .35); background: rgba(217, 178, 111, .08); }
.btn-warn:hover { border-color: var(--warn); }
.btn-danger { color: #fff; border-color: #b85c5c; background: #a84f4f; }
.btn-danger:hover { background: #bb5a5a; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn.icon-warn:hover { color: var(--warn); border-color: var(--warn); }
.icon-btn.icon-danger:hover { color: var(--danger); border-color: var(--danger); }
.notice-info { border-color: rgba(139, 213, 179, .25); background: var(--accent-soft); }
.dialog { padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(8, 10, 11, .7); }
.dialog-body { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-head h2 { margin: 0; font: italic 24px/1.1 var(--display); }
.dialog-target { margin: 0; display: flex; align-items: center; gap: 8px; }
.dialog-body > p.muted { margin: -6px 0 0; font-size: 13px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* OSSERVA */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.watch-stage { padding: 0; overflow: hidden; }
.watch-video { position: relative; aspect-ratio: 16 / 9; background: #070909; }
.watch-video video { width: 100%; height: 100%; display: block; object-fit: contain; background: #070909; }
.watch-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 20px; color: var(--text-2); }
.watch-overlay .icon { width: 36px; height: 36px; color: var(--accent); }
.watch-overlay[data-state="error"] .icon { color: var(--danger); }
.watch-overlay small { color: var(--muted); max-width: 440px; }
.watch-live { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px; background: rgba(16, 20, 22, .8); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.watch-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: pulse 2s ease-in-out infinite; }
.watch-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.watch-side { display: flex; flex-direction: column; gap: 16px; }
.meters { display: flex; flex-direction: column; gap: 10px; }
.meter { display: grid; grid-template-columns: 110px 1fr 44px; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.meter span:first-child { display: flex; align-items: center; gap: 6px; }
.meter .icon { width: 15px; height: 15px; color: var(--muted); }
.meter strong { text-align: right; font-variant-numeric: tabular-nums; }
.meter .bar-track { height: 6px; }
.meter[data-meter="armour"] .bar-fill { background: var(--info); }
.meter.low .bar-fill { background: var(--danger); }

/* SEGNALAZIONI E RICOSTRUZIONE */
.alert-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.alert-chip { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-soft); }
.alert-chip span { flex: 1; color: var(--text-2); font-size: 13px; }
.alert-chip strong { font: italic 22px var(--display); color: var(--text); }
.alert-chip:hover { border-color: var(--line); }
.alert-chip.is-zero { opacity: .5; }
.who-list { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.person { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 9px; background: var(--ink); border: 1px solid var(--line-soft); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 105px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.timeline li { display: grid; grid-template-columns: 88px 36px minmax(0, 1fr); align-items: start; gap: 0 10px; padding: 6px 0; }
.tl-time { text-align: right; font: 600 13px var(--mono); color: var(--text-2); padding-top: 7px; }
.tl-time small { display: block; font: 11px var(--font); color: var(--muted); }
.tl-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); }
.tl-dot .icon { width: 15px; height: 15px; }
.tl-body { display: flex; flex-direction: column; padding: 6px 12px; border-radius: 8px; }
.tl-body:hover { background: rgba(255, 255, 255, .025); }
.tl-body small { color: var(--muted); }
.tl-kind { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.timeline li.is-current .tl-body { background: rgba(224, 127, 127, .08); border: 1px solid rgba(224, 127, 127, .25); }

/* STATISTICHE */
.kpis-6 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span-2 { grid-column: 1 / -1; }
.chart { width: 100%; min-height: 120px; }
.chart svg { display: block; overflow: visible; font-family: var(--font); }
.chart-card .card-head p { margin: 2px 0 0; }
.chart-table { margin-top: 10px; font-size: 13px; }
.chart-table summary { cursor: pointer; color: var(--muted); }
.chart-table summary:hover { color: var(--accent); }
.chart-tooltip { position: fixed; z-index: 50; pointer-events: none; display: flex; flex-direction: column; padding: 8px 11px; border-radius: 8px; background: #0b0e10; border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 12px; }
.chart-tooltip strong { font-size: 14px; }
.chart-tooltip small { color: var(--muted); }

/* MAPPA */
.map-card { display: flex; flex-direction: column; }
.map { height: calc(100vh - 260px); min-height: 460px; border-radius: 9px; overflow: hidden; background: #0c1214; border: 1px solid var(--line-soft); }
.map-notice { margin-bottom: 12px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.legend-player { background: var(--accent); }
.legend-kill { background: var(--danger); }
.legend-heat { display: inline-block; width: 22px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #5a2626, #9c3d3d, #e05f5f, #ffc2b8); }
.field-select select { border: 0; background: transparent; color: var(--text); font: inherit; outline: 0; }
.leaflet-container { background: #0c1214; font-family: var(--font); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); }
.leaflet-popup-content { margin: 12px 14px; font-size: 13px; }
.map-popup { display: flex; flex-direction: column; gap: 3px; min-width: 190px; }
.map-popup .link { margin-top: 6px; }
.leaflet-tooltip.map-id { background: rgba(16, 20, 22, .85); color: var(--text); border: 0; box-shadow: none; font: 600 11px var(--mono); padding: 1px 5px; }
.leaflet-tooltip.map-id::before { display: none; }
.leaflet-tooltip.map-place-label { background: transparent; border: 0; box-shadow: none; color: var(--muted); font-size: 11px; padding: 0; }
.leaflet-tooltip.map-place-label::before { display: none; }
.map-place { background: #4f5a56; border-radius: 50%; }
.leaflet-bar a, .leaflet-control-layers { background: var(--panel); color: var(--text); border-color: var(--line); }
.leaflet-bar a:hover { background: var(--panel-2); color: var(--accent); }

/* REPLAY SCONTRO */
.replay-window { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.replay-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.map-replay { height: calc(100vh - 330px); min-height: 420px; }
.replay-controls { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.replay-track { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 3px; padding-top: 10px; }
.replay-range { width: 100%; margin: 0; accent-color: var(--accent); }
.replay-time { font: 600 12px var(--mono); color: var(--text-2); white-space: nowrap; min-width: 170px; text-align: right; }
.replay-marks { position: relative; height: 7px; margin: 0 8px; }
.replay-hint { margin: 8px 0 0; }
.replay-marks i { position: absolute; top: 0; width: 2px; height: 8px; border-radius: 1px; background: var(--danger); }
.replay-marks i.tone-warn { background: var(--warn); }
.replay-side { display: flex; flex-direction: column; gap: 16px; }
.replay-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.replay-people li { display: grid; grid-template-columns: 12px 1fr auto; column-gap: 8px; align-items: center; }
.replay-people li small { grid-column: 2 / 4; }
.replay-people .link { background: none; border: 0; padding: 0; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.replay-people .link:hover { color: var(--accent); }
.replay-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.replay-feed li { display: grid; grid-template-columns: 70px 1fr; gap: 8px; padding: 6px 8px; border-radius: 7px; border-left: 2px solid var(--line); opacity: .55; }
.replay-feed li.is-past { opacity: 1; }
.replay-feed li.is-now { background: var(--panel-2); }
.replay-feed li.tone-danger.is-past { border-left-color: var(--danger); }
.replay-feed li.tone-warn.is-past { border-left-color: var(--warn); }
.replay-feed li.is-current strong, .replay-feed li.is-current a { color: var(--danger); }
.replay-feed li div { display: flex; flex-direction: column; min-width: 0; }
.replay-feed-time { background: none; border: 0; padding: 0; font: 600 12px var(--mono); color: var(--muted); cursor: pointer; text-align: left; }
.replay-feed-time:hover { color: var(--accent); }
.replay-event { border-radius: 3px; transform: rotate(45deg); background: var(--danger); border: 2px solid #171d21; }
.replay-event.is-wound { background: var(--warn); }
@media (max-width: 1100px) {
  .replay-layout { grid-template-columns: 1fr; }
  .map-replay { height: 60vh; }
}
@media (max-width: 640px) {
  .replay-controls { flex-wrap: wrap; }
  .replay-track { flex-basis: 100%; order: 3; }
  .replay-time { min-width: 0; text-align: left; }
}

/* PED PERSONALIZZATI (creatore) */
.pc { position: relative; display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 18px; align-items: start; }
.pc.is-success::after { content: ""; position: absolute; inset: -4px; pointer-events: none; border-radius: 16px;
  box-shadow: 0 0 0 2px var(--accent), 0 0 60px rgba(139, 213, 179, .25); animation: pc-glow 1.8s ease-out forwards; }
@keyframes pc-glow { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }

.pc-stage { position: sticky; top: 18px; display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 14px;
  background: linear-gradient(180deg, #151b1f, #101416); border: 1px solid var(--line); box-shadow: var(--shadow); }
.pc-stage-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pc-eyebrow { display: block; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); }
.pc-title { margin: 2px 0 2px; font: italic 40px/1 var(--display); letter-spacing: .02em; }
.pc-model { font: 600 11px var(--mono); color: var(--muted); }
.pc-models { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-pill { height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--ink); color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer; }
.pc-pill.is-active, .pc-pill:hover { border-color: var(--accent); color: var(--text); }

.pc-photo { position: relative; margin: 0; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-soft);
  background: radial-gradient(ellipse 70% 55% at 50% 38%, rgba(139, 213, 179, .16), transparent 70%), radial-gradient(circle at 50% 120%, #1f2a2e, #0b0f11 70%); }
.pc-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.015); transition: opacity .35s ease, transform .5s ease; }
.pc-photo img.is-in { opacity: 1; transform: none; }
.pc-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }
.pc-empty strong { color: var(--text-2); font-size: 14px; }
.pc-silhouette { width: 34%; max-width: 130px; fill: #1d272b; stroke: #2d3a3f; stroke-width: 1.5; margin-bottom: 8px; animation: pc-breathe 3.5s ease-in-out infinite; }
@keyframes pc-breathe { 50% { fill: #223035; } }
.pc-caption { position: absolute; left: 12px; bottom: 12px; padding: 5px 10px; border-radius: 8px; background: rgba(10, 13, 15, .78); border: 1px solid var(--line);
  font-size: 12px; font-weight: 600; color: var(--text); backdrop-filter: blur(4px); }
.pc-angles { position: absolute; right: 12px; top: 12px; display: flex; padding: 3px; border-radius: 99px; background: rgba(10, 13, 15, .78); border: 1px solid var(--line); }
.pc-angle { height: 26px; padding: 0 11px; border: 0; border-radius: 99px; background: transparent; color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer; }
.pc-angle.is-active { background: var(--accent); color: #0d1411; font-weight: 600; }
.pc-scan { position: absolute; inset: 0; pointer-events: none; background: rgba(8, 11, 12, .35); }
.pc-scan i { position: absolute; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 18px var(--accent); animation: pc-scan 2.2s ease-in-out infinite; }
.pc-scan span { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); padding: 4px 11px; border-radius: 99px; background: rgba(10, 13, 15, .85);
  border: 1px solid rgba(139, 213, 179, .4); color: var(--accent); font: 600 12px var(--mono); white-space: nowrap; }
@keyframes pc-scan { 0% { top: 4%; } 50% { top: 94%; } 100% { top: 4%; } }
.pc-stage-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pc-stage-actions .btn { justify-content: center; }
.pc-auto { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--ink); border: 1px solid var(--line-soft); cursor: pointer; font-size: 13px; }
.pc-auto input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }
.pc-auto small { font-size: 12px; margin-top: 2px; }
.pc-studio { display: none; flex-direction: column; gap: 6px; }
.pc-studio.is-active { display: flex; }
.pc-studio.is-error small { color: var(--danger); }
.pc-studio-bar { height: 5px; border-radius: 99px; background: var(--ink); overflow: hidden; }
.pc-studio-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); transition: width .4s ease; }
.pc-note { display: flex; gap: 8px; margin: 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.pc-note .icon { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }

.pc-editor { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-soft); min-width: 0; }
.pc-block { display: flex; flex-direction: column; gap: 10px; }
.pc-block + .pc-block { padding-top: 14px; border-top: 1px solid var(--line-soft); }
.pc-block-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pc-block-head h3 { margin: 0; font-size: 14px; font-weight: 600; flex: 1; }
.pc-step { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(139, 213, 179, .3); font: italic 15px/1 var(--display); }
.pc-tools { display: flex; gap: 6px; }
.pc-block .ped-search { width: 100%; }
.pc-block .pc-search { display: flex; width: 100%; height: 42px; box-sizing: border-box; }
.pc-block .pc-search input { flex: 1; min-width: 0; width: 100%; }

.pc-tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.pc-tab { position: relative; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-soft);
  background: var(--ink); color: var(--text-2); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.pc-tab .icon { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.pc-tab:hover { border-color: var(--line); color: var(--text); }
.pc-tab.is-active { border-color: var(--accent); background: linear-gradient(135deg, rgba(139, 213, 179, .14), var(--ink)); color: var(--text); }
.pc-tab.is-active .icon { color: var(--accent); }
.pc-tab.is-custom::after { content: ""; position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.pc-part { display: flex; flex-direction: column; gap: 12px; }
.pc-part.is-shuffled .pc-option { animation: pc-pop .4s ease-out; }
@keyframes pc-pop { 0% { transform: scale(.96); } 100% { transform: none; } }
.pc-part-head { display: flex; align-items: baseline; gap: 10px; }
.pc-part-head strong { font: italic 22px/1 var(--display); letter-spacing: .02em; }
.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.pc-option { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 10px; border: 1px solid var(--line-soft);
  background: var(--ink); color: var(--text-2); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, transform .15s; }
.pc-option:hover { border-color: rgba(139, 213, 179, .45); transform: translateY(-1px); }
.pc-option.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; color: var(--text); }
.pc-thumb { display: grid; place-items: center; aspect-ratio: 3 / 4; border-radius: 7px; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #1f2a2e, #0e1214 75%); color: #4f5a56; font: italic 28px/1 var(--display); }
.pc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pc-option-label { padding: 0 2px; font-size: 12px; font-weight: 600; }
.pc-option-count { padding: 0 2px; font-size: 11px; color: var(--muted); margin-top: -4px; }
.pc-option-check { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #0d1411; }
.pc-option-check .icon { width: 13px; height: 13px; }
.pc-textures { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 10px; background: var(--ink); border: 1px dashed var(--line); }
.pc-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.pc-swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--text-2); font: 600 11px var(--mono); cursor: pointer; }
.pc-swatch .pc-thumb { width: 54px; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--line); font-size: 18px; transition: border-color .15s, transform .15s; }
.pc-swatch:hover .pc-thumb { border-color: rgba(139, 213, 179, .5); transform: scale(1.05); }
.pc-swatch.is-active .pc-thumb { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 213, 179, .2); }
.pc-swatch.is-active { color: var(--accent); }
.pc-hint { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border-radius: 9px; background: var(--accent-soft); color: var(--text-2); font-size: 12px; }
.pc-hint .icon { color: var(--accent); flex-shrink: 0; }

.pc-apply { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(139, 213, 179, .1), var(--ink)); border: 1px solid rgba(139, 213, 179, .25); }
.pc-summary { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pc-summary code { font: 600 12px var(--mono); color: var(--accent); word-break: break-word; }
.pc-apply-btn { height: 44px; padding: 0 20px; font-size: 14px; }

/* Ricerca giocatore e avanzamento (condivisi) */
.ped-search { position: relative; }
.ped-results { list-style: none; margin: 6px 0 0; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--ink); display: flex; flex-direction: column; gap: 2px; }
.ped-result { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ped-result:hover, .ped-result:focus-visible { background: var(--panel-2); outline: 0; }
.ped-result-main { display: flex; flex-direction: column; min-width: 0; }
.ped-result-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 11px; }
.ped-result-tags { display: flex; gap: 6px; flex-shrink: 0; }
.ped-result-empty { padding: 10px; color: var(--muted); font-size: 13px; }
.ped-target { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: linear-gradient(135deg, var(--accent-soft), transparent); border: 1px solid rgba(139, 213, 179, .3); }
.ped-target > div { flex: 1; min-width: 0; }
.ped-target small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ped-target-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--ink); color: var(--accent); border: 1px solid var(--line); flex-shrink: 0; }
.ped-progress { list-style: none; margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--ink); border: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.ped-progress li { display: flex; align-items: center; gap: 10px; }
.ped-progress li span { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; }
.ped-progress li.is-active, .ped-progress li.is-done { color: var(--text); }
.ped-progress li.is-active span { border-color: var(--accent); border-top-color: transparent; animation: pc-spin .8s linear infinite; }
.ped-progress li.is-done span { background: var(--accent); border-color: var(--accent); }
.ped-progress li.is-error { color: var(--danger); }
.ped-progress li.is-error span { background: var(--danger); border-color: var(--danger); }
.ped-progress b { font-weight: 600; }
@keyframes pc-spin { to { transform: rotate(360deg); } }

/* Ped assegnati */
.pc-list { margin-top: 18px; }
.pc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.pc-card { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; padding: 10px; border-radius: 12px; background: var(--ink); border: 1px solid var(--line-soft); transition: border-color .15s; }
.pc-card:hover { border-color: var(--line); }
.pc-card.is-online { border-color: rgba(139, 213, 179, .3); }
.pc-card-photo { position: relative; display: grid; place-items: center; aspect-ratio: 3 / 4; border-radius: 9px; overflow: hidden; color: #4f5a56;
  background: radial-gradient(circle at 50% 35%, #1f2a2e, #0e1214 75%); }
.pc-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.pc-card-photo .icon { width: 28px; height: 28px; }
.pc-card-live { position: absolute; left: 4px; right: 4px; bottom: 4px; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 2px 0; border-radius: 6px;
  background: var(--accent); color: #0d1411; font: 700 10px var(--mono); }
.pc-card-live .icon { width: 11px; height: 11px; color: #0d1411; }
.pc-card-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pc-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pc-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }

@media (max-width: 1100px) {
  .pc { grid-template-columns: 1fr; }
  .pc-stage { position: static; }
  .pc-photo { max-height: 70vh; }
}
@media (max-width: 640px) {
  .pc-stage, .pc-editor { padding: 14px; }
  .pc-title { font-size: 32px; }
  .pc-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .pc-apply-btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .pc.is-success::after, .pc-scan i, .pc-silhouette, .pc-part.is-shuffled .pc-option, .ped-progress li.is-active span { animation: none; }
  .pc-photo img { transition: none; }
}

/* INCROCIO IDENTIFICATORI */
.crossref-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.crossref-form .field.grow { flex: 1 1 480px; }
.crossref-form textarea { font-family: var(--mono); font-size: 12px; }
.crossref-side { display: flex; flex-direction: column; gap: 10px; min-width: 210px; }
.verdict { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.verdict > div:nth-child(2) { flex: 1 1 320px; }
.verdict h2 { margin: 0 0 4px; font: italic 26px/1.1 var(--display); }
.verdict p { margin: 0; color: var(--text-2); font-size: 13px; }
.verdict-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; flex: none; }
.verdict-icon .icon { width: 26px; height: 26px; }
.verdict-danger { border-color: rgba(224, 127, 127, .4); } .verdict-danger .verdict-icon { background: rgba(224, 127, 127, .12); color: var(--danger); }
.verdict-warn { border-color: rgba(217, 178, 111, .4); } .verdict-warn .verdict-icon { background: rgba(217, 178, 111, .12); color: var(--warn); }
.verdict-ok .verdict-icon { background: var(--accent-soft); color: var(--accent); }
.id-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.id-chips .copy code { max-width: 120px; }
.id-type { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11px; font-weight: 600; background: rgba(255, 255, 255, .05); color: var(--text-2); border: 1px solid var(--line); margin-right: 4px; }
.id-type-token { color: var(--danger); border-color: rgba(224, 127, 127, .3); }
.id-type-discord { color: var(--info); border-color: rgba(143, 180, 232, .3); }
.id-type-steam, .id-type-license { color: var(--warn); border-color: rgba(217, 178, 111, .3); }
.crossref-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.crossref-group { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 9px; background: var(--ink); border: 1px solid var(--line-soft); min-width: 0; }
.crossref-group h3 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.crossref-id { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.crossref-id .copy code { max-width: 200px; }

/* MODALITA TV */
body.tv { height: 100vh; overflow: hidden; display: flex; flex-direction: column; background: radial-gradient(ellipse at top, #141b1e, var(--ink) 60%); }
.tv-top { display: flex; align-items: center; gap: 22px; padding: 14px 22px; border-bottom: 1px solid var(--line-soft); }
.tv-brand { display: flex; align-items: center; gap: 12px; }
.tv-brand img { height: 34px; width: auto; }
.tv-brand .tv-wordmark { height: 26px; }
.tv-brand span { color: var(--muted); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; border-left: 1px solid var(--line); padding-left: 12px; }
.tv-status { display: flex; align-items: center; gap: 9px; color: var(--text-2); font-size: 13px; margin-left: auto; }
.tv-status i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.tv-status.is-online i { background: var(--accent); animation: pulse 2.4s ease-in-out infinite; }
.tv-status.is-offline i { background: var(--danger); }
.tv-clock { font: italic 30px/1 var(--display); letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.tv-buttons { display: flex; gap: 8px; }
.tv-grid { flex: 1; min-height: 0; display: grid; gap: 14px; padding: 14px 22px 18px;
  grid-template-columns: minmax(0, 2.1fr) minmax(320px, 1fr); grid-template-rows: auto minmax(0, 1fr) minmax(0, .8fr);
  grid-template-areas: "kpis kpis" "map feed" "map players"; }
.tv-kpis { grid-area: kpis; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tv-kpi { position: relative; padding: 14px 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line-soft); overflow: hidden; }
.tv-kpi small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.tv-kpi strong { display: block; font: italic 44px/1.05 var(--display); }
.tv-kpi em { font-style: normal; color: var(--text-2); font-size: 12px; }
.tv-spark { position: absolute; right: 16px; bottom: 14px; width: 45%; height: 30px; opacity: .9; }
.tv-kpi.is-active { border-color: rgba(224, 127, 127, .5); background: linear-gradient(135deg, rgba(224, 127, 127, .14), var(--panel)); }
.tv-kpi.is-active strong { color: var(--danger); }
.tv-kpi-alarm.is-active { animation: alarm 2s ease-in-out infinite; }
@keyframes alarm { 50% { box-shadow: 0 0 0 3px rgba(224, 127, 127, .18); } }
.tv-map { grid-area: map; padding: 0; overflow: hidden; }
.tv-map #tv-map { width: 100%; height: 100%; min-height: 300px; background: #0c1214; }
.tv-feed { grid-area: feed; display: flex; flex-direction: column; min-height: 0; }
.tv-feed .feed { flex: 1; min-height: 0; overflow: hidden; }
.tv-feed .feed li.is-new a { animation: fresh 3s ease-out; }
@keyframes fresh { from { background: rgba(139, 213, 179, .16); } to { background: transparent; } }
.tv-players { grid-area: players; display: flex; flex-direction: column; min-height: 0; }
.tv-player-list { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 6px; }
.tv-player { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--line-soft); }
.tv-player-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tv-player-name small { color: var(--muted); font-weight: 400; font-size: 12px; }
.tv-flash { position: fixed; left: 50%; top: 90px; transform: translateX(-50%); z-index: 1000; display: flex; align-items: center; gap: 14px; padding: 16px 22px;
  border-radius: 12px; background: #2a1517; border: 1px solid rgba(224, 127, 127, .6); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); max-width: min(720px, 90vw); }
.tv-flash .icon { width: 30px; height: 30px; color: var(--danger); }
.tv-flash strong { display: block; color: var(--danger); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; }
.tv-flash span { font-size: 18px; }
.tv-map { position: relative; }
.tv-live { position: absolute; right: 12px; bottom: 12px; z-index: 500; width: min(560px, 55%); border-radius: 10px; overflow: hidden; background: var(--panel);
  border: 1px solid rgba(224, 127, 127, .55); box-shadow: 0 18px 50px rgba(0, 0, 0, .55); }
.tv-live header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line-soft); }
.tv-live header strong { font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--danger); }
.tv-live .watch-bar { padding: 6px 10px; }
@media (max-width: 1100px) { body.tv { overflow: auto; height: auto; } .tv-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "kpis" "map" "feed" "players"; } .tv-map #tv-map { height: 420px; } .tv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* VISORE, CLIP E MULTI-OSSERVAZIONE */
.viewer { display: flex; flex-direction: column; }
.watch-tag { position: absolute; top: 12px; right: 12px; padding: 3px 9px; border-radius: 6px; background: rgba(16, 20, 22, .8); font: 600 12px var(--mono); }
.watch-note { margin: 0 16px 14px; }
.multi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.multi-slot { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.multi-pick { display: flex; align-items: flex-end; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.multi-pick .field { min-width: 0; }
.multi-num { display: grid; place-items: center; width: 30px; height: 38px; font: italic 22px var(--display); color: var(--accent); }
.multi-view { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 260px; }
.multi-view .watch-bar { padding: 8px 12px; }
.clip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.clip { margin: 0; border-radius: 9px; overflow: hidden; background: var(--ink); border: 1px solid var(--line-soft); }
.clip video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #070909; }
.clip figcaption { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; font-size: 13px; }
@media (max-width: 1100px) { .multi { grid-template-columns: minmax(0, 1fr); } }

.hero-actions { flex-basis: 100%; align-items: center; }
.ratio-track { width: 90px; flex: none; }
.watch-form { display: inline-flex; gap: 6px; align-items: center; }
.watch-form input { height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--ink); color: var(--text); font: inherit; font-size: 12px; min-width: 220px; }
.settings-form { display: flex; flex-direction: column; gap: 12px; max-width: 760px; margin: 6px 0 14px; }
.inline-form { display: inline; margin: 0; }
.table tr.is-seen { opacity: .55; }

/* MANUTENZIONE */
.danger-zone { border-color: rgba(224, 127, 127, .3); }
.danger-zone .card-head h2 .icon { color: var(--danger); }
.danger-zone p { margin: 0 0 12px; color: var(--text-2); font-size: 13px; }
.reset-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.reset-form .btn { align-self: flex-start; }
.list.small li { padding-left: 14px; position: relative; }
.list.small li::before { content: ""; position: absolute; left: 0; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }

/* REGISTRO STAFF */
.staff-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.staff-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 9px; background: var(--ink); border: 1px solid var(--line-soft); min-width: 0; }
.staff-card:hover { border-color: rgba(139, 213, 179, .35); }
.staff-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.staff-card-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-card-count { font: italic 20px var(--display); color: var(--accent); }
.staff-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-icon { display: inline-flex; margin-right: 7px; color: var(--muted); vertical-align: -3px; }
.source-icon .icon { width: 15px; height: 15px; }
.outcome { max-width: 260px; white-space: normal; }
.trunc-cell { max-width: 200px; }

/* ECONOMIA, CLASSIFICHE, TESTI */
.delta { font-weight: 600; font-variant-numeric: tabular-nums; }
.delta-up { color: var(--ok); }
.delta-down { color: var(--danger); }
.rank { list-style: none; margin: 0; padding: 0; }
.rank a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 6px; border-bottom: 1px solid var(--line-soft); border-radius: 6px; }
.rank li:last-child a { border-bottom: 0; }
.rank a:hover { background: rgba(255, 255, 255, .025); color: var(--accent); }
.rank strong { font-variant-numeric: tabular-nums; }
.plate { font-family: var(--mono); letter-spacing: .08em; padding: 2px 8px; border-radius: 5px; background: #e9e6d6; color: #15191b; }
.prewrap { white-space: pre-wrap; margin: 0; color: var(--text-2); }
.nav { gap: 1px; }
.nav-link { padding: 8px 10px; }

/* RESPONSIVE */
@media (max-width: 1280px) { .alert-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpis-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .watch { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } .hero-stats { grid-template-columns: repeat(2, auto); } .user-meta { display: none; } }
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .quick-search { order: 5; width: 100%; margin: 0; }
  .user-box { margin-left: auto; }
  .content { padding: 16px; }
  .kpis, .kpis-6, .alert-summary { grid-template-columns: minmax(0, 1fr); }
  .timeline::before { left: 81px; }
  .timeline li { grid-template-columns: 64px 36px minmax(0, 1fr); }
  .kv { grid-template-columns: 120px minmax(0, 1fr); }
  .field-inline input { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* =====================================================================================
   ARVELL CONSOLE v2 - strato tecnico/professionale (stessa identita: menta, fondo scuro, Impact).
   In fondo al file: prevale sulle regole precedenti senza dover riscrivere le pagine.
   ===================================================================================== */
:root {
  --grid-line: rgba(139, 213, 179, .035);
  --hud: rgba(139, 213, 179, .55);
  --panel-hi: rgba(255, 255, 255, .022);
  --glow: 0 0 0 1px rgba(139, 213, 179, .35), 0 8px 26px rgba(95, 220, 170, .14);
  --radius: 9px;
}

/* Fondo: griglia tecnica appena percettibile e luce dall'alto */
body {
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(139, 213, 179, .07), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(143, 180, 232, .035), transparent 60%),
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--ink);
  background-attachment: fixed;
  font-feature-settings: "tnum" 1;
}
::selection { background: rgba(139, 213, 179, .28); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--line);
  border-bottom-width: 2px; background: var(--ink); color: var(--text-2); font: 600 10px/1 var(--mono); }

/* ---------- Sidebar ---------- */
.sidebar { background: linear-gradient(180deg, rgba(19, 24, 27, .97), rgba(14, 18, 20, .99)); box-shadow: inset -1px 0 0 rgba(139, 213, 179, .04); }
.brand { position: relative; }
.brand::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 1px; background: linear-gradient(90deg, var(--accent), transparent 70%); opacity: .5; }
.nav { counter-reset: navgroup; gap: 1px; }
.nav-label { display: flex; align-items: center; gap: 8px; padding: 16px 10px 6px; font: 600 10px/1 var(--mono); letter-spacing: .18em; color: #5f6b67; }
.nav-label::before { counter-increment: navgroup; content: counter(navgroup, decimal-leading-zero); color: var(--accent); opacity: .75; }
.nav-label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.nav-link { padding: 8px 10px; font-size: 13px; border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s, transform .15s; }
.nav-link .icon { width: 17px; height: 17px; color: #6f7b77; transition: color .15s; }
.nav-link:hover { background: rgba(255, 255, 255, .03); transform: translateX(2px); }
.nav-link:hover .icon { color: var(--text-2); }
.nav-link.active { background: linear-gradient(90deg, rgba(139, 213, 179, .14), rgba(139, 213, 179, .02)); border-color: rgba(139, 213, 179, .16); color: var(--text); }
.nav-link.active .icon { color: var(--accent); }
.nav-link.active::before { box-shadow: 0 0 12px var(--accent); }
.server-pill { background: rgba(16, 20, 22, .7); }
.palette-hint { display: flex; align-items: center; gap: 6px; width: 100%; margin-top: 8px; padding: 8px 10px; border-radius: 8px; border: 1px dashed var(--line);
  background: transparent; color: var(--muted); font: 500 12px var(--font); cursor: pointer; transition: border-color .15s, color .15s; }
.palette-hint span { flex: 1; text-align: left; }
.palette-hint .icon { width: 14px; height: 14px; }
.palette-hint:hover { border-color: rgba(139, 213, 179, .45); color: var(--text); }

/* ---------- Barra di sistema ---------- */
.sysbar { display: flex; align-items: stretch; height: 30px; padding: 0 18px; background: rgba(9, 12, 13, .92); border-bottom: 1px solid var(--line-soft);
  font: 500 11px/1 var(--mono); color: var(--muted); letter-spacing: .04em; overflow: hidden; }
.sys-item { display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border-right: 1px solid rgba(38, 48, 54, .7); white-space: nowrap; }
.sys-item small { font: inherit; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #5d6965; }
.sys-item b { color: var(--text-2); font-weight: 600; }
.sys-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.sys-state.is-online i { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: sys-blink 2.4s ease-in-out infinite; }
.sys-state.is-online b { color: var(--accent); }
.sys-state.is-offline b { color: var(--danger); }
@keyframes sys-blink { 50% { opacity: .45; } }
.sys-alerts b { color: var(--danger); }
.sys-alerts:hover small, .sys-alerts:hover b { color: #ffb4b4; }
.sys-spacer { flex: 1; }
.sysbar .sys-item:last-child { border-right: 0; }
.sysbar .sys-spacer + .sys-item { border-left: 1px solid rgba(38, 48, 54, .7); }

/* ---------- Intestazione ---------- */
.topbar { padding: 14px 28px; background: rgba(14, 18, 20, .82); backdrop-filter: blur(12px) saturate(1.2); box-shadow: 0 1px 0 rgba(139, 213, 179, .05); }
.crumb { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font: 600 10px/1 var(--mono); letter-spacing: .18em; color: #5f6b67; }
.crumb b { color: var(--accent); font-weight: 700; }
.crumb i { font-style: normal; color: #3f4b48; }
.crumb span { color: #77837f; }
.topbar-title h1 { font-size: 28px; letter-spacing: .015em; text-shadow: 0 2px 18px rgba(0, 0, 0, .35); }
.topbar-title p { font-size: 12.5px; max-width: 760px; }
.quick-search { position: relative; background: rgba(16, 20, 22, .9); transition: border-color .15s, box-shadow .15s; }
.quick-search:focus-within { box-shadow: var(--glow); }
.quick-kbd { margin-left: auto; transition: opacity .15s; }
.user-meta strong, .user-meta small { white-space: nowrap; }
.quick-search:focus-within .quick-kbd { opacity: 0; }

/* ---------- Contenuto: ingresso morbido ---------- */
.content > * { animation: rise .42s cubic-bezier(.2, .7, .2, 1) both; }
.content > *:nth-child(2) { animation-delay: .04s; }
.content > *:nth-child(3) { animation-delay: .08s; }
.content > *:nth-child(4) { animation-delay: .12s; }
.content > *:nth-child(5) { animation-delay: .16s; }
.content > *:nth-child(n+6) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Card: pannello tecnico con angolo HUD ---------- */
.card { position: relative; background: linear-gradient(180deg, var(--panel-hi), transparent 120px), var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025), 0 1px 0 rgba(0, 0, 0, .25); }
.card::before { content: ""; position: absolute; top: -1px; left: -1px; width: 12px; height: 12px; border-top: 1px solid var(--hud); border-left: 1px solid var(--hud);
  border-top-left-radius: var(--radius); pointer-events: none; opacity: .8; }
.card > .card-head { margin: -4px -20px 16px; padding: 0 20px 12px; border-bottom: 1px solid var(--line-soft); }
.card-head h2 { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.card-head h2 .icon { width: 16px; height: 16px; padding: 4px; box-sizing: content-box; border-radius: 6px; background: var(--accent-soft); }
.card-head .muted, .card-head .small { font-size: 12px; }

/* ---------- KPI ---------- */
.kpi { position: relative; overflow: hidden; padding: 16px 18px; background: linear-gradient(160deg, rgba(139, 213, 179, .05), transparent 45%), var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025); }
.kpi::before { content: ""; position: absolute; top: -1px; left: -1px; width: 12px; height: 12px; border-top: 1px solid var(--hud); border-left: 1px solid var(--hud); border-top-left-radius: var(--radius); }
.kpi::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--accent), transparent); opacity: .35; transition: opacity .2s; }
.kpi:hover::after { opacity: .8; }
.kpi:hover { border-color: rgba(139, 213, 179, .3); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .25); }
.kpi small { font: 600 10px/1.2 var(--mono); letter-spacing: .16em; }
.kpi strong { font-size: 36px; letter-spacing: .01em; }
.kpi em { font-size: 11.5px; color: var(--muted); }
.kpi-icon { border: 1px solid rgba(139, 213, 179, .2); box-shadow: inset 0 0 18px rgba(139, 213, 179, .08); }
.kpi-icon.kpi-danger { border-color: rgba(224, 127, 127, .25); }

/* ---------- Tabelle ---------- */
.table thead th { background: rgba(9, 12, 13, .55); font: 600 10px/1.2 var(--mono); letter-spacing: .16em; color: #6d7975; }
.table thead th:first-child { border-top-left-radius: 7px; }
.table thead th:last-child { border-top-right-radius: 7px; }
.table td { padding: 11px 10px; }
.table tbody tr:nth-child(even) { background: rgba(255, 255, 255, .008); }
.table tbody tr:hover { background: linear-gradient(90deg, rgba(139, 213, 179, .06), rgba(139, 213, 179, .015)); }
.table tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.table td.num { font-family: var(--mono); font-size: 12.5px; }
.id-tag { border-radius: 5px; font-size: 11px; background: rgba(9, 12, 13, .7); border-color: rgba(139, 213, 179, .18); color: var(--accent); }

/* ---------- Badge: squadrati, con indicatore ---------- */
.badge { border-radius: 5px; padding: 2px 8px; font: 600 10.5px/1.6 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.badge:not(:has(svg))::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.badge .icon { width: 12px; height: 12px; }
.chip { border-radius: 5px; font-family: var(--mono); font-size: 11.5px; }

/* ---------- Pulsanti e campi ---------- */
.btn { border-radius: 7px; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #9be0c0, var(--accent)); border-color: #9be0c0; box-shadow: 0 6px 18px rgba(95, 220, 170, .18), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-primary:hover { background: linear-gradient(180deg, #a9e8cb, var(--accent-strong)); box-shadow: 0 8px 24px rgba(95, 220, 170, .28), inset 0 1px 0 rgba(255, 255, 255, .4); }
.btn-ghost:hover { background: rgba(255, 255, 255, .03); }
.btn:not(.btn-primary):not(.btn-danger):not(.btn-warn):not(.btn-ghost):hover { border-color: rgba(139, 213, 179, .45); color: var(--text); }
.icon-btn { border-radius: 7px; background: rgba(23, 29, 33, .9); }
.icon-btn:hover { box-shadow: 0 0 0 3px rgba(139, 213, 179, .1); }
.field span { font: 600 10px/1.2 var(--mono); letter-spacing: .16em; }
.field input, .field select, .field textarea { background: rgba(9, 12, 13, .6); transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field select:focus, .field textarea:focus { box-shadow: 0 0 0 3px rgba(139, 213, 179, .14); }
.field-inline { background: rgba(9, 12, 13, .6); }
.field-inline:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 213, 179, .14); }
.tab.active { text-shadow: 0 0 18px rgba(139, 213, 179, .35); }
.pager { font: 500 12px var(--mono); color: var(--muted); }
.pager-btn, .pager-size { border-radius: 6px; font-family: var(--mono); }

/* ---------- Avvisi, stati vuoti, feed, dettagli ---------- */
.notice { border-radius: 8px; border-left-width: 3px; }
.empty { margin: 4px 0; border: 1px dashed var(--line); border-radius: 10px;
  background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(255, 255, 255, .012) 10px 20px); }
.empty .icon { padding: 10px; box-sizing: content-box; border-radius: 12px; background: rgba(9, 12, 13, .6); border: 1px solid var(--line-soft); color: #5c6864; }
.feed-icon { border-radius: 8px; background: rgba(9, 12, 13, .6); }
.feed time { font-family: var(--mono); font-size: 11px; }
.kv dt { font: 600 10.5px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #6d7975; }
.kv dt, .kv dd { padding: 9px 0; }
.code { background: rgba(7, 9, 10, .85); border-color: var(--line); }
.hero-card { background: radial-gradient(600px 220px at 0% 0%, rgba(139, 213, 179, .08), transparent 70%), linear-gradient(120deg, var(--panel-2), var(--panel) 60%); }
.hero-stats small, .facts small { font: 600 10px/1.3 var(--mono); letter-spacing: .14em; }
.hero-stats strong { font-family: var(--mono); font-size: 15px; }

/* ---------- Dialoghi ---------- */
.dialog { border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(139, 213, 179, .08); }
.dialog::backdrop { background: rgba(6, 8, 9, .62); backdrop-filter: blur(3px); }
.dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }

/* ---------- Palette comandi ---------- */
.palette { padding: 0; margin: 12vh auto auto; border: 0; background: transparent; width: min(620px, calc(100vw - 32px)); max-height: none; overflow: visible; color: var(--text); }
.palette::backdrop { background: rgba(6, 8, 9, .66); backdrop-filter: blur(4px); }
.palette[open] .palette-box { animation: pop .16s ease-out; }
.palette-box { overflow: hidden; border-radius: 14px; background: #141a1d; border: 1px solid var(--line);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .6), 0 0 0 1px rgba(139, 213, 179, .1), inset 0 1px 0 rgba(255, 255, 255, .04); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 56px; border-bottom: 1px solid var(--line-soft); color: var(--accent); }
.palette-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 500 16px var(--font); }
.palette-input input::-webkit-search-cancel-button { display: none; }
.palette-list { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 1px; }
.palette-group { padding: 10px 10px 4px; font: 600 10px/1 var(--mono); letter-spacing: .18em; color: #5f6b67; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; color: var(--text-2); cursor: pointer; }
.palette-item .icon { width: 17px; height: 17px; color: #6f7b77; }
.palette-item small { margin-left: auto; font: 500 11px var(--mono); color: #5f6b67; }
.palette-item.is-active { background: linear-gradient(90deg, rgba(139, 213, 179, .14), rgba(139, 213, 179, .03)); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.palette-item.is-active .icon { color: var(--accent); }
.palette-item mark { background: none; color: var(--accent); font-weight: 700; }
.palette-empty { padding: 18px 12px; color: var(--muted); font-size: 13px; text-align: center; }
.palette-foot { display: flex; gap: 16px; padding: 9px 14px; border-top: 1px solid var(--line-soft); background: rgba(9, 12, 13, .5); font-size: 11px; color: var(--muted); }
.palette-foot span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Rischio giocatori ---------- */
.risk-gauge { position: relative; display: inline-grid; place-items: center; flex: none; }
.risk-gauge svg { transform: rotate(-90deg); }
.risk-track { fill: none; stroke: var(--line); stroke-width: 4; }
.risk-arc { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; filter: drop-shadow(0 0 4px currentColor); }
.risk-gauge.tone-warn .risk-arc { stroke: var(--warn); }
.risk-gauge.tone-danger .risk-arc { stroke: var(--danger); }
.risk-gauge.tone-muted .risk-arc { stroke: #8b9a95; }
.risk-gauge b { position: absolute; font: 700 13px var(--mono); }
.risk-cell { display: flex; align-items: center; gap: 10px; }
.risk-factors { display: flex; flex-wrap: wrap; gap: 5px; }
.risk-factor { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 5px; font-size: 12px; background: rgba(9, 12, 13, .6); border: 1px solid var(--line-soft); color: var(--text-2); }
.risk-factor b { font: 700 11px var(--mono); }
.risk-factor.tone-danger b { color: var(--danger); } .risk-factor.tone-warn b { color: var(--warn); } .risk-factor.tone-info b { color: var(--info); }
.hero-risk { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; }
.hero-risk small { font: 600 9.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hero-risk .risk-gauge b { font-size: 16px; }
.profile-tools { gap: 8px; }
.risk-kpi.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.risk-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.risk-mini li { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line-soft); }
.risk-mini li:last-child { border-bottom: 0; }
.risk-mini .risk-why { margin-left: auto; color: var(--muted); font-size: 12px; text-align: right; }

/* ---------- Ricorsi ---------- */
.appeal-card { width: min(620px, 100%); }
.appeal-me { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 16px; border-radius: 10px; background: rgba(9, 12, 13, .6); border: 1px solid var(--line-soft); }
.appeal-me > div { flex: 1; }
.appeal-ban { padding: 14px; margin-bottom: 12px; border-radius: 10px; border: 1px solid rgba(224, 127, 127, .3); background: rgba(224, 127, 127, .04); }
.appeal-ban-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.appeal-ban p { margin: 0 0 10px; font-size: 13px; }
.appeal-form { display: flex; flex-direction: column; gap: 10px; }
.appeal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.appeal-list li { padding: 10px 12px; border-radius: 8px; background: rgba(9, 12, 13, .55); border: 1px solid var(--line-soft); font-size: 13px; }
.appeal-reply { margin: 8px 0 0; padding: 8px 10px; border-left: 2px solid var(--accent); background: rgba(139, 213, 179, .05); font-size: 13px; }
.appeal-layout { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
.appeal-queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.appeal-queue a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 8px; border: 1px solid transparent; }
.appeal-queue a:hover { background: rgba(255, 255, 255, .025); }
.appeal-queue a.is-active { background: rgba(139, 213, 179, .07); border-color: rgba(139, 213, 179, .3); }
.appeal-text { margin: 0 0 16px; padding: 14px 16px; border-radius: 8px; border-left: 3px solid var(--accent); background: rgba(9, 12, 13, .6); font-size: 13.5px; line-height: 1.6; color: var(--text); }
.appeal-accounts { margin: 10px 0; }
.appeal-reply-form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.appeal-reply-form > .btn { align-self: flex-start; }
@media (max-width: 1000px) { .appeal-layout { grid-template-columns: 1fr; } }

/* ---------- Ban: calendario delle scadenze ---------- */
.ban-cal { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 6px; }
.ban-day { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 8px; border: 1px solid var(--line-soft); background: rgba(9, 12, 13, .5); color: var(--muted); }
.ban-day small { font: 600 9.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.ban-day b { font: 700 15px var(--mono); color: var(--text-2); }
.ban-day i { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--warn); color: #1a1408; font: 700 10.5px/18px var(--mono); font-style: normal; text-align: center; }
.ban-day.has-bans { border-color: rgba(217, 178, 111, .45); }
.ban-day.has-bans b { color: var(--warn); }
.ban-day.is-today { border-color: var(--accent); }
.ban-day.is-today b { color: var(--accent); }
.ban-day:hover { border-color: var(--accent); }
@media (max-width: 900px) { .ban-cal { grid-template-columns: repeat(10, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ban-cal { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ---------- Analisi economica ---------- */
.flow-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.flow-side { display: flex; flex-direction: column; gap: 18px; }
.flow-stage { position: relative; }
.flow-svg { width: 100%; display: block; }
.flow-edge { fill: none; stroke: rgba(139, 213, 179, .55); stroke-linecap: round; transition: opacity .15s, stroke .15s; cursor: pointer; }
.flow-edge:hover { stroke: var(--accent); }
.flow-edge.is-cycle { stroke: rgba(224, 127, 127, .75); }
.flow-edge.is-staff { stroke: rgba(143, 180, 232, .6); stroke-dasharray: 6 5; }
.flow-edge.is-dim { opacity: .08; }
.flow-arrow-flow { fill: var(--accent); } .flow-arrow-cycle { fill: var(--danger); } .flow-arrow-staff { fill: var(--info); }
.flow-node circle { fill: #1d272b; stroke: var(--accent); stroke-width: 2; }
.flow-node.is-cycle circle { stroke: var(--danger); fill: rgba(224, 127, 127, .2); }
.flow-node.is-staff circle { stroke: var(--info); }
.flow-node { cursor: pointer; }
.flow-node text { fill: var(--text); font: 600 12px var(--font); paint-order: stroke; stroke: var(--panel); stroke-width: 4px; }
.flow-node .flow-sub { fill: var(--muted); font: 500 10.5px var(--mono); }
.flow-cycles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.flow-cycles li { padding: 8px 10px; border-radius: 7px; background: rgba(224, 127, 127, .06); border: 1px solid rgba(224, 127, 127, .25); font-size: 12.5px; }
.heat-map { height: calc(100vh - 330px); min-height: 460px; }
.heat-zones { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.heat-zone { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line-soft); background: rgba(9, 12, 13, .55);
  color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s; }
.heat-zone:hover, .heat-zone.is-active { border-color: var(--accent); }
.heat-rank { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font: 700 12px var(--mono); flex: none; }
.items-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.items-split .sub { margin-top: 0; }
@media (max-width: 1100px) { .flow-layout { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .items-split { grid-template-columns: 1fr; } }

/* ---------- Grafo dei collegamenti ---------- */
.graph-shell { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.graph-stage { position: relative; height: calc(100vh - 300px); min-height: 520px; border-radius: var(--radius); border: 1px solid var(--line-soft); overflow: hidden;
  background: radial-gradient(800px 500px at 50% 45%, rgba(139, 213, 179, .06), transparent 70%),
    linear-gradient(rgba(139, 213, 179, .05) 1px, transparent 1px) 0 0 / 40px 40px, linear-gradient(90deg, rgba(139, 213, 179, .05) 1px, transparent 1px) 0 0 / 40px 40px, #0b0f11; }
.graph-svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; user-select: none; }
.graph-svg.is-panning { cursor: grabbing; }
.g-edge { stroke: #4f5a56; stroke-opacity: .75; stroke-linecap: round; }
.g-edge.t-token { stroke: var(--danger); }
.g-edge.t-discord { stroke: var(--info); }
.g-edge.t-steam { stroke: #b59ae0; }
.g-edge.t-license { stroke: var(--accent); }
.g-edge.t-fivem, .g-edge.t-xbl, .g-edge.t-live { stroke: var(--warn); }
.g-node { cursor: pointer; }
.g-dot { fill: #1d272b; stroke: #8b9a95; stroke-width: 2; transition: r .15s; }
.g-halo { fill: transparent; stroke: transparent; stroke-width: 2; }
.g-node.is-online .g-dot { fill: rgba(139, 213, 179, .25); stroke: var(--accent); }
.g-node.is-banned .g-dot { fill: rgba(224, 127, 127, .3); stroke: var(--danger); }
.g-node.is-seed .g-halo { stroke: var(--accent); stroke-dasharray: 4 4; animation: g-spin 8s linear infinite; }
.g-node.is-selected .g-halo { stroke: #fff; stroke-dasharray: none; }
.g-node:hover .g-dot { stroke: #fff; }
@keyframes g-spin { to { stroke-dashoffset: -64; } }
.g-label { fill: var(--text-2); font: 600 11px var(--font); text-anchor: middle; paint-order: stroke; stroke: #0b0f11; stroke-width: 4px; pointer-events: none; }
.g-node.is-selected .g-label, .g-node.is-seed .g-label { fill: #fff; }
.graph-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 13px; pointer-events: none; }
.graph-empty .icon { width: 34px; height: 34px; color: #4f5a56; }
.graph-hud { position: absolute; top: 12px; left: 14px; right: 14px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.graph-hud .crumb { margin: 0; padding: 6px 10px; border-radius: 7px; background: rgba(9, 12, 13, .8); border: 1px solid var(--line-soft); }
.graph-tools { display: flex; gap: 6px; pointer-events: auto; }
.graph-legend { position: absolute; left: 14px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px 14px; max-width: calc(100% - 28px); margin: 0; padding: 8px 12px; list-style: none;
  border-radius: 8px; background: rgba(9, 12, 13, .82); border: 1px solid var(--line-soft); font-size: 11.5px; color: var(--text-2); }
.graph-legend li { display: inline-flex; align-items: center; gap: 6px; }
.graph-legend i { width: 16px; height: 3px; border-radius: 2px; background: #4f5a56; }
.graph-legend .lg-token { background: var(--danger); } .graph-legend .lg-discord { background: var(--info); } .graph-legend .lg-steam { background: #b59ae0; }
.graph-legend .lg-license { background: var(--accent); } .graph-legend .lg-fivem { background: var(--warn); }
.lg-node { width: 11px; height: 11px; border-radius: 50%; border: 2px solid #8b9a95; background: #1d272b; }
.lg-node.is-banned { border-color: var(--danger); background: rgba(224, 127, 127, .3); }
.lg-node.is-online { border-color: var(--accent); background: rgba(139, 213, 179, .25); }
.lg-node.is-seed { border-style: dashed; border-color: var(--accent); background: transparent; }
.graph-side { position: sticky; top: 92px; }
.graph-who { display: flex; flex-direction: column; padding: 10px 12px; margin-bottom: 10px; border-radius: 8px; background: rgba(9, 12, 13, .6); border-left: 3px solid #8b9a95; }
.graph-who.is-online { border-left-color: var(--accent); }
.graph-who.is-banned { border-left-color: var(--danger); }
.graph-who strong { font-size: 15px; }
.graph-who small { font-family: var(--mono); font-size: 11px; overflow-wrap: anywhere; }
.graph-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.graph-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.graph-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.graph-links li { display: flex; flex-direction: column; padding: 6px 8px; border-radius: 6px; background: rgba(9, 12, 13, .5); }
.graph-links .link { padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
@media (max-width: 1100px) { .graph-shell { grid-template-columns: 1fr; } .graph-side { position: static; } }

/* ---------- Timeline giocatore ---------- */
.tl-license { width: 340px; height: 36px; }
.tl-stage { position: relative; }
.tl-svg { width: 100%; display: block; cursor: grab; user-select: none; touch-action: none; }
.tl-lane { fill: rgba(9, 12, 13, .55); stroke: var(--line-soft); }
.tl-lane.is-alt { fill: rgba(9, 12, 13, .35); }
.tl-lane-label { fill: #6d7975; font: 600 10px var(--mono); letter-spacing: .14em; dominant-baseline: middle; }
.tl-grid { stroke: rgba(139, 213, 179, .08); }
.tl-tick { fill: #6d7975; font: 500 10.5px var(--mono); text-anchor: middle; }
.tl-dot { stroke: #0b0f11; stroke-width: 2; cursor: pointer; transition: r .12s; }
.tl-dot:hover { r: 7; }
.tl-dot.is-selected { stroke: #fff; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .5)); }
.tl-tip { position: absolute; z-index: 5; width: 250px; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; background: #0b0f11;
  border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 12px; pointer-events: none; }
.tl-tip small { font: 600 10px var(--mono); color: var(--accent); letter-spacing: .08em; }
.tl-tip span { color: var(--muted); }
.tl-hint { margin: 8px 0 0; }
.tl-range { margin: 0; }
.tl-bottom { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.tl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tl-list li { display: grid; grid-template-columns: 96px 92px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--line-soft);
  border-left: 2px solid transparent; cursor: pointer; }
.tl-list li:hover { background: rgba(255, 255, 255, .02); }
.tl-list li.is-selected { background: rgba(139, 213, 179, .06); border-left-color: var(--accent); }
.tl-list time { font: 500 11px var(--mono); color: var(--muted); }
.tl-list div { display: flex; flex-direction: column; min-width: 0; }
.tl-list strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-badge { justify-self: start; padding: 1px 7px; border-radius: 5px; font: 600 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; background: rgba(9, 12, 13, .7); border: 1px solid var(--line); }
.tl-list li.tone-ok .tl-badge { color: var(--ok); } .tl-list li.tone-warn .tl-badge { color: var(--warn); } .tl-list li.tone-danger .tl-badge { color: var(--danger); }
.tl-list li.tone-info .tl-badge { color: var(--info); }
.tl-list li.tl-pager { display: flex; justify-content: center; align-items: center; gap: 12px; border: 0; cursor: default; padding-top: 12px; font: 500 12px var(--mono); color: var(--muted); }
.tl-list li.tl-pager:hover { background: none; }
.tl-list .pager-btn { background: none; cursor: pointer; font-size: 16px; }
.tl-map-card { position: sticky; top: 92px; }
.tl-map { height: 420px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line-soft); background: #0c1214; }
@media (max-width: 1100px) { .tl-bottom { grid-template-columns: 1fr; } .tl-map-card { position: static; } .tl-license { width: 100%; } }

/* ---------- Densita compatta ---------- */
[data-density][aria-pressed="true"] { color: var(--accent); border-color: rgba(139, 213, 179, .5); background: var(--accent-soft); }
body.is-compact { font-size: 13px; }
body.is-compact .content { gap: 12px; padding-top: 16px; }
body.is-compact .topbar { padding-top: 10px; padding-bottom: 10px; }
body.is-compact .topbar-title h1 { font-size: 23px; }
body.is-compact .card { padding: 13px 16px; }
body.is-compact .card > .card-head { margin: -2px -16px 12px; padding: 0 16px 10px; }
body.is-compact .table-wrap { margin: 0 -16px; padding: 0 16px; }
body.is-compact .table { font-size: 12.5px; }
body.is-compact .table td { padding: 6px 8px; }
body.is-compact .table thead th { padding: 7px 8px; }
body.is-compact .kpis { gap: 12px; }
body.is-compact .kpi { padding: 11px 14px; }
body.is-compact .kpi strong { font-size: 28px; }
body.is-compact .kpi-icon { width: 36px; height: 36px; }
body.is-compact .feed li a, body.is-compact .feed li.feed-split { padding: 6px; }
body.is-compact .feed-icon { width: 28px; height: 28px; }
body.is-compact .grid-2 { gap: 12px; }
body.is-compact .nav-link { padding: 6px 10px; }
body.is-compact .nav-label { padding-top: 11px; }
body.is-compact .btn { height: 34px; }
body.is-compact .field input, body.is-compact .field select { height: 34px; }
body.is-compact .kv dt, body.is-compact .kv dd { padding: 6px 0; }

/* ---------- Stato del sistema ---------- */
.sys-hero { display: flex; align-items: center; gap: 18px; padding: 18px 22px; border-radius: var(--radius); border: 1px solid rgba(139, 213, 179, .25);
  background: radial-gradient(500px 160px at 0% 50%, rgba(139, 213, 179, .1), transparent 70%), var(--panel); }
.sys-hero.is-warn { border-color: rgba(217, 178, 111, .35); background: radial-gradient(500px 160px at 0% 50%, rgba(217, 178, 111, .1), transparent 70%), var(--panel); }
.sys-hero h2 { margin: 2px 0 2px; font: italic 26px/1.1 var(--display); }
.sys-hero p { margin: 0; font-size: 12px; }
.sys-hero-led { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: rgba(139, 213, 179, .08); border: 1px solid rgba(139, 213, 179, .3); }
.sys-hero-led i { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 18px var(--accent); animation: sys-blink 2.4s ease-in-out infinite; }
.sys-hero.is-warn .sys-hero-led { background: rgba(217, 178, 111, .08); border-color: rgba(217, 178, 111, .35); }
.sys-hero.is-warn .sys-hero-led i { background: var(--warn); box-shadow: 0 0 18px var(--warn); }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.svc { display: flex; flex-direction: column; gap: 12px; }
.svc-head { display: flex; align-items: flex-start; gap: 12px; }
.svc-head > div { flex: 1; min-width: 0; }
.svc-head strong { display: block; font-size: 14px; }
.svc-head small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.svc-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); flex: none; }
.svc-state { display: inline-flex; align-items: center; gap: 6px; font: 700 10.5px var(--mono); letter-spacing: .1em; color: var(--accent); white-space: nowrap; }
.svc-state i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.svc.tone-warn .svc-state, .svc.tone-warn .svc-icon { color: var(--warn); }
.svc.tone-danger .svc-state, .svc.tone-danger .svc-icon { color: var(--danger); }
.svc.tone-warn .svc-icon { background: rgba(217, 178, 111, .1); }
.svc.tone-danger .svc-icon { background: rgba(224, 127, 127, .1); }
.svc.tone-warn { border-color: rgba(217, 178, 111, .3); }
.svc.tone-danger { border-color: rgba(224, 127, 127, .35); }
.svc-facts { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; margin: 0; font-size: 12.5px; }
.svc-facts dt { color: #6d7975; font: 600 10px/1.8 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.svc-facts dd { margin: 0; font-family: var(--mono); color: var(--text-2); text-align: right; }
.svc-latency { height: 3px; border-radius: 3px; background: var(--line-soft); overflow: hidden; margin-top: auto; }
.svc-latency i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--warn)); }
.disk { margin-bottom: 12px; }
.disk-bar { height: 10px; border-radius: 6px; background: rgba(9, 12, 13, .7); border: 1px solid var(--line-soft); overflow: hidden; }
.disk-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); box-shadow: 0 0 12px rgba(139, 213, 179, .4); }
.disk-bar i.is-warn { background: var(--warn); }
.disk-bar i.is-danger { background: var(--danger); }
.disk-legend { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font: 500 11.5px var(--mono); color: var(--muted); }
.disk-legend b { color: var(--text); }

/* ---------- Permessi ---------- */
.perm-rules { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.perm-rule { display: flex; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line-soft); }
.perm-rule strong { font-size: 13px; }
.perm-rule p { margin: 4px 0 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.perm-rule-n { font: 700 11px var(--mono); color: var(--accent); padding-top: 2px; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.perm-role { --role: var(--text-2); display: inline-flex; align-items: center; gap: 7px; padding: 3px 9px; border-radius: 6px; background: rgba(9, 12, 13, .7);
  border: 1px solid color-mix(in srgb, var(--role) 40%, transparent); color: var(--text); font-size: 12px; font-weight: 600; white-space: nowrap; }
.perm-role i { width: 8px; height: 8px; border-radius: 50%; background: var(--role); box-shadow: 0 0 8px var(--role); }
.perm-role.is-default { --role: var(--accent); }
.perm-add select { min-width: 240px; }
.perm-table th, .perm-table td { white-space: nowrap; }
.perm-section-col { min-width: 230px; }
.perm-col { text-align: center !important; vertical-align: top; }
.perm-col-head { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 2px 0; text-transform: none; letter-spacing: 0; font-family: var(--font); }
.perm-col.is-new .perm-role { animation: perm-new 1.4s ease-out; }
@keyframes perm-new { 0% { box-shadow: 0 0 0 0 rgba(139, 213, 179, .7); } 100% { box-shadow: 0 0 0 10px rgba(139, 213, 179, 0); } }
.perm-col-tools { display: inline-flex; align-items: center; gap: 4px; font: 500 11px var(--font); color: var(--muted); }
.perm-col-tools .link { padding: 0; border: 0; background: none; cursor: pointer; font-size: 11px; }
.perm-remove { width: 22px; height: 22px; margin-left: 4px; }
.perm-remove .icon { width: 12px; height: 12px; }
.perm-missing { color: var(--warn); font-size: 10.5px; }
.perm-label { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; }
.perm-label .icon { width: 15px; height: 15px; color: #6f7b77; }
.perm-cell { text-align: center; }
.perm-group td { padding: 14px 10px 6px !important; font: 600 10px var(--mono); letter-spacing: .18em; color: var(--accent); background: none !important; box-shadow: none !important; }
.perm-special td { background: rgba(139, 213, 179, .025); }
.perm-fixed td { opacity: .75; }
.perm-check { display: inline-grid; place-items: center; cursor: pointer; }
.perm-check input { position: absolute; opacity: 0; pointer-events: none; }
.perm-check span { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); background: rgba(9, 12, 13, .7); display: grid; place-items: center; transition: background .12s, border-color .12s, box-shadow .12s; }
.perm-check span::after { content: ""; width: 10px; height: 6px; border-left: 2px solid #0d1411; border-bottom: 2px solid #0d1411; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.perm-check input:checked + span { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px rgba(139, 213, 179, .35); }
.perm-check input:checked + span::after { opacity: 1; }
.perm-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.perm-check:hover span { border-color: rgba(139, 213, 179, .55); }
.perm-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 14px -20px -18px; padding: 12px 20px;
  border-top: 1px solid var(--line-soft); background: rgba(16, 20, 22, .94); backdrop-filter: blur(8px); border-radius: 0 0 var(--radius) var(--radius); }
.perm-foot #perm-dirty { margin-right: auto; }
.perm-foot #perm-dirty.is-dirty { color: var(--warn); }
@media (max-width: 1100px) { .perm-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .perm-rules { grid-template-columns: 1fr; } }

/* ---------- Login: stessi angoli HUD delle card ---------- */
.login-card { position: relative; box-shadow: 0 30px 80px rgba(0, 0, 0, .5), 0 0 0 1px rgba(139, 213, 179, .06); }
.login-card::before, .login-card::after { content: ""; position: absolute; width: 18px; height: 18px; pointer-events: none; }
.login-card::before { top: -1px; left: -1px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); border-top-left-radius: 14px; }
.login-card::after { right: -1px; bottom: -1px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); border-bottom-right-radius: 14px; opacity: .6; }

/* ---------- Piede ---------- */
.footer { display: flex; flex-wrap: wrap; gap: 6px 18px; font: 500 11px var(--mono); letter-spacing: .06em; color: #56615e; text-transform: uppercase; }
.footer i { font-style: normal; color: var(--accent); opacity: .6; }

/* ---------- Schermi stretti ---------- */
@media (max-width: 1000px) { .sys-wide { display: none; } }
@media (max-width: 640px) {
  .sysbar { padding: 0 6px; }
  .sys-item { padding: 0 8px; }
  .quick-kbd { display: none; }
  .crumb { font-size: 9px; }
  /* Statistiche a due colonne: meno scorrimento sul telefono */
  .content .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; }
  .kpi-icon { width: 34px; height: 34px; }
  .kpi-icon .icon { width: 18px; height: 18px; }
  .kpi strong { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) { .nav-link:hover { transform: none; } }

/* MANUTENZIONE: BACKUP */
.bk-upload-btn { cursor: pointer; }
.bk-progress { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.bk-bar { flex: 0 0 220px; height: 6px; border-radius: 3px; background: var(--ink); border: 1px solid var(--line-soft); overflow: hidden; }
.bk-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.bk-progress.is-error .bk-bar span { background: var(--danger); }
.bk-progress.is-error #bk-status { color: var(--danger); }
.bk-list { display: flex; flex-direction: column; gap: 8px; }
.bk-item { border: 1px solid var(--line-soft); border-radius: 9px; background: var(--ink); }
.bk-item[open] { border-color: var(--line); }
.bk-item summary { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 14px; cursor: pointer; list-style: none; }
.bk-item summary::-webkit-details-marker { display: none; }
.bk-item summary .btn { margin-left: auto; }
.bk-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.bk-name code { overflow-wrap: anywhere; }
.bk-meta { color: var(--text-2); font-size: 12px; }
.bk-form { padding: 4px 14px 14px; border-top: 1px solid var(--line-soft); }
.bk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 12px 0; }
.bk-check { align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 7px; }
.bk-check input { margin-top: 2px; flex: 0 0 auto; }
.bk-check:has(input:checked) { border-color: rgba(139, 213, 179, .45); }
.bk-check:has(input:disabled) { opacity: .45; cursor: default; }
.bk-form .actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 640px) { .bk-bar { flex-basis: 120px; } .bk-item summary .btn { margin-left: 0; } }
/* ============================================================ ASSISTENZA: portale giocatori e ticket staff */
.portal-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--ink); }
.portal-top { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 22px; height: 62px; padding: 0 22px; background: rgba(16, 20, 22, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-soft); }
.portal-brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.portal-brand img:first-child { width: 30px; height: 30px; }
.portal-wordmark { height: 16px; width: auto; }
.portal-brand small { font: 600 10px var(--mono); letter-spacing: .28em; color: var(--accent); padding-left: 10px; border-left: 1px solid var(--line); }
.portal-nav { display: flex; gap: 4px; }
.portal-nav a { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 13px; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.portal-nav a:hover { background: var(--panel); color: var(--text); }
.portal-nav a.active { background: var(--panel); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.portal-user { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--text-2); font-weight: 500; }
.portal-user .avatar { width: 32px; height: 32px; }
.portal-login { max-width: 470px; }
.portal-feats { list-style: none; margin: 4px 0 20px; padding: 0; display: grid; gap: 10px; }
.portal-feats li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 13px; border-radius: 9px; background: rgba(255, 255, 255, .02); border: 1px solid var(--line-soft); }
.portal-feats li > .icon { color: var(--accent); flex: none; margin-top: 2px; }
.portal-feats b { display: block; color: var(--text); font-size: 13px; }
.portal-feats span { color: var(--text-2); font-size: 12.5px; }

.tk-app { display: grid; grid-template-columns: 330px minmax(0, 1fr); background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; min-height: 560px; }
.tk-staff { grid-template-columns: 330px minmax(0, 1fr) 290px; height: calc(100vh - 262px); }
.tk-portal { flex: 1; height: calc(100vh - 62px); border-radius: 0; border: 0; }
.tk-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line-soft); background: var(--ink-2); }
.tk-side-head { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-bottom: 1px solid var(--line-soft); }
.tk-portal .tk-side-head { flex-direction: row; align-items: center; justify-content: space-between; }
.tk-side-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.tk-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; padding: 3px; border-radius: 9px; background: var(--ink); border: 1px solid var(--line-soft); }
.tk-tabs button { height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font: 600 11.5px var(--font); cursor: pointer; }
.tk-tabs button.active { background: var(--panel-2); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.tk-side-tools { display: flex; gap: 6px; }
.tk-search { flex: 1; display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--ink); color: var(--muted); }
.tk-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; outline: 0; }
#tk-notify.is-on { color: var(--accent); border-color: rgba(139, 213, 179, .4); }
.tk-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.tk-list-empty, .tk-ctx-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 40px 18px; color: var(--muted); font-size: 13px; }
.tk-list-empty .icon, .tk-ctx-empty .icon { width: 26px; height: 26px; opacity: .6; }
.tk-list-empty strong { color: var(--text-2); }
.tk-item { display: flex; flex-direction: column; gap: 5px; width: 100%; text-align: left; padding: 11px 12px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--text); font: inherit; cursor: pointer; transition: background .15s, border-color .15s; }
.tk-item:hover { background: var(--panel); }
.tk-item.active { background: var(--panel); border-color: var(--line); box-shadow: inset 3px 0 0 var(--accent); }
.tk-item.has-new .tk-item-title { color: #fff; }
.tk-item-top { display: flex; align-items: center; gap: 7px; }
.tk-id { font: 600 11.5px var(--mono); color: var(--muted); }
.tk-unread { margin-left: auto; min-width: 19px; height: 19px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 10px; background: var(--accent); color: #0d1412; font: 700 11px var(--mono); }
.portal-nav .tk-unread { margin-left: 2px; background: var(--danger); color: #1a0f0f; }
.tk-item-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-item-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; color: var(--text-2); }
.tk-who { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.tk-av { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.tk-av-empty { display: inline-grid; place-items: center; background: var(--line); font-size: 10px; color: var(--text-2); }
.tk-online { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(139, 213, 179, .18); }
.tk-item-last { margin: 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-item-staff { font-size: 11px; color: var(--muted); } .tk-item-staff.is-mine { color: var(--info); }
.tk-voice-flag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 6px; font: 600 10.5px var(--mono); color: var(--accent); background: rgba(139, 213, 179, .1); border: 1px solid rgba(139, 213, 179, .25); }
.tk-voice-flag .icon { width: 12px; height: 12px; }
.tk-voice-flag.is-pulse { color: var(--danger); background: rgba(224, 127, 127, .1); border-color: rgba(224, 127, 127, .3); animation: tk-pulse 1.4s ease-in-out infinite; }
@keyframes tk-pulse { 50% { opacity: .45; } }

.tk-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--panel); }
.tk-empty { margin: auto; max-width: 460px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 30px; color: var(--text-2); }
.tk-empty > .icon { width: 40px; height: 40px; color: var(--accent); opacity: .85; }
.tk-empty strong { font-size: 17px; color: var(--text); }
.tk-empty p { margin: 0; font-size: 13.5px; }
.tk-welcome-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 6px 0 4px; }
.tk-welcome-cats span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 20px; font-size: 12px; border: 1px solid var(--line); background: var(--ink); }
.tk-welcome-cats .icon { width: 14px; height: 14px; color: var(--accent); }
.tk-convo { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.tk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line-soft); }
.tk-back { display: none; }
.tk-head-title { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 3px; }
.tk-head-line { display: flex; align-items: center; gap: 8px; }
.tk-head h2 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.tk-cat { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }
.tk-cat .icon { width: 13px; height: 13px; }
.tk-presence { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; color: var(--ok); }
.tk-presence i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: tk-pulse 2s infinite; }
.tk-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.tk-queue { flex-basis: 100%; display: flex; align-items: center; gap: 5px; padding: 8px 12px; border-radius: 8px; font-size: 13px; background: rgba(217, 178, 111, .07); border: 1px solid rgba(217, 178, 111, .22); color: var(--text-2); }
.tk-queue .icon { color: var(--warn); width: 15px; height: 15px; }
.tk-queue b { color: var(--warn); font: 700 14px var(--mono); }

.tk-voice:empty { display: none; }
.tk-voice { padding: 10px 18px 0; }
.tk-voice-banner { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--ink); }
.tk-voice-ico { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--panel-2); color: var(--accent); }
.tk-voice-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tk-voice-text strong { font-size: 13.5px; } .tk-voice-text small { color: var(--text-2); font-size: 12px; }
.tk-voice-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-voice-banner.is-quiet { background: transparent; border-style: dashed; }
.tk-voice-banner.is-wait .tk-voice-ico { color: var(--warn); }
.tk-voice-banner.is-pulse { border-color: rgba(224, 127, 127, .4); }
.tk-voice-banner.is-pulse .tk-voice-ico { color: var(--danger); animation: tk-ring 1.6s ease-out infinite; }
.tk-voice-banner.is-live { border-color: rgba(139, 213, 179, .35); background: linear-gradient(90deg, rgba(139, 213, 179, .08), transparent 70%); }
.tk-voice-banner.is-live .tk-voice-ico { animation: tk-ring 2s ease-out infinite; }
@keyframes tk-ring { 0% { box-shadow: 0 0 0 0 rgba(139, 213, 179, .45); } 100% { box-shadow: 0 0 0 12px rgba(139, 213, 179, 0); } }

.vc-dock { border-radius: 12px; border: 1px solid rgba(139, 213, 179, .35); background: radial-gradient(120% 140% at 0% 0%, rgba(139, 213, 179, .1), transparent 60%), var(--ink); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.vc-wait { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.vc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vc-live { display: inline-flex; align-items: center; gap: 6px; font: 700 10.5px var(--mono); letter-spacing: .18em; color: var(--accent); }
.vc-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: tk-pulse 1.2s infinite; }
.vc-timer { font: 600 13px var(--mono); color: var(--text-2); }
.vc-banner { margin-left: auto; padding: 3px 9px; border-radius: 6px; font-size: 12px; color: var(--warn); background: rgba(217, 178, 111, .1); border: 1px solid rgba(217, 178, 111, .25); }
.vc-people { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.vc-person { display: flex; align-items: center; gap: 9px; padding: 7px 11px 7px 7px; border-radius: 30px; background: var(--panel); border: 1px solid var(--line-soft); min-width: 0; }
.vc-avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--mono); color: var(--text); background: linear-gradient(135deg, #2b3a36, #1d2629); box-shadow: 0 0 0 2px var(--line); transition: box-shadow .12s; }
.vc-person[data-role="utente"] .vc-avatar { background: linear-gradient(135deg, #3a3326, #262019); }
.vc-person.is-speaking .vc-avatar { box-shadow: 0 0 0 2px var(--accent), 0 0 14px rgba(139, 213, 179, .55); }
.vc-meta { display: flex; flex-direction: column; min-width: 0; }
.vc-meta strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.vc-meta small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.vc-flags { display: flex; align-items: center; gap: 4px; color: var(--danger); }
.vc-flags .icon { width: 14px; height: 14px; }
.vc-conn { font-size: 10.5px; font-style: normal; color: var(--warn); }
.vc-controls { display: flex; gap: 8px; }
.vc-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; transition: .15s; }
.vc-btn:hover { border-color: var(--text-2); }
.vc-btn.is-off { background: rgba(224, 127, 127, .14); border-color: rgba(224, 127, 127, .4); color: var(--danger); }
.vc-btn.is-danger { background: #b84d4d; border-color: #b84d4d; color: #fff; }
.vc-btn:disabled { opacity: .5; cursor: not-allowed; }
.vc-staff { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; border-top: 1px dashed var(--line); }
.vc-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text-2); font: 600 12px var(--font); cursor: pointer; }
.vc-chip .icon { width: 14px; height: 14px; }
.vc-chip.is-off { color: var(--danger); border-color: rgba(224, 127, 127, .4); background: rgba(224, 127, 127, .08); text-decoration: line-through; }
.vc-chip.is-on { color: var(--warn); border-color: rgba(217, 178, 111, .45); background: rgba(217, 178, 111, .1); }
.vc-chip.is-danger { margin-left: auto; color: var(--danger); }

.tk-msgs { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-height: 0; background-image: radial-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px); background-size: 22px 22px; }
.tk-day { align-self: center; margin: 10px 0 4px; padding: 2px 10px; border-radius: 10px; font: 600 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--ink); border: 1px solid var(--line-soft); }
.tk-sys { align-self: center; display: flex; gap: 8px; align-items: baseline; max-width: 80%; text-align: center; font-size: 12px; color: var(--muted); padding: 3px 0; }
.tk-sys time { font: 10.5px var(--mono); opacity: .7; }
.tk-msg { display: flex; max-width: 76%; }
.tk-msg.is-right { align-self: flex-end; }
.tk-msg.is-left { align-self: flex-start; }
.tk-bubble { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px 7px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line-soft); min-width: 0; animation: tk-in .18s ease-out; }
@keyframes tk-in { from { opacity: 0; transform: translateY(4px); } }
.tk-msg.is-right .tk-bubble { background: linear-gradient(180deg, rgba(139, 213, 179, .16), rgba(139, 213, 179, .1)); border-color: rgba(139, 213, 179, .28); border-bottom-right-radius: 4px; }
.tk-msg.is-left .tk-bubble { border-bottom-left-radius: 4px; }
.tk-msg.is-nota .tk-bubble { background: repeating-linear-gradient(135deg, rgba(217, 178, 111, .1) 0 10px, rgba(217, 178, 111, .06) 10px 20px); border-color: rgba(217, 178, 111, .35); }
.tk-msg-who { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-2); }
.tk-msg-who b { color: var(--text); font-weight: 600; }
.tk-msg-who time { margin-left: auto; padding-left: 10px; font: 10.5px var(--mono); color: var(--muted); }
.tk-msg-who .icon { width: 12px; height: 12px; color: var(--warn); }
.tk-staff-tag { padding: 0 5px; border-radius: 4px; font: 700 9.5px var(--mono); letter-spacing: .1em; color: #0d1412; background: var(--accent); }
.tk-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.45; }
.tk-attach img { display: block; max-width: min(320px, 100%); max-height: 260px; border-radius: 9px; border: 1px solid var(--line); cursor: zoom-in; }
.tk-seen { align-self: flex-end; font: 10.5px var(--mono); color: var(--muted); }
.tk-seen.is-seen { color: var(--accent); }
.tk-typing { height: 0; overflow: hidden; padding: 0 18px; font-size: 12px; color: var(--accent); font-style: italic; transition: height .15s; }
.tk-typing.is-on { height: 22px; }
.tk-foot { border-top: 1px solid var(--line-soft); padding: 12px 18px 14px; background: var(--ink-2); }
.tk-compose { display: flex; flex-direction: column; gap: 7px; }
.tk-compose-row { display: flex; align-items: flex-end; gap: 8px; }
.tk-compose textarea { flex: 1; min-height: 42px; max-height: 180px; resize: none; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--ink); color: var(--text); font: inherit; font-size: 14px; outline: 0; line-height: 1.4; }
.tk-compose textarea:focus { border-color: var(--accent); }
.tk-compose.is-note textarea { border-color: rgba(217, 178, 111, .55); background: rgba(217, 178, 111, .05); }
.tk-attach-btn, .tk-send { height: 42px; width: 42px; padding: 0; flex: none; }
.tk-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.tk-note-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tk-note-toggle input { accent-color: var(--warn); }
.tk-note-toggle .icon { width: 13px; height: 13px; color: var(--warn); }
.tk-quick { height: 28px; max-width: 260px; border-radius: 7px; border: 1px solid var(--line); background: var(--ink); color: var(--text-2); font: inherit; font-size: 12px; }
.tk-count { margin-left: auto; font: 11px var(--mono); color: var(--warn); }
.tk-file-chip { display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 7px; font-size: 12px; background: var(--ink); border: 1px solid var(--line); }
.tk-file-chip .icon { width: 13px; height: 13px; color: var(--accent); }
.tk-closed { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13.5px; }
.tk-closed > .icon { color: var(--ok); flex: none; }
.tk-rate { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); }
.tk-rate textarea { resize: vertical; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--ink); color: var(--text); font: inherit; }
.tk-rate .btn { align-self: flex-start; }
.tk-stars { display: flex; gap: 4px; }
.tk-star { border: 0; background: transparent; font-size: 28px; line-height: 1; color: var(--line); cursor: pointer; transition: transform .1s, color .1s; }
.tk-star:hover { transform: scale(1.15); }
.tk-star.is-on { color: var(--warn); text-shadow: 0 0 12px rgba(217, 178, 111, .4); }
.tk-rated { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.tk-stars-static { color: var(--warn); font-size: 18px; letter-spacing: 2px; }
.tk-rated q { color: var(--text-2); font-size: 13px; }

.tk-new { flex: 1; overflow-y: auto; padding: 18px 22px 24px; display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.tk-new-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.tk-new-head h2 { margin: 0; font-size: 18px; } .tk-new-head p { flex-basis: 100%; margin: 0; font-size: 13px; }
.tk-new .btn-primary { align-self: flex-start; }
.tk-new .field input[type="file"] { height: auto; padding: 8px; }
.tk-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.tk-cat-card { position: relative; cursor: pointer; }
.tk-cat-card input { position: absolute; opacity: 0; }
.tk-cat-card > span { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--ink); transition: .15s; }
.tk-cat-card .icon { color: var(--text-2); margin-bottom: 3px; }
.tk-cat-card b { font-size: 13px; } .tk-cat-card small { font-size: 11.5px; color: var(--muted); }
.tk-cat-card input:checked + span { border-color: var(--accent); background: rgba(139, 213, 179, .07); box-shadow: 0 0 0 1px var(--accent) inset; }
.tk-cat-card input:checked + span .icon { color: var(--accent); }
.tk-cat-card input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.tk-context { border-left: 1px solid var(--line-soft); background: var(--ink-2); overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.tk-ctx-who { display: flex; align-items: center; gap: 11px; }
.tk-ctx-who strong { display: block; font-size: 14px; } .tk-ctx-who code { font: 11px var(--mono); color: var(--muted); }
.tk-ctx-av { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); }
.tk-ctx-online { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 9px; font-size: 12.5px; color: var(--ok); background: rgba(139, 213, 179, .08); border: 1px solid rgba(139, 213, 179, .28); }
.tk-ctx-online i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: tk-pulse 1.6s infinite; }
.tk-ctx-online .icon { margin-left: auto; width: 15px; height: 15px; }
.tk-ctx-sec { display: flex; flex-direction: column; gap: 6px; }
.tk-ctx-sec h3 { margin: 0 0 2px; display: flex; align-items: center; gap: 6px; font: 600 10.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.tk-ctx-sec h3 .icon { width: 13px; height: 13px; }
.tk-ctx-acc { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 8px 10px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line-soft); color: var(--text); }
.tk-ctx-acc:hover { border-color: var(--line); }
.tk-ctx-acc strong { display: block; font-size: 12.5px; } .tk-ctx-acc code { font: 10.5px var(--mono); color: var(--muted); }
.tk-ctx-ban { margin: 0; padding: 7px 10px; border-radius: 8px; font-size: 12px; color: var(--danger); background: rgba(224, 127, 127, .07); border: 1px solid rgba(224, 127, 127, .25); }
.tk-ctx-prev { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line-soft); background: var(--panel); color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.tk-ctx-prev-t { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-ctx-prev small { grid-column: 2; font-size: 11px; }

.tk-stats { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.tk-stat { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 0 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-soft); }
.tk-stat .icon { grid-row: 1 / 3; width: 18px; height: 18px; color: var(--muted); }
.tk-stat small { font: 600 9.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-stat b { font: 700 18px var(--mono); }
.tk-stat.tone-warn b, .tk-stat.tone-warn .icon { color: var(--warn); } .tk-stat.tone-danger b, .tk-stat.tone-danger .icon { color: var(--danger); }
.tk-stat.tone-info b, .tk-stat.tone-info .icon { color: var(--info); } .tk-stat.tone-ok b, .tk-stat.tone-ok .icon { color: var(--ok); }
.tk-toast { position: fixed; left: 50%; bottom: 26px; z-index: 50; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 10px; font-size: 13.5px; background: var(--panel-2); border: 1px solid rgba(139, 213, 179, .4); box-shadow: 0 12px 34px rgba(0, 0, 0, .45); transition: opacity .4s, transform .4s; }
.tk-toast.is-bad { border-color: rgba(224, 127, 127, .5); color: #f3c9c9; }
.tk-toast.is-out { opacity: 0; transform: translate(-50%, 10px); }

@media (max-width: 1350px) { .tk-staff { grid-template-columns: 300px minmax(0, 1fr); } .tk-context { display: none; } .tk-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .tk-app, .tk-staff { grid-template-columns: 1fr; height: calc(100vh - 150px); }
  .tk-portal { height: calc(100vh - 62px); }
  .tk-app .tk-main { display: none; } .tk-app.has-open .tk-main { display: flex; } .tk-app.has-open .tk-side { display: none; }
  .tk-back { display: inline-grid; }
  .tk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tk-msg { max-width: 90%; }
  .portal-top { gap: 10px; padding: 0 12px; }
  .portal-brand small, .portal-wordmark, .portal-user > span { display: none; }
  .portal-nav a { padding: 0 9px; font-size: 13px; }
  .vc-chip.is-danger { margin-left: 0; }
}
.sys-tickets { color: var(--warn); }
.sys-tickets b { color: var(--warn); }

/* AREA GIOCATORE: schede e scheda personaggio */
.portal-tab { flex: 1; }
.portal-tab-full { display: flex; flex-direction: column; }
.portal-tab-full[hidden], .portal-tab[hidden] { display: none; }
.portal-flash { margin: 14px auto 0; width: min(1100px, calc(100% - 32px)); }
.portal-wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 40px; display: flex; flex-direction: column; gap: 16px; }
.portal-narrow { width: min(820px, calc(100% - 32px)); }
.tk-unread.is-soft { background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line); }
.pc-switch { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-switch button { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text-2); font: 600 13px var(--font); cursor: pointer; }
.pc-switch button.active { color: var(--text); border-color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.pc-sheet { display: flex; flex-direction: column; gap: 16px; }
.pc-sheet[hidden] { display: none; }
.pc-hero { position: relative; display: flex; align-items: center; gap: 20px; padding: 22px 24px; border-radius: var(--radius); border: 1px solid var(--line-soft); overflow: hidden;
  background: radial-gradient(90% 160% at 0% 0%, rgba(139, 213, 179, .13), transparent 55%), linear-gradient(135deg, var(--panel), var(--panel-2)); }
.pc-hero::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px); background-size: 26px 26px; pointer-events: none; mask-image: linear-gradient(90deg, transparent, #000 60%); }
.pc-hero.is-small { padding: 18px 20px; }
.pc-avatar { flex: none; position: relative; z-index: 1; width: 74px; height: 74px; border-radius: 18px; display: grid; place-items: center; font: 800 26px var(--font); color: #0d1412;
  background: linear-gradient(135deg, var(--accent), #5fae8d); box-shadow: 0 10px 30px rgba(139, 213, 179, .25); }
.pc-avatar .icon { width: 32px; height: 32px; }
.pc-hero.is-small .pc-avatar { width: 56px; height: 56px; border-radius: 14px; }
.pc-hero-main { position: relative; z-index: 1; min-width: 0; }
.pc-hero h1 { margin: 2px 0 8px; font-size: 28px; letter-spacing: -.01em; }
.pc-hero.is-small h1 { font-size: 21px; margin-bottom: 4px; } .pc-hero p.muted { margin: 0; font-size: 13.5px; }
.pc-readonly { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 1px 7px; border-radius: 5px; font-size: 10px; color: var(--muted); border: 1px solid var(--line); }
.pc-readonly .icon { width: 11px; height: 11px; }
.pc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 12px; color: var(--text-2); background: rgba(0, 0, 0, .25); border: 1px solid var(--line); }
.pc-tag .icon { width: 13px; height: 13px; }
.pc-tag.is-job { color: var(--text); border-color: rgba(139, 213, 179, .3); }
.pc-tag.is-online { color: var(--ok); border-color: rgba(139, 213, 179, .4); }
.pc-tag.is-online i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: tk-pulse 1.6s infinite; }
.pc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pc-kpi { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line-soft); }
.pc-kpi > .icon { grid-row: 1 / 4; width: 22px; height: 22px; color: var(--accent); }
.pc-kpi small { font: 600 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pc-kpi b { font: 700 20px var(--mono); }
.pc-kpi em { font-style: normal; font-size: 11.5px; color: var(--text-2); }
.pc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pc-wide { grid-column: 1 / -1; }
.pc-card h2, .pc-h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font: 600 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.pc-card h2 .icon, .pc-h2 .icon { width: 15px; height: 15px; color: var(--accent); }
.pc-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.pc-row:first-of-type { border-top: 0; padding-top: 0; }
.pc-row > div { flex: 1; min-width: 0; }
.pc-val { display: flex; flex-direction: column; align-items: flex-end; font: 600 13.5px var(--mono); }
.pc-val small { font: 10px var(--font); color: var(--muted); }
.pc-bar { display: grid; grid-template-columns: 90px 1fr 44px; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; }
.pc-bar b { font: 600 12px var(--mono); text-align: right; color: var(--text-2); }
.pc-meter { height: 8px; border-radius: 4px; background: var(--ink); border: 1px solid var(--line-soft); overflow: hidden; }
.pc-meter i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--accent); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.pc-meter.is-mid i { background: var(--warn); } .pc-meter.is-low i { background: var(--danger); }
.pc-cars { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.pc-car { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--ink); border: 1px solid var(--line-soft); }
.pc-car > div { flex: 1; min-width: 0; }
.pc-story { margin: 0; white-space: pre-wrap; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.pc-note { display: flex; align-items: center; gap: 6px; margin: 0; }
.pc-note .icon { width: 13px; height: 13px; }
.tk-ctx-acc > div { min-width: 0; } .tk-ctx-acc code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .tk-ctx-acc .badge { flex: none; }
@media (max-width: 860px) {
  .pc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pc-grid { grid-template-columns: 1fr; }
  .pc-hero { padding: 16px; gap: 14px; } .pc-avatar { width: 56px; height: 56px; font-size: 20px; } .pc-hero h1 { font-size: 22px; }
  .portal-nav a span:not(.tk-unread) { display: none; }
}.pc-card { display: block; min-width: 0; padding: 16px 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line-soft); }
.pc-card .kv { margin: 0; }
/* Condivisione schermo nella vocale dei ticket */
.vc-btn.is-on { background: rgba(139, 213, 179, .18); border-color: var(--accent); color: var(--accent); }
.vc-stage { position: relative; border-radius: 10px; overflow: hidden; background: #000; border: 1px solid rgba(139, 213, 179, .3); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.vc-stage[hidden] { display: none; }
.vc-video { display: block; width: 100%; max-height: min(52vh, 560px); aspect-ratio: 16 / 9; object-fit: contain; background: #000; }
.vc-stage.is-self .vc-video { max-height: 180px; }
.vc-stage-bar { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .7), transparent); pointer-events: none; }
.vc-stage-who { display: inline-flex; align-items: center; gap: 7px; font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #fff; }
.vc-stage-who::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: tk-pulse 1.2s infinite; }
.vc-stage-full { pointer-events: auto; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(0, 0, 0, .45); color: #fff; cursor: pointer; }
.vc-stage-full .icon { width: 15px; height: 15px; }
.vc-thumbs:empty { display: none; }
.vc-thumbs { display: flex; gap: 6px; padding: 8px; background: rgba(0, 0, 0, .55); }
.vc-thumb { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, .2); background: transparent; color: #ddd; font: 600 11.5px var(--font); cursor: pointer; }
.vc-thumb .icon { width: 13px; height: 13px; }
.vc-thumb.active { border-color: var(--accent); color: #fff; background: rgba(139, 213, 179, .15); }
.vc-flags .vc-flag-screen { color: var(--accent); }
.vc-video:fullscreen { max-height: none; aspect-ratio: auto; }
/* Vocale: registrazione, premi per parlare, stanza staff */
.vc-rec { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 6px; font: 700 10.5px var(--mono); letter-spacing: .14em; color: #fff; background: #b84d4d; }
.vc-rec[hidden] { display: none; }
.vc-rec::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: tk-pulse 1s infinite; }
.vc-btn.is-ptt { border-style: dashed; }
.vc-btn.is-down { background: rgba(139, 213, 179, .25); border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px rgba(139, 213, 179, .15); }
.vc-ptt-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }
.vc-ptt-hint[hidden] { display: none; }
.vc-ptt-hint kbd { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 6px; border-radius: 5px; border: 1px solid var(--line); background: var(--panel-2); font: 700 11px var(--mono); color: var(--text); }
.vc-ptt-hint.is-down { color: var(--accent); font-weight: 600; }
.vc-chip.is-rec { color: #fff; background: #b84d4d; border-color: #b84d4d; }
.vc-chip:disabled { opacity: .5; cursor: not-allowed; }
.tk-audio { width: min(320px, 100%); height: 36px; margin-top: 4px; }
.sys-room b { color: var(--text-2); }
.sys-room.is-live { color: var(--accent); }
.sys-room.is-live b { color: var(--accent); }
.sys-room.is-live small::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--accent); animation: tk-pulse 1.4s infinite; vertical-align: middle; }
.room-page { margin: 0; min-height: 100vh; background: radial-gradient(80% 60% at 50% 0%, rgba(139, 213, 179, .12), transparent 60%), var(--ink); color: var(--text); display: flex; flex-direction: column; }
.room-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.room-logo { width: 30px; height: auto; }
.room-head strong { display: block; font: italic 400 22px/1 Impact, 'Arial Narrow', sans-serif; letter-spacing: .04em; }
.room-head small { font-size: 11px; color: var(--muted); }
.room-main { flex: 1; padding: 16px; display: flex; flex-direction: column; }
.room-empty { margin: auto; max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.room-empty b { font: italic 400 28px/1 Impact, 'Arial Narrow', sans-serif; letter-spacing: .02em; }
.room-empty span { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.room-empty[hidden], .room-dock[hidden] { display: none; }
.room-dock { flex: 1; }
.room-dock .vc-video { max-height: 50vh; }
/* Regolamento: documento (anteprima staff e area giocatore) ed editor */
.rl-doc { font-size: 14.5px; line-height: 1.7; color: var(--text-2); }
.rl-doc .rl-title { margin: 0 0 14px; font: italic 400 34px/1 Impact, 'Arial Narrow', sans-serif; letter-spacing: .01em; color: var(--text); }
.rl-doc .rl-sec { display: flex; align-items: center; gap: 12px; margin: 26px 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); font-size: 17px; color: var(--text); scroll-margin-top: 90px; }
.rl-doc .rl-sec span { font: 700 12px var(--mono); color: #0d1412; background: var(--accent); padding: 3px 7px; border-radius: 4px; }
.rl-doc h4 { margin: 16px 0 4px; color: var(--text); }
.rl-doc p { margin: 0 0 10px; }
.rl-doc ul, .rl-doc ol { margin: 0 0 12px; padding-left: 22px; }
.rl-doc li { margin: 4px 0; }
.rl-doc li::marker { color: var(--accent); }
.rl-doc strong { color: var(--text); }
.rl-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.rl-editor { display: flex; flex-direction: column; gap: 12px; }
.rl-editor textarea { min-height: 460px; padding: 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--ink); color: var(--text); font: 13.5px/1.6 var(--mono); resize: vertical; outline: 0; }
.rl-editor textarea:focus { border-color: var(--accent); }
.rl-preview { max-height: 720px; overflow-y: auto; }
.rl-tabs { border-bottom: 0; }
@media (max-width: 1100px) { .rl-editor-grid { grid-template-columns: 1fr; } }
/* Regolamento a sezioni: editor dello staff, articoli, citazioni */
.rs-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.rs-list { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 6px; }
.rs-item { display: flex; align-items: center; gap: 6px; border-radius: 9px; border: 1px solid transparent; }
.rs-item > a { flex: 1; display: flex; align-items: center; gap: 10px; padding: 9px 10px; min-width: 0; color: var(--text); }
.rs-item:hover { background: var(--panel-2); }
.rs-item.active { border-color: var(--accent); background: rgba(139, 213, 179, .06); }
.rs-item.is-off { opacity: .55; }
.rs-num { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--ink); border: 1px solid var(--line); font: 700 12px var(--mono); color: var(--accent); }
.rs-txt { display: flex; flex-direction: column; min-width: 0; }
.rs-txt b { font-size: 13.5px; } .rs-txt small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-move { display: flex; flex-direction: column; gap: 2px; padding-right: 6px; }
.rs-move button { width: 22px; height: 16px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--text-2); font-size: 10px; line-height: 1; cursor: pointer; }
.rs-move button:disabled { opacity: .3; cursor: default; }
.rs-new { display: flex; gap: 6px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.rs-new input { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--ink); color: var(--text); font: inherit; font-size: 12.5px; }
.rs-help { margin: 8px 0 0; line-height: 1.8; } .rs-help code { font-size: 10.5px; }
.rs-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rs-fields { display: grid; grid-template-columns: 1.2fr 2fr 1fr 1.3fr; gap: 10px; }
.rs-jobs { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.rs-jobs[hidden] { display: none; }
.rs-edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.rs-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rs-label { font: 600 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.rs-label small { margin-left: 6px; letter-spacing: 0; text-transform: none; font-family: var(--font); }
.rs-col textarea { min-height: 520px; flex: 1; }
.rs-preview { height: 520px; overflow-y: auto; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--ink); }
.rl-doc .rl-sec span { white-space: nowrap; cursor: pointer; }
.rl-doc .rl-sec span.is-copied { background: #fff; }
.rl-badge { margin-left: 8px; padding: 2px 7px; border-radius: 4px; font: 700 9.5px var(--mono); font-style: normal; letter-spacing: .12em; color: #1a1406; background: var(--warn); }
.rl-badge.is-new { background: var(--accent); color: #0d1412; }
.rl-live { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; margin: 0 2px; border-radius: 10px; font: 700 11.5px var(--mono); color: #0d1412; background: var(--accent); box-shadow: 0 0 10px rgba(139, 213, 179, .4); vertical-align: 1px; }
.rl-art[hidden] { display: none; }
.rl-art.is-target { border-radius: 10px; box-shadow: 0 0 0 2px rgba(139, 213, 179, .5); background: rgba(139, 213, 179, .05); padding: 0 12px 4px; }
mark.rl-hit { background: rgba(217, 178, 111, .45); color: inherit; border-radius: 3px; padding: 0 1px; }
.tk-art { color: var(--accent); font-weight: 700; text-decoration: underline dotted; }
.tk-cite { max-width: 300px; }
@media (max-width: 1250px) { .rs-layout { grid-template-columns: 1fr; } .rs-list { position: static; } .rs-fields { grid-template-columns: 1fr 1fr; } .rs-edit-grid { grid-template-columns: 1fr; } }
/* Candidature dello staff */
.cd-tabs { margin-bottom: 14px; }
.cd-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.cd-pts { font: 700 13px var(--mono); } .cd-pts.is-ok { color: var(--ok); } .cd-pts.is-bad { color: var(--danger); }
tr.row-link { cursor: pointer; }
.cd-detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.cd-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cd-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 90px; }
.cd-head { display: flex; align-items: center; gap: 16px; }
.cd-head h2 { margin: 2px 0 6px; font: italic 400 30px/1 Impact, 'Arial Narrow', sans-serif; letter-spacing: .01em; }
.cd-head p { margin: 0; }
.cd-av { width: 64px; height: 64px; border-radius: 16px; flex: none; display: grid; place-items: center; }
.cd-score { margin-left: auto; display: flex; flex-direction: column; align-items: center; padding: 10px 16px; border-radius: 12px; background: var(--ink); border: 1px solid var(--line); }
.cd-score b { font: 700 26px var(--mono); } .cd-score small { font-size: 11px; color: var(--muted); }
.cd-score.is-ok b { color: var(--ok); } .cd-score.is-bad b { color: var(--danger); }
.cd-interview { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; padding: 8px 12px; border-radius: 9px; font-size: 13px; color: var(--warn); background: rgba(217, 178, 111, .08); border: 1px solid rgba(217, 178, 111, .3); }
.cd-interview .icon { width: 15px; height: 15px; }
.cd-outcome { margin: 8px 0 0; font-size: 13px; color: var(--text-2); }
.cd-answers { margin: 0; }
.cd-answers dt { margin-top: 14px; font-weight: 700; font-size: 13.5px; color: var(--text); }
.cd-answers dt:first-child { margin-top: 0; }
.cd-answers dd { margin: 4px 0 0; padding: 10px 12px; border-radius: 9px; background: var(--ink); border: 1px solid var(--line-soft); font-size: 14px; line-height: 1.55; color: var(--text-2); }
.cd-votes { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cd-votes li { display: flex; gap: 10px; align-items: flex-start; }
.cd-votes p { margin: 3px 0 0; font-size: 13px; color: var(--text-2); }
.cd-vote { flex: none; display: grid; place-items: center; width: 34px; height: 26px; border-radius: 7px; font: 700 12px var(--mono); }
.cd-vote.v2 { color: #0d1412; background: var(--ok); } .cd-vote.v0 { color: #fff; background: #b84d4d; } .cd-vote.v1 { color: var(--text-2); background: var(--panel-2); }
.cd-vote-form, .cd-form { display: flex; flex-direction: column; gap: 8px; }
.cd-form + .cd-form, .cd-actions form + form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.cd-vote-form textarea, .cd-form textarea, .cd-form input[type="text"] { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--ink); color: var(--text); font: inherit; font-size: 13px; resize: vertical; }
.cd-vote-pick { display: flex; gap: 6px; }
.cd-vote-pick label { flex: 1; }
.cd-vote-pick input { position: absolute; opacity: 0; }
.cd-vote-pick span { display: block; padding: 7px 4px; border-radius: 8px; border: 1px solid var(--line); text-align: center; font-size: 12px; cursor: pointer; }
.cd-vote-pick input:checked + span { border-color: var(--accent); background: rgba(139, 213, 179, .1); color: var(--text); }
.cd-decide { display: flex; gap: 8px; }
.cd-reject { color: var(--danger); border-color: rgba(224, 127, 127, .4); }
.cd-kv dd div + div { margin-top: 3px; }
.cd-bandi { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
.cd-bando-list { display: flex; flex-direction: column; gap: 6px; }
.cd-bando { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-soft); color: var(--text); }
.cd-bando:hover { border-color: var(--line); background: var(--panel-2); }
.cd-bando.active { border-color: var(--accent); }
.cd-bando > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cd-bando b { font-size: 13.5px; } .cd-bando small { font-size: 11.5px; color: var(--muted); }
.cd-bando-n { display: flex; flex-direction: column; align-items: center; font: 700 16px var(--mono); }
.cd-bando-n small { font: 9.5px var(--font); color: var(--muted); }
.cd-editor { display: flex; flex-direction: column; gap: 12px; }
.cd-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cd-qhead { display: flex; align-items: center; justify-content: space-between; }
.cd-questions { list-style: none; counter-reset: q; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cd-q { counter-increment: q; position: relative; padding: 10px 10px 10px 44px; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--ink); display: flex; flex-direction: column; gap: 8px; }
.cd-q::before { content: counter(q); position: absolute; left: 12px; top: 12px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font: 700 11px var(--mono); color: #0d1412; background: var(--accent); }
.cd-q textarea, .cd-q input, .cd-q select { padding: 7px 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: 13px; }
.cd-q-line { display: flex; align-items: center; gap: 12px; }
.cd-q-tools { margin-left: auto; display: flex; gap: 4px; }
.cd-q-btn { width: 28px; height: 26px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--text-2); cursor: pointer; }
.cd-q-opts[hidden] { display: none; }
@media (max-width: 1250px) { .cd-detail, .cd-bandi { grid-template-columns: 1fr; } .cd-side { position: static; } .cd-fields { grid-template-columns: 1fr 1fr; } }
/* Regolamento completo: tutte le sezioni in un unico testo */
.rs-all { display: grid; gap: 6px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.rs-all .btn, .rs-all form .btn { width: 100%; justify-content: center; }
.rs-full-help { margin: 0 0 10px; } .rs-full-help p { margin: 0 0 6px; line-height: 1.6; } .rs-full-help code { font-size: 11.5px; }
.rs-full-text { width: 100%; min-height: 62vh; resize: vertical; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--ink); color: var(--text); font: 13px/1.6 var(--mono, ui-monospace, monospace); margin-bottom: 12px; }
/* ---- Gestione personaggi ---- */
.gs-on { color: var(--ok); } .gs-off { color: var(--warn); }
.gs-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.gs-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.gs-id h2 { margin: 0; font: 400 26px/1.1 var(--display); letter-spacing: .02em; }
.gs-id p { margin: 4px 0 0; overflow-wrap: anywhere; }
.gs-avatar { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.gs-avatar .icon { width: 24px; height: 24px; }
.gs-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tab-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--panel-2); color: var(--text-2); font-size: 11px; text-align: center; }
.gs-form { display: flex; flex-direction: column; gap: 12px; }
.gs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gs-points, .gs-modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.gs-point { align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--ink-2); cursor: pointer; }
.gs-point:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.gs-parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.gs-map { height: 460px; min-height: 360px; cursor: crosshair; }
.gs-map-title { margin-top: 16px; }
.gs-cars { display: flex; flex-direction: column; gap: 10px; }
.gs-car { display: grid; grid-template-columns: 132px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--ink-2); }
.gs-car.is-active { border-color: var(--accent); }
.gs-car-photo { width: 132px; height: 84px; border-radius: 8px; background: #0c1214; display: grid; place-items: center; overflow: hidden; color: var(--muted); }
.gs-car-photo img { width: 100%; height: 100%; object-fit: cover; }
.gs-car-info h3 { margin: 0 0 4px; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gs-car-info p { margin: 0 0 8px; }
.gs-plate { display: inline-block; padding: 1px 7px; border-radius: 4px; background: #e9e4d0; color: #1b2a44; font: 700 12px var(--mono); letter-spacing: .08em; }
.gs-meters { display: flex; gap: 14px; flex-wrap: wrap; }
.gs-meter { display: grid; grid-template-columns: auto 90px auto; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.gs-meter i { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.gs-meter b { display: block; height: 100%; width: 0; background: var(--accent); }
.gs-meter b.is-low { background: var(--danger); }
.gs-meter em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.gs-car-actions { grid-column: 1 / -1; }
.gs-car-actions > summary { list-style: none; display: inline-flex; width: auto; }
.gs-car-actions > summary::-webkit-details-marker { display: none; }
.gs-car-forms { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 10px; }
.gs-vform { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--panel); }
.gs-vform .sub { margin: 0 0 2px; }
.gs-vform p { margin: 0; }
.gs-vform input, .gs-vform select { height: 32px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--ink); color: var(--text); font: inherit; font-size: 13px; min-width: 0; }
.gs-vform .btn { align-self: flex-start; }
.gs-plate-input { text-transform: uppercase; font-family: var(--mono) !important; letter-spacing: .08em; }
.gs-car-pin span { display: inline-block; transform: translate(-50%, -50%); padding: 1px 6px; border-radius: 4px; background: #e9e4d0; color: #1b2a44; font: 700 11px var(--mono); white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.gs-wipes, .gs-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.gs-wipes li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.gs-log li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.gs-log-type { font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); padding-top: 2px; }
.gs-restore { flex: none; }

/* ---- Controllo duplicati ---- */
.tone-row-danger td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.tone-row-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }

/* ---- Storico spostamenti ---- */
.rt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.rt-side { display: flex; flex-direction: column; gap: 18px; }
.rt-map { height: calc(100vh - 330px); min-height: 440px; }
.rt-player { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.rt-player input[type="range"] { flex: 1; accent-color: var(--accent); }
.rt-player b { font: 600 13px var(--mono); min-width: 150px; }
.rt-sum { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rt-sum li { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; background: var(--ink-2); }
.rt-sum small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.rt-sum b { font: 400 20px var(--display); }
.rt-key { display: inline-block; width: 18px; height: 4px; border-radius: 2px; vertical-align: middle; margin: 0 4px 0 8px; }
.rt-key-foot { background: #ffdca8; } .rt-key-car { background: #7fe0b4; }
.rt-stops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; }
.rt-stop { width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line-soft); background: var(--ink-2); color: var(--text); font: inherit; cursor: pointer; }
.rt-stop:hover { border-color: var(--accent); }

/* ---- Salute del server ---- */
.hl-events { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; display: flex; flex-direction: column; }
.hl-events li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.hl-when { font: 12px var(--mono); color: var(--muted); }
.hl-text { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); font-size: 11.5px; }
.hl-resources { display: flex; flex-wrap: wrap; gap: 6px; }
.hl-res { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 14px; background: var(--ink-2); border: 1px solid var(--line-soft); font: 12px var(--mono); color: var(--text-2); }
.hl-res i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.hl-res.is-off { border-color: rgba(224, 127, 127, .5); color: var(--danger); }
.hl-res.is-off i { background: var(--danger); }
.hl-res.is-arvell { color: var(--text); }

/* ---- Andamento economia ---- */
.et-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.et-bars li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.et-bars i { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.et-bars b { display: block; height: 100%; width: 0; background: var(--accent); }
.et-bars em { font-style: normal; font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) {
  .rt-layout { grid-template-columns: minmax(0, 1fr); }
  .gs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .gs-grid { grid-template-columns: minmax(0, 1fr); }
  .gs-car { grid-template-columns: minmax(0, 1fr); }
  .gs-car-photo { width: 100%; height: 140px; }
  .gs-log li, .hl-events li { grid-template-columns: minmax(0, 1fr); }
}
.gs-search input { flex: 1; width: 100%; min-width: 0; background: transparent; }
.gs-car-photo .icon { width: 30px; height: 30px; }
.gs-car-photo.is-empty { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }

/* Vocale: il clic arriva sempre al pulsante, mai all'icona (che puo essere aggiornata mentre si clicca). */
.vc-btn > *, .vc-chip > *, .vc-thumb > *, .vc-stage-full > * { pointer-events: none; }

/* Codice d'acquisto dello shop nei ticket */
.tk-code { display: inline-block; padding: 0 6px; border: 1px dashed var(--accent); color: var(--accent); font-family: var(--mono); font-size: .95em; letter-spacing: .06em; text-decoration: none; }
a.tk-code:hover { background: var(--accent-soft); }

/* ---- Shop (pannello) ---- */
.shp-goal { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--text-2); }
.shp-goal i { flex: 1; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.shp-goal i b { display: block; height: 100%; width: 0; background: var(--accent); }
.shp-order-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.shp-order-head h2 { margin: 4px 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 18px; }
.shp-order-head p { margin: 0; }
.shp-code { font-family: var(--mono); font-size: 20px; letter-spacing: .1em; color: var(--accent); }
.shp-total { text-align: right; display: flex; flex-direction: column; }
.shp-total b { font: 400 30px var(--display); }
.shp-total small { color: var(--muted); font-size: 12px; }
.shp-lines, .shp-rewards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.shp-lines li { display: flex; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.shp-lines li span { margin-left: auto; font-variant-numeric: tabular-nums; }
.shp-rewards li { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }
.shp-rewards li .icon { color: var(--accent); width: 16px; height: 16px; }
.shp-rewards li.is-done { color: var(--muted); }
.shp-act { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.shp-act .sub { margin: 0 0 2px; }
.shp-act input, .shp-act select { height: 34px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--ink); color: var(--text); font: inherit; font-size: 13px; }
.shp-act .btn { align-self: flex-start; }
.shp-act-row { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 10px; }
.shp-top { align-items: start; }
.shp-top .card { margin: 0; }
.shp-editor { display: flex; flex-direction: column; gap: 18px; }
.shp-flags { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.shp-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shp-builder { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.shp-reward { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--ink-2); }
.shp-reward.is-veicolo { border-left: 3px solid var(--info); } .shp-reward.is-contanti { border-left: 3px solid var(--warn); } .shp-reward.is-oggetto { border-left: 3px solid var(--accent); }
.shp-kind { font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--text-2); }
.shp-fields { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.shp-fields input, .shp-fields select { height: 32px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--ink); color: var(--text); font: inherit; font-size: 13px; min-width: 0; }
.shp-fields > input[type="text"] { flex: 1 1 180px; }
.shp-qty { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.shp-qty input { width: 110px; }
.shp-fields small.is-bad { color: var(--danger); }
.shp-tools { display: flex; gap: 4px; }
.shp-empty { padding: 14px; color: var(--muted); font-size: 13px; border: 1px dashed var(--line); border-radius: 9px; text-align: center; }
.shp-add { display: flex; gap: 8px; flex-wrap: wrap; }
.shp-danger { justify-content: flex-end; }
@media (max-width: 700px) { .shp-reward { grid-template-columns: minmax(0, 1fr); } .shp-grid-2 { grid-template-columns: minmax(0, 1fr); } }
/* Shop: scheda del cliente nell'ordine */
.shp-people { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
.shp-person { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px 16px; align-items: center; margin: 0; }
.shp-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--panel-2); display: grid; place-items: center; color: var(--muted); }
.shp-avatar .icon { width: 28px; height: 28px; }
.shp-person-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.shp-person-info b { font-size: 17px; }
.shp-person-id .copy { font-size: 12px; }
.shp-person-acts { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
/* Backup: importazione per sezione */
.bk-section { border: 1px solid var(--line-soft); border-radius: 9px; padding: 10px 12px 12px; margin: 0 0 10px; }
.bk-section legend { padding: 0 6px; }
.bk-section legend .check { gap: 8px; }

/* =====================================================================================
   MOBILE (telefoni e tablet stretti) - ultimo strato del file: prevale su tutto il resto.
   Intestazione compatta, barre scorrevoli col dito, menu laterale a scomparsa, campi a 16px (niente zoom su iPhone).
   ===================================================================================== */
@media (max-width: 860px) {
  html, body { overflow-x: hidden; }
  .shell { display: block; }
  .main { min-width: 0; width: 100%; }
  /* Menu laterale a scomparsa con sfondo oscurato */
  .sidebar { position: fixed; top: 0; left: 0; z-index: 60; width: min(300px, 84vw); height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
    transform: translateX(-102%); transition: transform .22s ease, box-shadow .22s ease; padding: 18px 12px calc(18px + env(safe-area-inset-bottom)); }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(5, 8, 9, .62), 20px 0 50px rgba(0, 0, 0, .5); }
  .nav-link { padding: 11px 10px; }
  /* Barra di stato: scorre di lato */
  .sysbar { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 0 4px; }
  .sysbar::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
  .sys-item { flex: none; white-space: nowrap; }
  .sys-spacer { display: none; }
  /* Intestazione: menu + titolo + profilo, sotto la ricerca */
  .topbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px 10px; padding: 10px 12px; }
  .topbar .menu-btn { display: inline-grid; grid-column: 1; grid-row: 1; width: 42px; height: 42px; }
  .topbar-title { grid-column: 2; grid-row: 1; min-width: 0; }
  .topbar-title .crumb { font-size: 9.5px; }
  .topbar-title h1 { font-size: 21px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-title p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 11.5px; margin-top: 2px; }
  .topbar > [data-density], .topbar > a.icon-btn, .quick-kbd { display: none; }
  .user-box { grid-column: 3; grid-row: 1; gap: 6px; margin: 0; }
  .user-box .avatar { width: 34px; height: 34px; }
  .quick-search { grid-column: 1 / -1; grid-row: 2; width: 100%; margin: 0; }
  /* Contenuto */
  .content { padding: 12px 12px calc(28px + env(safe-area-inset-bottom)); gap: 12px; }
  .card { padding: 12px 13px; border-radius: 11px; }
  .card-head { margin: -2px -13px 12px; padding: 0 13px 10px; flex-wrap: wrap; gap: 8px; }
  .card-head h2 { font-size: 13.5px; }
  .card-head > .muted.small, .card-head > span.muted { flex-basis: 100%; }
  .notice { padding: 10px 12px; font-size: 13px; }
  /* Schede: scorrono con il dito invece di allargare la pagina */
  .tabs { overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 -12px; padding: 0 12px;
    -webkit-mask-image: linear-gradient(90deg, #000 86%, transparent); mask-image: linear-gradient(90deg, #000 86%, transparent); }
  .tab { flex: none; white-space: nowrap; padding: 11px 12px; }
  /* Filtri a tutta larghezza */
  .filters { flex-direction: column; align-items: stretch; gap: 10px; }
  .filters > *, .filters .field, .filters .field-inline, .filter-actions { width: 100%; max-width: none; }
  .filter-actions { display: flex; gap: 8px; }
  .filter-actions .btn { flex: 1; justify-content: center; }
  .grow-text { font-size: 12px; }
  /* Campi: 16px evita lo zoom automatico di iPhone */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px !important; }
  .field-inline { height: 42px; }
  .btn { min-height: 38px; }
  .btn-sm { min-height: 34px; }
  .actions { gap: 8px; }
  .page-actions { align-items: stretch; }
  .toolbar { gap: 8px; }
  /* Tabelle: scorrono nel loro riquadro */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -13px; padding: 0 13px; }
  .table { font-size: 12.5px; }
  .table td, .table thead th { padding: 7px 7px; }
  .trunc-cell { max-width: 160px; }
  /* Griglie */
  .grid-2, .flow-layout, .rs-layout, .rt-layout { grid-template-columns: minmax(0, 1fr) !important; }
  .kpis, .kpis-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; }
  .kpi strong { font-size: 24px; }
  .map, .gs-map, .rt-map { height: 58vh; min-height: 300px; }
  /* Finestre */
  .dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 24px); }
  .palette { width: calc(100vw - 20px); margin-top: 8vh; }
  .footer { flex-wrap: wrap; gap: 6px 12px; font-size: 10px; }
}
@media (max-width: 380px) {
  .kpis, .kpis-6 { grid-template-columns: minmax(0, 1fr); }
  .topbar-title h1 { font-size: 19px; }
}
@media (max-width: 860px) {
  .filters > *, .filters .grow { flex: none; }
  .filters .field-inline.grow { height: 42px; }
}
@media (max-width: 860px){
  .rt-player { flex-wrap: wrap; gap: 8px 10px; }
  .rt-player input[type="range"] { flex: 1 1 100%; order: 3; }
  .rt-player b { min-width: 0; flex: 1; }
  .field-select { min-width: 0; max-width: 100%; }
  .field-select select { min-width: 0; max-width: 100%; width: 100%; text-overflow: ellipsis; }
}
@media (max-width: 860px){ .sidebar .quick-kbd, .sidebar kbd { display: none; } .chart svg { touch-action: pan-y; } }
