/* LexiVirt Infrastructure Cloud — enterprise console layer.

   Loaded AFTER style.css. style.css owns the token names and the class
   contract the existing pages depend on; this file retunes a few of those
   token VALUES and adds the shell, the navigation and a component set under
   an `lv-` prefix. Nothing here renames an existing class, so every page
   that nodes-vms.js already renders keeps working while it inherits the new
   surface treatment.

   Density is the point. An operator looking at 40 nodes wants rows, not
   cards; the spacing scale below is deliberately tighter than a marketing
   dashboard's, and every radius is small enough that a table still reads as
   a table. */

/* ── Tokens ───────────────────────────────────────────────────────────── */
:root{
  /* Indigo rather than violet: it reads as infrastructure, and it leaves
     violet free for nothing at all, which is the point -- one accent.
     Two tokens, not one, because the accent is asked to do two jobs that
     pull in opposite directions: as a *surface* it has to be dark enough
     that white text on it clears 4.5:1, and as *text* it has to be light
     enough to clear 4.5:1 on a card. One value cannot do both in a dark
     theme. The console is monochrome, like the website: the accent is white
     on dark and black on light, and colour is left to status alone. */
  /* A label on a gradient button is measured against its lightest stop
     (.btn-primary lightens the top to 92% accent + 8% white): the audit
     walks past a gradient to the card underneath and would pass anything. */
  --accent:#f4f4f5;--accent-text:#f4f4f5;--accent-2:#a1a1aa;
  --accent-dim:rgba(255,255,255,.10);--accent-ring:rgba(255,255,255,.42);
  --on-accent:#09090b;

  /* Status colours are muted on purpose. A console where everything is
     saturated teaches operators to stop looking at colour.

     Every value below is the nearest colour to the designer's original, at
     the same hue and saturation, that reaches 4.6:1 against the *darkest*
     text surface it is used on -- measured in the browser across all 27
     pages, not estimated. 4.6 rather than AA's 4.5 leaves room for
     antialiasing and rounding. */
  --success:#2fb37c;--warn:#d99a2b;--danger:#e15971;--info:#4a8ff0;--neutral:#7e889a;
  /* The same three colours as *surfaces* carrying white text, which is the
     opposite requirement to text on a card and cannot be the same value:
     white on #2fb37c is 2.47:1. The buttons that needed these were painting
     hardcoded gradients from the pre-token palette instead -- #2dd4a7,
     #f5a524, #f2555a -- so a "success" button was a colour the design system
     did not contain. Each is the darkest-needed value at which white clears
     4.6:1 on the *lightest* stop of .btn-primary's gradient. */
  --success-solid:#207853;--warn-solid:#8b6219;--danger-solid:#d32645;
  /* Tree glyphs are characters, so they are held to the text threshold
     rather than the 3:1 one for decoration: they were 1.48:1. */
  --tree:#7788a5;

  --sidebar-w:244px;--sidebar-w-collapsed:60px;--header-h:56px;
  --lv-row-h:42px;

  /* Spacing scale -- use these, not ad-hoc pixels.
     The three half-steps exist because the markup already used 6, 10 and 20
     px in 100-odd places and those are real intervals in this design, not
     mistakes. Naming them is what makes the scale honest: an unnamed 6px is
     indistinguishable from a typo, and the next person adds 7. */
  --s1:4px;--s2:8px;--s3:12px;--s4:16px;--s5:24px;--s6:32px;
  --s1h:6px;--s2h:10px;--s4h:20px;
  /* 2px is the vertical padding of a chip -- forcing it to 4 makes every
     status pill visibly taller, so it is named rather than rounded away.
     40px is the breathing room an empty state wants. */
  --s0h:2px;--s7:40px;

  /* The log/terminal surface. Deliberately the same in both themes: a log
     pane and a terminal are a terminal, and an operator reading output does
     not want it to become a white page in light mode. One definition, so the
     release log, the update log and the xterm host cannot drift apart --
     they were three separate literals. */
  --console-bg:#040910;--console-fg:#d7e2ee;--console-ok:#7ee8b8;

  /* Type scale. The markup had 14 distinct font sizes in 343 places --
     10, 11, 11.5, 12, 12.5, 13, 14 and up -- which is not a scale, it is an
     accumulation. Four steps cover every one of those uses below heading
     size, and headings come from h1/h2/h3. */
  --t-xs:11px;--t-sm:12px;--t-md:13px;--t-base:14px;
  /* Above body size. These are headings and metric values; h1/h2/h3 get
     theirs from style.css, these are for the places that set a size inline. */
  --t-lg:16px;--t-xl:18px;--t-2xl:20px;

  --lv-glass:color-mix(in srgb,var(--card) 72%,transparent);
}
:root[data-theme="light"]{
  --accent:#09090b;--accent-text:#09090b;--accent-2:#52525b;
  --on-accent:#fff;
  --accent-dim:rgba(0,0,0,.07);--accent-ring:rgba(0,0,0,.32);
  --success:#127f59;--warn:#986509;--danger:#c93250;--info:#1d63d8;--neutral:#657086;
  --success-solid:#117955;--warn-solid:#916009;--danger-solid:#c93250;
  --tree:#5c7096;
  --lv-glass:color-mix(in srgb,#fff 80%,transparent);
}

/* ── Shell ────────────────────────────────────────────────────────────── */
.layout{display:grid;grid-template-columns:var(--sidebar-w) 1fr;min-height:100vh;transition:grid-template-columns .16s ease}
.layout.lv-collapsed{grid-template-columns:var(--sidebar-w-collapsed) 1fr}
/* Set by the inline <head> script so a collapsed rail never flashes open. */
:root.lv-rail-collapsed .layout{grid-template-columns:var(--sidebar-w-collapsed) 1fr}

.sidebar{
  /* style.css pins this to width:var(--sidebar-w). That wins over the grid
     track, so collapsing the layout moved the column to 60px and left the
     sidebar itself 244px wide, overflowing it. The width comes from the grid
     now; 100% simply fills whichever track the layout gives it. */
  width:100%;min-width:0;
  background:var(--bg-2);border-inline-end:1px solid var(--border);
  display:flex;flex-direction:column;position:sticky;top:0;height:100vh;overflow:hidden
}
.sidebar-logo{
  display:flex;align-items:center;gap:var(--s3);height:var(--header-h);
  padding:0 var(--s4);border-bottom:1px solid var(--border);flex-shrink:0
}
.sidebar-logo .logo-icon{
  width:28px;height:28px;border-radius:7px;flex-shrink:0;display:flex;align-items:center;
  justify-content:center;color:var(--on-accent);background:linear-gradient(140deg,var(--accent),var(--accent-2))
}
.sidebar-logo .logo-icon svg{width:16px;height:16px}
.logo-text h2{font-size:14px;font-weight:650;letter-spacing:-.01em;line-height:1.15;white-space:nowrap}
.logo-text span{font-size:10px;color:var(--muted);letter-spacing:.06em;text-transform:uppercase;white-space:nowrap}

.sidebar-nav{flex:1;overflow-y:auto;overflow-x:hidden;padding:var(--s3) 0 var(--s4)}
.sidebar-nav::-webkit-scrollbar{width:8px}
.sidebar-nav::-webkit-scrollbar-thumb{background:var(--border-2);border-radius:var(--r-xs);border:2px solid var(--bg-2)}
.nav-section{margin-bottom:var(--s1)}
.nav-section-label{
  font-size:10px;font-weight:600;letter-spacing:.09em;text-transform:uppercase;
  color:var(--muted);padding:var(--s3) var(--s4) var(--s2);white-space:nowrap
}
.nav-item{
  display:flex;align-items:center;gap:10px;height:32px;padding:0 var(--s4);margin:0 var(--s2);
  border-radius:7px;color:var(--text-2);text-decoration:none;font-size:13px;position:relative;
  white-space:nowrap;transition:background .12s,color .12s
}
.nav-item:hover{background:var(--card-2);color:var(--text)}
.nav-item.active{background:var(--accent-dim);color:var(--text);font-weight:550}
/* The active marker is a bar on the rail, not a filled pill: it survives a
   dense list without turning the sidebar into a column of blocks. */
.nav-item.active::before{
  content:'';position:absolute;inset-inline-start:calc(var(--s4) * -1 + 2px);top:7px;bottom:7px;width:2.5px;
  border-radius:0 2px 2px 0;background:var(--accent)
}
.nav-item .ic{width:15px;height:15px;flex-shrink:0;opacity:.85}
.nav-item.active .ic{opacity:1;color:var(--accent-text)}
.nav-item .badge{
  margin-inline-start:auto;background:var(--card-2);border:1px solid var(--border);color:var(--text-2);
  font-size:10.5px;font-weight:600;padding:1px 6px;border-radius:var(--r-xs);min-width:19px;text-align:center
}
.nav-item.active .badge{background:var(--accent);border-color:transparent;color:var(--on-accent)}

/* Collapsed rail: icons only, with a real tooltip rather than title= so it
   appears instantly and can be styled. */
:is(.lv-collapsed, :root.lv-rail-collapsed .layout) .sidebar-nav{padding-top:var(--s2)}
:is(.lv-collapsed, :root.lv-rail-collapsed .layout) .logo-text,
:is(.lv-collapsed, :root.lv-rail-collapsed .layout) .nav-item span,
:is(.lv-collapsed, :root.lv-rail-collapsed .layout) .nav-section-label,
:is(.lv-collapsed, :root.lv-rail-collapsed .layout) .user-meta,
:is(.lv-collapsed, :root.lv-rail-collapsed .layout) .update-notice{display:none}
:is(.lv-collapsed, :root.lv-rail-collapsed .layout) .nav-section{border-top:1px solid var(--border);padding-top:var(--s2);margin-top:var(--s2)}
:is(.lv-collapsed, :root.lv-rail-collapsed .layout) .nav-section:first-child{border-top:0;margin-top:0}
:is(.lv-collapsed, :root.lv-rail-collapsed .layout) .sidebar-logo{justify-content:center;padding:0}
:is(.lv-collapsed, :root.lv-rail-collapsed .layout) .nav-item{justify-content:center;padding:0;margin:0 var(--s2)}
:is(.lv-collapsed, :root.lv-rail-collapsed .layout) .nav-item::after{
  content:attr(data-label);position:absolute;inset-inline-start:calc(100% + 10px);top:50%;transform:translateY(-50%);
  background:var(--elev);border:1px solid var(--border-2);color:var(--text);font-size:12px;
  padding:5px 9px;border-radius:var(--r-xs);white-space:nowrap;pointer-events:none;opacity:0;
  box-shadow:var(--shadow-2);z-index:80;transition:opacity .1s
}
:is(.lv-collapsed, :root.lv-rail-collapsed .layout) .nav-item:hover::after{opacity:1}
:is(.lv-collapsed, :root.lv-rail-collapsed .layout) .nav-item .badge{display:none}

/* Folding groups and favorites (static/js/lv-nav.js). */
.lv-nav-toggle{
  display:flex;align-items:center;gap:var(--s1);width:100%;background:none;border:0;cursor:pointer;
  font-family:inherit;text-align:start
}
.lv-nav-toggle:hover{color:var(--text-2)}
.lv-nav-toggle:focus-visible{outline:2px solid var(--accent-ring);outline-offset:-2px;border-radius:var(--r-xs)}
.lv-nav-toggle .ic{width:12px;height:12px;margin-inline-start:auto;transition:transform .12s}
.lv-folded .lv-nav-toggle .ic{transform:rotate(-90deg)}
[dir="rtl"] .lv-folded .lv-nav-toggle .ic{transform:rotate(90deg)}
.lv-nav-items[hidden]{display:none}
.lv-nav-row{position:relative}
.lv-fav{
  position:absolute;inset-inline-end:var(--s3);top:50%;transform:translateY(-50%);width:22px;height:22px;
  display:flex;align-items:center;justify-content:center;background:none;border:0;padding:0;
  border-radius:var(--r-xs);color:var(--muted);cursor:pointer;opacity:0;transition:opacity .1s
}
.lv-fav .ic{width:13px;height:13px}
.lv-fav[aria-pressed="true"]{--lv-star-fill:currentColor;color:var(--text-2)}
.lv-nav-row:hover .lv-fav,.lv-fav:focus-visible{opacity:1}
.lv-fav:hover{color:var(--text);background:var(--card-2)}
.lv-fav:focus-visible{outline:2px solid var(--accent-ring);outline-offset:0}
.lv-nav-row:hover .nav-item .badge{visibility:hidden}
.lv-favorites{border-bottom:1px solid var(--border);padding-bottom:var(--s2)}
/* On the collapsed rail every icon stays, folded or not, and the stars go. */
:is(.lv-collapsed, :root.lv-rail-collapsed .layout) .lv-nav-items[hidden]{display:block}
:is(.lv-collapsed, :root.lv-rail-collapsed .layout) .lv-fav{display:none}

.sidebar-bottom{border-top:1px solid var(--border);padding:var(--s2);flex-shrink:0}
.lv-rail-toggle{
  display:flex;align-items:center;justify-content:center;gap:var(--s2);width:100%;height:28px;
  background:transparent;border:1px solid var(--border);border-radius:var(--r-xs);color:var(--muted);
  font-size:11.5px;cursor:pointer;margin-bottom:var(--s2);transition:all .12s
}
.lv-rail-toggle:hover{border-color:var(--border-2);color:var(--text-2);background:var(--card-2)}
.lv-rail-toggle .ic{width:13px;height:13px;transition:transform .16s}
:is(.lv-collapsed, :root.lv-rail-collapsed .layout) .lv-rail-toggle .ic{transform:rotate(180deg)}
:is(.lv-collapsed, :root.lv-rail-collapsed .layout) .lv-rail-toggle span{display:none}

.user-info{
  display:flex;align-items:center;gap:var(--s2);padding:var(--s2);border-radius:7px;
  cursor:pointer;transition:background .12s
}
.user-info:hover{background:var(--card-2)}
.user-avatar{
  width:26px;height:26px;border-radius:var(--r-xs);flex-shrink:0;display:flex;align-items:center;
  justify-content:center;font-size:11.5px;font-weight:650;color:var(--on-accent);
  background:linear-gradient(140deg,var(--accent),var(--accent-2))
}
.user-meta{display:flex;flex-direction:column;line-height:1.25;min-width:0}
.user-meta span{font-size:12.5px;font-weight:550;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.user-meta small{font-size:10.5px;color:var(--muted)}

/* ── Top bar ──────────────────────────────────────────────────────────── */
.main{display:flex;flex-direction:column;min-width:0}
.header{
  height:var(--header-h);flex-shrink:0;display:flex;align-items:center;gap:var(--s4);
  padding:0 var(--s5);border-bottom:1px solid var(--border);
  background:var(--lv-glass);backdrop-filter:blur(12px);position:sticky;top:0;z-index:40
}
.lv-crumb{display:flex;align-items:center;gap:7px;font-size:12.5px;min-width:0;flex-shrink:0}
.lv-crumb .lv-crumb-root{color:var(--muted);font-weight:600;letter-spacing:.07em;text-transform:uppercase;font-size:10.5px}
.lv-crumb .lv-crumb-sep{color:var(--border-2);flex-shrink:0}
.lv-crumb a{color:var(--text-2);text-decoration:none}
.lv-crumb a:hover{color:var(--text)}
.lv-crumb strong{font-weight:600;font-size:13.5px;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* The old h1 page title is replaced by the breadcrumb's last segment. */
.header h1{display:none}

.global-search{position:relative;flex:1;max-width:460px;margin:0 auto}
.global-search .ic{position:absolute;inset-inline-start:10px;top:50%;transform:translateY(-50%);color:var(--muted);width:14px;height:14px;pointer-events:none}
.global-search input{
  width:100%;height:32px;background:var(--bg);border:1px solid var(--border);border-radius:7px;
  padding-block:0;padding-inline:31px 58px;color:var(--text);font-size:12.5px;outline:none;transition:border-color .12s,box-shadow .12s
}
.global-search input:hover{border-color:var(--border-2)}
.global-search input:focus{border-color:var(--accent-text);box-shadow:0 0 0 3px var(--accent-ring)}
.global-search input::placeholder{color:var(--muted)}
.lv-kbd{
  position:absolute;inset-inline-end:8px;top:50%;transform:translateY(-50%);pointer-events:none;
  font-family:var(--mono);font-size:10px;color:var(--muted);border:1px solid var(--border);
  border-bottom-width:2px;border-radius:var(--r-xs);padding:1px 5px;background:var(--card)
}
.global-search input:focus ~ .lv-kbd{opacity:0}

.header-right{display:flex;align-items:center;gap:var(--s2);margin-inline-start:auto;flex-shrink:0}
.status-pill{
  display:flex;align-items:center;gap:7px;height:28px;padding:0 10px;border-radius:7px;
  border:1px solid var(--border);background:var(--card);font-size:12px;font-weight:550;white-space:nowrap
}
.status-pill .status-dot{width:6px;height:6px;border-radius:50%;background:currentColor;flex-shrink:0}
.icon-btn{
  width:28px;height:28px;border-radius:7px;display:flex;align-items:center;justify-content:center;
  color:var(--text-2);cursor:pointer;position:relative;border:1px solid transparent;transition:all .12s
}
.icon-btn:hover{background:var(--card-2);border-color:var(--border);color:var(--text)}
.icon-btn .ic{width:15px;height:15px}
.icon-btn.warn{color:var(--warn)}
.lv-count{
  position:absolute;top:-3px;inset-inline-end:-3px;min-width:14px;height:14px;padding:0 3px;border-radius:7px;
  background:var(--accent);color:var(--on-accent);font-size:9.5px;font-weight:700;line-height:14px;
  text-align:center;border:2px solid var(--bg-2)
}

.content{flex:1;padding:var(--s5);min-width:0;overflow-x:hidden}

/* ── Page furniture ───────────────────────────────────────────────────── */
.lv-page-head{
  display:flex;align-items:flex-start;gap:var(--s4);margin-bottom:var(--s5);flex-wrap:wrap
}
.lv-page-head h2{font-size:19px;font-weight:650;letter-spacing:-.02em;line-height:1.25}
.lv-page-head p{font-size:12.5px;color:var(--text-2);margin-top:3px}
.lv-page-actions{display:flex;align-items:center;gap:var(--s2);margin-inline-start:auto;flex-shrink:0}

.lv-toolbar{
  display:flex;align-items:center;gap:var(--s2);margin-bottom:var(--s3);flex-wrap:wrap
}
.lv-toolbar .lv-filter{
  height:30px;background:var(--card);border:1px solid var(--border);border-radius:7px;
  color:var(--text-2);font-size:12px;padding:0 26px 0 9px;outline:none;cursor:pointer;
  appearance:none;background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);
  background-position:calc(100% - 13px) 13px,calc(100% - 9px) 13px;background-size:4px 4px;background-repeat:no-repeat
}
.lv-toolbar .lv-filter:hover{border-color:var(--border-2);color:var(--text)}
.lv-toolbar .lv-filter:focus{border-color:var(--accent-text);box-shadow:0 0 0 3px var(--accent-ring)}
.lv-search-inline{position:relative;min-width:200px}
.lv-search-inline input{
  width:100%;height:30px;background:var(--card);border:1px solid var(--border);border-radius:7px;
  padding-block:0;padding-inline:29px 9px;color:var(--text);font-size:12px;outline:none
}
.lv-search-inline input:focus{border-color:var(--accent-text);box-shadow:0 0 0 3px var(--accent-ring)}
.lv-search-inline .ic{position:absolute;inset-inline-start:9px;top:50%;transform:translateY(-50%);color:var(--muted);width:13px;height:13px}
.lv-spacer{margin-inline-start:auto}

/* ── Surfaces ─────────────────────────────────────────────────────────── */
.lv-card{
  background:var(--card);border:1px solid var(--border);border-radius:var(--r-sm);
  box-shadow:var(--shadow-1)
}
.lv-card-head{
  display:flex;align-items:center;gap:var(--s3);padding:var(--s3) var(--s4);
  border-bottom:1px solid var(--border)
}
.lv-card-head h3{font-size:13px;font-weight:600;letter-spacing:-.005em}
.lv-card-head .lv-spacer + *{flex-shrink:0}
.lv-card-body{padding:var(--s4)}
.lv-grid{display:grid;gap:var(--s3)}
.lv-grid.lv-4{grid-template-columns:repeat(4,1fr)}
.lv-grid.lv-3{grid-template-columns:repeat(3,1fr)}
.lv-grid.lv-2{grid-template-columns:repeat(2,1fr)}

/* ── Metric card ──────────────────────────────────────────────────────── */
.lv-metric{
  background:var(--card);border:1px solid var(--border);border-radius:var(--r-sm);
  padding:var(--s3) var(--s4);display:flex;flex-direction:column;gap:7px;min-width:0
}
.lv-metric-label{
  font-size:10.5px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);
  display:flex;align-items:center;gap:6px
}
.lv-metric-label .ic{width:12px;height:12px}
.lv-metric-value{
  font-size:24px;font-weight:650;letter-spacing:-.025em;line-height:1;
  font-variant-numeric:tabular-nums;display:flex;align-items:baseline;gap:5px
}
.lv-metric-value small{font-size:12px;font-weight:500;color:var(--muted);letter-spacing:0}
.lv-metric-sub{font-size:11.5px;color:var(--text-2);font-variant-numeric:tabular-nums}

/* ── Progress ─────────────────────────────────────────────────────────── */
.lv-bar{height:4px;border-radius:2px;background:var(--card-2);overflow:hidden;position:relative}
.lv-bar > i{display:block;height:100%;border-radius:2px;background:var(--accent);transition:width .3s ease}
.lv-bar.ok > i{background:var(--success)}
.lv-bar.warn > i{background:var(--warn)}
.lv-bar.crit > i{background:var(--danger)}
.lv-bar-row{display:flex;align-items:center;gap:var(--s3)}
.lv-bar-row .lv-bar{flex:1}
.lv-bar-row b{font-size:11.5px;font-weight:600;font-variant-numeric:tabular-nums;min-width:38px;text-align:end}

/* ── Status badge ─────────────────────────────────────────────────────── */
.lv-status{
  display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:550;
  padding:2px 7px;border-radius:var(--r-xs);border:1px solid transparent;white-space:nowrap;line-height:1.5
}
.lv-status::before{content:'';width:5px;height:5px;border-radius:50%;background:currentColor;flex-shrink:0}
.lv-status.ok      {color:var(--success);background:color-mix(in srgb,var(--success) 11%,transparent);border-color:color-mix(in srgb,var(--success) 24%,transparent)}
.lv-status.warn    {color:var(--warn);   background:color-mix(in srgb,var(--warn) 12%,transparent);   border-color:color-mix(in srgb,var(--warn) 26%,transparent)}
.lv-status.crit    {color:var(--danger); background:color-mix(in srgb,var(--danger) 11%,transparent); border-color:color-mix(in srgb,var(--danger) 26%,transparent)}
.lv-status.info    {color:var(--info);   background:color-mix(in srgb,var(--info) 11%,transparent);   border-color:color-mix(in srgb,var(--info) 24%,transparent)}
.lv-status.idle    {color:var(--neutral);background:color-mix(in srgb,var(--neutral) 12%,transparent);border-color:var(--border-2)}
.lv-status.busy    {color:var(--accent-text); background:var(--accent-dim);                                border-color:color-mix(in srgb,var(--accent) 28%,transparent)}
.lv-status.busy::before{animation:lv-pulse 1.4s ease-in-out infinite}
@keyframes lv-pulse{0%,100%{opacity:1}50%{opacity:.35}}
@media (prefers-reduced-motion:reduce){.lv-status.busy::before{animation:none}}

/* ── Data table ───────────────────────────────────────────────────────── */
.lv-table-wrap{
  background:var(--card);border:1px solid var(--border);border-radius:var(--r-sm);
  overflow-x:auto;box-shadow:var(--shadow-1)
}
table.lv-table{width:100%;border-collapse:collapse;font-size:12.5px}
table.lv-table th{
  text-align:start;font-size:10.5px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;
  color:var(--muted);padding:9px var(--s3);border-bottom:1px solid var(--border);
  white-space:nowrap;background:var(--card);position:sticky;top:0;z-index:2
}
table.lv-table th.lv-sortable{cursor:pointer;user-select:none}
table.lv-table th.lv-sortable:hover{color:var(--text-2)}
table.lv-table th .lv-sort-mark{opacity:.5;font-size:9px;margin-inline-start:3px}
table.lv-table td{
  padding:0 var(--s3);height:var(--lv-row-h);border-bottom:1px solid var(--border);
  color:var(--text-2);vertical-align:middle;white-space:nowrap
}
table.lv-table tbody tr:last-child td{border-bottom:0}
table.lv-table tbody tr{transition:background .1s}
table.lv-table tbody tr:hover{background:var(--card-2)}
table.lv-table td.lv-name{color:var(--text);font-weight:550}
table.lv-table td.lv-num{font-variant-numeric:tabular-nums;text-align:end}
table.lv-table td.lv-mono{font-family:var(--mono);font-size:var(--t-xs)}
table.lv-table td.lv-right,table.lv-table th.lv-right{text-align:end}

/* Text primitives. These were being written as inline styles on every page
   that wanted a name with a smaller line under it -- the single most repeated
   shape in this console -- so they are classes. --text-2 and --muted both
   clear 4.6:1 on every surface, which an inline colour could not promise. */
.lv-strong{color:var(--text);font-weight:550}
.lv-sub{font-size:var(--t-sm);color:var(--text-2);line-height:1.5}
.lv-muted{color:var(--muted)}
.lv-right{text-align:end}

/* Form fields, so a dialog does not have to invent them. Same focus ring as
   the search box, because they are the same kind of thing. */
.lv-label{
  display:block;font-size:var(--t-sm);font-weight:600;color:var(--text-2);
  margin:var(--s3) 0 var(--s1h)
}
.lv-label:first-child{margin-top:0}
.lv-input{
  width:100%;background:var(--bg-2);border:1px solid var(--border);
  border-radius:var(--r-sm);padding:var(--s2) var(--s3);color:var(--text);
  font-size:var(--t-md);font-family:inherit;outline:none;
  transition:border-color .15s,box-shadow .15s
}
.lv-input:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-ring)}
.lv-input::placeholder{color:var(--muted)}
table.lv-table .lv-row-actions{display:flex;gap:3px;justify-content:flex-end;opacity:0;transition:opacity .1s}
table.lv-table tr:hover .lv-row-actions,
table.lv-table tr:focus-within .lv-row-actions{opacity:1}
.lv-cell-link{color:var(--text);text-decoration:none;font-weight:550}
.lv-cell-link:hover{color:var(--accent-text);text-decoration:underline;text-underline-offset:2px}
/* A usage cell: number plus a thin bar, readable at a glance down a column. */
.lv-usage{display:flex;align-items:center;gap:7px;min-width:92px}
.lv-usage b{font-size:11.5px;font-weight:600;font-variant-numeric:tabular-nums;min-width:33px}
.lv-usage .lv-bar{flex:1;height:3px}

