/*
 * La simulazione di XenConsole: la shell «1+3» del prodotto (src/XenConsole.Web/src/app/AppShell.tsx)
 * sopra la base comune delle simulazioni della piattaforma (../platform/shell.css), che porta i token
 * del canone UI di Corellix, gli stessi di XenConsole: colori, carattere, controlli, tabelle, badge.
 *
 * Qui solo quello che e' di XenConsole: la barra globale scura con le cinque sezioni, la ricerca e lo
 * stato «In tempo reale»; il pannello a sinistra con l'albero dell'inventario; il percorso con le
 * azioni della pagina; le attivita' recenti e la barra di stato dei pool; e le pagine che la visita
 * guidata apre. Le classi cominciano con «xc-».
 */

.xc { display: flex; flex-direction: column; height: 100%; overflow: hidden; background: var(--canvas); color: var(--ink); position: relative; }

/* ---------------------------------------------------------------- la barra globale (gray-900) */
.xc-bar { position: relative; display: flex; align-items: center; gap: 8px; height: 48px; flex-shrink: 0; padding: 0 12px; background: #111827; color: #F3F4F6; }
.dark .xc-bar { background: #000; }
.xc-brand { display: flex; align-items: center; gap: 8px; padding-right: 12px; color: #fff; font-size: 15px; font-weight: 600; white-space: nowrap; }
.xc-brand svg { width: 28px; height: 28px; }
.xc-brand b { color: #34D399; font-weight: 600; }
.xc-sections { display: flex; align-self: stretch; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.xc-sections button { display: flex; align-items: center; padding: 0 12px; border-bottom: 2px solid transparent; color: #D1D5DB; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.xc-sections button:hover { color: #fff; }
.xc-sections button.on { border-bottom-color: #5F79C6; color: #fff; }
.xc-count { margin-left: 6px; padding: 0 6px; border-radius: 999px; background: #3B55AD; color: #fff; font-size: 10px; font-weight: 600; line-height: 16px; }
.xc-search { position: relative; flex: 1; min-width: 0; max-width: 420px; margin-left: 12px; }
.xc-search svg.i { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: #9CA3AF; pointer-events: none; }
.xc-search input { width: 100%; height: 30px; padding: 0 52px 0 30px; border: 1px solid #374151; border-radius: 4px; background: rgba(31, 41, 55, 0.8); color: #F3F4F6; font-size: 13px; }
.xc-search input::placeholder { color: #9CA3AF; }
.xc-search input:focus { border-color: #5F79C6; }
.xc-search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 0 4px; border: 1px solid #4B5563; border-radius: 3px; color: #9CA3AF; font-family: inherit; font-size: 10px; line-height: 14px; pointer-events: none; }
.xc-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; padding: 4px 0; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.xc-results button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 12px; text-align: left; font-size: 13px; }
.xc-results button:hover { background: var(--surface-2); }
.xc-live { display: flex; align-items: center; gap: 6px; margin-left: auto; padding: 2px 10px; border: 1px solid #15803D; border-radius: 999px; background: #052E16; color: #86EFAC; font-size: 11.5px; white-space: nowrap; }
.xc-live i { width: 6px; height: 6px; border-radius: 50%; background: #4ADE80; }
.xc-barbtn { position: relative; display: flex; flex-shrink: 0; align-items: center; gap: 4px; padding: 7px; border-radius: 4px; color: #D1D5DB; font-size: 11.5px; }
.xc-barbtn:hover { background: #1F2937; color: #fff; }
.xc-barbtn .xc-dotcount { position: absolute; right: 1px; top: 1px; padding: 0 4px; border-radius: 999px; font-size: 9px; font-weight: 700; line-height: 13px; color: #fff; }
.xc-avatar { display: flex; flex-shrink: 0; align-items: center; justify-content: center; width: 30px; height: 30px; margin-left: 2px; border-radius: 50%; background: #172B6B; color: #fff; font-size: 11.5px; font-weight: 600; }

/* ---------------------------------------------------------------- corpo: pannello e colonna */
.xc-body { display: flex; flex: 1; min-height: 0; }
.xc-side { display: flex; flex-direction: column; width: 248px; flex-shrink: 0; border-right: 1px solid var(--line); background: var(--surface); }
.xc-side-head { padding: 12px 12px 8px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.xc-side-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.xc-side-nav button { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 4px; color: var(--ink-2); font-size: 13px; text-align: left; }
.xc-side-nav button svg { color: var(--faint); }
.xc-side-nav button:hover { background: var(--surface-2); }
.xc-side-nav button.on { background: var(--p50); color: var(--p-ink); font-weight: 600; }
.xc-side-foot { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding: 8px; border-top: 1px solid var(--line); }
.xc-side-foot .btn { width: 100%; justify-content: center; }

.xc-treetabs { display: flex; border-bottom: 1px solid var(--line); }
.xc-treetabs button { display: flex; flex: 1; align-items: center; justify-content: center; padding: 8px 0; border-bottom: 2px solid transparent; color: var(--faint); }
.xc-treetabs button.on { border-bottom-color: var(--p600); color: var(--p-ink); }
.xc-treetabs button:hover { color: var(--ink-2); }
.xc-treefilter { padding: 8px; }
.xc-treefilter .input { height: 28px; font-size: 12px; }
.xc-tree { flex: 1; min-height: 0; overflow-y: auto; padding: 0 4px 8px; font-size: 13px; }
.xc-node { display: flex; width: 100%; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 3px; color: var(--ink-2); text-align: left; white-space: nowrap; }
.xc-node:hover { background: var(--surface-2); }
.xc-node.on { background: var(--p50); color: var(--p-ink); font-weight: 600; }
.xc-node .chev { width: 14px; height: 14px; color: var(--faint); }
.xc-node .gap { width: 14px; flex-shrink: 0; }
.xc-node .lbl { overflow: hidden; text-overflow: ellipsis; }
.xc-node .xc-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.xc-node.lvl1 { padding-left: 18px; }
.xc-node.lvl2 { padding-left: 34px; }
.xc-dot.run { background: #22C55E; }
.xc-dot.off { background: #9CA3AF; }
.xc-dot.sus { background: #F59E0B; }
.xc-node .xc-tag { margin-left: auto; color: var(--faint); font-size: 10.5px; }

.xc-main { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.xc-head { flex-shrink: 0; border-bottom: 1px solid var(--line); background: var(--surface); }
.xc-crumbs { display: flex; min-height: 44px; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 4px 12px; font-size: 13.5px; }
.xc-crumbs .sec { color: var(--muted); }
.xc-crumbs .sep { color: var(--line); }
.xc-crumbs .pg { font-weight: 600; }
.xc-crumbs .sub { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.xc-crumbs .acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.xc-vmtabs { display: flex; gap: 18px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.xc-vmtabs button { display: flex; align-items: center; gap: 6px; margin-bottom: -1px; padding: 8px 0; border-bottom: 2px solid transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.xc-vmtabs button.on { border-bottom-color: var(--p600); color: var(--ink); }
.dark .xc-vmtabs button.on { border-bottom-color: var(--p300); }
.xc-page { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; }

/* ---------------------------------------------------------------- attivita' recenti e barra di stato */
/* Gli avvisi a comparsa sopra le attivita' recenti e la barra di stato, non sopra la loro barra di avanzamento. */
.xc .toasts { bottom: 104px; }
.xc-tasks { flex-shrink: 0; border-top: 1px solid var(--line); background: var(--surface); font-size: 12.5px; }
.xc-tasks-head { display: flex; align-items: center; gap: 8px; padding: 5px 12px; color: var(--ink-3); font-weight: 600; }
.xc-tasks-head .muted { font-weight: 400; }
.xc-task { display: grid; grid-template-columns: 170px minmax(0, 1fr) 150px 90px; align-items: center; gap: 10px; padding: 4px 12px; border-top: 1px solid var(--line-soft); }
.xc-task .bar { height: 5px; }
.xc-status { display: flex; flex-shrink: 0; flex-wrap: wrap; align-items: center; gap: 4px 18px; padding: 4px 12px; background: #111827; color: #9CA3AF; font-size: 11.5px; }
.dark .xc-status { background: #000; }
.xc-status .ok { color: #86EFAC; }
.xc-status b { color: #E5E7EB; font-weight: 600; }
.xc-status .ver { margin-left: auto; }

/* ---------------------------------------------------------------- pagine */
.xc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.xc-kpi { display: flex; gap: 12px; padding: 12px 14px; }
.xc-kpi.click { cursor: pointer; }
.xc-kpi.click:hover { border-color: var(--p300); }
.xc-kpi .ico { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 4px; background: var(--p50); color: var(--p600); }
.xc-kpi .val { font-size: 20px; font-weight: 600; line-height: 1.2; }
.xc-kpi .lbl { color: var(--muted); font-size: 12px; }
.xc-kpi .sub { margin-top: 2px; color: var(--faint); font-size: 11.5px; }
.xc-kpi.warn .ico { background: var(--warn-bg); color: var(--warn); }
.xc-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; align-items: start; }
.xc-gauge { padding: 12px 14px; }
.xc-gauge .row { justify-content: space-between; margin-bottom: 8px; }
.xc-gauge .big { font-size: 18px; font-weight: 600; }
.xc-gauge .bar { height: 8px; }
.xc-gauge .foot { margin-top: 6px; color: var(--faint); font-size: 11.5px; }
.xc-mb { margin-bottom: 12px; }
.xc-list { margin: 0; padding: 0; list-style: none; }
.xc-list li { display: flex; align-items: center; gap: 10px; padding: 7px 14px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.xc-list li:first-child { border-top: 0; }
.xc-mosaic { display: flex; flex-wrap: wrap; gap: 4px; padding: 12px 14px; }
.xc-mosaic button { width: 22px; height: 22px; border-radius: 3px; }
.xc-mosaic .run { background: #22C55E; }
.xc-mosaic .off { background: #D0D5DD; }
.dark .xc-mosaic .off { background: #4B5563; }
.xc-mosaic .sus { background: #F59E0B; }
.xc-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 0 14px 12px; color: var(--muted); font-size: 11.5px; }
.xc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.xc-legend i { width: 9px; height: 9px; border-radius: 2px; }
.xc-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.xc-filters .input { width: 260px; height: 30px; }
.xc-dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 7px 12px; padding: 12px 14px; margin: 0; font-size: 13px; }
.xc-dl dt { color: var(--muted); }
.xc-dl dd { margin: 0; }
.xc-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border: 1px solid var(--warn-line); border-radius: 4px; background: var(--warn-bg); color: var(--warn-ink); font-size: 12.5px; }

/* La console della VM: lo schermo che noVNC disegnerebbe. */
.xc-consolebar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.xc-screen { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; aspect-ratio: 16 / 9; max-height: 430px; border-radius: 4px; background: #0B2E59; color: #E5E7EB; overflow: hidden; }
.xc-screen.linux { align-items: flex-start; justify-content: flex-start; padding: 16px 18px; background: #0A0A0A; color: #D4D4D4; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.xc-screen .clock { font-size: 54px; font-weight: 300; line-height: 1; }
.xc-screen .date { margin-top: 6px; font-size: 16px; }
.xc-screen .hint { position: absolute; bottom: 22px; font-size: 12.5px; opacity: 0.85; }
.xc-caret { display: inline-block; width: 8px; height: 15px; margin-left: 1px; vertical-align: -2px; background: #D4D4D4; animation: xc-blink 1s steps(1) infinite; }
@keyframes xc-blink { 50% { opacity: 0; } }

/* Gli snapshot: l'albero da sinistra a destra, con il percorso verso lo stato attuale in verde. */
.xc-snaps { display: flex; align-items: center; gap: 0; padding: 18px 14px; overflow-x: auto; }
.xc-snap { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 116px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); font-size: 12px; text-align: center; }
.xc-snap.base { border-style: dashed; color: var(--muted); }
.xc-snap.now { border-color: #16A34A; color: #166534; font-weight: 600; }
.dark .xc-snap.now { color: #86EFAC; }
.xc-snap .xs { color: var(--faint); font-weight: 400; }
.xc-link { width: 26px; height: 2px; flex-shrink: 0; background: var(--line); }
.xc-link.ok { background: #16A34A; }

/* La memoria dell'host, con i colori di XenCenter (app/shinyBar.ts, decisione del 01/11/2026). */
.xc-shiny { display: flex; height: 26px; overflow: hidden; border: 1px solid var(--line); border-radius: 3px; background: var(--surface-2); }
.xc-shiny span { display: block; min-width: 0; overflow: hidden; padding: 0 3px; color: #fff; font-size: 10.5px; line-height: 26px; text-align: center; white-space: nowrap; text-overflow: ellipsis; }
.xc-shiny .xen { background: #A9A9A9; color: #111827; }
.xc-shiny .dom0 { background: #696969; }
.xc-shiny .vm0 { background: #191970; }
.xc-shiny .vm1 { background: #4682B4; }
.dark .xc-shiny span { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3); }
.xc-memrow { display: grid; grid-template-columns: 120px minmax(0, 1fr) 110px; align-items: center; gap: 12px; padding: 9px 14px; border-top: 1px solid var(--line-soft); font-size: 12.5px; }
.xc-memrow:first-of-type { border-top: 0; }
.xc-memfacts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0 14px 12px; font-size: 12px; }
.xc-memfacts b { display: block; font-size: 14px; }

/* La finestra della migrazione e quella della conversione: scelte come pulsanti, non tendine. */
.xc-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.xc-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 10px; border: 1px solid var(--input-line); border-radius: 4px; background: var(--surface); font-size: 12.5px; text-align: left; }
.xc-choice .xs { color: var(--faint); }
.xc-choice.on { border-color: var(--p500); background: var(--p50); color: var(--p-ink); box-shadow: 0 0 0 1px var(--p500); }
.xc-choice:disabled { opacity: 0.5; }
.xc-lbl { display: block; margin: 0 0 6px; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.xc-check { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 4px; background: var(--ok-bg); color: var(--ok-ink); font-size: 12.5px; }
.xc-vmpick { width: 100%; }
.xc-vmpick td:first-child { width: 28px; }
.xc-box { display: inline-flex; width: 15px; height: 15px; align-items: center; justify-content: center; border: 1px solid var(--input-line); border-radius: 3px; background: var(--surface); }
.xc-box.on { border-color: var(--p600); background: var(--p600); color: #fff; }

/* La replica e il backup. */
.xc-log { max-height: 150px; margin: 0; padding: 10px 14px; overflow-y: auto; border-top: 1px solid var(--line-soft); background: var(--surface-2); font: 11.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; }
.xc-points { display: flex; align-items: flex-end; gap: 6px; height: 76px; padding: 12px 14px 0; }
.xc-points button { flex: 1; min-width: 8px; border-radius: 2px 2px 0 0; background: var(--p300); }
.xc-points button.full { background: var(--p600); }
.xc-points button.on { outline: 2px solid #F59E0B; outline-offset: 1px; }

/* La finestra resta larga quanto lo spazio che c'e', anche in una simulazione stretta. */
.xc .modal { min-width: 0; }
.xc-about { text-align: center; }
.xc-about svg { width: 56px; height: 56px; margin: 4px auto 10px; }

/* ---------------------------------------------------------------- larghezze */
/* Nell'iframe della pagina, largo poco piu' di 1100 pixel, la ricerca resta leggibile: lo stato
   «In tempo reale» lascia il posto prima. */
@media (max-width: 1240px) {
    .xc-live, .xc-search kbd { display: none; }
}
@media (max-width: 1100px) {
    .xc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .xc-side { width: 210px; }
    .xc-grid2 { grid-template-columns: minmax(0, 1fr); }
    .xc-sections button { padding: 0 8px; }
    .xc-search { display: none; }
    .xc-task { grid-template-columns: 130px minmax(0, 1fr) 90px; }
    .xc-task .who { display: none; }
}
@media (max-width: 640px) {
    .xc-side { display: none; }
    .xc-brand span { display: none; }
    .xc-avatar, .xc-barbtn[data-act="lang"], .xc-barbtn[data-act="about"] { display: none; }
    .xc-kpis { grid-template-columns: minmax(0, 1fr); }
    .xc-memrow { grid-template-columns: minmax(0, 1fr); }
    .xc-memfacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .xc .overlay { padding: 12px; }
}
