:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef1f6;
  --border: #e4e8ef;
  --border-strong: #d2d8e2;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eaf1ff;
  --accent-text: #ffffff;
  --red: #dc2626;      --red-soft: #fef1f1;
  --amber: #c2670a;    --amber-soft: #fff6e8;
  --blue: #2563eb;     --blue-soft: #edf3ff;
  --green: #15803d;    --green-soft: #ecfaf1;
  --violet: #7c3aed;   --violet-soft: #f4f0ff;
  --grey: #64748b;     --grey-soft: #f1f4f8;
  --sidebar: #0b1324;
  --sidebar-2: #131d33;
  --sidebar-text: #aab5c8;
  --sidebar-strong: #ffffff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px rgba(15, 23, 42, .05);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .22);
  --radius: 14px;
  --radius-sm: 9px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1c; --surface: #111827; --surface-2: #151e30; --surface-3: #1b2539; --border: #222d42; --border-strong: #2d3a53;
    --text: #e8ecf4; --text-2: #c3cbd9; --muted: #8b97ad; --faint: #64718a;
    --accent: #5b8cff; --accent-hover: #7aa2ff; --accent-soft: #18264a;
    --red: #f87171; --red-soft: #2c1519; --amber: #f5b14a; --amber-soft: #2c2110; --blue: #6c9cff; --blue-soft: #15223f;
    --green: #4ade80; --green-soft: #0f2a1b; --violet: #a78bfa; --violet-soft: #221a3d; --grey: #94a3b8; --grey-soft: #1a2232;
    --sidebar: #070b15; --sidebar-2: #111a2d;
    --shadow-sm: none; --shadow: 0 0 0 1px rgba(255, 255, 255, .01); --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f1c; --surface: #111827; --surface-2: #151e30; --surface-3: #1b2539; --border: #222d42; --border-strong: #2d3a53;
  --text: #e8ecf4; --text-2: #c3cbd9; --muted: #8b97ad; --faint: #64718a;
  --accent: #5b8cff; --accent-hover: #7aa2ff; --accent-soft: #18264a;
  --red: #f87171; --red-soft: #2c1519; --amber: #f5b14a; --amber-soft: #2c2110; --blue: #6c9cff; --blue-soft: #15223f;
  --green: #4ade80; --green-soft: #0f2a1b; --violet: #a78bfa; --violet-soft: #221a3d; --grey: #94a3b8; --grey-soft: #1a2232;
  --sidebar: #070b15; --sidebar-2: #111a2d;
  --shadow-sm: none; --shadow: 0 0 0 1px rgba(255, 255, 255, .01); --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.error { color: var(--red); margin: 0; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.ico { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 15px; height: 15px; }
.ico.lg { width: 22px; height: 22px; }

/* ---------- Tones ---------- */
.t-red { --c: var(--red); --cs: var(--red-soft); }
.t-amber { --c: var(--amber); --cs: var(--amber-soft); }
.t-blue { --c: var(--blue); --cs: var(--blue-soft); }
.t-green { --c: var(--green); --cs: var(--green-soft); }
.t-violet { --c: var(--violet); --cs: var(--violet-soft); }
.t-grey { --c: var(--grey); --cs: var(--grey-soft); }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-weight: 550; font-size: 13px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  padding: 7px 13px; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn:focus-visible, .icon-btn:focus-visible, .chip:focus-visible, .tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--red); }
.btn.quiet, .btn.quiet:disabled { background: var(--green-soft); border-color: transparent; color: var(--green); opacity: 1; cursor: default; }
.btn.danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger-solid:hover { filter: brightness(1.08); background: var(--red); }
.ui-dialog { max-width: 460px; }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.btn.lg { padding: 11px 16px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 11px; width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 550; color: var(--text-2); flex: 1; min-width: 0; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check input { width: auto; }

/* Switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  width: 34px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; flex: none; transition: background .15s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .55; }

/* Pills / badges / tags */
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; line-height: 1;
  padding: 5px 9px; border-radius: 999px; color: var(--c); background: var(--cs); white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.tag {
  display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; letter-spacing: .02em; line-height: 1;
  padding: 4px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.tag.c { background: var(--cs); color: var(--c); }
.count {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center; background: var(--red); color: #fff;
}
.count:empty { display: none; }
.count.amber { background: var(--amber); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
/* left half: digital rain (matrix.js) behind the logo and the name */
.login-hero { position: relative; overflow: hidden; display: grid; place-items: center; background: #0b1324; }
#matrix { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-mark {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 70px 90px;
  background: radial-gradient(closest-side, rgba(11, 19, 36, .92) 55%, rgba(11, 19, 36, 0)); text-align: center;
}
.logo.logo-xl { width: 104px; height: 104px; border-radius: 28px; box-shadow: 0 0 0 1px rgba(147, 197, 253, .25), 0 0 48px rgba(59, 130, 246, .55), 0 18px 40px rgba(0, 0, 0, .45); }
.logo.logo-xl::before { width: 66px; height: 66px; }
.hero-name { font-size: 48px; font-weight: 750; letter-spacing: -.02em; color: #fff; line-height: 1; text-shadow: 0 0 24px rgba(59, 130, 246, .65); }
.login-side { display: grid; place-items: center; padding: 32px 20px; background: var(--surface); }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 18px; }
.login-card h2 { font-size: 24px; }
.login-card p { margin: 4px 0 0; }

.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; color: var(--sidebar-strong); }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--sidebar-text); letter-spacing: .02em; }
.logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8); box-shadow: 0 6px 16px rgba(37, 99, 235, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.logo::before { content: ""; width: 22px; height: 22px; background: url(logo-mark.svg) center / contain no-repeat; }
.brand-rmm { font-weight: 500; opacity: .72; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  background: var(--sidebar); color: var(--sidebar-text); padding: 20px 14px; border-right: 1px solid rgba(255, 255, 255, .04);
}
.sidebar .brand { padding: 2px 8px 10px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #5d6a82; padding: 14px 10px 6px; }
.nav a, .nav button, .sidebar-foot button {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border-radius: 9px; border: none; background: none;
  color: var(--sidebar-text); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; text-decoration: none; text-align: left;
}
.nav a:hover, .nav button:hover, .sidebar-foot button:hover { background: rgba(255, 255, 255, .05); color: #fff; text-decoration: none; }
.nav a.active { background: var(--sidebar-2); color: #fff; box-shadow: inset 3px 0 0 #5b8cff; }
.nav a.active .ico { color: #7aa2ff; }
.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .06); padding-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-foot .server { font-size: 11.5px; padding: 6px 10px 2px; color: #5d6a82; display: flex; align-items: center; gap: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); flex: none; }
.dot.off { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); }
.scrim { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 14px 32px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .menu { display: none; }
.titles { min-width: 0; flex: 1; }
.titles h1 { font-size: 20px; font-weight: 650; }
.titles p { margin: 2px 0 0; font-size: 13px; }
.top-tools { display: flex; align-items: center; gap: 10px; }
.search { position: relative; width: 300px; }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input { padding-left: 36px; background: var(--surface); }
.sync { font-size: 12px; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.content { padding: 24px 32px 64px; max-width: 1560px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.page { display: flex; flex-direction: column; gap: 22px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-h h2, .card-h h3 { font-size: 15px; font-weight: 650; }
.card-h .sub { font-size: 12.5px; color: var(--muted); }
.card-b { padding: 18px 20px; }
.card-b.flush { padding: 0; }
.section-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section-title h2 { font-size: 15px; font-weight: 650; }

.grid-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); gap: 22px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.stack.tight { gap: 10px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { min-width: 150px; }

/* KPI tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.tile {
  position: relative; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; transition: border-color .12s, box-shadow .12s, transform .12s;
}
.tile:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.tile.static { cursor: default; }
.tile.static:hover { transform: none; border-color: var(--border); }
.tile.active { border-color: var(--c); box-shadow: 0 0 0 3px var(--cs); }
.tile .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile .label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tile .badge-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--cs); color: var(--c); }
.tile .value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.tile .value.zero { color: var(--faint); }
.tile .foot { font-size: 12px; color: var(--muted); }
.tiles.compact { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 12px; }
.tiles.compact .tile { padding: 12px 14px; gap: 6px; }
.tiles.compact .value { font-size: 24px; }

/* Chips / filters */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font: inherit; font-size: 12.5px; font-weight: 550; cursor: pointer; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
}
.chip:hover { border-color: var(--faint); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--surface); }
.chip .n { opacity: .6; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 11.5px; font-weight: 650; letter-spacing: .03em; text-transform: uppercase; color: var(--muted);
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: var(--surface-2); }
.tbl .r { text-align: right; }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 20px; }
.cell-title { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.tbl-empty { padding: 36px 20px; text-align: center; color: var(--muted); }

/* Action list */
.actions { display: flex; flex-direction: column; }
.action { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.action:last-child { border-bottom: none; }
.action .a-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--cs); color: var(--c); }
.action .a-title { font-weight: 600; }
.action .a-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.action .a-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.all-clear { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 20px; text-align: center; color: var(--muted); }
.all-clear .big { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green); }
.all-clear .big .ico { width: 26px; height: 26px; }
.all-clear b { color: var(--text); font-size: 15px; }

/* Maintenance window hero */
.window-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 20px 22px; }
.cal {
  width: 66px; border-radius: 12px; overflow: hidden; text-align: center; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm);
}
.cal .m { background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 0; }
.cal .d { font-size: 26px; font-weight: 700; padding: 4px 0 0; line-height: 1.1; }
.cal .w { font-size: 11px; color: var(--muted); padding-bottom: 6px; }
.window-card h3 { font-size: 17px; font-weight: 650; }
.window-card .when { color: var(--text-2); margin-top: 2px; }
.countdown { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--c); background: var(--cs); padding: 4px 10px; border-radius: 999px; }
.policy { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; color: var(--text-2); }
.policy span { display: inline-flex; align-items: center; gap: 5px; }
.policy .yes .ico { color: var(--green); }
.policy .no .ico { color: var(--red); }
.policy-fold { margin-top: 12px; }
.policy-fold summary { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; list-style: none; font-size: 12.5px; font-weight: 600; color: var(--muted); user-select: none; }
.policy-fold summary::-webkit-details-marker { display: none; }
.policy-fold summary:hover { color: var(--text); }
.policy-fold summary .ico { transition: transform .15s; }
.policy-fold[open] summary .ico { transform: rotate(90deg); }
.policy-fold .policy:first-of-type { margin-top: 8px; }

/* Folding side cards (Software page): closed shows only the title line; open uses smaller text */
.card.fold > .card-h { cursor: pointer; user-select: none; padding-top: 12px; padding-bottom: 12px; }
.card.fold > .card-h:hover h2 { color: var(--accent); }
.card.fold > .card-h:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius); }
.card.fold > .card-h h2 { font-size: 13.5px; }
.card.fold > .card-h .sub { font-size: 12px; }
.card.fold .fold-ico { color: var(--muted); transition: transform .15s; margin-right: -4px; }
.card.fold:not(.folded) .fold-ico { transform: rotate(90deg); }
.card.fold.folded > .card-h { border-bottom: 0; }
.card.fold.folded > .card-b { display: none; }
.card.fold > .card-b { font-size: 12.5px; }
.card.fold > .card-b .tbl th, .card.fold > .card-b .tbl td { font-size: 12.5px; padding-top: 8px; padding-bottom: 8px; }
.card.fold > .card-b .check, .card.fold > .card-b .field { font-size: 12.5px; }
.card.fold > .card-b .btn:not(.sm) { padding: 6px 11px; font-size: 12.5px; }
.card.fold > .card-b input, .card.fold > .card-b select { font-size: 12.5px; padding: 6px 9px; }
.card.fold > .card-b b, .card.fold > .card-b .cell-title { font-size: 12.5px; }

