:root {
  --bg: #0b1220;
  --panel: #121b2b;
  --panel-2: #172235;
  --muted: #8ea3c7;
  --text: #eef4ff;
  --line: #24324c;
  --accent: #2d6dff;
  --accent-2: #5c8dff;
  --danger: #ff5a67;
  --success: #17b26a;
  --neon-blue: #21c7ff;
  --neon-blue-soft: rgba(33, 199, 255, .35);
  --neon-blue-glow: rgba(33, 199, 255, .18);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background: linear-gradient(180deg, #09101c 0%, #0b1220 100%);
  color: var(--text);
}
button, input, select { font: inherit; }
.shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar {
  border-right: 1px solid var(--neon-blue);
  box-shadow: inset -1px 0 0 var(--neon-blue-soft);
  background: rgba(9,16,28,.9);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 800;
}
.brand-title { font-weight: 700; font-size: 18px; }
.brand-subtitle { color: var(--muted); font-size: 13px; }
.nav { display: grid; gap: 10px; }
.nav-btn {
  background: var(--panel); color: var(--text); border: 1px solid var(--neon-blue-soft);
  border-radius: 14px; padding: 12px 14px; text-align: left; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(33, 199, 255, .08), 0 0 12px rgba(33, 199, 255, .06);
}
.nav-btn.active {
  border-color: var(--neon-blue);
  box-shadow: inset 0 0 0 1px rgba(33, 199, 255, .28), 0 0 14px rgba(33, 199, 255, .10);
}
.side-meta { margin-top: auto; color: var(--muted); font-size: 13px; }
.small-label { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; color: #6f86ab; }
.top-gap { margin-top: 14px; }
.content { padding: 28px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.topbar h1 { margin: 0 0 6px; font-size: 28px; }
.topbar p { margin: 0; color: var(--muted); }
.card {
  background: rgba(18,27,43,.92);
  border: 1px solid var(--neon-blue);
  border-radius: 20px;
  padding: 20px;
  box-shadow:
    inset 0 0 0 1px rgba(33, 199, 255, .12),
    0 0 0 1px rgba(33, 199, 255, .10),
    0 0 18px rgba(33, 199, 255, .08),
    0 12px 32px rgba(0,0,0,.18);
}
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.grid-2.compact { gap: 12px; }
.process-grid { margin-bottom: 18px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
input, select {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--neon-blue-soft);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 12px;
  box-shadow: inset 0 0 0 1px rgba(33, 199, 255, .06);
}
button {
  border: 0; border-radius: 12px; padding: 12px 14px; cursor: pointer;
}
button.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: white; font-weight: 700; }
button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--neon-blue-soft);
  box-shadow: inset 0 0 0 1px rgba(33, 199, 255, .08), 0 0 10px rgba(33, 199, 255, .05);
}
button.full { width: 100%; margin-top: 16px; }
.tabs { display: flex; gap: 10px; margin-bottom: 18px; }
.tab {
  background: transparent;
  border: 1px solid var(--neon-blue-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(33, 199, 255, .06);
}
.tab.active {
  background: var(--panel-2);
  border-color: var(--neon-blue);
  box-shadow: inset 0 0 0 1px rgba(33, 199, 255, .18), 0 0 12px rgba(33, 199, 255, .08);
}
.auth-pane, .view, .hidden { display: none; }
.auth-pane.active, .view.active { display: block; }
.hidden.force { display: none !important; }
.info-card { min-height: 100%; }
.info-list { margin: 12px 0 0; padding-left: 18px; color: var(--muted); line-height: 1.6; }
.small-note { margin-top: 10px; color: var(--muted); font-size: 13px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.kv span { color: var(--muted); }
.family-row { display: flex; flex-wrap: wrap; gap: 16px; margin: 14px 0 16px; color: var(--muted); }
.family-row label { margin: 0; display: flex; align-items: center; gap: 8px; }
.logs-box {
  max-height: 180px; overflow: auto; background: #0c1524; border: 1px solid var(--neon-blue);
  border-radius: 14px; padding: 12px; color: #b7c7e5; font-family: Consolas, monospace; font-size: 12px; white-space: pre-wrap;
  box-shadow: inset 0 0 0 1px rgba(33, 199, 255, .10), 0 0 14px rgba(33, 199, 255, .06);
}
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.results-actions { display: flex; gap: 10px; align-items: center; }
.table-wrap {
  overflow: auto;
  border: 1px solid var(--neon-blue);
  border-radius: 16px;
  margin-top: 14px;
  box-shadow: inset 0 0 0 1px rgba(33, 199, 255, .08), 0 0 14px rgba(33, 199, 255, .06);
}
table { width: 100%; border-collapse: collapse; min-width: 980px; }
thead { background: #101a2a; position: sticky; top: 0; }
th, td { border-bottom: 1px solid rgba(255,255,255,.05); padding: 10px 12px; font-size: 13px; text-align: left; }
tr:hover td { background: rgba(255,255,255,.02); }
.mono { font-family: Consolas, Menlo, monospace; word-break: break-all; }
.block {
  display: block;
  margin-top: 10px;
  padding: 10px 12px;
  background: #0c1524;
  border-radius: 12px;
  border: 1px solid var(--neon-blue-soft);
  box-shadow: inset 0 0 0 1px rgba(33, 199, 255, .06);
}
#alerts { display: grid; gap: 10px; margin-bottom: 18px; }
.alert { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); }
.alert.info { background: rgba(45,109,255,.12); border-color: rgba(45,109,255,.35); }
.alert.success { background: rgba(23,178,106,.12); border-color: rgba(23,178,106,.35); }
.alert.error { background: rgba(255,90,103,.12); border-color: rgba(255,90,103,.35); }
@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .grid-2, .process-grid, .results-head { grid-template-columns: 1fr; }
  .results-head { display: grid; }
}



#resultsHead th.sortable {
  cursor: pointer;
  user-select: none;
  text-align: center;
}

#resultsHead th {
  background: #102339;
  color: #E8F6FF;
  border-right: 1px solid #1AA3FF;
  border-bottom: 1px solid #1AA3FF;
}

#resultsHead th.sort-focus {
  background: #15314D;
}

#resultsHead th.sort-active {
  background: #2C1518;
  color: #FF5A5A;
  font-weight: 700;
  border-right: 1px solid #FF5A5A;
  border-bottom: 1px solid #FF5A5A;
}

td.status-cell {
  text-align: center;
}

.status-chip {
  display: inline-block;
  min-width: 74px;
  padding: 6px 12px;
  border-radius: 6px;
  color: #FFFFFF;
  font-weight: 700;
  text-align: center;
  border: 1px solid #12324D;
}

.status-chip.status-on {
  background: #00C853;
}

.status-chip.status-off {
  background: #FF4D6D;
}

tr:hover .status-chip {
  border-color: #86DCFF;
}


input:focus,
select:focus,
button:focus-visible {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow:
    0 0 0 1px rgba(33, 199, 255, .22),
    0 0 14px rgba(33, 199, 255, .12);
}

.card:hover,
.table-wrap:hover,
.logs-box:hover {
  box-shadow:
    inset 0 0 0 1px rgba(33, 199, 255, .14),
    0 0 0 1px rgba(33, 199, 255, .12),
    0 0 22px rgba(33, 199, 255, .10),
    0 12px 32px rgba(0,0,0,.18);
}
