:root {
  --bg: #0b0f14;
  --bg-elev: #121821;
  --bg-soft: #18202b;
  --line: #243042;
  --text: #e7eef8;
  --muted: #8fa3b8;
  --accent: #3dd6c6;
  --accent-2: #5b8cff;
  --danger: #ff6b7a;
  --warn: #f0b429;
  --ok: #3ecf8e;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "Consolas", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 214, 198, 0.08), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(91, 140, 255, 0.07), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side {
  border-right: 1px solid var(--line);
  background: rgba(18, 24, 33, 0.92);
  padding: 1.25rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.brand span {
  width: 10px; height: 10px; border-radius: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(61, 214, 198, 0.45);
}
.nav a {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  color: var(--muted);
  margin-bottom: 0.2rem;
  text-decoration: none;
}
.nav a:hover, .nav a.active {
  background: var(--bg-soft);
  color: var(--text);
  text-decoration: none;
}
.side-foot {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.main { padding: 1.5rem 1.75rem 3rem; max-width: 1280px; }
.h1 { font-size: 1.45rem; font-weight: 600; margin: 0 0 0.35rem; }
.sub { color: var(--muted); margin: 0 0 1.25rem; font-size: 0.95rem; }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.stat {
  font-family: var(--mono);
  font-size: 1.4rem;
  color: var(--accent);
}
.stat-label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
table.data th, table.data td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
table.data th {
  background: var(--bg-soft);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
}
table.data th a.th-sort {
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  white-space: nowrap;
}
table.data th a.th-sort:hover,
table.data th a.th-sort.is-active {
  color: var(--accent);
  text-decoration: none;
}

table.data tr:hover td { background: rgba(255,255,255,0.02); }
.mono { font-family: var(--mono); font-size: 0.85rem; }
.muted { color: var(--muted); }
.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.badge.ok { color: var(--ok); border-color: rgba(62,207,142,0.35); }
.badge.run { color: var(--accent-2); border-color: rgba(91,140,255,0.4); }
.badge.warn { color: var(--warn); border-color: rgba(240,180,41,0.35); }
.badge.err { color: var(--danger); border-color: rgba(255,107,122,0.35); }

.btn {
  display: inline-block;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); text-decoration: none; color: var(--text); }
.btn.primary {
  background: linear-gradient(135deg, rgba(61,214,198,0.2), rgba(91,140,255,0.2));
  border-color: rgba(61,214,198,0.45);
  color: var(--text);
}
.btn.danger { border-color: rgba(255,107,122,0.45); color: var(--danger); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }

label { display: block; margin: 0.75rem 0 0.3rem; color: var(--muted); font-size: 0.85rem; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%;
  max-width: 520px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  font: inherit;
}
textarea { min-height: 110px; max-width: 100%; font-family: var(--mono); font-size: 0.85rem; }
.hint { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }
.check { display: flex; align-items: center; gap: 0.5rem; margin: 0.75rem 0; color: var(--text); }
.check input { width: auto; }
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
}
.alert.err { background: rgba(255,107,122,0.08); border-color: rgba(255,107,122,0.35); color: #ffb3bb; }
.alert.ok { background: rgba(62,207,142,0.08); border-color: rgba(62,207,142,0.35); color: #9ee6c2; }

.progress {
  height: 10px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin: 0.5rem 0 0.25rem;
}
.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  width: 0%;
  transition: width 0.35s ease;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.75rem;
}
.login-box .brand { margin-bottom: 0.5rem; }
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}
.filters .field { flex: 1 1 140px; max-width: 220px; }
.filters label { margin-top: 0; }
.filters input[type=text] { max-width: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .grid-2 { grid-template-columns: 1fr; }
}
