:root {
  color-scheme: dark;
  --bg: #070b12;
  --panel: #0d1422;
  --panel-2: #111b2d;
  --panel-3: #162238;
  --line: #24324a;
  --line-soft: #19253a;
  --text: #f4f7fb;
  --muted: #91a0b8;
  --blue: #62a8ff;
  --blue-strong: #2f7ee6;
  --green: #45d39e;
  --red: #ff6b73;
  --amber: #f7bd5a;
  --shadow: 0 18px 60px rgba(0,0,0,.32);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 88% -10%, rgba(47,126,230,.12), transparent 32rem), var(--bg); font-size: 16px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 .45rem; color: var(--blue); font-size: .75rem; font-weight: 800; letter-spacing: .14em; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; background: linear-gradient(145deg, rgba(19,36,62,.25), transparent 50%); }
.login-card { width: min(100%, 27rem); padding: 2.5rem; background: rgba(13,20,34,.94); border: 1px solid var(--line); border-radius: 1.5rem; box-shadow: var(--shadow); }
.brand-mark { width: 3rem; height: 3rem; display: grid; place-items: center; margin-bottom: 1.75rem; border-radius: .85rem; background: linear-gradient(145deg, #69adff, #2e70d5); box-shadow: 0 10px 30px rgba(47,126,230,.25); color: #fff; font-size: 1.45rem; font-weight: 900; }
.brand-mark.small { width: 2.35rem; height: 2.35rem; margin: 0; border-radius: .7rem; font-size: 1.1rem; }
.login-card h1 { margin: 0; font-size: 2rem; letter-spacing: -.04em; }
.login-copy { margin: .65rem 0 1.8rem; color: var(--muted); line-height: 1.5; }
label { display: block; margin: 1rem 0 .45rem; color: #cbd5e5; font-size: .9rem; font-weight: 700; }
input, select { width: 100%; min-height: 3rem; padding: .72rem .9rem; border: 1px solid var(--line); border-radius: .75rem; outline: none; background: #0a111e; color: var(--text); }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(98,168,255,.15); }
.form-error { min-height: 1.25rem; margin: .75rem 0; color: var(--red); font-size: .88rem; }
button { min-height: 2.65rem; border: 1px solid transparent; border-radius: .7rem; padding: .65rem 1rem; color: var(--text); font-weight: 750; transition: transform .12s ease, background .15s ease, border-color .15s ease; }
button:hover { transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:focus-visible { outline: 3px solid rgba(98,168,255,.45); outline-offset: 2px; }
button:disabled { opacity: .55; cursor: wait; transform: none; }
.primary { background: var(--blue-strong); }
.primary:hover { background: #3b8cf1; }
.full { width: 100%; }
.ghost { border-color: var(--line); background: transparent; }
.ghost:hover { background: var(--panel-3); }
.danger { background: #be3642; }
.danger:hover { background: #d34752; }
.secure-note { display: flex; gap: .5rem; justify-content: center; margin-top: 1.4rem; color: var(--muted); font-size: .78rem; }
.secure-note span { color: var(--green); }
.topbar { position: sticky; top: 0; z-index: 20; height: 4.5rem; display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem; border-bottom: 1px solid var(--line-soft); background: rgba(7,11,18,.9); backdrop-filter: blur(16px); }
.brand-lockup { display: flex; align-items: center; gap: .8rem; }
.brand-lockup strong, .brand-lockup span { display: block; }
.brand-lockup strong { letter-spacing: -.015em; }
.brand-lockup span { margin-top: .12rem; color: var(--muted); font-size: .72rem; }
.header-actions { display: flex; align-items: center; gap: .55rem; }
.icon-button { width: 2.65rem; padding: 0; border-color: var(--line); background: transparent; font-size: 1.3rem; }
.workspace { display: grid; grid-template-columns: 13rem minmax(0,1fr); min-height: calc(100vh - 4.5rem); }
.sidebar { position: sticky; top: 4.5rem; height: calc(100vh - 4.5rem); padding: 1.25rem .85rem; border-right: 1px solid var(--line-soft); background: rgba(10,16,27,.55); }
.nav-button { width: 100%; display: flex; align-items: center; gap: .75rem; justify-content: flex-start; margin-bottom: .35rem; border: 0; background: transparent; color: var(--muted); }
.nav-button.active { background: var(--panel-3); color: var(--text); }
.nav-button span { color: var(--blue); }
.sidebar-bottom { position: absolute; bottom: 1.5rem; left: 1.2rem; right: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line-soft); }
.sidebar-bottom p { margin: 0 0 .25rem; color: var(--muted); font-size: .75rem; }
.sidebar-bottom strong { font-size: .88rem; }
.content { width: 100%; max-width: 100rem; margin: 0 auto; padding: 2.25rem clamp(1rem,3vw,3rem) 5rem; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 1.5rem; }
.page-heading h1 { margin: 0; font-size: clamp(1.7rem,3vw,2.35rem); letter-spacing: -.045em; }
.updated-text { color: var(--muted); font-size: .8rem; }
.stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .85rem; margin-bottom: 1.2rem; }
.stat-card { display: flex; align-items: center; gap: .9rem; min-height: 6.8rem; padding: 1.15rem; border: 1px solid var(--line-soft); border-radius: 1rem; background: linear-gradient(145deg, rgba(17,27,45,.92), rgba(13,20,34,.92)); }
.stat-card .stat-icon { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: .75rem; background: rgba(98,168,255,.12); color: var(--blue); }
.stat-card.online .stat-icon { background: rgba(69,211,158,.12); color: var(--green); }
.stat-card.offline .stat-icon { background: rgba(255,107,115,.1); color: var(--red); }
.stat-card.groups .stat-icon { background: rgba(247,189,90,.11); color: var(--amber); }
.stat-card strong { display: block; font-size: 1.7rem; }
.stat-card p { margin: .15rem 0 0; color: var(--muted); font-size: .83rem; }
.control-panel, .activity-panel { border: 1px solid var(--line-soft); border-radius: 1rem; overflow: hidden; background: rgba(13,20,34,.78); box-shadow: 0 12px 40px rgba(0,0,0,.14); }
.filters { display: grid; grid-template-columns: minmax(15rem,1fr) 12rem 10rem; gap: .65rem; padding: 1rem; border-bottom: 1px solid var(--line-soft); }
.filters input, .filters select { min-height: 2.75rem; }
.search-wrap { position: relative; }
.search-wrap span { position: absolute; left: .9rem; top: .6rem; color: var(--muted); font-size: 1.25rem; }
.search-wrap input { padding-left: 2.45rem; }
.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; border-bottom: 1px solid rgba(98,168,255,.25); background: rgba(47,126,230,.1); }
.bulk-bar > div { display: flex; gap: .45rem; flex-wrap: wrap; }
.action-button { min-height: 2.25rem; padding: .38rem .7rem; border-color: var(--line); background: var(--panel-3); font-size: .78rem; }
.action-button.wake { color: #86bcff; }
.action-button.lock { color: #c9d4e5; }
.action-button.restart { color: var(--amber); }
.action-button.danger { border-color: rgba(255,107,115,.3); background: rgba(190,54,66,.18); color: #ff9ca2; }
.device-table-head, .device-row { display: grid; grid-template-columns: 6.2rem minmax(12rem,1.45fr) minmax(7rem,.7fr) minmax(7rem,.7fr) minmax(18rem,1.25fr); align-items: center; gap: 1rem; padding: .75rem 1rem; }
.device-table-head { color: var(--muted); background: rgba(17,27,45,.56); font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.device-row { min-height: 5.2rem; border-top: 1px solid var(--line-soft); }
.device-row:hover { background: rgba(22,34,56,.42); }
.check-wrap { display: flex; align-items: center; gap: .55rem; margin: 0; font-size: inherit; }
.check-wrap input { width: 1.05rem; min-height: auto; accent-color: var(--blue-strong); }
.computer-cell { display: flex; gap: .75rem; align-items: center; min-width: 0; }
.status-orb { width: .7rem; height: .7rem; flex: 0 0 auto; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(255,107,115,.08); }
.status-orb.online { background: var(--green); box-shadow: 0 0 0 4px rgba(69,211,158,.08); }
.computer-info { min-width: 0; }
.computer-info strong, .computer-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.computer-info strong { font-size: .92rem; }
.computer-info span, .device-meta { margin-top: .25rem; color: var(--muted); font-size: .74rem; }
.group-pill { width: max-content; max-width: 100%; padding: .3rem .55rem; overflow: hidden; text-overflow: ellipsis; border: 1px solid var(--line); border-radius: 2rem; color: #b9c8dd; background: rgba(22,34,56,.65); font-size: .75rem; white-space: nowrap; }
.row-actions { display: flex; justify-content: flex-end; gap: .35rem; }
.row-actions button { min-height: 2.2rem; padding: .35rem .55rem; border-color: var(--line); background: transparent; font-size: .74rem; }
.row-actions button:hover { background: var(--panel-3); }
.row-actions .shutdown { color: #ff9ba1; }
.row-actions .wake { color: #7db7ff; }
.align-right { text-align: right; }
.empty-state { padding: 4.5rem 1rem; text-align: center; color: var(--muted); }
.empty-state > div { color: var(--blue); font-size: 2rem; }
.empty-state h2 { margin: .65rem 0 .3rem; color: var(--text); font-size: 1.15rem; }
.empty-state p { margin: 0; font-size: .88rem; }
.activity-list { min-height: 12rem; }
.activity-item { display: grid; grid-template-columns: 9rem minmax(10rem,1fr) minmax(8rem,.6fr); gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line-soft); }
.activity-item time, .activity-item span { color: var(--muted); font-size: .8rem; }
.activity-item strong { font-size: .87rem; }
.modal { width: min(calc(100% - 2rem), 28rem); padding: 0; border: 1px solid var(--line); border-radius: 1rem; background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(4px); }
.modal form { padding: 1.5rem; }
.modal-icon { width: 2.8rem; height: 2.8rem; display: grid; place-items: center; border-radius: .8rem; background: rgba(255,107,115,.12); color: var(--red); font-weight: 900; }
.modal-icon.neutral { background: rgba(98,168,255,.12); color: var(--blue); }
.modal h2 { margin: 1rem 0 .45rem; }
.modal p { margin: 0; color: var(--muted); line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.5rem; }
.toast { position: fixed; z-index: 100; right: 1rem; bottom: 1rem; max-width: min(25rem,calc(100% - 2rem)); padding: .85rem 1rem; transform: translateY(130%); border: 1px solid var(--line); border-radius: .75rem; opacity: 0; background: var(--panel-3); box-shadow: var(--shadow); transition: .2s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { border-color: rgba(255,107,115,.4); color: #ffc0c4; }
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .device-table-head { display: none; }
  .device-row { grid-template-columns: 2.2rem minmax(11rem,1.2fr) minmax(7rem,.6fr) minmax(16rem,1fr); }
  .device-row > :nth-child(4) { display: none; }
}
@media (max-width: 760px) {
  .topbar { height: 4rem; padding: 0 .8rem; }
  .brand-lockup span, #refreshButton { display: none; }
  .workspace { display: block; min-height: calc(100vh - 4rem); }
  .sidebar { position: fixed; z-index: 30; top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 4.25rem; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: .45rem .75rem calc(.45rem + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--line); background: rgba(9,15,25,.96); backdrop-filter: blur(16px); }
  .nav-button { justify-content: center; margin: 0; min-height: 3rem; }
  .sidebar-bottom { display: none; }
  .content { padding: 1.35rem .8rem 6.5rem; }
  .page-heading { align-items: flex-start; }
  .updated-text { margin-top: .6rem; }
  .stat-grid { gap: .55rem; }
  .stat-card { min-height: 5.3rem; padding: .8rem; }
  .stat-card .stat-icon { width: 2.15rem; height: 2.15rem; }
  .stat-card strong { font-size: 1.35rem; }
  .filters { grid-template-columns: 1fr 1fr; }
  .search-wrap { grid-column: 1 / -1; }
  .bulk-bar { align-items: flex-start; flex-direction: column; }
  .device-list { display: grid; gap: .65rem; padding: .7rem; }
  .device-row { position: relative; display: grid; grid-template-columns: 1.7rem minmax(0,1fr); gap: .75rem; padding: 1rem; border: 1px solid var(--line-soft); border-radius: .8rem; background: rgba(17,27,45,.62); }
  .device-row > :nth-child(3), .device-row > :nth-child(4) { display: block; grid-column: 2; }
  .row-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5,1fr); margin-top: .25rem; }
  .row-actions button { padding: .38rem .2rem; font-size: .68rem; }
  .group-pill { margin-top: -.35rem; }
  .activity-item { grid-template-columns: 1fr; gap: .35rem; }
}
@media (max-width: 430px) {
  .login-card { padding: 1.6rem; }
  .header-actions .ghost { padding: .5rem .65rem; }
  .stat-card p { font-size: .72rem; }
  .row-actions { grid-template-columns: repeat(3,1fr); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