/* ── Buttons (compact, for toolbars and rows) ─────────────────────────── */
.lv-btn{
  display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 11px;border-radius:7px;
  border:1px solid var(--border);background:var(--card);color:var(--text-2);font-size:12px;
  font-weight:550;cursor:pointer;white-space:nowrap;font-family:inherit;transition:all .12s
}
.lv-btn:hover{border-color:var(--border-2);color:var(--text);background:var(--card-2)}
.lv-btn:focus-visible{outline:none;border-color:var(--accent-text);box-shadow:0 0 0 3px var(--accent-ring)}
.lv-btn .ic{width:13px;height:13px}
.lv-btn.lv-primary{background:var(--accent);border-color:var(--accent-text);color:var(--on-accent)}
.lv-btn.lv-primary:hover{filter:brightness(1.08)}
.lv-btn.lv-danger{color:var(--danger);border-color:color-mix(in srgb,var(--danger) 30%,transparent)}
.lv-btn.lv-danger:hover{background:color-mix(in srgb,var(--danger) 10%,transparent);color:var(--danger)}
.lv-btn.lv-sm{height:25px;padding:0 8px;font-size:11.5px;border-radius:var(--r-xs)}
.lv-btn.lv-icon{width:25px;padding:0;justify-content:center}
.lv-btn:disabled{opacity:.45;cursor:not-allowed}

