/* TRUST next — scrivania a finestre.
 * Palette ripresa dall'app TRUST attuale (campionata dalla UI Sencha):
 *   barra superiore oro #d6b140 con bottoni neri, intestazioni pannello blu #6fa1d8,
 *   righe alternate #e6e6e6, footer #232323. Sfondo scrivania: immagine della
 *   pagina di login (style/images/desk-bg.jpg, copia locale).
 * Metro/Fluent: niente border-radius (solo badge e avatar), niente gradienti. */

:root {
    --nx-gold: #d6b140;
    --nx-gold-dark: #b8962f;
    --nx-black: #111111;
    --nx-blue: #6fa1d8;        /* intestazioni pannello TRUST */
    --nx-blue-dark: #2f6db3;   /* barre grafici, link */
    --nx-desk: #e9eff7;
    --nx-bar: #ffffff;
    --nx-bar-text: #111111;
    --nx-como: #1f66b8;          /* bluette Como per la taskbar */
    --nx-como-dark: #17518f;
    --nx-como-light: #2f7bd0;
    --nx-taskbar: var(--nx-como);
    --nx-taskbar-border: var(--nx-como-dark);
    --nx-text: #1e2530;
    --nx-muted: #5f6b7a;
    --nx-accent: var(--nx-gold);
    --nx-surface: #ffffff;      /* fondo di campi, pulsanti, schede (cambia nel tema scuro) */
    --nx-win: #ffffff;
    --nx-win-head: var(--nx-blue);
    --nx-win-head-text: #ffffff;
    --nx-win-head-active: #5f95d2;   /* intestazione della finestra attiva */
    --nx-win-head-bd: #5b8fc9;       /* filo sotto l'intestazione */
    --nx-hover: #e3edf8;             /* sfondo di righe e voci al passaggio del mouse */
    --nx-win-border: #c5d3e3;
    --nx-win-text: #1e2530;
    --nx-win-muted: #6b7482;
    --nx-row-alt: #f2f2f2;
    --nx-tile: #f4f6f9;
    --nx-tile-border: #e1e6ee;
    --nx-track: #e6e6e6;
    --nx-red: #b3261e;    --nx-red-bg: #f7dedc;
    --nx-amber: #8a5a00;  --nx-amber-bg: #f5e6c4;
    --nx-blue-txt: #1f5f8b; --nx-blue-bg: #d9e8f3;
    --nx-green: #2e6b3a;  --nx-green-bg: #dcecdf;
    --nx-gray: #4b5563;   --nx-gray-bg: #e5e7eb;
    --nx-topbar-h: 0px;
    --nx-taskbar-h: 40px;
    --nx-sidebar-w: 0px;
    --nx-font: 12px;
}

html, body.next-body { height: 100%; }
body.next-body {
    margin: 0;
    background: var(--nx-desk);
    color: var(--nx-text);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: var(--nx-font);
    overflow: hidden;
}
* { border-radius: 0 !important; }
.nw-badge, .next-avatar { border-radius: 999px !important; }