/* Uploaded installers */
.ico.flip { transform: rotate(180deg); }
.pkg-old { opacity: .7; }
.upload-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.upload-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* Find PC (Windows Update list) */
.pc-search-wrap { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--muted); }
.pc-search-wrap:focus-within { border-color: var(--accent); }
.pc-search-wrap input { border: 0; background: transparent; box-shadow: none; padding: 6px 0; width: 200px; color: var(--text); font-size: 13px; }
.pc-search-wrap input:focus { outline: none; box-shadow: none; }
@media (max-width: 640px) { .pc-search-wrap input { width: 130px; } }

/* Bars and distribution */
.dist { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.dist span { background: var(--c); min-width: 4px; }
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin-top: 14px; font-size: 13px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); flex: none; }
.legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar .hb-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; gap: 8px; }
.hbar .track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.hbar .track span { display: block; height: 100%; border-radius: 999px; background: var(--c); }

/* ---------- Supplies ---------- */
.ship .action { grid-template-columns: 38px minmax(0, 1.2fr) minmax(0, 1fr) auto; }
.ship-what { font-size: 13px; }
.ship-what .why { color: var(--red); font-size: 12.5px; font-weight: 550; }
.group { display: flex; flex-direction: column; gap: 14px; }
.group-head {
  display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; flex-wrap: wrap;
  background: none; border: none; font: inherit; color: inherit; padding: 2px 0; text-align: left;
}
.group-head h2 { font-size: 16px; font-weight: 650; }
.group-head .caret { color: var(--muted); transition: transform .15s; display: inline-flex; }
.group.collapsed .caret { transform: rotate(-90deg); }
.group.collapsed .cards { display: none; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.loc { overflow: hidden; position: relative; }
.loc::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c, transparent); }
.loc-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 10px 18px; }
.loc-head .title { font-weight: 650; font-size: 14.5px; flex: 1; }
.printer { padding: 12px 18px 14px; border-top: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.loc-head + .printer { border-top: none; padding-top: 4px; }
.printer:hover { background: var(--surface-2); }
.printer.off { opacity: .55; }
.p-line { display: flex; align-items: center; gap: 8px; }
.p-model { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-pc { color: var(--muted); font-size: 12px; margin: 2px 0 8px; display: flex; align-items: center; gap: 6px; }
.supply { display: grid; grid-template-columns: 130px minmax(0, 1fr) 64px; gap: 10px; align-items: center; margin-top: 7px; font-size: 12.5px; }
.supply .sname { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.supply .sval { text-align: right; white-space: nowrap; font-weight: 650; font-variant-numeric: tabular-nums; }
.bar { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--c, var(--green)); }
.bar.unknown { background: repeating-linear-gradient(45deg, var(--surface-3) 0 6px, var(--border) 6px 12px); }
.supply.low { --c: var(--red); } .supply.low .sval { color: var(--red); }
.supply.mid { --c: var(--amber); } .supply.mid .sval { color: var(--amber); }
.supply.good { --c: var(--green); }
.supply.na .sval { color: var(--faint); font-weight: 500; }
.p-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; margin-top: 9px; flex-wrap: wrap; }
.p-meta .src { display: inline-flex; align-items: center; gap: 5px; }
.p-alert { color: var(--red); font-size: 12px; font-weight: 550; margin-top: 6px; }

/* ---------- Windows / updates ---------- */
.os { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.os .ver { font-weight: 650; }
.kind { font-size: 11px; font-weight: 650; padding: 3px 7px; border-radius: 6px; background: var(--cs); color: var(--c); white-space: nowrap; }
.checks { display: flex; flex-direction: column; gap: 9px; margin: 4px 0 14px; }
.checks div { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.checks .ok { color: var(--green); } .checks .bad { color: var(--red); }
.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: 11px; background: var(--cs); color: var(--text-2); font-size: 13px; border: 1px solid color-mix(in srgb, var(--c) 25%, transparent); }
.callout .ico { color: var(--c); margin-top: 1px; }

/* ---------- Dialogs ---------- */
.dialog {
  border: 1px solid var(--border); border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.dialog.wide { width: min(760px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(8, 12, 24, .5); backdrop-filter: blur(2px); }
.dialog-body { display: flex; flex-direction: column; }
.d-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 22px 16px; border-bottom: 1px solid var(--border); }
.d-head h3 { font-size: 18px; font-weight: 650; }
.d-head p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.d-main { padding: 18px 22px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.d-foot { display: flex; gap: 8px; align-items: center; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px; flex-wrap: wrap; }
.sheet {
  margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(620px, 100vw); border-radius: 0; border-width: 0 0 0 1px;
  height: 100dvh; max-height: 100dvh;
}
.sheet .dialog-body { height: 100%; }
.sheet .d-main { flex: 1; }
.sheet .d-foot { border-radius: 0; }
.sheet[open] { animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.d-section { display: flex; flex-direction: column; gap: 12px; }
.d-section > h4 { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.facts { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 9px 16px; margin: 0; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.box { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.mini-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.mini-list .li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.mini-list .li:last-child { border-bottom: none; }
.mini-list .li.dim { opacity: .65; }
.code {
  background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 0;
  font: 12.5px/1.6 "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; word-break: break-all;
}
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.pc-grid { display: grid; grid-template-columns: 130px minmax(0, 1fr) minmax(0, 1fr) 80px; gap: 10px; align-items: center; }
.pc-head { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.list-edit { display: flex; flex-direction: column; gap: 8px; }
.list-edit .item { display: flex; gap: 8px; align-items: center; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 100;
  background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow-lg);
  transition: opacity .2s, transform .2s; pointer-events: none; display: flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.empty-page { text-align: center; color: var(--muted); padding: 60px 20px; }

/* ---------- Responsive ---------- */
/* Settings & agents */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.agent-card { border: 1px solid var(--border); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); min-width: 0; }
.agent-top { display: flex; align-items: center; gap: 12px; }
.agent-card h3 { margin: 0; font-size: 16px; }
.agent-ico { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); flex: none; }
.agent-ico.sm { width: 32px; height: 32px; border-radius: 8px; }
.agent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.agent-list li { display: flex; gap: 8px; align-items: flex-start; }
.agent-list .ico { color: var(--accent); margin-top: 2px; flex: none; }
.agent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.agent-card .code { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.setting-list { display: flex; flex-direction: column; }
.setting-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border: 0; border-top: 1px solid var(--border); background: transparent;
  color: var(--text); font: inherit; text-align: left; cursor: pointer; width: 100%; }
.setting-row:first-child { border-top: 0; }
.setting-row:hover { background: var(--surface-2); }
.setting-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.setting-row > div { min-width: 0; }
@media (max-width: 600px) { .agent-grid { grid-template-columns: 1fr; } }

/* Paper usage: weekly columns (single series, accent) */
.wbars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 22px; }
.wbars .wcol { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; min-width: 0; }
.wbars .wbar { width: 100%; max-width: 56px; background: var(--accent); border-radius: 4px 4px 0 0; }
.wbars .wbar.zero { height: 2px !important; background: var(--border-strong); }
.wbars .wlbl { position: absolute; bottom: -22px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.wbars .wval { font-size: 12px; font-weight: 650; color: var(--text); margin-bottom: 4px; }
.wbars { margin-bottom: 22px; }
.wbars .wcol:hover .wbar { filter: brightness(1.15); }
.wbars .wcol[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--surface); font-size: 12px; padding: 5px 8px; border-radius: 6px; white-space: nowrap; z-index: 5; pointer-events: none; }
.wbars.sm { height: 28px; gap: 2px; padding-top: 0; margin-bottom: 0; width: 120px; }
.wbars.sm .wbar { border-radius: 2px 2px 0 0; }
.wbars.sm .wcol[data-tip]:hover::after { bottom: calc(100% + 6px); }
.pack { display: inline-block; min-width: 44px; padding: 3px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-weight: 700; text-align: center; }
/* PC health: drive usage bars */
.ubar { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.ubar-track { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.ubar-track span { display: block; height: 100%; border-radius: 4px; background: var(--c); }
.ubar.t-blue { --c: var(--accent); }
.ubar-txt { font-size: 12px; font-variant-numeric: tabular-nums; }

/* Software */
.policy-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card.flat { box-shadow: none; }
.add-app { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Live status dot */
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; flex: none; }
.live-dot.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.live-dot.off { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.live-dot.unk { background: transparent; border: 1.5px solid var(--faint); width: 7px; height: 7px; }

/* Software: out-of-date count opens the list of PCs */
.count-btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid transparent; border-radius: 999px; padding: 2px 6px 2px 10px;
  background: var(--cs); color: var(--c); font: inherit; font-weight: 700; cursor: pointer; }
.count-btn:hover { border-color: var(--c); }
.count-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.count-btn .ico { transform: rotate(90deg); transition: transform .15s; }
.count-btn.open .ico { transform: rotate(-90deg); }
.tbl tr.open-row td { background: var(--surface-2); border-bottom: none; }
.tbl tr.detail-row td { background: var(--surface-2); padding-top: 0; }
.outdated-box { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.outdated-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mini-list .li.click { cursor: pointer; }
.mini-list .li.click:hover { background: var(--surface-2); }

/* Overview: one card per area */
.areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.area { display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 14px 16px; border-radius: 14px; cursor: pointer; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--c); box-shadow: var(--shadow, none); transition: border-color .15s, transform .15s; }
.area:hover { border-color: var(--c); transform: translateY(-1px); }
.area:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.area-top { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.area-top .badge-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--cs); color: var(--c); flex: none; }
.area-title { flex: 1; font-size: 13px; font-weight: 650; color: var(--text-2, var(--text)); }
.area-verdict { font-size: 19px; font-weight: 700; letter-spacing: -.01em; color: var(--c); }
.area.t-grey .area-verdict { color: var(--muted); font-weight: 600; }
.area-also { font-size: 13px; font-weight: 600; color: var(--amber); }
.area-facts { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.att-group + .att-group { border-top: 1px solid var(--border); }
.att-head { display: flex; align-items: center; gap: 8px; padding: 12px 20px 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--c); }
.att-head i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.att-more { margin: 4px 20px 12px; }
.fleet-sep { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 6px; }
.page#page-overview > .grid-main { margin-top: 18px; }
@media (max-width: 600px) {
  .areas { grid-template-columns: 1fr 1fr; gap: 10px; }
  .area { padding: 11px 12px; gap: 5px; }
  .area-top .badge-ico { width: 26px; height: 26px; }
  .area-top > .ico:last-child { display: none; }
  .area-verdict { font-size: 15px; }
  .area-also { display: block; font-size: 12px; }
  .area-facts div + div { display: none; }
}

/* PC panel tabs */
/* stays visible at the top of the panel while the tab scrolls (d-main has 18px top padding) */
.pc-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; border-bottom: 1px solid var(--border); margin: -18px -22px 4px; padding: 6px 22px 0;
  position: sticky; top: -18px; z-index: 5; background: var(--surface); flex-shrink: 0; }
.pc-tabs .pc-back { display: inline-flex; align-items: center; gap: 2px; margin-right: 6px; padding: 6px 10px 6px 6px; border: 1px solid var(--border-strong) !important;
  border-radius: 999px; color: var(--text); font-size: 12.5px; }
.pc-tabs .pc-back .ico { transform: rotate(180deg); }
.pc-tabs .pc-back:hover { border-color: var(--accent) !important; color: var(--accent); }
.pc-tabs button { border: 0; background: transparent; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); padding: 9px 12px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.pc-tabs button:hover { color: var(--text); }
.pc-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.pc-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.reopen-chip { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; padding: 2px 9px 2px 7px; border-radius: 999px; border: 1px dashed var(--border-strong);
  background: transparent; color: var(--faint); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.reopen-chip:hover { color: var(--text); border-color: var(--faint); }
.reopen-chip.on { border-style: solid; border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.reopen-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Sign-in steps */
.step-form { display: flex; flex-direction: column; gap: 14px; }
.step-form h2 { margin: 0 0 4px; }
.code-input { font-size: 22px; letter-spacing: .2em; text-align: center; font-variant-numeric: tabular-nums; }
.qr { display: grid; place-items: center; padding: 12px; background: #fff; border-radius: 12px; border: 1px solid var(--border); }
.qr img { image-rendering: pixelated; display: block; max-width: 100%; }
.secret { display: block; margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface-3); font-size: 13px; word-break: break-all; user-select: all; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 14px; }
.check input { margin-top: 3px; width: 16px; height: 16px; flex: none; }
.check small { display: block; color: var(--muted); font-size: 12px; }
.recovery { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.recovery code { padding: 8px; border-radius: 8px; background: var(--surface-3); text-align: center; font-size: 14px; letter-spacing: .05em; }
.whoami { display: flex; flex-direction: column; padding: 6px 10px; font-size: 12.5px; color: var(--sb-muted, #94a3b8); }
.whoami b { color: var(--sb-text, #e2e8f0); font-weight: 600; }
/* Viewers only look: hide the controls they cannot use (the server refuses them anyway) */
body[data-role="viewer"] [data-open="addDialog"], body[data-role="viewer"] [data-open="policyDialog"],
body[data-role="viewer"] #pcRename, body[data-role="viewer"] #pcRemove, body[data-role="tech"] #pcRename, body[data-role="tech"] #pcRemove,
body:not([data-role="admin"]) [data-open="groupsDialog"], body:not([data-role="admin"]) [data-open="settingsDialog"],
body:not([data-role="admin"]) [data-open="policyDialog"], body:not([data-role="admin"]) [data-open="addDialog"] { display: none; }
@media print { body * { visibility: hidden; } .recovery, .recovery * { visibility: visible; } .recovery { position: absolute; top: 20px; left: 20px; } }

/* Accounts */
.account { display: flex; flex-direction: column; gap: 14px; }
.account-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.account-facts > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.ok-text { color: var(--green); }
.bad-text { color: var(--red); }
.action-select { width: auto; min-width: 120px; }

/* Warning signs */
.sign-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.sign { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.sign b { font-size: 18px; color: var(--text); }
.sign.warn { border-color: var(--amber); background: var(--amber-soft); }
.sign.warn b { color: var(--amber); }
.sign.bad { border-color: var(--red); background: var(--red-soft); }
.sign.bad b { color: var(--red); }

/* PC picker in the install / remove dialog */
.pc-pick { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; display: flex; flex-direction: column; gap: 4px; }
.pc-pick .check { font-size: 13.5px; padding: 3px 0; }
.pc-pick .check small { display: inline; margin-left: 6px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }

/* Notifications */
.notify-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.notify-grid .row { display: flex; gap: 10px; flex-wrap: wrap; }
.notify-grid .row .field { flex: 1; min-width: 140px; }
.matrix td.c, .matrix th.c { text-align: center; width: 110px; }
.matrix input { width: 17px; height: 17px; }
.mini-links { font-weight: 400; font-size: 11px; text-transform: none; letter-spacing: 0; }
button.link { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }

.win-tile .win-list { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.win-tile .win-list > div { display: flex; justify-content: space-between; gap: 8px; }
.win-tile .win-list b { font-size: 15px; }
.win-tile .win-list .old b { color: var(--amber); }
.group-pick { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); }
.group-pick select { border: 0; background: transparent; font-weight: 600; color: var(--text); padding: 4px 6px; width: auto; box-shadow: none; }
/* the opened list of a select is drawn by the browser: give it the theme's colours (white on white in dark mode otherwise) */
select option, select optgroup { background: var(--surface); color: var(--text); }
.group-pick.active { border-color: var(--accent); background: var(--accent-soft); }
.group-pick.active select { color: var(--accent); }

/* Microsoft 365 */
.office-scope { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.check.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.check.inline input { margin: 0; }

/* Data pools */
.pool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; margin-bottom: 18px; }
.pool { border-top: 3px solid var(--c); }
.pool .card-b { display: flex; flex-direction: column; gap: 10px; }
.pool-head { display: flex; align-items: baseline; justify-content: space-between; }
.pool-big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.pool-bar { height: 12px; position: relative; overflow: visible; border-radius: 6px; }
.pool-bar span { background: var(--c); border-radius: 6px; }
.pool-bar i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--red); opacity: .7; }
.pool-share { display: flex; flex-direction: column; gap: 6px; }
.pool-share > div { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto auto; gap: 10px; align-items: center; font-size: 13px; }
/* Compact volume cards (under the usage table): about half the size, more per row */
.pool-grid.compact { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 18px; }
.pool-grid.compact .card-h { padding: 9px 12px; gap: 6px; }
.pool-grid.compact .card-h h2 { font-size: 13px; }
.pool-grid.compact .card-h .sub { font-size: 11px; flex-basis: 100%; order: 3; margin-top: -4px; }
.pool-grid.compact .card-b { padding: 10px 12px; gap: 6px; font-size: 11.5px; }
.pool-grid.compact .pool-big { font-size: 19px; }
.pool-grid.compact .pool-head .muted { font-size: 11.5px; }
.pool-grid.compact .pill { font-size: 11px; padding: 2px 7px; }
.pool-grid.compact .pool-bar { height: 7px; }
.pool-grid.compact .small, .pool-grid.compact .callout { font-size: 11px; line-height: 1.4; }
.pool-grid.compact .callout { padding: 7px 9px; gap: 7px; }
.pool-grid.compact .callout .ico { width: 14px; height: 14px; }
.pool-grid.compact .pool-share { gap: 3px; }
.pool-grid.compact .pool-share > div { font-size: 11.5px; gap: 6px; }
.pool-grid.compact .agent-actions { gap: 5px; }
.pool-grid.compact .agent-actions .btn { padding: 4px 9px; font-size: 11.5px; }
.pool-grid.compact .icon-btn { width: 24px; height: 24px; }
.pool-share .ubar-track span { background: var(--accent); }
.mini-bar { height: 4px; border-radius: 2px; background: var(--surface-3); margin-top: 4px; overflow: hidden; }
.mini-bar span { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.mini-bar[class*="t-"] span { background: var(--c); }
.data-used { min-width: 70px; }

@media (max-width: 1200px) {
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .search { width: 220px; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(8, 12, 24, .5); z-index: 40; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .topbar .menu { display: inline-grid; }
  .top-tools { width: 100%; }
  .search { flex: 1; width: auto; }
  .content { padding: 18px 16px 48px; }
  .login { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .login-hero { min-height: 210px; }
  .hero-mark { flex-direction: row; gap: 14px; padding: 40px 48px; }
  .logo.logo-xl { width: 60px; height: 60px; border-radius: 17px; }
  .logo.logo-xl::before { width: 38px; height: 38px; }
  .hero-name { font-size: 32px; }
  .window-card { grid-template-columns: auto minmax(0, 1fr); }
  .window-card > :last-child { grid-column: 1 / -1; }
  .ship .action, .action { grid-template-columns: 38px minmax(0, 1fr); }
  .ship .action > :nth-child(n+3), .action .a-btns { grid-column: 2; justify-content: flex-start; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .supply { grid-template-columns: 96px minmax(0, 1fr) 54px; }
  .facts { grid-template-columns: 110px minmax(0, 1fr); }
  .pc-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pc-head { display: none; }
  .hide-sm { display: none; }
}

/* Data volume: this month per school, history per year */
.data-school { font-weight: 600; font-size: 15px; }
.data-big { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.data-used .pill { font-size: 15px; padding: 4px 10px; }
.year-months { display: flex; flex-direction: column; gap: 6px; }
.ym { display: grid; grid-template-columns: 40px minmax(0, 1fr) 76px; gap: 10px; align-items: center; font-size: 13px; }
.ym.none { color: var(--muted); }
.ym-track { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.ym-track span { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.ym b { text-align: right; }
.pool .card-h .sub { font-size: 14px; font-weight: 600; color: var(--text); }
.share-name { font-size: 14.5px; font-weight: 600; }
.tk-note { font-size: 12px; padding: 8px 10px; }
.tk-note b { font-size: 12.5px; }
.data-search { min-width: 240px; flex: 0 1 320px; }
.icon-btn.sm { width: 26px; height: 26px; }

/* PC keys */
.stack { display: flex; flex-direction: column; gap: 12px; }
.ok-text { color: var(--green); }
.bad-text { color: var(--red); }

.card.attention { border-color: var(--red); }

/* RustDesk */
.rd-id { font-size: 22px; font-weight: 700; letter-spacing: .02em; }
/* PC panel: RAM statistics */
.mem-stats { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; padding-top: 12px; border-top: 1px solid var(--border); }
.mem-headline { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; }
.mem-chart { display: flex; flex-direction: column; gap: 6px; }
.mem-legend { display: flex; gap: 14px; color: var(--muted); }
.mem-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mem-legend i { display: inline-block; }
.lg-bar { width: 9px; height: 9px; border-radius: 2px; background: var(--accent); }
.lg-max { width: 12px; height: 2px; background: var(--text-2); }
.lg-limit { width: 14px; border-top: 2px dashed var(--amber); }
.lg-work { width: 12px; height: 10px; border-radius: 2px; background: var(--accent-soft); }
.mem-off { color: var(--amber); }
.mem-col.work .mem-plot { background: var(--accent-soft); border-radius: 0; }
.mem-grid { position: relative; display: grid; grid-template-columns: repeat(24, 1fr); gap: 0; height: 120px; padding-bottom: 18px;
  background: linear-gradient(var(--border), var(--border)) left calc(100% - 18px) / 100% 1px no-repeat; }
.mem-limit { position: absolute; left: 0; right: 0; bottom: calc(18px + (100% - 18px) * var(--limit) / 100); border-top: 2px dashed var(--amber); opacity: .7; pointer-events: none; z-index: 1; }
.mem-col { position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: 6px; outline: none; cursor: default; }
.mem-col:hover .mem-plot, .mem-col:focus-visible .mem-plot { background: var(--surface-3); }
.mem-plot { position: relative; flex: 1; border-radius: 6px 6px 0 0; }
.mem-bar { position: absolute; left: 22%; right: 22%; bottom: 0; background: var(--accent); border-radius: 4px 4px 0 0; }
.mem-max { position: absolute; left: 14%; right: 14%; height: 2px; background: var(--text-2); border-radius: 1px; }
.mem-x { position: absolute; bottom: -17px; left: 0; right: 0; text-align: center; font-size: 10.5px; color: var(--muted); }
.mem-col.empty .mem-x { color: var(--faint); }
.mem-readout { color: var(--text-2); min-height: 1.4em; }
.mem-weekdays { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.mem-days summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.mem-days summary:hover { color: var(--text); }
.mem-days .table-wrap { margin-top: 6px; }
.mem-days .tbl th, .mem-days .tbl td { font-size: 12px; padding-top: 6px; padding-bottom: 6px; }

/* PC panel: RustDesk in one compact row */
.rd-box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 3px; }
.rd-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.rd-row img { flex: none; }
.rd-num { font-size: 14px; font-weight: 700; letter-spacing: .03em; white-space: nowrap; }
.rd-row .pill { font-size: 11px; padding: 2px 7px; }
.rd-meta { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.btn.xs { padding: 3px 9px; font-size: 12px; border-radius: 7px; gap: 4px; min-height: 0; line-height: 1.4; }
.btn.xs .ico { width: 14px; height: 14px; }
.rd-cell { width: 44px; padding-left: 4px !important; padding-right: 4px !important; text-align: center; }
.rd-quick { display: inline-flex; padding: 5px; border-radius: 8px; line-height: 0; }
.rd-quick img { display: block; }
a.rd-quick:hover { background: var(--surface-3); }
a.rd-quick:hover img { transform: scale(1.1); }
.rd-quick.off img { filter: grayscale(1); opacity: .3; }

/* Blocked updates in the policy dialog: KB + Microsoft's name */
.kb-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.kb-chip { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2, transparent); font-size: 12.5px; min-width: 0; }
.kb-chip .ellipsis { flex: 1; min-width: 0; color: var(--muted); }
.kb-add { display: flex; gap: 8px; align-items: center; }
.kb-add input { flex: 1; min-width: 0; }

/* Dismissed alerts in "Needs attention" */
.action .a-dismiss { color: var(--muted); }
.action .a-dismiss:hover { color: var(--text); }
.action.dismissed { opacity: .72; }
.att-more .ico.open { transform: rotate(90deg); }

/* Fleet: online / offline counts in their colour */
.hbar.strong .hb-top b { color: var(--c); font-size: 15px; }

/* --- Logs page --- */
body:not([data-role="admin"]) .admin-only { display: none !important; }
.log-bar { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.log-bar-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.log-dates { display: flex; gap: 6px; align-items: center; }
.log-dates input { width: auto; padding: 5px 8px; font-size: 12.5px; }
.log-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius); padding: 0 10px; background: var(--surface); }
.log-search:focus-within { border-color: var(--accent); }
.log-search .ico { color: var(--muted); flex-shrink: 0; }
.log-search input { border: 0; background: transparent; box-shadow: none; padding: 9px 0; width: 100%; outline: none; }
.log-filters select { width: auto; font-size: 12.5px; }
.log-chart { display: flex; flex-direction: column; gap: 6px; }
.log-svg { width: 100%; height: 150px; display: block; }
.log-svg .seg, .log-legend .seg { fill: var(--grey); background: var(--grey); }
.log-svg .seg.error, .log-legend .seg.error { fill: var(--red); background: var(--red); }
.log-svg .seg.warn, .log-legend .seg.warn { fill: var(--amber); background: var(--amber); }
.log-svg .seg.info { opacity: .45; }
.log-legend .seg.info { opacity: .45; }
.log-svg .hit { fill: transparent; cursor: pointer; outline: none; }
.log-svg .hit:hover, .log-svg .hit:focus-visible { fill: var(--text); fill-opacity: .06; }
.log-legend { display: flex; gap: 16px; color: var(--muted); }
.log-legend span { display: inline-flex; align-items: center; gap: 6px; }
.log-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.log-axis { display: flex; }
.log-axis span { flex: 1; text-align: center; white-space: nowrap; overflow: visible; font-size: 11px; }
.log-readout { min-height: 18px; }
.log-list table { table-layout: auto; }
.log-day td { background: var(--surface-2); font-size: 12.5px; padding: 8px 16px !important; position: sticky; top: 0; z-index: 1; border-top: 1px solid var(--border); }
.log-row { cursor: pointer; }
.log-row:hover td { background: var(--surface-2); }
.log-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.log-row.lv-error td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.log-row.lv-warn td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.log-row.open td { background: var(--surface-2); border-bottom: 0; }
.log-what { min-width: 220px; max-width: 520px; }
.log-what .cell-sub.ellipsis { max-width: 520px; }
.log-level { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--c); }
.log-level.t-grey { color: var(--muted); font-weight: 500; }
.log-cat { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.log-cat .ico { color: var(--muted); }
.log-detail td { background: var(--surface-2); padding-top: 0 !important; }
.log-detail-box { display: flex; flex-direction: column; gap: 10px; padding: 4px 4px 12px; }
.log-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.log-raw { max-height: 260px; overflow: auto; font-size: 11.5px; margin: 0; }
.log-more { display: flex; justify-content: center; padding: 14px; border-top: 1px solid var(--border); }

/* Disks in the PC panel: extra drives / disks that are not watched */
.vol-row { display: flex; gap: 12px; align-items: center; }
.vol-row .ubar { flex: 1; min-width: 0; }
.vol-row.unwatched .ubar, .li.unwatched > div:first-child { opacity: .55; }
.switch.sm { font-size: 12px; gap: 6px; }

/* Waiting for approval: one compact line per PC, scrolls when many */
.enroll-list { max-height: 320px; overflow-y: auto; }
.enroll-row { display: flex; align-items: center; gap: 10px; padding: 5px 16px; font-size: 13px; border-top: 1px solid var(--border); min-width: 0; }
.enroll-row:first-child { border-top: 0; }
.enroll-row.doubt { background: rgba(220, 60, 60, .07); }
.enroll-row .en-name, .enroll-row .en-tag { white-space: nowrap; }
.enroll-row .en-tag, .enroll-row .en-meta { font-size: 12px; }
.enroll-row .en-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 560px) { .enroll-row .en-meta { display: none; } }

/* iPhone/iPad: fields at 16px, else Safari zooms in on every tap into a field */
@media (max-width: 900px) { input, select, textarea { font-size: 16px; } }

/* Overview: schools at a glance (many schools: small tiles that wrap) */
.school-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.school-search { flex: 1; min-width: 150px; max-width: 260px; margin-left: auto; }
.school-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 5px; }
.school-tile { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 8px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); color: inherit; font: inherit; font-size: 11.5px; line-height: 1.35; text-align: left; cursor: pointer; }
.school-tile:hover { border-color: var(--border-strong); }
.school-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.school-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.school-meta { flex: none; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.school-tile.s-on .school-dot { background: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.school-tile.s-part { border-color: var(--amber); background: var(--amber-soft); }
.school-tile.s-part .school-dot { background: var(--amber); }
.school-tile.s-part .school-meta { color: var(--amber); }
.school-tile.s-off { border-color: var(--red); background: var(--red-soft); }
.school-tile.s-off .school-dot { background: var(--red); }
.school-tile.s-off .school-meta { color: var(--red); }
@media (max-width: 560px) { .school-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); } .school-search { max-width: none; margin-left: 0; } }