/* ── Tabs ─────────────────────────────────────────────────────────────── */
.lv-tabs{display:flex;gap:2px;border-bottom:1px solid var(--border);margin-bottom:var(--s4);overflow-x:auto}
.lv-tab{
  padding:8px 12px;font-size:12.5px;font-weight:550;color:var(--text-2);cursor:pointer;
  border:0;background:none;font-family:inherit;border-bottom:2px solid transparent;
  margin-bottom:-1px;white-space:nowrap;transition:color .12s
}
.lv-tab:hover{color:var(--text)}
.lv-tab.active{color:var(--accent-text);border-bottom-color:var(--accent-text)}
.lv-tab:focus-visible{outline:none;color:var(--accent-text);box-shadow:inset 0 0 0 2px var(--accent-ring);border-radius:var(--r-xs) 5px 0 0}

/* ── States: empty / error / loading / not configured ─────────────────── */
.lv-state{
  display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;
  padding:56px var(--s5);background:var(--card);border:1px solid var(--border);
  border-radius:var(--r-sm);min-height:220px
}
.lv-state .lv-state-icon{
  width:40px;height:40px;border-radius:var(--r-sm);display:flex;align-items:center;justify-content:center;
  background:var(--card-2);border:1px solid var(--border);color:var(--muted);margin-bottom:var(--s4)
}
.lv-state .lv-state-icon .ic{width:18px;height:18px}
.lv-state h3{font-size:14px;font-weight:600;margin-bottom:6px;color:var(--text)}
.lv-state p{font-size:12.5px;color:var(--text-2);max-width:420px;line-height:1.6}
.lv-state .lv-state-actions{display:flex;gap:var(--s2);margin-top:var(--s4)}
.lv-state.lv-error .lv-state-icon{color:var(--danger);border-color:color-mix(in srgb,var(--danger) 28%,transparent);background:color-mix(in srgb,var(--danger) 9%,transparent)}
.lv-state.lv-unconfigured .lv-state-icon{color:var(--info);border-color:color-mix(in srgb,var(--info) 26%,transparent);background:color-mix(in srgb,var(--info) 9%,transparent)}
.lv-state-meta{
  margin-top:var(--s4);font-size:11px;color:var(--muted);font-family:var(--mono);
  background:var(--bg);border:1px solid var(--border);border-radius:var(--r-xs);padding:7px 11px;
  max-width:100%;overflow-x:auto;text-align:start
}
/* A "not configured" notice that sits above real content rather than
   replacing it -- used where part of a page works and part does not. */
