:root {
  --bg: #070708;
  --panel: #101113;
  --row: #141518;
  --row-on: #1c1d22;
  --line: #26262b;
  --text: #ececee;
  --muted: #8d8d96;
  --faint: #5f5f68;
  --ok: #9cbaa4;
  --bad: #e07a7a;
  --white: #f4f4f5;
  --radius: 8px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.4 "Segoe UI", system-ui, sans-serif;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.muted { color: var(--muted); }
.err { color: var(--bad); min-height: 1.2em; margin-top: 8px; font-size: 12px; }

.gate {
  min-height: 100%;
  display: grid;
  place-items: center;
}
.gate-box {
  width: 320px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.brand { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.sub { color: var(--faint); font-size: 12px; margin-top: -6px; }
.gate-box input, .search, .field input {
  background: #0c0c0e;
  border: 1px solid #2c2c31;
  border-radius: var(--radius);
  height: 36px;
  padding: 0 12px;
  outline: none;
}
.gate-box input:focus, .search:focus, .field input:focus { border-color: #4a4a52; }

.btn {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}
.btn.solid {
  background: var(--white);
  color: #111;
  border-color: var(--white);
  font-weight: 600;
}
.btn.solid:disabled { opacity: 0.45; }
.btn.danger { color: var(--bad); border-color: #3a2426; }

.shell {
  height: 100%;
  display: grid;
  grid-template-columns: 280px 1fr;
  min-width: 960px;
}
.side {
  border-right: 1px solid var(--line);
  background: #0c0c0e;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px 12px 12px;
  gap: 10px;
}
.side-head { display: flex; align-items: center; justify-content: space-between; }
.icon {
  background: none;
  border: 0;
  color: var(--faint);
  padding: 0;
}
.icon:hover { color: var(--text); }
.search { width: 100%; }
.side-label {
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  margin-top: 4px;
}
.list { overflow: auto; flex: 1; min-height: 80px; }
.file {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 7px 8px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
}
.file:hover { background: var(--row); }
.file.on { background: var(--row-on); }
.file b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file span { color: var(--faint); flex: none; }
.accounts {
  margin: 0;
  white-space: pre-wrap;
  color: var(--muted);
  font: 12px/1.45 ui-monospace, "Cascadia Mono", Consolas, monospace;
  max-height: 120px;
  overflow: auto;
}

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 6px; background: #0c0c0e; padding: 3px; border-radius: 10px; border: 1px solid var(--line); }
.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  height: 30px;
  padding: 0 14px;
  border-radius: 8px;
}
.tab.on { background: var(--white); color: #111; font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.field { display: flex; align-items: center; gap: 8px; color: var(--faint); }
.field input { width: 220px; height: 34px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button {
  background: transparent;
  border: 0;
  color: var(--muted);
  height: 34px;
  padding: 0 10px;
}
.seg button.on { background: #1c1d22; color: var(--text); }

.status { padding: 12px 16px 4px; display: grid; gap: 8px; }
.meter-row { display: flex; justify-content: space-between; margin-bottom: 6px; }
.bar { height: 3px; background: #222226; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--white); }
.line {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--muted);
  min-height: 36px;
  white-space: pre-wrap;
}

@media (max-width: 860px) {
  .shell { min-width: 0; grid-template-columns: 1fr; height: auto; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 320px; }
  .top, .top-actions { flex-wrap: wrap; }
  .field { width: 100%; }
  .field input { width: 100%; flex: 1; }
  .main { min-height: 70vh; }
}

.table-wrap { flex: 1; overflow: auto; padding: 8px 8px 16px; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-weight: 500;
  color: var(--faint);
  font-size: 12px;
  padding: 8px 12px;
  position: sticky;
  top: 0;
  background: var(--bg);
}
td {
  padding: 9px 12px;
  border-top: 1px solid #1c1c20;
  vertical-align: top;
}
tr:hover td { background: #121316; }
.user { color: var(--text); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.dim { color: var(--muted); }
.empty { color: var(--faint); padding: 28px 12px; }
