:root {
  color-scheme: dark;
  --bg: #101216;
  --panel: #191d24;
  --panel-2: #222735;
  --text: #f3f5f7;
  --muted: #a9b0bd;
  --line: #303746;
  --accent: #d7a957;
  --accent-2: #7fb7a8;
  --danger: #d96b6b;
  --ok: #81c784;
  --shadow: 0 18px 44px rgba(0, 0, 0, .28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #141820;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #17110a;
  font-weight: 900;
}

.brand span,
.muted {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-button,
.ghost {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 0 14px;
}

.nav-button {
  text-align: left;
}

.nav-button.active,
.ghost:hover {
  background: var(--panel-2);
}

.session-panel {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.content {
  padding: 28px;
  display: grid;
  gap: 22px;
  align-content: start;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
}

.status-pill.online {
  color: var(--ok);
  border-color: rgba(129, 199, 132, .45);
}

.empty-state,
.panel,
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.empty-state {
  min-height: 320px;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat {
  padding: 16px;
}

.stat strong {
  display: block;
  font-size: 28px;
}

.toolbar,
.panel-head,
.actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.actions-row {
  margin: 16px 0;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, .6fr);
  gap: 18px;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel-head {
  margin-bottom: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  color: var(--text);
  background: #11151c;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

.form {
  display: grid;
  gap: 14px;
}

.primary {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--accent);
  color: #17110a;
  font-weight: 800;
}

.table {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.compact-table {
  margin-bottom: 16px;
}

.compact-table table {
  min-width: 0;
}

.empty-row {
  padding: 12px;
  color: var(--muted);
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

tr.selected td {
  background: rgba(215, 169, 87, .12);
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  min-height: 26px;
  padding: 0 9px;
  color: #12161d;
  background: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
}

.tag.locked {
  background: var(--accent);
}

.danger {
  color: #fff;
  background: var(--danger);
}

.mini {
  min-height: 32px;
  border-radius: 8px;
  padding: 0 10px;
}

.checks {
  display: grid;
  gap: 8px;
}

.check-row {
  grid-template-columns: 20px 1fr;
  align-items: center;
  color: var(--text);
}

.check-row input {
  min-height: auto;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #f3f5f7;
  color: #151922;
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .shell,
  .split {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .content,
  .sidebar {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 26px;
  }
}