/* ---- barra superiore (bianca, ombra sottile verso il desktop) ---- */
.next-topbar {
    position: fixed; inset: 0 0 auto 0; height: var(--nx-topbar-h);
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 0 12px; background: var(--nx-bar); color: var(--nx-bar-text); border-bottom: 1px solid #e3e6ea; box-shadow: 0 2px 6px rgba(20,40,70,0.18); z-index: 1000;
}
.next-brand { display: flex; align-items: center; gap: 8px; white-space: nowrap; padding: 3px 0; height: 36px; }
.next-brand img { height: 26px; width: auto; display: block; }
.next-brand-sub { color: var(--nx-muted); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10.5px; border-left: 1px solid #ddd; padding-left: 8px; }
.next-topbar-right { display: flex; align-items: center; gap: 12px; }
.next-badge-demo { border: 1px dashed var(--nx-muted); color: var(--nx-muted); padding: 2px 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10px; letter-spacing: 0.06em; }
.next-clock { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--nx-muted); }
.next-avatar { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; background: var(--nx-como); color: #fff; font-size: 11px; font-weight: 700; }
.next-logout { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; background: var(--nx-black); color: #fff; font-size: 13px; }
.next-logout:hover { color: var(--nx-gold); }

/* bottone Profili (bozza) nella barra superiore */
.next-profiles { display: flex; gap: 6px; }
.next-profile { border: 1px solid #d0d5dc; background: var(--nx-surface); color: var(--nx-text); padding: 6px 12px; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.next-profile:hover { border-color: var(--nx-como); color: var(--nx-como); }
.next-draft-pill { background: repeating-linear-gradient(45deg, #f5c400 0 6px, #111 6px 12px); color: #fff; font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 1px 6px; text-shadow: 0 0 2px #000; }

/* ---- contenuti in BOZZA (mockup) ---- */
.nw-draft { position: relative; }
.nw-draft-banner { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: repeating-linear-gradient(45deg, #fff3b0 0 12px, #ffe066 12px 24px); border-bottom: 2px solid #111; color: #111; font-size: 12px; }
.nw-draft-banner strong { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; background: #111; color: #ffe066; padding: 2px 8px; }
.nw-draft-mark { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; font-size: 96px; font-weight: 800; letter-spacing: 0.2em; color: rgba(17,17,17,0.06); transform: rotate(-20deg); text-transform: uppercase; }
.nw-mock { display: grid; grid-template-columns: 260px 1fr; gap: 16px; padding: 12px 14px; }
.nw-mock-list { border: 1px solid var(--nx-win-border); }
.nw-mock-item { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid #edf0f4; cursor: pointer; }
.nw-mock-item:hover { background: var(--nx-hover); }
.nw-mock-item.is-on { background: var(--nx-blue-bg); border-left: 3px solid var(--nx-como); }
.nw-mock-item i { color: var(--nx-como); }
.nw-mock-item small { display: block; color: var(--nx-win-muted); }
.nw-mock-add { padding: 8px 10px; color: var(--nx-como); }
.nw-mock-mods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.nw-mock-mod { display: grid; grid-template-columns: 20px 24px 1fr; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--nx-tile-border); background: var(--nx-tile); }
.nw-mock-mod i { color: var(--nx-como); }
.nw-mock-mod small { display: block; color: var(--nx-win-muted); }
.nw-mock-mod.is-planned { opacity: 0.7; }
.nw-mock-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.nw-mock-actions .nw-btn { border: 1px solid var(--nx-win-border); background: var(--nx-surface); padding: 4px 10px; font-size: 11.5px; }
.nw-mock-actions .nw-btn-primary { background: var(--nx-black); border-color: var(--nx-black); color: #fff; font-weight: 600; }
.nw-mock-actions .nw-btn-danger { color: var(--nx-red); border-color: #e7b9b5; }
.nw-mock-actions .nw-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.nw-mock-field { margin-bottom: 8px; }
.nw-mock-field label { display: block; font-size: 10.5px; color: var(--nx-win-muted); text-transform: uppercase; letter-spacing: 0.06em; font-family: ui-monospace, Menlo, Consolas, monospace; }
.nw-mock-field input, .nw-mock-field select { width: 100%; border: 1px solid var(--nx-win-border); padding: 4px 6px; font-size: 12px; background: var(--nx-surface); }

/* ---- layout principale ---- */
.next-main { position: fixed; inset: var(--nx-topbar-h) 0 var(--nx-taskbar-h) 0; z-index: 1; }
body.has-max .next-main { z-index: 2200; } /* sopra la barra superiore (1000), sotto modali (2500) */
body.has-max .next-taskbar { z-index: 0; } /* la taskbar sta dentro il piano delle finestre: con una massimizzata finisce sotto */
.next-sidebar { display: none; }

.next-desk {
    position: absolute; top: 0; bottom: 0; left: var(--nx-sidebar-w); right: 0; overflow: hidden;
    background: var(--nx-desk) url("../images/desk-bg.jpg") center / cover no-repeat;
}

/* ---- tooltip descrittivo delle vapp ---- */
.next-tip { position: fixed; z-index: 3000; max-width: 340px; background: var(--nx-surface); color: var(--nx-text); border: 1px solid var(--nx-win-border); border-top: 3px solid var(--nx-blue); box-shadow: 0 8px 24px rgba(20,40,70,0.25); padding: 10px 12px; font-size: 11.5px; line-height: 1.45; pointer-events: none; }
/* con un tasto dentro (es. copia indirizzo) il tooltip deve ricevere il mouse:
   con pointer-events:none non arriva ne' l'entrata ne' il click */
.next-tip.has-actions { pointer-events: auto; padding-left: 40px; }
.next-tip-copy { position: absolute; left: 10px; top: 10px; border: 1px solid var(--nx-win-border);
                 background: var(--nx-surface); color: var(--nx-win-muted); cursor: pointer; font-size: 11px;
                 line-height: 1; padding: 4px 5px; }
.next-tip-copy:hover { border-color: var(--nx-blue-dark); color: var(--nx-blue-dark); }
.next-tip-copy.is-ok { border-color: var(--nx-green); color: var(--nx-green); }
.next-tip strong { display: block; margin-bottom: 4px; font-size: 12px; }
.next-tip p { margin: 0; color: var(--nx-muted); }

/* ---- icone vapp sul desk (stile OS/DSM) ---- */
/* icone: griglia libera (celle 92x82) con posizioni salvate nel layout; trascinabili */
.next-icons { position: absolute; top: 14px; left: 14px; right: 14px; bottom: 14px; z-index: 0; }
.next-icon.is-dragging { z-index: 5; opacity: 0.85; transition: none; background: rgba(255,255,255,0.7); border-color: var(--nx-gold); }
.next-icon { position: absolute; left: 0; top: 0; transition: left 0.15s, top 0.15s; touch-action: none; }
.next-icon .next-group-tile, .next-apps-item .next-group-tile { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 2px; width: 40px; height: 40px; margin: 0 auto 5px; padding: 4px; box-sizing: border-box; background: rgba(255,255,255,0.6); border: 1px solid rgba(255,255,255,0.8); border-radius: 9px !important; box-shadow: 0 2px 5px rgba(20,40,70,0.35); backdrop-filter: blur(3px); }
.next-icon .next-group-tile img { width: 100%; height: 100%; display: block; margin: 0; border-radius: 2px !important; box-shadow: none; object-fit: cover; }
.next-icon:hover .next-group-tile { transform: translateY(-1px); }
/* cartella aperta: riquadro arrotondato e "frosted" come iOS (eccezione voluta alla regola no border-radius) */
.next-group-pop { position: fixed; inset: 0; z-index: 2150; display: flex; align-items: center; justify-content: center; background: rgba(214,226,242,0.45); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.next-group-box { background: rgba(255,255,255,0.55); border: 1px solid rgba(255,255,255,0.75); border-radius: 26px !important; box-shadow: 0 24px 60px rgba(20,40,70,0.28), inset 0 1px 0 rgba(255,255,255,0.8); backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3); padding: 18px 26px 22px; min-width: 340px; max-width: 90vw; animation: nx-group-in 0.18s ease-out; }
@keyframes nx-group-in { from { transform: scale(0.82); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.next-group-title { text-align: center; font-size: 15px; font-weight: 600; letter-spacing: 0.01em; margin-bottom: 14px; color: var(--nx-text); text-shadow: 0 1px 0 rgba(255,255,255,0.7); }
.next-group-items { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.next-group-items .next-icon { position: static; transition: none; border-radius: 12px !important; }
.next-group-items .next-icon:hover { background: rgba(255,255,255,0.55); border-color: transparent; }
.next-icon { width: 84px; border: 1px solid transparent; background: transparent; color: var(--nx-text); padding: 8px 4px; cursor: pointer; text-align: center; font-size: 10.5px; line-height: 1.2; user-select: none; }
.next-icon img { display: block; width: 40px; height: 40px; margin: 0 auto 5px; border-radius: 9px !important; box-shadow: 0 2px 5px rgba(20,40,70,0.35); }
.next-icon:hover img { transform: translateY(-1px); }
.next-icon span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-icon:hover { background: rgba(255,255,255,0.6); border-color: var(--nx-win-border); }
.next-icon.is-selected { background: rgba(214,177,64,0.25); border-color: var(--nx-gold); }

/* ---- finestra ---- */
.nx-win {
    position: absolute; display: flex; flex-direction: column;
    background: var(--nx-win); color: var(--nx-win-text); border: 1px solid var(--nx-win-border);
    box-shadow: 0 8px 24px rgba(20,40,70,0.28); min-width: 240px; min-height: 120px;
}
.nx-win.is-active { box-shadow: 0 12px 32px rgba(20,40,70,0.4); border-color: var(--nx-blue-dark); }
.nx-win.is-min { display: none; }
.nx-win.is-max { position: fixed; left: 0 !important; top: 0 !important; width: 100vw !important; height: 100vh !important; box-shadow: none; } /* tutta la finestra del browser, taskbar compresa */
.nx-win-head {
    display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px 0 10px;
    background: var(--nx-win-head); color: var(--nx-win-head-text); border-bottom: 1px solid var(--nx-win-head-bd); cursor: move; user-select: none;
}
.nx-win.is-active .nx-win-head { background: var(--nx-win-head-active); }
.nx-win-dot { width: 7px; height: 7px; background: var(--nx-gold); border-radius: 999px !important; flex: none; }
.nx-win-title { font-weight: 600; white-space: nowrap; font-size: 13px; }
.nx-win-sub { color: rgba(255,255,255,0.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.nx-win-ctl { display: flex; gap: 2px; flex: none; }
.nx-win-ctl button { width: 26px; height: 24px; border: 0; background: transparent; color: #fff; cursor: pointer; font-size: 12px; }
.nx-win-ctl button:hover { background: rgba(0,0,0,0.18); }
.nx-win-ctl button.nx-close:hover { background: var(--nx-red); }
.nx-win-ctl .nx-info, .nx-win-ctl .nx-pdf { color: #fff; }
/* durante la rasterizzazione la finestra è allargata al contenuto: niente ombra né maniglia */
.nx-win.is-printing { box-shadow: none; z-index: 1 !important; }
.nx-win.is-printing .nx-win-resize { display: none; }
.nx-win-content { flex: 1; overflow: auto; position: relative; }
.nx-win-content.is-loading::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,0.6); }
.nx-win-resize { position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, var(--nx-win-border) 50%); }
.nx-win.is-max .nx-win-resize { display: none; }

/* ---- contenuto finestre (prefisso nw-) ---- */
.nw-body { font-size: 12px; }
.nw-pad { padding: 12px 14px; }
.nw-lead { font-size: 14px; margin: 0 0 6px; }
.nw-muted { color: var(--nx-win-muted); }
.nw-small { font-size: 11px; }
.nw-list { list-style: none; padding: 0; margin: 8px 0; }
.nw-list li { padding: 3px 0; }
.nw-list i { width: 18px; color: var(--nx-win-muted); }
.nw-ok { color: var(--nx-green); font-weight: 600; }
.nw-ko { color: var(--nx-red); font-weight: 600; }
.nw-warn { color: var(--nx-amber); font-weight: 600; }
.nw-error { margin: 12px; padding: 10px 12px; background: var(--nx-red-bg); color: var(--nx-red); }
/* dentro un corpo gia' spaziato l'errore si allinea al resto e prende il filetto rosso */
.nw-body .nw-error { margin: 0 0 10px; border-left: 3px solid var(--nx-red); }
.nw-error .nw-small { color: var(--nx-red); opacity: 0.85; margin-top: 3px; }
.nw-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.nw-tiles-2 { grid-template-columns: repeat(2, 1fr); }
.nw-tiles-3 { grid-template-columns: repeat(3, 1fr); }
.nw-tile { background: var(--nx-tile); border: 1px solid var(--nx-tile-border); border-left: 3px solid var(--nx-blue); padding: 8px 10px; }
.nw-tile.is-alert { background: var(--nx-red-bg); border-color: #e7b9b5; border-left-color: var(--nx-red); }
.nw-tile.is-alert .nw-num { color: var(--nx-red); }
/* riquadro cliccabile: nel dettaglio scansione i numeri FANNO da schede
   (enti visitati / risultati / nuovi / errori), al posto di una fila di bottoni */
.nw-tile-btn { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.nw-tile-btn:hover { border-left-color: var(--nx-blue-dark); background: var(--nx-surface); }
.nw-tile-btn.is-on { background: var(--nx-surface); border-color: var(--nx-blue); border-left-width: 3px; box-shadow: inset 0 -2px 0 var(--nx-blue); }
.nw-tile-btn.is-on .nw-lbl { color: var(--nx-win-text); font-weight: 600; }
.nw-tile-btn.is-alert.is-on { border-color: var(--nx-red); box-shadow: inset 0 -2px 0 var(--nx-red); }
.nw-num { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 22px; font-weight: 700; line-height: 1.1; }
.nw-lbl { color: var(--nx-win-muted); font-size: 11px; margin-top: 2px; }
.nw-caption { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--nx-win-muted); margin: 6px 0 4px; }
.nw-bars { display: flex; align-items: flex-end; gap: 3px; height: 60px; border-bottom: 1px solid var(--nx-win-border); }
.nw-bars.nw-bars-tall { height: 110px; }
.nw-bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.nw-bar span { display: block; width: 100%; background: var(--nx-blue-dark); }
.nw-bar-lbl { display: flex; gap: 3px; margin-top: 2px; }
.nw-bar-lbl span { flex: 1; text-align: center; font-size: 9.5px; color: var(--nx-win-muted); font-family: ui-monospace, Menlo, Consolas, monospace; }
.nw-axis { display: flex; justify-content: space-between; color: var(--nx-win-muted); font-size: 10.5px; margin-top: 3px; }
.nw-progress { height: 8px; background: var(--nx-track); }
.nw-progress span { display: block; height: 100%; background: var(--nx-green); }
.nw-table { width: 100%; border-collapse: collapse; }
.nw-table th { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--nx-win-muted); font-weight: 600; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--nx-win-border); position: sticky; top: 0; background: var(--nx-win); }
.nw-table td { padding: 6px 10px; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
.nw-table tbody tr:nth-child(even) td { background: var(--nx-row-alt); }
.nw-table tr:hover td { background: var(--nx-hover); }
.nw-table-plain th { display: none; }
.nw-table-plain td { padding: 4px 6px; font-size: 11.5px; }
.nw-strong { font-weight: 600; }
.nw-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nw-right { text-align: right; }
.nw-mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.nw-neg { color: var(--nx-red); }
.nw-badge { display: inline-block; padding: 1px 8px; font-size: 11px; white-space: nowrap; }
.nw-badge::before { content: "● "; font-size: 8px; vertical-align: 1px; }
.nw-badge-red { background: var(--nx-red-bg); color: var(--nx-red); }
.nw-badge-amber { background: var(--nx-amber-bg); color: var(--nx-amber); }
.nw-badge-blue { background: var(--nx-blue-bg); color: var(--nx-blue-txt); }
.nw-badge-green { background: var(--nx-green-bg); color: var(--nx-green); }
.nw-badge-gray { background: var(--nx-gray-bg); color: var(--nx-gray); }
.nw-foot { padding: 6px 12px; border-top: 1px solid var(--nx-win-border); color: var(--nx-win-muted); font-size: 10.5px; background: var(--nx-tile); }
.nw-foot code { font-size: 10.5px; }
.nw-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.nw-section { margin-top: 10px; }
.nw-hbar { display: grid; grid-template-columns: 140px 1fr 90px; align-items: center; gap: 8px; padding: 3px 0; font-size: 11.5px; }
.nw-hbar .nw-hbar-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nw-hbar .nw-hbar-track { height: 8px; background: var(--nx-track); }
.nw-hbar .nw-hbar-track span { display: block; height: 100%; background: var(--nx-blue-dark); }
.nw-hbar .nw-hbar-val { text-align: right; font-family: ui-monospace, Menlo, Consolas, monospace; }
a.nw-hbar, .nw-link { color: inherit; text-decoration: none; cursor: pointer; }
a.nw-hbar:hover, tr.nw-link:hover td { background: var(--nx-hover); }
a.nw-hbar:hover .nw-hbar-lbl { text-decoration: underline; }
.nw-kv { display: grid; grid-template-columns: 1fr; gap: 3px; margin: 4px 0 12px; font-size: 12px; }
.nw-kv > div { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }
.nw-kv > div > span:first-child { color: var(--nx-win-muted); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; padding-top: 2px; }
.nw-kv a { color: var(--nx-blue-dark); text-decoration: none; }
.nw-kv a:hover { text-decoration: underline; }

/* barra parametri delle vapp (es. intervallo date) */
.nw-params { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; background: var(--nx-tile); border-bottom: 1px solid var(--nx-win-border); }
.nw-params label { color: var(--nx-win-muted); font-size: 11px; }
.nw-params .nw-year { width: 72px; border: 1px solid var(--nx-win-border); background: var(--nx-surface); font-size: 11px; padding: 2px 4px; height: 24px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.nw-params input[type="date"] { border: 1px solid var(--nx-win-border); background: var(--nx-surface); font-size: 11px; padding: 2px 4px; height: 24px; }
.nw-params .nw-btn { border: 1px solid var(--nx-win-border); background: var(--nx-surface); color: var(--nx-win-text); font-size: 11px; padding: 2px 8px; height: 24px; cursor: pointer; }
.nw-params .nw-btn:hover { border-color: var(--nx-blue-dark); }
.nw-params .nw-btn-primary { background: var(--nx-black); border-color: var(--nx-black); color: #fff; font-weight: 600; }
.nw-params .nw-btn.is-on { background: var(--nx-blue-bg); border-color: var(--nx-blue); }
.nw-params .nw-sep { width: 1px; height: 18px; background: var(--nx-win-border); margin: 0 4px; }

/* sezioni a scomparsa dentro le vapp (details/summary) */
.nw-acc { border-top: 1px solid var(--nx-win-border); }
.nw-acc summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--nx-blue); color: #fff; cursor: pointer; font-size: 12.5px; font-weight: 600; user-select: none; }
.nw-acc summary::-webkit-details-marker { display: none; }
.nw-acc summary i:first-child { width: 16px; text-align: center; opacity: 0.9; }
.nw-acc-count { background: rgba(255,255,255,0.25); padding: 0 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; }
.nw-acc-chev { margin-left: auto; transition: transform 0.15s; font-size: 11px; }
.nw-acc[open] .nw-acc-chev { transform: rotate(180deg); }
.nw-acc-body { max-height: 420px; overflow: auto; }
.nw-select { border: 1px solid var(--nx-win-border); background: var(--nx-surface); font-size: 11.5px; padding: 2px 6px; height: 24px; max-width: 320px; }

/* cella con quick-edit e modale generica */
.nw-qe { cursor: pointer; }
.nw-qe i { color: var(--nx-blue-dark); margin-right: 4px; font-size: 11px; }
.nw-qe:hover { background: var(--nx-hover) !important; text-decoration: underline; }
.next-modal { position: fixed; inset: 0; z-index: 2500; background: rgba(20,40,70,0.45); display: flex; align-items: center; justify-content: center; }
.next-modal-box { width: 680px; max-width: 94vw; background: var(--nx-surface); color: var(--nx-text); border: 1px solid var(--nx-win-border); box-shadow: 0 16px 40px rgba(20,40,70,0.45); }
.next-modal-head { display: flex; align-items: center; gap: 8px; background: var(--nx-blue); color: #fff; padding: 8px 12px; font-weight: 600; font-size: 13px; }
.next-modal-x { margin-left: auto; border: 0; background: transparent; color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.next-modal-body { padding: 12px 14px; }
.next-modal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.next-modal-error { margin-top: 8px; padding: 6px 10px; background: var(--nx-red-bg); color: var(--nx-red); font-size: 12px; }
.next-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--nx-win-border); background: var(--nx-tile); }
.next-modal-foot .nw-btn { border: 1px solid var(--nx-win-border); background: var(--nx-surface); padding: 5px 12px; font-size: 12px; cursor: pointer; }
.next-modal-foot .nw-btn-primary { background: var(--nx-black); border-color: var(--nx-black); color: #fff; font-weight: 600; }
@media (max-width: 768px) { .next-modal-grid { grid-template-columns: 1fr; } }

/* ---- vapp Task (prefisso nt-) ---- */
.nt { font-size: 12px; }
.nt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--nx-win-border); background: var(--nx-tile); }
.nt-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nt-title i { color: var(--nx-blue-dark); }
.nt-head-r { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.nt-head-r .nw-btn, .nt-actions .nw-btn, .nt-inline .nw-btn { border: 1px solid var(--nx-win-border); background: var(--nx-surface); color: var(--nx-win-text); font-size: 11.5px; padding: 4px 10px; cursor: pointer; }
.nt-head-r .nw-btn-primary { background: var(--nx-black); border-color: var(--nx-black); color: #fff; font-weight: 600; }
.nt-menu-wrap { position: relative; }
.nt-menu { position: absolute; right: 0; top: calc(100% + 4px); min-width: 240px; background: var(--nx-surface); border: 1px solid var(--nx-win-border); box-shadow: 0 8px 24px rgba(20,40,70,0.25); z-index: 5; padding: 4px; }
.nt-menu button, .nt-menu a { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; text-align: left; padding: 7px 10px; font-size: 12px; color: var(--nx-win-text); text-decoration: none; cursor: pointer; }
.nt-menu button:hover, .nt-menu a:hover { background: var(--nx-hover); }
.nt-menu i { width: 16px; color: var(--nx-blue-dark); }
.nt-form { padding: 10px 14px; }
.nt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 8px; }
.nt-grid-2 { grid-template-columns: repeat(2, 1fr); }
.nt-grid-3 { grid-template-columns: repeat(3, 1fr); }
.nt-field label { display: block; font-size: 10.5px; color: var(--nx-win-muted); text-transform: uppercase; letter-spacing: 0.06em; font-family: ui-monospace, Menlo, Consolas, monospace; margin-bottom: 2px; }
.nt-field label a { color: var(--nx-blue-dark); margin-left: 4px; }
.nt-field input, .nt-field select, .nt-field textarea, .nt-dialog-body input:not([type=checkbox]), .nt-dialog-body select, .nt-dialog-body textarea { width: 100%; border: 1px solid var(--nx-win-border); background: var(--nx-surface); padding: 5px 6px; font-size: 12px; font-family: inherit; }
.nt-field select:disabled, .nt-field input:disabled { background: var(--nx-tile); color: var(--nx-win-text); }
.nt-full { margin-bottom: 8px; }
.nt-check { display: flex; align-items: center; gap: 6px; font-size: 12px; margin: 6px 0; }
.nt-tabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--nx-win-border); background: var(--nx-tile); }
.nt-tabs button { border: 1px solid transparent; border-bottom: 0; background: transparent; padding: 8px 12px; font-size: 12px; cursor: pointer; color: var(--nx-win-muted); }
.nt-tabs button.is-on { background: var(--nx-surface); border-color: var(--nx-win-border); color: var(--nx-win-text); font-weight: 600; margin-bottom: -1px; }
.nt-pane { min-height: 80px; }
.nt-tl { padding: 12px 14px; }
.nt-ev { display: grid; grid-template-columns: 96px 30px 1fr; gap: 8px; align-items: start; position: relative; padding-bottom: 12px; }
.nt-ev::before { content: ""; position: absolute; left: 110px; top: 28px; bottom: 0; width: 2px; background: #e6e6e6; }
.nt-ev:last-child::before { display: none; }
.nt-ev-when { text-align: right; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; line-height: 1.3; padding-top: 4px; }
.nt-ev-day { display: block; font-weight: 700; }
.nt-ev-hour { display: block; color: var(--nx-win-muted); }
.nt-ev-delta { display: block; font-size: 10px; color: var(--nx-win-muted); }
.nt-ev-dot { width: 28px; height: 28px; border-radius: 999px !important; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; position: relative; z-index: 1; }
.nt-ev-card { background: var(--nx-tile); border: 1px solid var(--nx-tile-border); padding: 8px 10px; }
.nt-ev-head { font-size: 12.5px; }
.nt-ev-body { margin-top: 6px; white-space: pre-wrap; background: var(--nx-surface); border: 1px solid var(--nx-tile-border); padding: 6px 8px; }
.nt-ev-att { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.nt-ev-att a { text-decoration: none; }
.nt-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--nx-win-border); background: var(--nx-tile); position: sticky; bottom: 0; }
.nt-actions .nt-warn { border-color: var(--nx-amber); color: var(--nx-amber); }
.nt-actions .nt-info { border-color: var(--nx-blue-dark); color: var(--nx-blue-dark); }
.nt-actions .nt-dark { border-color: #232323; color: #232323; }
.nt-actions .nt-ok { border-color: var(--nx-green); color: var(--nx-green); }
.nt-actions .nw-btn:hover { background: var(--nx-hover); }
.nt-hint { background: var(--nx-blue-bg); color: var(--nx-blue-txt); padding: 6px 10px; font-size: 11.5px; margin: 0 0 10px; }
.nt-dialog-body label { display: block; font-size: 10.5px; color: var(--nx-win-muted); text-transform: uppercase; letter-spacing: 0.06em; font-family: ui-monospace, Menlo, Consolas, monospace; margin: 8px 0 2px; }
.nt-dialog-body label.nt-check { text-transform: none; letter-spacing: 0; font-family: inherit; font-size: 12px; color: var(--nx-win-text); }
.nt-inline { display: flex; gap: 6px; }
.nt-preview { margin-top: 8px; padding: 8px 10px; background: var(--nx-blue-bg); }
.nt-plist { list-style: none; padding: 0; margin: 0; }
.nt-plist li { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; border-bottom: 1px solid #edf0f4; }
.nt-plist .nw-btn { border: 1px solid var(--nx-win-border); background: var(--nx-surface); padding: 2px 8px; cursor: pointer; color: var(--nx-red); }
.nt-mail { padding-left: 4px; list-style: none; }
.nt-mail li { padding: 2px 0; }
.nt-mail i { color: var(--nx-blue-dark); margin-right: 4px; }
@media (max-width: 768px) { .nt-grid, .nt-grid-2, .nt-grid-3 { grid-template-columns: 1fr; } .nt-ev { grid-template-columns: 70px 28px 1fr; } }

/* ---- vapp Commerciale ---- */
.nc-tabs { padding: 0 10px; }
.nc-tabs .nc-clifilter { margin-left: auto; align-self: center; font-size: 11.5px; color: var(--nx-win-muted); display: flex; align-items: center; gap: 6px; }
.nc-tabs .nc-clifilter .nw-btn { border: 1px solid var(--nx-win-border); background: var(--nx-surface); padding: 0 6px; cursor: pointer; }
.nc-sub { font-weight: 400; font-size: 11px; opacity: 0.85; margin-left: 6px; }
.nc-subtabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 12px; background: var(--nx-tile); border-bottom: 1px solid var(--nx-win-border); }
.nc-subtabs button { border: 1px solid var(--nx-win-border); background: var(--nx-surface); color: var(--nx-win-text); font-size: 11.5px; padding: 4px 10px; cursor: pointer; }
.nc-subtabs button:hover { border-color: var(--nx-blue-dark); }
.nc-subtabs button.is-on { background: var(--nx-blue); border-color: var(--nx-blue); color: #fff; font-weight: 600; }
.nc-ypm tr.is-current td { background: #eef5fc !important; }
.nc-ypm tr.is-current td:first-child { box-shadow: inset 3px 0 0 var(--nx-blue); }
.nc-chart { background: var(--nx-surface); border: 1px solid var(--nx-tile-border); padding: 10px 12px 6px; }
.nc-ypm td, .nc-ypm th { padding: 4px 6px; font-size: 11px; white-space: nowrap; }
.nc-ypm td.nw-link:hover { background: #d9e8f3 !important; text-decoration: underline; }
.nw-params .nw-text { border: 1px solid var(--nx-win-border); background: var(--nx-surface); font-size: 11px; padding: 2px 6px; height: 24px; width: 150px; }

/* ---- taskbar (bluette Como) ---- */
.next-taskbar {
    position: fixed; inset: auto 0 0 0; height: var(--nx-taskbar-h);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 0 10px; background: var(--nx-taskbar); color: #ffffff; border-top: 1px solid var(--nx-taskbar-border); box-shadow: 0 -2px 6px rgba(20,40,70,0.18); z-index: 2000;
}
.next-taskbar-left { display: flex; align-items: center; gap: 6px; min-width: 0; }
.next-tb-btn { border: 1px solid var(--nx-como-dark); background: var(--nx-como-dark); color: #ffffff; padding: 4px 10px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.next-tb-btn:hover { border-color: var(--nx-gold); }
.next-tb-btn.is-active { background: var(--nx-como-light); border-color: var(--nx-como-light); }
.next-tb-btn.is-min { color: #bcd3ee; }
.next-tb-btn .dot { color: var(--nx-gold); font-size: 8px; vertical-align: 1px; margin-right: 4px; }
.next-taskbar-windows { display: flex; gap: 6px; overflow-x: auto; }
.next-apps-wrap { position: relative; }
.next-apps-menu { position: absolute; left: 0; bottom: calc(100% + 6px); width: 300px; background: var(--nx-surface); color: var(--nx-text); border: 1px solid var(--nx-win-border); border-bottom: 3px solid var(--nx-como); box-shadow: 0 8px 24px rgba(0,0,0,0.5); padding: 6px; z-index: 2100; }
.next-apps-title { color: var(--nx-muted); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; padding: 6px 8px; }
.next-apps-item { text-decoration: none; display: grid; grid-template-columns: 24px 1fr; grid-template-rows: auto auto; column-gap: 8px; width: 100%; border: 0; background: transparent; color: var(--nx-text); text-align: left; padding: 6px 8px; cursor: pointer; }
.next-apps-item i, .next-apps-item img { grid-row: 1 / span 2; align-self: center; color: var(--nx-como); }
.next-apps-item img { width: 24px; height: 24px; border-radius: 6px !important; }
.next-apps-item small { color: var(--nx-muted); }
.next-apps-item:hover { background: var(--nx-hover); }
/* menù a livelli (logica Windows 95): le voci-gruppo aprono un sottomenù a destra */
.next-apps-item.has-sub { position: relative; grid-template-columns: 24px 1fr 14px; cursor: default; }
.next-apps-item.has-sub > span:not(.next-apps-tile), .next-apps-item.has-sub > small { grid-column: 2; }
.next-apps-item.has-sub > .next-apps-tile { grid-column: 1; }
.next-apps-chev { grid-column: 3; grid-row: 1 / span 2; align-self: center; font-size: 10px; color: var(--nx-muted); }
.next-apps-item.has-sub.is-open, .next-apps-item.has-sub:hover { background: var(--nx-hover); }
.next-apps-tile { grid-row: 1 / span 2; align-self: center; width: 24px !important; height: 24px !important; padding: 2px !important; margin: 0 !important; gap: 1px !important; border-radius: 6px !important; box-shadow: none !important; background: var(--nx-tile) !important; border: 1px solid var(--nx-win-border) !important; }
.next-apps-item .next-apps-tile img { width: 100%; height: 100%; border-radius: 1px !important; margin: 0; }
.next-apps-sub { position: absolute; left: calc(100% + 2px); top: -7px; width: 280px; background: var(--nx-surface); color: var(--nx-text); border: 1px solid var(--nx-win-border); border-bottom: 3px solid var(--nx-como); box-shadow: 0 8px 24px rgba(0,0,0,0.35); padding: 6px; cursor: default; }
.next-apps-sub .next-apps-item { grid-template-columns: 24px 1fr; }
.next-apps-sep { height: 1px; background: var(--nx-win-border); margin: 6px 0; }
.next-taskbar-right { display: flex; align-items: center; gap: 12px; padding-right: 2px; color: #d6e4f5; white-space: nowrap; }
.next-taskbar .next-clock { font-family: ui-monospace, Menlo, Consolas, monospace; color: #fff; font-size: 12px; }
.next-tb-tools { display: inline-flex; align-items: center; gap: 4px; padding-right: 10px; margin-right: 2px; border-right: 1px solid rgba(255,255,255,.22); }
.next-tb-tool { width: 28px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.06); color: #d6e4f5; font-size: 13px; cursor: pointer; border-radius: 3px; padding: 0; }
.next-tb-tool:hover { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.55); }
.next-tb-tool.is-global { color: var(--nx-gold); border-color: rgba(230,180,60,.55); }
.next-tb-tool.is-global:hover { background: rgba(230,180,60,.22); color: #ffd978; }
.imp-banner { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 14px; padding: 12px 14px; background: #fff4dc; border: 1px solid #e0b24a; border-left: 6px solid #d18b00; color: #5a3d00; }
.imp-banner > i { font-size: 26px; color: #d18b00; margin-top: 2px; }
.imp-banner strong { display: block; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.imp-banner p { margin: 0; font-size: 12px; line-height: 1.45; }
.imp-sezione { border-left: 4px solid #d18b00; padding-left: 8px; }
.next-user { display: inline-flex; align-items: center; gap: 6px; }
.next-user .next-avatar { width: 26px; height: 26px; background: #fff; color: var(--nx-como); font-size: 10.5px; }
.next-avatar-btn { border: 0; padding: 0; cursor: pointer; font-family: inherit; font-weight: 600; }
.next-avatar-btn:hover, .next-avatar-btn:focus-visible { box-shadow: 0 0 0 2px rgba(255,255,255,.75); outline: none; }
.next-user-name { color: #fff; font-size: 12px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.next-taskbar .next-logout { width: auto; height: auto; background: transparent; color: #d6e4f5; font-size: 12px; margin-left: 2px; }
.next-taskbar .next-logout:hover { color: #fff; }
/* tasto "start" (stile Windows, squadrato): il logo TRUST apre il menù Applicazioni */
.next-apps-btn { display: inline-flex; align-items: center; height: 28px; padding: 0 6px; border: 0; background: #fff; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); cursor: pointer; }
.next-apps-btn img { height: 18px; width: auto; display: block; }
.next-apps-btn:hover, .next-apps-btn.is-active { box-shadow: inset 0 0 0 2px var(--nx-gold); }
/* ricerca contestuale (stile Windows 11) accanto ad Applicazioni */
.next-search { position: relative; display: flex; align-items: center; gap: 6px; background: var(--nx-como-dark); border: 1px solid var(--nx-como-dark); padding: 0 8px; height: 28px; width: 240px; }
.next-search:focus-within { background: #fff; border-color: #fff; }
.next-search i { color: #bcd3ee; font-size: 12px; }
.next-search:focus-within i { color: var(--nx-como); }
.next-search input { flex: 1; border: 0; background: transparent; color: #fff; font-size: 12px; outline: none; min-width: 0; }
.next-search input::placeholder { color: #bcd3ee; }
.next-search:focus-within input { color: var(--nx-text); }
.next-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.next-search-results { position: absolute; left: 0; bottom: calc(100% + 6px); width: 460px; max-height: 60vh; overflow: auto; background: var(--nx-surface); color: var(--nx-text); border: 1px solid var(--nx-win-border); border-bottom: 3px solid var(--nx-como); box-shadow: 0 8px 24px rgba(0,0,0,0.35); z-index: 2100; }
.next-search-group { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--nx-muted); padding: 8px 10px 2px; }
.next-search-item { display: grid; grid-template-columns: 26px 1fr; column-gap: 8px; align-items: center; padding: 6px 10px; cursor: pointer; }
.next-search-item i { color: var(--nx-como); text-align: center; }
.next-search-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-search-item small { display: block; color: var(--nx-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-search-item:hover, .next-search-item.is-on { background: var(--nx-hover); }
.next-search-empty { padding: 10px; color: var(--nx-muted); font-size: 12px; }
@media (max-width: 768px) { .next-search { width: 140px; } .next-search-results { width: 90vw; } }
.next-tb-status { font-size: 11px; }
.next-tb-status.is-saving { color: var(--nx-gold); }
.next-tb-status.is-error { color: #ffb4ae; }

/* ---- pagine non-desk (serverinfo, 404) ---- */
.next-page { padding: 20px; max-width: 900px; margin: 0 auto; overflow: auto; height: 100%; background: var(--nx-surface); }
.next-page h1 { font-size: 18px; margin-bottom: 14px; }
.next-table { color: var(--nx-text); }
.next-table th { width: 120px; color: var(--nx-muted); }
.next-error { margin: 20px; padding: 12px; background: var(--nx-red-bg); color: var(--nx-red); }

/* ---- auth (login) ---- */
.next-auth { display: flex; align-items: center; justify-content: center; background: var(--nx-desk) url("../images/desk-bg.jpg") center / cover no-repeat; }
.next-auth-box { background: var(--nx-surface); color: var(--nx-win-text); padding: 24px 28px; max-width: 480px; border: 1px solid var(--nx-win-border); border-top: 4px solid var(--nx-gold); box-shadow: 0 12px 32px rgba(20,40,70,0.25); }
.next-auth-box .next-brand { padding: 0; height: auto; }
.next-auth-box .next-brand img { height: 36px; }
.next-auth-error { background: var(--nx-red-bg); color: var(--nx-red); padding: 6px 10px; margin-bottom: 10px; font-size: 12px; }
.next-auth-box .form-label { font-size: 11px; margin-bottom: 2px; color: var(--nx-win-muted); }
.next-auth-box .btn-warning { background: var(--nx-black); border-color: var(--nx-black); color: #fff; }
.next-auth-box .btn-warning:hover { background: #333; border-color: #333; }
.next-muted { color: var(--nx-win-muted); }

/* ---- mobile: finestre impilate, niente drag ---- */
@media (max-width: 768px) {
    .next-profiles { display: none; }
    .next-desk { overflow: auto; padding: 8px; }
    .next-icons { position: static; flex-direction: row; max-height: none; margin-bottom: 8px; }
    .nx-win { position: static !important; width: auto !important; height: auto !important; max-height: 70vh; margin-bottom: 8px; }
    .nx-win-head { cursor: default; }
    .nx-win-resize, .nx-max { display: none; }
    .nw-tiles { grid-template-columns: repeat(2, 1fr); }
    .nw-grid-2 { grid-template-columns: 1fr; }
}

/* ===== TDS tools (Reports, Vulnerability, Checklist/Modelli) ===== */
.nw-btn { border: 1px solid var(--nx-win-border); background: var(--nx-surface); color: var(--nx-win-text); font-size: 12px; padding: 5px 10px; cursor: pointer; font-family: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.nw-btn:hover { border-color: var(--nx-blue-dark); }
.nw-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.nw-btn-primary { background: var(--nx-black); border-color: var(--nx-black); color: #fff; font-weight: 600; }
.nw-btn-danger { color: var(--nx-red); border-color: #e7b9b5; }
.nw-btn-danger:hover { background: var(--nx-red-bg); border-color: var(--nx-red); }
.nw-btn-xs { padding: 2px 6px; font-size: 11px; }
.nw-pad-x { padding-left: 14px; padding-right: 14px; }
.nw-input { width: 100%; max-width: 420px; border: 1px solid var(--nx-win-border); background: var(--nx-surface); padding: 5px 6px; font-size: 12px; font-family: inherit; }
.tds-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 14px; background: var(--nx-tile); border-bottom: 1px solid var(--nx-win-border); }
.tds-toolbar-l, .tds-toolbar-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tds-toolbar .nw-lead { margin: 0; }
.tds-search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--nx-win-border); background: var(--nx-surface); padding: 0 8px; height: 28px; min-width: 320px; }
.tds-search i { color: var(--nx-win-muted); font-size: 11px; }
.tds-search input { flex: 1; border: 0; outline: none; font-size: 12px; font-family: inherit; min-width: 0; background: transparent; }
.tds-search .nw-btn { padding: 2px 8px; height: 22px; font-size: 11px; }
.tds-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; }
.tds-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--nx-win-border); }
.tds-tags .nw-caption { margin: 0 6px 0 0; }
.tds-tag { display: inline-flex; align-items: center; border: 1px solid var(--nx-blue); background: var(--nx-surface); font-size: 11.5px; }
.tds-tag button { border: 0; background: transparent; padding: 4px 8px; cursor: pointer; font-size: 11.5px; color: var(--nx-blue-dark); font-family: inherit; }
.tds-tag-eye { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.tds-tag-eye i { width: 12px; text-align: center; }
.tds-tag.is-hidden { border-color: var(--nx-win-border); }
.tds-tag.is-hidden .tds-tag-eye { color: var(--nx-win-muted); font-weight: 400; text-decoration: line-through; background: var(--nx-tile); }
.tds-tag-na { border-left: 1px solid var(--nx-win-border) !important; font-weight: 600; color: var(--nx-win-muted) !important; }
.tds-tag.is-na { border-color: var(--nx-amber); }
.tds-tag.is-na .tds-tag-na { background: var(--nx-amber); color: #fff !important; }
.tds-fieldset { border: 1px solid var(--nx-win-border); margin: 0 0 10px; }
.tds-fieldset-title { background: var(--nx-blue); color: #fff; padding: 6px 10px; font-size: 12px; font-weight: 600; }
.tds-fieldset-title i { opacity: 0.85; margin-right: 4px; }
.tds-fieldset-body { padding: 8px 10px; }
fieldset.tds-q { border: 0; border-top: 1px solid var(--nx-tile-border); margin: 0; padding: 10px 0 6px; min-width: 0; }
fieldset.tds-q:first-child { border-top: 0; }
fieldset.tds-q legend { font-size: 12.5px; font-weight: 600; padding: 0 0 6px; float: left; width: 100%; }
fieldset.tds-q legend .nw-badge { margin-right: 4px; }
fieldset.tds-q.is-na { opacity: 0.55; }
fieldset.tds-q.is-collapsed .tds-q-txt { opacity: 0.4; }
.tds-q-row { display: flex; gap: 12px; align-items: flex-start; clear: both; }
.tds-q-opts { display: flex; flex-direction: column; gap: 4px; min-width: 110px; font-size: 12px; }
.tds-q-opts label { cursor: pointer; }
.tds-q-txt { flex: 1; min-width: 0; }
.tds-comment { margin: 4px 0 10px; }
.tds-comment label { font-size: 11px; color: var(--nx-win-muted); display: block; margin-bottom: 3px; }
.tds-html-preview { position: relative; border: 1px solid var(--nx-win-border); background: #f8f9fa; color: #5a6473; padding: 7px 10px; font-size: 12px; line-height: 1.45; cursor: pointer; }
.tds-html-preview:hover, .tds-html-preview:focus { background: var(--nx-surface); border-color: var(--nx-blue); color: var(--nx-win-text); outline: none; }
.tds-html-preview:hover .tds-html-hint, .tds-html-preview:focus .tds-html-hint { opacity: 1; }
.tds-html-hint { position: absolute; right: 6px; top: 4px; font-size: 10.5px; color: var(--nx-blue-dark); opacity: 0; transition: opacity 0.12s; }
.tds-html-ph { color: var(--nx-win-muted); font-style: italic; }
.tds-html-inner p { margin: 0 0 4px; }
.tds-html-inner p:last-child { margin-bottom: 0; }
/* editor HTML a tutto schermo (TinyMCE locale) */
.next-html-editor { position: fixed; inset: 0; z-index: 3200; background: rgba(20,40,70,0.55); display: flex; align-items: center; justify-content: center; }
.next-html-editor-box { width: 94vw; height: 92vh; background: var(--nx-surface); display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,0.45); }
.next-html-editor-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--nx-win-border); }
.next-html-editor-head .k { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--nx-muted); }
.next-html-editor-head h3 { margin: 0; font-size: 14px; font-weight: 700; flex: 1; text-transform: uppercase; }
.next-html-editor-head .next-modal-x { border: 0; background: transparent; font-size: 22px; cursor: pointer; line-height: 1; }
.next-html-editor-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.next-html-editor-body .tox-tinymce { border: 0 !important; flex: 1; height: 100% !important; }
.next-html-editor-body textarea { flex: 1; width: 100%; border: 0; padding: 12px; font-family: inherit; font-size: 13px; resize: none; }
.next-html-editor-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--nx-win-border); font-size: 11.5px; color: var(--nx-muted); }
.next-html-editor-foot kbd { color: var(--nx-text); border: 1px solid var(--nx-win-border); background: var(--nx-surface); padding: 1px 5px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10.5px; }
.next-html-editor-foot .sp { flex: 1; }
.tds-chart { border-top: 1px solid var(--nx-tile-border); padding: 10px 0; }
.tds-chart .nw-caption code { font-size: 10px; }
.tds-preview { pointer-events: none; opacity: 0.9; }
.tds-tpl-list { display: flex; flex-direction: column; gap: 4px; }
.tds-tpl { display: flex; align-items: center; gap: 8px; border: 1px solid var(--nx-win-border); background: var(--nx-surface); padding: 6px 8px; font-size: 12px; cursor: pointer; }
.tds-tpl > span:nth-child(2) { flex: 1; }
.tds-tpl-act { display: flex; gap: 4px; }
.tds-tree-row { padding: 3px 0; border-bottom: 1px dotted var(--nx-tile-border); font-size: 12px; }
.tds-tree-row code { font-size: 10.5px; }
.tds-status { min-width: 80px; }

/* ===== DataTables / Select2 (locali) dentro le finestre ===== */
.nx-win-content .dt-container { padding: 8px 14px 6px; font-size: 12px; }
.nx-win-content .dt-container .dt-layout-row { margin: 0; }
.nx-win-content .dt-container .dt-layout-row:first-child { margin-bottom: 6px; }
.nx-win-content .dt-container .dt-layout-row:last-child { margin-top: 6px; }
.nx-win-content .dt-container .dt-search input, .nx-win-content .dt-container .dt-length select { border: 1px solid var(--nx-win-border); border-radius: 0 !important; font-size: 12px; padding: 3px 6px; height: 26px; box-shadow: none; }
.nx-win-content .dt-container .dt-search input { width: 220px; }
.nx-win-content .dt-container .dt-length select { width: auto; min-width: 66px; padding-right: 24px; background-position: right 6px center; }
.nx-win-content .dt-container { overflow-x: auto; }
.nx-win-content table.dataTable td, .nx-win-content table.dataTable th { white-space: nowrap; }
.nx-win-content table.dataTable td.wrap { white-space: normal; min-width: 200px; max-width: 380px; }
.nx-win-content .dt-container .dt-search label, .nx-win-content .dt-container .dt-length label { color: var(--nx-win-muted); font-size: 11.5px; }
.nx-win-content .dt-container .dt-info { color: var(--nx-win-muted); font-size: 11px; padding-top: 4px; }
.nx-win-content .dt-container .pagination { margin: 0; --bs-pagination-font-size: 11.5px; --bs-pagination-padding-y: 2px; --bs-pagination-padding-x: 8px; --bs-pagination-border-radius: 0; --bs-pagination-active-bg: var(--nx-blue); --bs-pagination-active-border-color: var(--nx-blue); --bs-pagination-color: var(--nx-win-text); }
.nx-win-content .dt-container .pagination .page-link { border-radius: 0 !important; }
.nx-win-content table.dataTable { margin: 0 !important; width: 100% !important; }
.nx-win-content table.dataTable > thead > tr > th { border-bottom: 1px solid var(--nx-win-border); }
.nx-win-content table.dataTable thead .dt-orderable-asc:hover, .nx-win-content table.dataTable thead .dt-orderable-desc:hover { outline: none; background: var(--nx-hover); }
.nx-win-content table.dataTable.no-footer { border-bottom: 1px solid var(--nx-win-border); }
.nx-win-content table.dataTable tbody td.dt-empty { text-align: center; color: var(--nx-win-muted); padding: 14px; }
.select2-container--bootstrap-5 .select2-selection { border-radius: 0 !important; border-color: var(--nx-win-border); font-size: 12px; min-height: 30px; }
.select2-container--bootstrap-5 .select2-selection--single { padding: 4px 30px 4px 8px; height: 30px; }
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered { font-size: 12px; line-height: 20px; }
.select2-container--bootstrap-5 .select2-dropdown { border-radius: 0 !important; font-size: 12px; border-color: var(--nx-win-border); box-shadow: 0 8px 24px rgba(20,40,70,0.25); }
.select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field { border-radius: 0 !important; font-size: 12px; }
.select2-container--bootstrap-5 .select2-results__option--highlighted { background: var(--nx-blue) !important; }
.select2-container--open { z-index: 3100 !important; }
.nw-params .select2-container--bootstrap-5 .select2-selection--single { height: 26px; padding: 2px 30px 2px 6px; }
.nw-params .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered { line-height: 20px; font-size: 11.5px; }
.nw-params .select2-container--bootstrap-5 .select2-selection { min-height: 26px; }

/* banner "vAPP - NON VALIDATA" (vapp con validata => false nel registro) */
.nw-nv { position: sticky; top: 0; z-index: 5; display: flex; align-items: baseline; gap: 12px; padding: 7px 14px; background: repeating-linear-gradient(135deg, #fff3cd 0 14px, #ffe69c 14px 28px); border-bottom: 2px solid var(--nx-amber); color: #5c3d00; }
.nw-nv strong { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }
.nw-nv small { font-size: 11px; color: #7a5a10; }

/* liste task (Operativo): colore riga per stato come il legacy */
.op-grid tbody tr.is-fatto td { background: #eaf6ee !important; }
.op-grid tbody tr.is-nuovo td { background: #eaf1fb !important; }
.op-grid tbody tr.is-aperto td { background: #fdf4e7 !important; }
.op-grid tbody tr.pe-warn td { background: #fdecec !important; }
.op-filters { row-gap: 6px; }
.op-filters .nw-select { max-width: 160px; }

/* contatore "pillola" sulle icone (es. segnalazioni da gestire) */
.next-icon { position: absolute; }
.next-icon-badge { position: absolute; top: 2px; right: 14px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px !important; background: #8b1a10; color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.35); pointer-events: none; }
.next-apps-item { position: relative; }
.next-apps-item .next-icon-badge { top: 4px; right: 8px; }
.next-group-items .next-icon-badge { right: 14px; }

/* editor amministrazione */
.next-modal-box.is-wide { max-width: 1100px; width: 94vw; }
.am-rows td input, .am-rows td select { width: 100%; border: 1px solid var(--nx-win-border); font-size: 11.5px; padding: 3px 4px; font-family: inherit; }
.am-rows td input[type=number] { width: 80px; }
.am-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.am-kpi { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; }
.am-kpi b { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* barre mensili con confronto esercizio precedente (grigio) / corrente (blu), attaccate */
.nw-bar-pair { gap: 0; }
.nw-bar-pair span { width: 50%; }
.nw-bar span.nw-bar-prev, .nw-bar-legend i.nw-bar-prev { background: #b9c2cc; }
.nw-bar-legend { display: flex; gap: 14px; margin-top: 4px; font-size: 10.5px; color: var(--nx-win-muted); }
.nw-bar-legend i { display: inline-block; width: 10px; height: 10px; background: var(--nx-blue-dark); vertical-align: -1px; margin-right: 4px; }

/* ===== vapp Calendario (porting di web/calendario) — prefisso ncal- ===== */
.ncal { display: flex; min-height: 340px; position: relative; border-top: 1px solid var(--nx-win-border); }
.ncal-side { width: 210px; flex: none; overflow: auto; padding: 10px; border-right: 1px solid var(--nx-win-border); background: var(--nx-tile); }
.ncal.is-side-closed .ncal-side { display: none; }
.ncal.is-narrow .ncal-side { display: none; }
.ncal.is-narrow.is-side-open .ncal-side { display: block; position: absolute; left: 0; top: 0; bottom: 0; z-index: 6; box-shadow: 4px 0 16px rgba(20,40,70,0.25); }
.ncal-side-title { font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.ncal-side form.nw-params { display: block; padding: 0; margin: 0 0 10px; background: none; border: 0; }
.ncal-side form.nw-params label { display: block; margin-bottom: 2px; }
.ncal-picker { background: var(--nx-surface); border: 1px solid var(--nx-win-border); padding: 4px; margin-bottom: 10px; }
.ncal-pk-head { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; font-weight: 600; padding: 2px 0 4px; }
.ncal-pk-head button { border: 0; background: transparent; cursor: pointer; color: var(--nx-win-muted); padding: 2px 6px; font-size: 10px; }
.ncal-pk-head button:hover { color: var(--nx-blue-dark); }
.ncal-pk-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.ncal-pk-dow { text-align: center; font-size: 9.5px; color: var(--nx-win-muted); text-transform: uppercase; padding: 2px 0; }
.ncal-pk-d { border: 0; background: transparent; font-size: 10.5px; padding: 3px 0; cursor: pointer; color: var(--nx-win-text); font-family: inherit; }
.ncal-pk-d:hover { background: var(--nx-hover); }
.ncal-pk-d.is-other { color: #aab2bd; }
.ncal-pk-d.is-range { background: var(--nx-blue-bg); }
.ncal-pk-d.is-today { font-weight: 700; color: var(--nx-blue-dark); }
.ncal-pk-d.is-sel { background: var(--nx-blue); color: #fff; }
.ncal-cal { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 12px; cursor: pointer; }
.ncal-cal input { margin: 0; }
.ncal-cal.is-off .ncal-cal-t { color: var(--nx-win-muted); }
.ncal-sw { width: 12px; height: 12px; flex: none; border: 1px solid rgba(0,0,0,0.15); }
.ncal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ncal-bar { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--nx-win-border); background: var(--nx-surface); flex-wrap: wrap; }
.ncal-bar .nw-btn { padding: 3px 9px; font-size: 11.5px; }
.ncal-bar .nw-btn.is-on { background: var(--nx-blue); border-color: var(--nx-blue); color: #fff; font-weight: 600; }
.ncal-title { font-size: 14px; font-weight: 600; margin: 0 8px; }
.ncal-views { margin-left: auto; display: inline-flex; }
.ncal-views .nw-btn + .nw-btn { margin-left: -1px; }
.ncal-view { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.ncal-view.is-loading::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,0.55); z-index: 7; }
/* griglia oraria (giorno / settimana) */
.ncal-tg { display: flex; flex-direction: column; height: 100%; }
.ncal-gutter { width: 48px; flex: none; position: relative; }
.ncal-tg-head { display: flex; border-bottom: 1px solid var(--nx-win-border); background: var(--nx-tile); }
.ncal-dh { flex: 1; text-align: center; padding: 5px 0; font-size: 11.5px; border-left: 1px solid var(--nx-tile-border); cursor: pointer; text-transform: lowercase; }
.ncal-dh:hover { text-decoration: underline; }
.ncal-dh.is-today { color: var(--nx-blue-dark); font-weight: 700; box-shadow: inset 0 -2px 0 var(--nx-blue); }
.ncal-tg-allday { display: flex; border-bottom: 2px solid var(--nx-win-border); }
.ncal-ad { flex: 1; position: relative; min-height: 20px; max-height: 128px; overflow-y: auto; }
.ncal-ad-col { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--nx-tile-border); }
.ncal-bar-ev { position: absolute; height: 18px; line-height: 14px; font-size: 11px; padding: 0 5px; border-width: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; box-sizing: border-box; }
.ncal-tg-body { flex: 1; min-height: 0; overflow-y: scroll; }
.ncal-tg-inner { display: flex; position: relative; }
.ncal-hour { position: absolute; right: 6px; transform: translateY(-50%); font-size: 10px; color: var(--nx-win-muted); font-family: ui-monospace, Menlo, Consolas, monospace; }
.ncal-hour:first-child { transform: none; }
.ncal-cols { flex: 1; display: flex; position: relative; }
.ncal-col { flex: 1; position: relative; border-left: 1px solid var(--nx-tile-border); background-image: linear-gradient(to bottom, #e9edf2 1px, transparent 1px); }
.ncal-col.is-today { background-color: #f6f9fd; }
.ncal-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--nx-red); z-index: 3; pointer-events: none; }
.ncal-ev { position: absolute; box-sizing: border-box; border-width: 2px; padding: 1px 4px; font-size: 11px; line-height: 1.25; overflow: hidden; cursor: pointer; z-index: 2; }
.ncal-ev:hover { z-index: 4; box-shadow: 0 2px 8px rgba(20,40,70,0.3); }
.ncal-ev-t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ncal-ev-d { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.9; }
.ncal-ev.is-movable { cursor: grab; touch-action: none; }
.ncal-ev.is-dragging { opacity: 0.8; z-index: 5; cursor: grabbing; box-shadow: 0 4px 14px rgba(20,40,70,0.4); }
.ncal-ev-rs { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; cursor: ns-resize; }
/* mese */
.ncal-month { display: flex; flex-direction: column; height: 100%; }
.ncal-mh { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--nx-tile); border-bottom: 1px solid var(--nx-win-border); }
.ncal-mh div { text-align: center; font-size: 11px; padding: 5px 0; text-transform: lowercase; color: var(--nx-win-muted); }
.ncal-mgrid { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); min-height: 0; }
.ncal-mcell { border-right: 1px solid var(--nx-tile-border); border-bottom: 1px solid var(--nx-tile-border); overflow: hidden; padding: 2px 3px; min-height: 0; }
.ncal-mcell.is-other { background: #fafbfc; }
.ncal-mcell.is-other .ncal-mday { color: #aab2bd; }
.ncal-mcell.is-today { background: #f0f6fd; }
.ncal-mday { border: 0; background: transparent; font-size: 11px; padding: 0 3px; cursor: pointer; font-family: inherit; color: var(--nx-win-text); }
.ncal-mcell.is-today .ncal-mday { background: var(--nx-blue); color: #fff; font-weight: 700; }
.ncal-mday:hover { text-decoration: underline; }
.ncal-mev { height: 15px; line-height: 11px; margin-top: 2px; font-size: 10.5px; padding: 0 4px; border-width: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; box-sizing: border-box; }
.ncal-more { border: 0; background: transparent; color: var(--nx-blue-dark); font-size: 10.5px; padding: 1px 2px; cursor: pointer; font-family: inherit; }
/* modali (dettaglio task/assenza, programmazione) */
.ncal-dlg { max-height: 68vh; overflow: auto; }
.ncal-info { margin: 0 0 8px; line-height: 1.5; }
.ncal-info a, .ncal-news a { color: var(--nx-blue-dark); }
.ncal-testo { width: 100%; border: 1px solid var(--nx-win-border); background: var(--nx-tile); padding: 5px 6px; font-size: 12px; font-family: inherit; resize: vertical; }
.ncal-part { margin: 6px 0; }
.ncal-news { margin: 5px 0; border: 1px solid var(--nx-win-border); padding: 8px 10px; display: flex; gap: 8px; }
.ncal-news-pic { width: 25px; flex: none; color: var(--nx-blue-dark); }
.ncal-news-pic i.fa-2x { font-size: 20px; }
.ncal-news-content { flex: 1; min-width: 0; }
.ncal-news-title { font-weight: 600; }
.ncal-news-small { font-size: 11px; color: var(--nx-win-muted); }
.ncal-news-author { color: var(--nx-win-text); }
.ncal-news-par { margin-top: 4px; }
.ncal-prog .ncal-disp { min-height: 26px; padding: 5px 6px; background: var(--nx-tile); border: 1px solid var(--nx-tile-border); font-size: 12px; }
.ncal-prog textarea[readonly] { background: var(--nx-tile); }
.ncal-radio { display: flex; gap: 16px; }
.ncal-prog input, .ncal-prog textarea { box-sizing: border-box; }
.ncal-prog .ncal-radio label.nt-check { display: inline-flex; margin: 2px 0; }
/* calendario sul telefono (CalDAV) */
.ncal-dav-btn { position: relative; margin-left: 4px; }
.ncal-dav-btn .ncal-dav-i { position: absolute; right: 2px; top: 1px; font-size: 8px; color: var(--nx-blue-dark); }
.ncal-dav { font-size: 12px; }
.ncal-dav ol { margin: 4px 0 0; padding-left: 18px; }
.ncal-dav ol li { margin-bottom: 3px; }
.ncal-dav-val { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ncal-dav-val code { font-size: 11.5px; background: var(--nx-tile); border: 1px solid var(--nx-tile-border); padding: 2px 6px; word-break: break-all; color: var(--nx-text); }
.ncal-dav-data td:first-child { width: 150px; white-space: nowrap; }
.ncal-dav-token { background: var(--nx-green-bg); color: var(--nx-green); border: 1px solid #b9d9c0; padding: 8px 10px; margin-bottom: 10px; }
.ncal-dav-token .ncal-dav-val { margin-top: 6px; }
.ncal-dav-token code { font-size: 14px; font-weight: 700; letter-spacing: 0.04em; }
.ncal-dav-new { display: flex; gap: 6px; margin: 4px 0 8px; }
.ncal-dav-new .nw-input { max-width: 320px; }
.ncal-dav-tokens tr.is-revoked td { color: var(--nx-win-muted); text-decoration: line-through; }
.ncal-dav-tokens tr.is-revoked td:last-child { text-decoration: none; }
.ncal-dav-guides { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.ncal-dav-guide { border: 1px solid var(--nx-tile-border); background: var(--nx-tile); padding: 8px 10px; }
.ncal-dav-guide .nw-caption { margin-top: 0; font-size: 11px; }
.ncal-dav-cals { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.ncal-dav-cals span { display: inline-flex; align-items: center; gap: 5px; }
.ncal-dav-cals .ncal-sw { display: inline-block; }
@media (max-width: 768px) { .ncal-dav-guides { grid-template-columns: 1fr; } }

/* ---------------- Radar Opportunità PA (vapp radar_pa) ---------------- */
.rp-filtri { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--nx-win-border); }
.rp-filtri input[type="text"] { border: 1px solid var(--nx-win-border); background: var(--nx-surface); font-size: 11px; padding: 3px 6px; height: 24px; min-width: 200px; flex: 1; font-family: inherit; }
.rp-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; white-space: nowrap; }
.rp-stati { border-bottom: 1px solid var(--nx-win-border); }
.rp-taglio { display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 11px;
             background: #fff8e1; border-bottom: 1px solid var(--nx-win-border); }

/* tabella dei risultati
   Larghezze fisse + overflow controllato: senza, un URL lungo o un nome di ente
   senza spazi sbordava sopra la colonna delle azioni.
   Il wrapper è un CONTAINER: le colonne si nascondono in base alla larghezza
   della FINESTRA, non del viewport — qui le finestre si ridimensionano a mano. */
.rp-wrap { container-type: inline-size; }
.rp-tab { table-layout: fixed; width: 100%; }
.rp-tab th, .rp-tab td { overflow: hidden; text-overflow: ellipsis; vertical-align: top; }
.rp-tab .rp-c-data   { width: 96px; white-space: nowrap; }
.rp-tab .rp-c-prov   { width: 68px; text-align: center; }
.rp-tab .rp-c-ente   { width: 260px; word-break: break-word; }
.rp-tab .rp-c-testo  { width: auto; }
.rp-tab .rp-c-az     { width: 132px; white-space: nowrap; text-align: right; overflow: visible; }
.rp-tab tr.is-ko     { opacity: .5; }
.rp-tab tr.is-hidden { opacity: .45; }

/* il testo del risultato è il link alla pagina: leggibile come testo, non un muro di blu */
a.rp-testo { font-size: 11px; line-height: 1.4; color: inherit; text-decoration: none; word-break: break-word; }
.rp-reg  { font-weight: 600; }
.rp-nota { color: #666; }
.rp-reg + .rp-nota::before { content: " · "; color: #aaa; font-weight: 400; }
a.rp-testo:hover { color: var(--nx-accent, #0b5cab); text-decoration: underline; }
a.rp-testo:visited { color: inherit; }

/* badge dei doppioni raggruppati */
.rp-dup { display: inline-block; margin-left: 5px; white-space: nowrap; font-size: 10px; font-weight: 600; color: #8a6d00;
          background: #fff3cd; border: 1px solid #e6d28a; padding: 0 3px; vertical-align: text-top; }

/* maniglia di ridimensionamento delle colonne (<table data-resizable>) */
.nw-table th { position: relative; }
.nw-grip { position: absolute; top: 0; right: 0; width: 7px; height: 100%; cursor: col-resize;
           user-select: none; touch-action: none; z-index: 2; }
.nw-grip:hover { background: var(--nx-accent, #0b5cab); opacity: .35; }
table.is-resizing { user-select: none; cursor: col-resize; }
table.is-resizing .nw-grip { background: var(--nx-accent, #0b5cab); opacity: .5; }

.rp-ente { font-weight: 600; text-decoration: none; }
.rp-ente:hover { text-decoration: underline; }
.rp-re { font-size: 10px; background: #eef0f3; border: 1px solid var(--nx-win-border); padding: 0 4px;
         font-family: var(--nx-mono, monospace); color: #555; word-break: break-all; }
.rp-c-az .nw-btn { margin-left: 2px; }
.rp-c-az .nw-btn.is-on { background: var(--nx-accent, #0b5cab); color: #fff; border-color: var(--nx-accent, #0b5cab); }

/* finestra stretta: si tolgono prima le colonne meno utili a colpo d'occhio.
   La regola resta comunque leggibile nel tooltip del risultato. */
@container (max-width: 1040px) {
    .rp-tab .rp-c-ente { width: 220px; }
    .rp-tab .rp-nota { display: none; }   /* resta il nome della regola */
}
@container (max-width: 880px) {
    .rp-tab .rp-c-ente { width: 170px; }
    .rp-tab .rp-c-az .nw-btn i { margin: 0; }
    .rp-tab .rp-c-az .nw-btn span, .rp-tab .rp-c-az .rp-lbl { display: none; }
    .rp-tab .rp-c-az { width: 92px; }
}
@container (max-width: 680px) {
    .rp-tab .rp-c-data { width: 78px; font-size: 10px; }
    .rp-tab .rp-c-ente { width: 130px; }
}

/* tabella delle regole */
.rp-tab-reg td { vertical-align: top; }
.rp-tab-reg tr.is-off { opacity: .55; }
.rp-tab-reg .rp-c-az { white-space: nowrap; text-align: right; }

/* editor di una regola */
.rp-form-r { display: flex; gap: 10px; flex-wrap: wrap; }
.rp-form-r label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; flex: 1; min-width: 220px; }
.rp-form input[type="text"] { border: 1px solid var(--nx-win-border); background: var(--nx-surface); font-size: 11px; padding: 4px 6px; font-family: inherit; }
.rp-ta { width: 100%; border: 1px solid var(--nx-win-border); background: var(--nx-surface); font-family: var(--nx-mono, monospace);
         font-size: 11px; line-height: 1.5; padding: 6px; resize: vertical; }
.rp-form-opt { display: flex; gap: 16px; margin-top: 10px; }
.rp-form-az { display: flex; gap: 8px; margin-top: 12px; }

/* scansioni */
.rp-new { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.rp-new label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; }
.rp-new label.rp-chk { flex-direction: row; align-items: center; }
.rp-run { border: 1px solid var(--nx-win-border); padding: 8px 10px; background: #f8fafc; }
.rp-run-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rp-run-h .nw-btn { margin-left: auto; }
.rp-run-n { display: flex; gap: 14px; font-size: 11px; margin-top: 5px; }

/* migrazione */
.rp-step { border-left: 3px solid var(--nx-accent, #0b5cab); padding: 4px 0 4px 8px; margin: 8px 0; }
.rp-step-t { font-weight: 600; font-size: 11px; }
.rp-step-b { font-size: 11px; line-height: 1.5; color: #444; }
.rp-ddl { font-family: var(--nx-mono, monospace); font-size: 10px; line-height: 1.45; background: #1e1e1e; color: #d6d6d6;
          padding: 10px; overflow: auto; max-height: 420px; white-space: pre; }

/* avviso non bloccante delle azioni ([data-action]) */
.nw-toast { position: fixed; right: 16px; bottom: 52px; z-index: 99999; background: #24303f; color: #fff;
            font-size: 11px; padding: 8px 12px; max-width: 380px; box-shadow: 0 4px 14px rgba(0,0,0,.28);
            transition: opacity .5s, transform .5s; }
.nw-toast.is-err { background: #9b2226; }
.nw-toast.is-out { opacity: 0; transform: translateY(6px); }

/* riga dei filtri per colonna (<table data-colfilter>) */
.nw-colfilter th { padding: 3px 4px !important; background: #f6f7f9; }
.nw-colfilter input, .nw-colfilter select { width: 100%; box-sizing: border-box; font-size: 10px;
    font-family: inherit; padding: 2px 4px; border: 1px solid var(--nx-win-border); background: var(--nx-surface); height: 22px; }
.nw-colfilter input::-webkit-search-cancel-button { cursor: pointer; }

/* banco di prova delle regole */
.rp-prova { display: flex; gap: 8px; align-items: center; }
.rp-prova input { flex: 1; border: 1px solid var(--nx-win-border); background: var(--nx-surface); font-size: 11px;
                  padding: 5px 7px; font-family: inherit; }
.rp-prova-r { border-bottom: 1px solid var(--nx-win-border); padding: 7px 10px; }
.rp-prova-r.is-hit { background: #f2fbf4; }
.rp-prova-h { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.rp-prova-a { margin-left: auto; }
.rp-prova-x { margin: 5px 0 0 14px; }
.rp-prova-m { font-size: 11px; line-height: 1.45; margin: 3px 0 0 10px; }
.rp-re.is-hit { background: #d8f3dd; border-color: #9ad2a6; color: #14532d; }

/* anagrafica degli enti */
.rp-tab-enti td { vertical-align: top; }
.rp-tab-enti tr.is-off { opacity: .5; }
.rp-tab-enti .rp-c-az { white-space: nowrap; text-align: right; }

/* dettaglio di una scansione */
.rp-errfam { font-size: 11px; padding: 3px 0; display: flex; gap: 7px; align-items: center; }
.rp-tab-sess td a { text-decoration: none; }
.rp-tab-sess td a:hover { text-decoration: underline; }
.rp-tab-sess tbody tr:hover { background: var(--nx-hover, #f6f7f9); }
/* Select2 multiplo delle regole.
   Il tema bootstrap-5 imposta font 16px e padding generosi con selettori molto
   specifici: per rientrare nella densità di next (font 11px) servono regole
   altrettanto specifiche, ancorate a .select2-container--bootstrap-5. */
.rp-regole { min-width: 250px; }
.rp-regole .select2-container--bootstrap-5 { font-size: 11px; }
.rp-regole .select2-container--bootstrap-5 .select2-selection {
    min-height: 26px; border: 1px solid var(--nx-win-border); border-radius: 0; padding: 1px 3px; }
.rp-regole .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered {
    gap: 3px; padding: 0; }
.rp-regole .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice {
    font-size: 10px; line-height: 1.5; padding: 0 4px 0 0; margin: 1px 0; border-radius: 0;
    background: #eef2f7; border: 1px solid var(--nx-win-border); color: #24303f; }
.rp-regole .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice__remove {
    padding: 0 4px; margin-right: 3px; border-right: 1px solid var(--nx-win-border); background: transparent; }
.rp-regole .select2-container--bootstrap-5 .select2-search--inline .select2-search__field {
    font-size: 10px; margin-top: 2px; height: 18px; }
/* la tendina è appesa al body: si stringe anche lei */
.select2-container--bootstrap-5 .select2-dropdown { font-size: 11px; border-radius: 0; }
.select2-container--bootstrap-5 .select2-results__option { padding: 3px 8px; }

/* evidenziazione del match nel banco di prova delle regole */
.rp-prova-m mark.rp-mk { background: #fff3b0; color: inherit; padding: 0 1px; }
.rp-prova-m .rp-mk-forte { background: #ffd54a; font-weight: 700; padding: 0 2px; border-radius: 2px; }
.nw-foot mark.rp-mk { background: #fff3b0; padding: 0 2px; }
.nw-foot .rp-mk-forte { background: #ffd54a; font-weight: 700; padding: 0 2px; }

/* richiesta di un valore dentro la modale (data-action-prompt) */
.nw-prompt { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.nw-prompt input { border: 1px solid var(--nx-win-border); background: var(--nx-surface); font-size: 12px;
                   padding: 6px 8px; font-family: inherit; }
.rp-tab-preset td { vertical-align: middle; }
.rp-tab-preset .rp-c-az { white-space: nowrap; text-align: right; }

/* tooltip con contenuto formattato (data-tip-html) */
.next-tip.is-rich { max-width: 520px; }
.next-tip.is-rich p { color: var(--nx-text); }
.next-tip .rp-tip-t { line-height: 1.5; margin-bottom: 6px; }
.next-tip .rp-tip-u { font-family: var(--nx-mono, monospace); font-size: 10px; color: var(--nx-accent, #0b5cab);
                      word-break: break-all; margin-bottom: 6px; }
.next-tip .rp-tip-m { font-size: 10px; color: var(--nx-muted, #6b7482); border-top: 1px solid var(--nx-win-border); padding-top: 5px; }
.next-tip .rp-tip-m code { font-size: 10px; word-break: break-all; }
.next-tip mark.rp-mk { background: #fff3b0; color: inherit; padding: 0 1px; }
.next-tip .rp-mk-forte { background: #ffd54a; font-weight: 700; padding: 0 2px; border-radius: 2px; }
.rp-tab-preset tr.is-edit { background: #fff8e1; box-shadow: inset 3px 0 0 var(--nx-accent, #0b5cab); }

/* Finestra aperta in sola lettura (profilo) */
.nw-ro { display: flex; align-items: baseline; gap: 8px; padding: 5px 12px; background: var(--nx-amber-bg); color: var(--nx-amber); border-bottom: 1px solid var(--nx-win-border); font-size: 11.5px; }
.nw-ro small { opacity: 0.85; }
.nw-ro-off { opacity: 0.45; cursor: not-allowed !important; pointer-events: none; }

/* ---- aiuto contestuale: icona "?" accanto alle etichette (data-help) con tooltip proprio (JS in next-desk.js) ---- */
.nw-help { color: var(--nx-win-muted, #6b7785); font-size: 11px; cursor: help; margin-left: 2px; outline: none; }
.nw-help:hover, .nw-help:focus { color: var(--nx-blue-dark, #1f5fa8); }
.nw-help-tip { position: fixed; z-index: 2147483000; max-width: 340px; background: #1f2a37; color: #fff; padding: 9px 11px; font-size: 12px; line-height: 1.45; border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.3); pointer-events: none; text-transform: none; letter-spacing: 0; font-family: inherit; }
[data-modo][hidden] { display: none !important; }

/* Riquadro "a cosa serve" in fondo alle vapp operative (procedure, certificati, to-do, documenti) */
.nw-foot.nw-explain { white-space: normal; line-height: 1.5; padding: 10px 14px; font-size: 12px; border-top: 1px solid var(--nx-win-border); background: var(--nx-row-alt); }
.nw-foot.nw-explain strong { color: var(--nx-win-text); }