.lv-notice{
  display:flex;align-items:flex-start;gap:10px;padding:10px var(--s3);border-radius:var(--r-sm);
  border:1px solid color-mix(in srgb,var(--info) 26%,transparent);
  background:color-mix(in srgb,var(--info) 8%,transparent);font-size:12.5px;color:var(--text-2);
  margin-bottom:var(--s4);line-height:1.55
}
.lv-notice .ic{width:14px;height:14px;color:var(--info);flex-shrink:0;margin-top:2px}
.lv-notice b{color:var(--text);font-weight:600}
.lv-notice.lv-warn{border-color:color-mix(in srgb,var(--warn) 28%,transparent);background:color-mix(in srgb,var(--warn) 8%,transparent)}
.lv-notice.lv-warn .ic{color:var(--warn)}
.lv-notice.lv-crit{border-color:color-mix(in srgb,var(--danger) 30%,transparent);background:color-mix(in srgb,var(--danger) 8%,transparent)}
.lv-notice.lv-crit .ic{color:var(--danger)}

/* A notice with a heading and a command under it -- the shape every
   diagnostic on the Nodes page and the update dialog had been building by
   hand, with the body text tinted the status colour. Tinted body text was
   the single worst thing in the console: #ffc0c2 on the light theme's
   #f5f7fb measured 1.43:1, which is unreadable, and it could not be
   otherwise because a literal cannot follow a theme. The status colour
   belongs on the icon and the border; the words stay --text-2. */
