/* Virus Guardia Enterprise - Management Console.
   Redesign (owner approved the v3 mockup on 15 Nov 2026): a left menu at every width (an icon rail when narrowed, a drawer
   on phones), a white top bar with the page title, cards on a pale breeze background. No web fonts: consoles run on
   air-gapped networks, so the system's own UI font is used.
   Light and dark: the console follows the computer's setting (prefers-color-scheme); every colour is a token below. */
:root {
  color-scheme: light;
  --app-bg: #eef6fc; --card: #ffffff; --card2: #f4fafe; --border: #d9e8f3; --fg: #102636;
  --muted: #5d7285; --faint: #86a0b3;
  --side-bg: #0c3a5c; --side-bg2: #0a3250; --side-fg: #c3dcec; --side-faint: #7fa5c0; --side-active: #2E8FD0;
  --breeze: #2E8FD0; --breeze-deep: #175e96; --breeze-bright: #4FB0E5; --breeze-soft: #e3f1fb;
  --ok: #1b9c67; --ok-soft: #e1f5ec; --warn: #c08400; --warn-soft: #fbeed3; --crit: #d8442e; --crit-soft: #fbe6e2;
  --violet: #6d5bd0; --violet-soft: #ece9fb; --teal: #138a8a; --teal-soft: #dff3f2;
  --ok-line: #b4e2cb; --info-line: #bcd9ef; --warn-line: #edd29a; --crit-line: #f0b7ab; --row-hover: #f8fcff;
  --ok-ink: #11603f; --warn-ink: #6b4a00; --crit-ink: #8f2a19; --code-bg: #e3f1fb; --on-accent: #ffffff;
  --ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", Ubuntu, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, "SFMono-Regular", "DejaVu Sans Mono", monospace;
  --radius: 14px;

  /* the earlier names, still used inside pages */
  --vg-accent: var(--breeze); --vg-accent-bright: var(--breeze-bright); --vg-accent-pressed: var(--breeze-deep);
  --vg-deep: #0E3A5A; --vg-deep-2: var(--side-bg); --vg-page: var(--app-bg); --vg-ink: var(--fg); --vg-muted: var(--muted);
  --vg-border: var(--border); --vg-card: var(--card); --vg-ok: #0a7d55; --vg-warn: #b06f00; --vg-danger: #b3261e;
}
/* dark: the same tokens, redefined (the mockup's dark palette) - for the system setting, and again for an explicit choice */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  color-scheme: dark;
  --app-bg: #081520; --card: #0f2130; --card2: #132a3a; --border: #1d3344; --fg: #e7f0f7; --muted: #8aa2b4; --faint: #5f7b8f;
  --side-bg: #071f30; --side-bg2: #061a29; --side-fg: #bdd7e8; --side-faint: #6c93ad;
  --breeze: #4FB0E5; --breeze-deep: #7ccbf0; --breeze-bright: #7ccbf0; --breeze-soft: #0f2c40;
  --ok: #36c389; --ok-soft: #0e2a1f; --warn: #e0a63a; --warn-soft: #2c2410; --crit: #f0806c; --crit-soft: #2c1512;
  --violet: #a99cf2; --violet-soft: #211d3d; --teal: #4fc9c4; --teal-soft: #0d2a2a;
  --ok-line: #1f5a42; --info-line: #1f4c6b; --warn-line: #5c4a1c; --crit-line: #6a2b22; --row-hover: #12283a;
  --ok-ink: #7fe0b5; --warn-ink: #f0c879; --crit-ink: #ffb3a5; --code-bg: #0f2c40; --vg-deep: #e7f0f7; --on-accent: #06202f;
} }
:root[data-theme="dark"] {
  color-scheme: dark;
  --app-bg: #081520; --card: #0f2130; --card2: #132a3a; --border: #1d3344; --fg: #e7f0f7; --muted: #8aa2b4; --faint: #5f7b8f;
  --side-bg: #071f30; --side-bg2: #061a29; --side-fg: #bdd7e8; --side-faint: #6c93ad;
  --breeze: #4FB0E5; --breeze-deep: #7ccbf0; --breeze-bright: #7ccbf0; --breeze-soft: #0f2c40;
  --ok: #36c389; --ok-soft: #0e2a1f; --warn: #e0a63a; --warn-soft: #2c2410; --crit: #f0806c; --crit-soft: #2c1512;
  --violet: #a99cf2; --violet-soft: #211d3d; --teal: #4fc9c4; --teal-soft: #0d2a2a;
  --ok-line: #1f5a42; --info-line: #1f4c6b; --warn-line: #5c4a1c; --crit-line: #6a2b22; --row-hover: #12283a;
  --ok-ink: #7fe0b5; --warn-ink: #f0c879; --crit-ink: #ffb3a5; --code-bg: #0f2c40; --vg-deep: #e7f0f7; --on-accent: #06202f;
}

* { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--ui); font-size: 14px; line-height: 1.5; color: var(--fg); background: var(--app-bg);
  -webkit-font-smoothing: antialiased;
}
svg.ic { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ======================= shell ======================= */
.vg-app { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }
.vg-side {
  background: var(--side-bg); color: var(--side-fg); display: flex; flex-direction: column; gap: 2px;
  padding: 18px 14px calc(18px + env(safe-area-inset-bottom, 0px)); padding-left: max(14px, env(safe-area-inset-left, 0px));
  position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin;
}
.vg-side-brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 14px; }
.vg-side-brand img { width: 34px; height: 34px; object-fit: contain; flex: none; }
.vg-side-brand .bn { font-weight: 800; font-size: .95rem; letter-spacing: -.01em; color: #fff; line-height: 1.1; }
.vg-side-brand .bs { font-size: .66rem; color: var(--side-faint); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.vg-collapse { margin-left: auto; background: none; border: 0; color: var(--side-faint); cursor: pointer; padding: 5px; border-radius: 8px; display: inline-flex; }
.vg-collapse:hover { background: var(--side-bg2); color: #fff; }
.vg-collapse svg { width: 18px; height: 18px; }
.vg-navlabel { font-size: .64rem; text-transform: uppercase; letter-spacing: .12em; color: var(--side-faint); font-weight: 700; padding: 12px 10px 5px; }
.vg-side a.vg-nav {
  display: flex; align-items: center; gap: 11px; padding: 8px 11px; border-radius: 10px; color: var(--side-fg);
  font-weight: 600; font-size: .87rem; text-decoration: none;
}
.vg-side a.vg-nav:hover { background: var(--side-bg2); color: #fff; }
.vg-side a.vg-nav.active { background: var(--side-active); color: #fff; box-shadow: 0 4px 14px -4px rgba(46, 143, 208, .6); }
.vg-side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; flex-direction: column; gap: 2px; }
.vg-side-foot form { margin: 0; }
.vg-side-foot button.vg-nav {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 11px; border-radius: 10px; border: 0; background: none;
  color: var(--side-faint); font: inherit; font-weight: 600; font-size: .87rem; cursor: pointer; text-align: left;
}
.vg-side-foot button.vg-nav:hover { background: var(--side-bg2); color: #fff; }

.vg-main { min-width: 0; display: flex; flex-direction: column; }
.vg-topbar {
  display: flex; align-items: center; gap: 14px; padding: 13px 26px; flex-wrap: wrap;
  padding-right: max(26px, env(safe-area-inset-right, 0px)); border-bottom: 1px solid var(--border); background: var(--card);
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
}
.vg-topbar h1 { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; margin: 0; color: var(--fg); text-wrap: balance; }
.vg-topbar .crumb { color: var(--muted); font-size: .76rem; font-weight: 600; }
.vg-who { margin-left: auto; display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: .82rem; color: var(--fg); text-decoration: none; }
.vg-who .av { width: 32px; height: 32px; border-radius: 50%; background: var(--breeze); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .8rem; text-transform: uppercase; }
.vg-who .role { color: var(--muted); font-weight: 600; font-size: .72rem; }
.vg-menubtn { display: none; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--card2); color: var(--fg); cursor: pointer; flex: none; padding: 0; }
.vg-menubtn:hover { background: var(--breeze-soft); }
.vg-menubtn svg { width: 20px; height: 20px; }
.vg-scrim { display: none; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--card); }

.vg-shell {
  padding: 22px 26px calc(60px + env(safe-area-inset-bottom, 0px));
  padding-left: max(26px, env(safe-area-inset-left, 0px)); padding-right: max(26px, env(safe-area-inset-right, 0px));
  max-width: 1400px; width: 100%;
}
.vg-footer { padding: 0 26px 24px; color: var(--faint); font-size: .74rem; }

/* narrowed menu (desktop): icons only */
@media (min-width: 761px) {
  body.vg-rail .vg-app { grid-template-columns: 70px minmax(0, 1fr); }
  body.vg-rail .vg-side { padding-left: 10px; padding-right: 10px; }
  body.vg-rail .vg-navlabel, body.vg-rail .vg-side-brand .bt, body.vg-rail .vg-nav .t { display: none; }
  body.vg-rail .vg-navlabel + .vg-nav { margin-top: 8px; }
  body.vg-rail .vg-side a.vg-nav, body.vg-rail .vg-side-foot button.vg-nav { justify-content: center; padding: 10px; }
  body.vg-rail .vg-side-brand { flex-direction: column; gap: 8px; padding: 4px 0 12px; }
  body.vg-rail .vg-collapse { margin: 0; transform: scaleX(-1); }
}
/* phones: the menu is a drawer */
@media (max-width: 760px) {
  .vg-app { grid-template-columns: minmax(0, 1fr); }
  .vg-side {
    position: fixed; inset: 0 auto 0 0; width: 270px; max-width: 85vw; height: auto; z-index: 40; transform: translateX(-104%);
    transition: transform .22s ease; padding-top: calc(18px + env(safe-area-inset-top, 0px));
  }
  body.vg-menu .vg-side { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  .vg-scrim { display: block; position: fixed; inset: 0; background: rgba(4, 18, 30, .5); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .22s; }
  body.vg-menu .vg-scrim { opacity: 1; pointer-events: auto; }
  .vg-menubtn { display: inline-flex; }
  .vg-collapse { display: none; }
  .vg-who .who-t { display: none; }
  .vg-topbar { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); gap: 10px; }
  .vg-shell { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .vg-footer { padding-left: 16px; padding-right: 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; }
  .kv { font-size: 1.5rem; }
}

/* ======================= login / first run ======================= */
.vg-login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; margin: 0; padding: 1rem; background: var(--app-bg); }
.vg-login-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 10px 40px rgba(14, 58, 90, .15); padding: 2rem; width: 100%; max-width: 23rem; }
.vg-login-brand { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin-bottom: 1.2rem; text-align: center; }
.vg-login-brand img { height: 56px; }
.vg-login-brand .vg-login-title { font-size: 1.2rem; font-weight: 800; color: var(--vg-deep); }
.vg-login-brand .vg-login-title .vg-accent-text { color: var(--breeze); }
.vg-login-brand .vg-login-sub { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.vg-login-form { display: flex; flex-direction: column; gap: .7rem; }
.vg-login-form label { font-size: .82rem; color: var(--muted); display: flex; flex-direction: column; gap: .25rem; font-weight: 600; }
.vg-login-form button { margin-top: .4rem; padding: .6rem 1rem; font-size: 1rem; }

/* ======================= base elements (every page) ======================= */
h1, h2, h3 { color: var(--fg); margin-top: 0; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-size: 1.3rem; font-weight: 800; }
h3 { font-size: 1.02rem; font-weight: 800; }
a { color: var(--breeze-deep); }
a:hover { color: var(--breeze); }
code { background: var(--code-bg); padding: .05rem .35rem; border-radius: 5px; font-size: .88em; font-family: var(--mono); }
pre { font-family: var(--mono); font-size: .8rem; background: var(--card2); border: 1px solid var(--border); border-radius: 10px; padding: .6rem .8rem; overflow-x: auto; }

button {
  background: var(--breeze); color: var(--on-accent); border: 1px solid var(--breeze); border-radius: 10px; padding: .45rem 1rem;
  font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; transition: background .12s ease;
}
button:hover { background: var(--breeze-deep); border-color: var(--breeze-deep); }
.btn-ghost, a.btn-ghost {
  display: inline-flex; align-items: center; gap: 7px; padding: .4rem .85rem; border-radius: 10px; font-weight: 700; font-size: .82rem;
  border: 1px solid var(--border); background: var(--card); color: var(--breeze-deep); text-decoration: none; cursor: pointer;
}
.btn-ghost:hover, a.btn-ghost:hover { border-color: var(--breeze); background: var(--breeze-soft); color: var(--breeze-deep); }
.vg-btn-danger { background: var(--crit); border-color: var(--crit); }
.vg-btn-danger:hover { background: #a8321f; border-color: #a8321f; }
input, textarea, select {
  border: 1px solid var(--border); border-radius: 9px; padding: .42rem .6rem; font: inherit; font-size: .88rem;
  background: var(--card); color: var(--fg);
}
input[type=checkbox], input[type=radio] { accent-color: var(--breeze); width: 16px; height: 16px; vertical-align: middle; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--breeze-bright); outline-offset: 0; border-color: var(--breeze); }

fieldset { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: .95rem 1.1rem; }
legend { color: var(--fg); font-weight: 800; padding: 0 .4rem; }

table { border-collapse: collapse; width: 100%; background: var(--card); border-radius: 12px; overflow: hidden; font-size: .86rem; }
th, td { border-bottom: 1px solid var(--border); padding: .55rem .65rem; text-align: left; vertical-align: middle; }
th { background: var(--card2); color: var(--faint); font-weight: 700; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
tr:last-child td, tr:last-child th { border-bottom: none; }
/* a label cell in a key/value table reads as a label, not as a column heading */
tbody th { background: transparent; color: var(--muted); font-size: .82rem; text-transform: none; letter-spacing: 0; white-space: normal; width: 1%; min-width: 11rem; }
tbody tr:hover td { background: var(--row-hover); }

.vg-card, .panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 17px 18px; min-width: 0; }

/* ======================= components (mockup v3) ======================= */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 16px; min-width: 0; text-decoration: none; color: inherit; display: block; }
a.kpi:hover { border-color: var(--breeze); }
.kh { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.ci { width: 30px; height: 30px; border-radius: 9px; background: var(--breeze-soft); color: var(--breeze-deep); display: flex; align-items: center; justify-content: center; flex: none; }
.ci svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ci.ok { background: var(--ok-soft); color: var(--ok); } .ci.warn { background: var(--warn-soft); color: var(--warn); } .ci.crit { background: var(--crit-soft); color: var(--crit); }
.ci.violet { background: var(--violet-soft); color: var(--violet); } .ci.teal { background: var(--teal-soft); color: var(--teal); }
.kv { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; margin-top: 9px; line-height: 1; font-variant-numeric: tabular-nums; }
.ks { font-size: .78rem; color: var(--muted); margin-top: 5px; font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: .35em; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.warn { background: var(--warn-soft); color: var(--warn); } .chip.crit { background: var(--crit-soft); color: var(--crit); }
.chip.plain { background: var(--card2); color: var(--muted); border: 1px solid var(--border); } .chip.blue { background: var(--breeze-soft); color: var(--breeze-deep); }
.phead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.panel h2 { font-size: .98rem; margin: 0 0 2px; }
.psub { color: var(--muted); font-size: .78rem; font-weight: 600; margin-bottom: 14px; }
.row2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stackv { display: flex; flex-direction: column; gap: 18px; }
.scroll { overflow-x: auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.dot.on { background: var(--ok); } .dot.off { background: var(--faint); } .dot.warn { background: var(--warn); } .dot.crit { background: var(--crit); }
.note-box { border-radius: 11px; padding: 10px 13px; font-size: .84rem; font-weight: 600; max-width: 62rem; margin: .5rem 0; }
.note-box.warn { border: 1px solid var(--warn-line); background: var(--warn-soft); color: var(--warn-ink); }
.note-box.info { border: 1px solid var(--info-line); background: var(--breeze-soft); color: var(--breeze-deep); }
.note-box.ok { border: 1px solid var(--ok-line); background: var(--ok-soft); color: var(--ok-ink); }
.note-box.crit { border: 1px solid var(--crit-line); background: var(--crit-soft); color: var(--crit-ink); }
.hint { color: var(--muted); font-size: .8rem; font-weight: 600; }

/* tiles: what a device is, with a dot for how it is */
.devid { display: flex; align-items: center; gap: 11px; min-width: 0; }
.dtile { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; position: relative; }
.dtile svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dtile.win { background: var(--breeze-soft); color: var(--breeze-deep); } .dtile.lin { background: var(--warn-soft); color: var(--warn); }
.dtile.srv { background: var(--violet-soft); color: var(--violet); } .dtile.unk { background: var(--card2); color: var(--faint); }
.dtile .st { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--card); }
.st.on { background: var(--ok); } .st.off { background: var(--faint); } .st.warn { background: var(--warn); } .st.crit { background: var(--crit); }
.dn { font-weight: 700; white-space: nowrap; } .dos { color: var(--muted); font-size: .76rem; font-weight: 600; white-space: nowrap; }

/* tick boxes + the action bar above a list */
tr.sel td { background: var(--breeze-soft) !important; }
.bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px 8px 14px; border-radius: 11px; background: var(--fg); color: var(--app-bg); font-size: .82rem; font-weight: 700; margin: 0 0 10px; }
.bulk select { background: var(--card); color: var(--fg); border-color: transparent; }
.bulk button { background: rgba(238, 246, 252, .17); border-color: transparent; color: inherit; border-radius: 8px; padding: 5px 11px; font-size: .78rem; }
.bulk button:hover { background: rgba(238, 246, 252, .28); border-color: transparent; }
.bulk button.danger { background: var(--crit); color: #fff; }
.bulk .hint { color: inherit; opacity: .8; }
.bulk a { color: inherit; }

/* group cards */
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.gcard { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ghead { display: flex; align-items: center; gap: 11px; }
.gico { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex: none; color: #fff; font-weight: 800; font-size: 1.05rem; }
.gname { font-weight: 800; font-size: .98rem; overflow-wrap: anywhere; } .gmeta { color: var(--muted); font-size: .78rem; font-weight: 600; }
.gdot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; vertical-align: -1px; margin-right: 4px; }

/* notes: look like text until you touch them */
.note-in { border: 1px dashed var(--border); border-radius: 8px; padding: 5px 9px; background: transparent; color: var(--fg); font: inherit; font-size: .8rem; font-weight: 600; width: 100%; min-width: 0; }
.note-in:hover { border-color: var(--faint); }
.note-in:focus { outline: 2px solid var(--breeze); outline-offset: 0; border-style: solid; background: var(--card); }
.note-in::placeholder { color: var(--faint); font-weight: 500; }
textarea.note-in { min-height: 54px; resize: vertical; }

@media (max-width: 900px) { .row2, .cols2 { grid-template-columns: minmax(0, 1fr); } }