.lv-notice-body{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1}
.lv-notice-title{font-weight:650;color:var(--text);font-size:13px}
.lv-notice-code{
  font-family:var(--mono);font-size:11.5px;background:var(--bg);
  border:1px solid var(--border);border-radius:var(--r-xs);padding:8px 10px;
  overflow-x:auto;direction:ltr;color:var(--text);white-space:pre
}
.lv-notice-note{font-size:var(--t-sm);color:var(--muted)}

/* Status buttons, so no caller has to write a gradient. Same construction as
   .btn-primary: a top stop 8% lighter, white text, a border a shade darker. */
.btn-ok,.btn-warn,.btn-danger{color:#fff;border-style:solid;border-width:1px}
.btn-ok{background:linear-gradient(180deg,color-mix(in srgb,var(--success-solid) 92%,#fff),var(--success-solid));border-color:color-mix(in srgb,var(--success-solid) 70%,#000)}
.btn-warn{background:linear-gradient(180deg,color-mix(in srgb,var(--warn-solid) 92%,#fff),var(--warn-solid));border-color:color-mix(in srgb,var(--warn-solid) 70%,#000)}
.btn-danger{background:linear-gradient(180deg,color-mix(in srgb,var(--danger-solid) 92%,#fff),var(--danger-solid));border-color:color-mix(in srgb,var(--danger-solid) 70%,#000)}

.lv-skeleton{
  background:linear-gradient(90deg,var(--card-2) 25%,var(--elev) 50%,var(--card-2) 75%);
  background-size:200% 100%;animation:lv-shimmer 1.3s linear infinite;border-radius:var(--r-xs);height:12px
}
@keyframes lv-shimmer{to{background-position:-200% 0}}
@media (prefers-reduced-motion:reduce){.lv-skeleton{animation:none}}

/* ── Cluster topology ─────────────────────────────────────────────────── */
.lv-topo{font-family:var(--mono);font-size:12px;line-height:1.95;padding:var(--s2) 0}
.lv-topo-row{display:flex;align-items:center;gap:var(--s2);white-space:nowrap}
.lv-topo-tree{color:var(--tree);user-select:none;flex-shrink:0}
.lv-topo-row .lv-topo-name{color:var(--text);font-weight:550}
.lv-topo-row.lv-topo-vm .lv-topo-name{color:var(--text-2);font-weight:400}
.lv-topo-row .lv-topo-meta{color:var(--muted);font-size:11px;margin-inline-start:auto;padding-inline-start:var(--s4)}

/* ── Key/value list ───────────────────────────────────────────────────── */
.lv-kv{display:grid;grid-template-columns:auto 1fr;gap:9px var(--s4);font-size:12.5px;align-items:baseline}
.lv-kv dt{color:var(--muted);white-space:nowrap}
.lv-kv dd{color:var(--text);text-align:end;font-variant-numeric:tabular-nums;word-break:break-word}

/* ── Responsive: tablet and laptop keep the dense layout ──────────────── */
@media (max-width:1280px){
  .lv-grid.lv-4{grid-template-columns:repeat(2,1fr)}
  .global-search{max-width:300px}
}
@media (max-width:1024px){
  .layout{grid-template-columns:var(--sidebar-w-collapsed) 1fr}
  .layout .logo-text,.layout .nav-item span,.layout .nav-section-label,
  .layout .user-meta,.layout .update-notice{display:none}
  .layout .nav-item{justify-content:center;padding:0}
  .layout .sidebar-logo{justify-content:center;padding:0}
  .lv-rail-toggle{display:none}
  .content{padding:var(--s4)}
}
@media (max-width:860px){
  .lv-grid.lv-4,.lv-grid.lv-3,.lv-grid.lv-2{grid-template-columns:1fr}
  .global-search{display:none}
  .header{padding:0 var(--s4)}
}

/* ── Accessibility ────────────────────────────────────────────────────── */
.lv-skip{
  position:absolute;inset-inline-start:-9999px;top:0;z-index:200;background:var(--accent);color:var(--on-accent);
  padding:9px 15px;border-radius:0 0 7px 0;font-size:13px;font-weight:600;text-decoration:none
}
.lv-skip:focus{inset-inline-start:0}
.nav-item:focus-visible,.lv-cell-link:focus-visible,.icon-btn:focus-visible{
  outline:2px solid var(--accent);outline-offset:1px;border-radius:var(--r-xs)
}
.lv-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* ── Readiness panel ──────────────────────────────────────────────────────
   Shown on the dashboard only while something is actionable, and styled to
   be read rather than dismissed: the fix is the part that matters, so it is
   not smaller than the problem. */
.lv-ready.blocker{border-color:color-mix(in srgb,var(--danger) 32%,transparent)}
.lv-ready.warning{border-color:color-mix(in srgb,var(--warn) 32%,transparent)}
.lv-ready-row{display:flex;gap:var(--s3);align-items:flex-start}
.lv-ready-mark{
  width:26px;height:26px;border-radius:7px;flex-shrink:0;display:flex;align-items:center;
  justify-content:center;margin-top:1px
}
.lv-ready-row.blocker .lv-ready-mark{color:var(--danger);background:color-mix(in srgb,var(--danger) 11%,transparent)}
.lv-ready-row.warning .lv-ready-mark{color:var(--warn);background:color-mix(in srgb,var(--warn) 12%,transparent)}
.lv-ready-mark .ic{width:14px;height:14px}
.lv-ready-text{min-width:0;flex:1}
.lv-ready-title{font-size:13px;font-weight:600;color:var(--text);margin-bottom:3px}
.lv-ready-text p{font-size:12.5px;color:var(--text-2);line-height:1.6;margin-top:3px}
.lv-ready-fix b{color:var(--text)}
.lv-ready-cmd{
  margin-top:7px;background:var(--bg);border:1px solid var(--border);border-radius:var(--r-xs);
  padding:8px 11px;font-family:var(--mono);font-size:11.5px;line-height:1.6;color:var(--text);
  overflow-x:auto;white-space:pre;direction:ltr;text-align:left
}

/* ── Versions (Updates page) ─────────────────────────────────────────────
   One section, three layers: where each part runs now, the versions there
   are to choose from, and a dialog that shows the plan before it runs. */
.lv-ver{margin-top:var(--s5);display:flex;flex-direction:column;gap:var(--s3)}
.lv-ver-head{display:flex;align-items:flex-end;justify-content:space-between;gap:var(--s4);flex-wrap:wrap}
.lv-ver-head h3{font-size:15px;font-weight:650;letter-spacing:-.015em;margin:0 0 var(--s1)}
.lv-ver-head p{font-size:var(--t-sm);color:var(--text-2);line-height:1.6;max-width:72ch;margin:0}
.lv-ver-head-act{display:flex;gap:var(--s2)}
.lv-ver-where table{min-width:560px}
.lv-ver-num{font-family:var(--mono);font-size:var(--t-sm);font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--text)}
.lv-ver-note{font-size:var(--t-xs);color:var(--muted);line-height:1.5}
.lv-ver-act{text-align:end;white-space:nowrap}
.lv-ver-act .lv-btn + .lv-btn{margin-inline-start:var(--s1h)}
.lv-ver-sk{display:inline-block;width:48px;height:10px;vertical-align:middle}
.lv-ver-tag{display:inline-block;margin-inline-start:var(--s1h);padding:0 6px;border:1px solid var(--border-2);
  border-radius:var(--r-xs);font-size:10.5px;letter-spacing:.04em;color:var(--muted);line-height:17px;vertical-align:1px}
.lv-ver-tag-new{color:var(--accent-text);border-color:color-mix(in srgb,var(--accent) 40%,transparent)}
.lv-ver-changes{max-width:52ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text-2)}
.lv-ver-tabs{display:flex;gap:2px;border-bottom:1px solid var(--border);margin-top:var(--s2)}
.lv-ver-tab{position:relative;display:inline-flex;align-items:center;gap:var(--s2);padding:var(--s2h) var(--s3);
  background:none;border:0;color:var(--muted);font:inherit;font-size:var(--t-md);font-weight:550;cursor:pointer;
  border-radius:var(--r-xs) var(--r-xs) 0 0;transition:color .15s ease-out,background-color .15s ease-out}
.lv-ver-tab span{font-family:var(--mono);font-size:10.5px;font-variant-numeric:tabular-nums;color:var(--muted);
  border:1px solid var(--border);border-radius:var(--r-xs);padding:0 5px;line-height:16px}
.lv-ver-tab:hover{color:var(--text);background:color-mix(in srgb,var(--text) 4%,transparent)}
.lv-ver-tab.active{color:var(--text)}
.lv-ver-tab.active::after{content:"";position:absolute;inset:auto 8px -1px;height:2px;background:var(--text);border-radius:2px}
.lv-ver-tab:focus-visible{outline:none;box-shadow:0 0 0 2px var(--accent-ring)}

/* The dialog */
.lv-ver-dialog{max-width:620px;width:100%}
.lv-ver-dialog .modal-header{align-items:flex-start}
.lv-ver-dialog .modal-header h3{font-size:17px;font-weight:650;letter-spacing:-.02em}
.lv-ver-src{font-family:var(--mono);font-size:var(--t-xs);color:var(--muted);margin-top:var(--s1)}
.lv-ver-label{font-size:10.5px;font-weight:600;letter-spacing:.09em;text-transform:uppercase;color:var(--muted);
  margin:var(--s4) 0 var(--s2)}
.lv-ver-label:first-child{margin-top:0}
.lv-seg{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border:1px solid var(--border-2);
  border-radius:var(--r-sm);overflow:hidden;background:var(--bg)}
.lv-seg button{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:var(--s2h) var(--s3);
  background:none;border:0;border-inline-start:1px solid var(--border);color:var(--text-2);font:inherit;
  text-align:start;cursor:pointer;transition:background-color .15s ease-out,color .15s ease-out}
.lv-seg button:first-child{border-inline-start:0}
.lv-seg button b{font-size:var(--t-md);font-weight:600;color:inherit}
.lv-seg button span{font-size:var(--t-xs);color:var(--muted)}
.lv-seg button:hover:not(:disabled){background:color-mix(in srgb,var(--text) 4%,transparent);color:var(--text)}
.lv-seg button:active:not(:disabled){background:color-mix(in srgb,var(--text) 7%,transparent)}
.lv-seg button.active{background:var(--card);color:var(--text);box-shadow:inset 0 -2px 0 var(--accent)}
.lv-seg button:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--accent-ring)}
.lv-seg button:disabled{opacity:.45;cursor:not-allowed}
.lv-ver-node{margin-top:var(--s3)}
.lv-ver-plan{border:1px solid var(--border);border-radius:var(--r-sm);background:var(--bg);padding:var(--s3) var(--s4)}
.lv-ver-steps{margin:0;padding-inline-start:var(--s4h);display:flex;flex-direction:column;gap:var(--s1h);
  font-size:var(--t-md);color:var(--text);line-height:1.55}
.lv-ver-steps li::marker{font-family:var(--mono);font-size:var(--t-xs);color:var(--muted)}
.lv-ver-refused{display:flex;gap:var(--s2);align-items:flex-start;font-size:var(--t-sm);line-height:1.6;color:var(--text-2)}
.lv-ver-refused svg{flex-shrink:0;margin-top:3px;color:var(--danger)}
.lv-ver-plan .lv-ver-refused + .lv-ver-refused,.lv-ver-steps + .lv-ver-refused{margin-top:var(--s3);padding-top:var(--s3);
  border-top:1px dashed var(--border)}
.lv-ver-warn svg{color:var(--warn)}
.lv-ver-fine{margin:var(--s3) 0 0;font-size:var(--t-xs);color:var(--muted);line-height:1.55}
.lv-ver-foot{display:flex;gap:var(--s2);justify-content:flex-end;padding:var(--s4) var(--s4h);border-top:1px solid var(--border)}
#lvVerConfirmRow{margin-top:var(--s3)}
@media (max-width:640px){
  .lv-seg{grid-template-columns:1fr}
  .lv-seg button{border-inline-start:0;border-top:1px solid var(--border)}
  .lv-seg button:first-child{border-top:0}
  .lv-ver-changes{max-width:28ch}
}
@media (prefers-reduced-motion:reduce){.lv-ver-tab,.lv-seg button{transition:none}}
.lv-ver-more{display:flex;align-items:baseline;gap:var(--s2);width:100%;padding:var(--s2h) var(--s3);background:none;border:0;
  border-top:1px solid var(--border);color:var(--text-2);font:inherit;font-size:var(--t-sm);font-weight:550;text-align:start;
  cursor:pointer;transition:background-color .15s ease-out,color .15s ease-out}
.lv-ver-more span{font-weight:400;font-size:var(--t-xs);color:var(--muted)}
.lv-ver-more:hover{background:color-mix(in srgb,var(--text) 4%,transparent);color:var(--text)}
.lv-ver-more:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--accent-ring)}
.lv-ver-table td{vertical-align:middle}
.lv-ver-table tbody tr{transition:background-color .15s ease-out}

/* Links that set no colour of their own. Without this the browser's default
   applies, and in a dark colour scheme that default is violet. */
a{color:var(--accent-text);text-underline-offset:2px}
a:visited{color:var(--accent-text)}
a:hover{color:var(--text)}

/* LexiVirt OS: the edition's Beta tag beside the name in the sidebar. */
.lv-edition-tag{display:inline-block;margin-inline-start:6px;padding:0 6px;border:1px solid var(--border-2);border-radius:var(--r-xs);
  font-size:9.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--text-2);line-height:16px;vertical-align:2px}
/* display above would otherwise beat the hidden attribute: an empty box on every console that is not LexiVirt OS */
.lv-edition-tag[hidden]{display:none}

/* VM rows (T10): the short UUID that copies, and the Actions menu. */
.lv-copy{
  display:inline-flex;align-items:center;gap:var(--s1);margin-top:2px;padding:0 var(--s1);border:1px solid transparent;
  border-radius:var(--r-xs);background:none;color:var(--muted);cursor:pointer;font:inherit;font-size:var(--t-xs)
}
.lv-copy code{font-family:var(--mono);font-size:var(--t-xs);color:inherit}
.lv-copy .ic{width:11px;height:11px;opacity:0;transition:opacity .1s}
.lv-copy:hover,.lv-copy:focus-visible{border-color:var(--border);color:var(--text-2)}
.lv-copy:hover .ic,.lv-copy:focus-visible .ic{opacity:1}
.lv-copy:focus-visible{outline:2px solid var(--accent-ring);outline-offset:0}
.lv-vm-actions .lv-menu-btn{gap:var(--s1);white-space:nowrap}
.lv-vm-actions .lv-menu-btn .ic{width:12px;height:12px}
.lv-vm-actions .action-item{width:100%;background:none;border:0;font:inherit;text-align:start}
.lv-vm-actions .action-item[disabled]{opacity:.45;cursor:not-allowed}
.lv-vm-actions .action-item:focus-visible{outline:2px solid var(--accent-ring);outline-offset:-2px}

/* A small labelled value in a row of them (a node and its load on the balance page). */
.lv-chip{display:inline-flex;align-items:center;gap:var(--s1);border:1px solid var(--border);border-radius:var(--r-lg);
  padding:var(--s0h) var(--s2h);font-size:var(--t-xs);white-space:nowrap}

/* The header's language button (i18n.js): a text label, not an icon. */
.lv-lang-toggle{width:auto;padding:0 8px}
.lv-lang-toggle .lv-lang-label{font-size:11px;font-weight:600;letter-spacing:.02em;white-space:nowrap;padding:0 2px}
