:root {
  --bg: #0E0F12;
  --panel: #232732;
  --panel-alt: #16181f;
  --border: #454853;
  --text: #bdbdbd;
  --text-dim: #ece9e2;
  --accent: #ffffff;
  --accent-dim: #393e4c;
  --danger: #ff6b6b;
  --radius: 8px;
  font-size: 13px;
}

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Rajdhani:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Sofia+Sans:ital,wght@0,1..1000;1,1..1000&display=swap');

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  font-size: 27px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 0 8px 12px;
  font-weight: 600;
  font-family: "Rajdhani", sans-serif;
  text-align: center;
}

.server-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.server-group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin: 14px 8px 4px;
}

.server-group-label:first-child {
  margin-top: 0;
}

.server-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 9px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  font-family: "Mulish", sans-serif !important;
  text-transform: uppercase;
}

.server-btn:hover {
  background: #1b1e26;
}

.server-btn.active {
  background: var(--accent-dim);
  color: #fff;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #4caf50;
}

.status-dot.inactive {
  background: #6b7280;
}

.server-btn .label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-btn.placeholder {
  cursor: default;
  color: var(--text-dim);
  opacity: 0.6;
}

.server-btn.placeholder:hover {
  background: transparent;
}

.server-btn .soon-tag {
  margin-left: auto;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 7px;
  flex-shrink: 0;
  white-space: nowrap;
}

.sidebar-loading {
  color: var(--text-dim);
  font-size: 13px;
  padding: 8px;
}

/* ---------- Main content ---------- */

.content {
  flex: 1;
  min-width: 0;
  padding: 24px 28px 40px;
  display: flex;
  flex-direction: column;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.content-header h2 {
  margin: 0;
  font-size: 30px;
  font-family: "Sofia Sans", sans-serif;
  text-transform: uppercase;
  font-weight: 900;
  font-style: italic;
}

.search-wrap input {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--radius);
  width: 260px;
  max-width: 60vw;
  font-size: 13px;
  font-family: "Rajdhani", sans-serif;
}

.search-wrap input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-wrap input:disabled {
  opacity: 0.5;
}

.empty-state, .error-state, .loading-state {
  color: var(--text-dim);
  padding: 40px 8px;
  text-align: center;
}

.error-state {
  color: var(--danger);
}

.table-wrap {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

table.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

table.stats-table thead th {
  position: sticky;
  top: 0;
  background: var(--panel-alt);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  text-transform: uppercase;
  user-select: none;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 12px;
}

table.stats-table thead th:hover {
  color: var(--text);
}

table.stats-table thead th.sorted {
  color: var(--accent);
}

table.stats-table thead th .arrow {
  display: inline-block;
  width: 10px;
  margin-left: 4px;
  opacity: 0.8;
}

table.stats-table thead th .col-icon {
  height: 18px;
  width: auto;
  max-width: 24px;
  vertical-align: middle;
  object-fit: contain;
}

table.stats-table thead th .col-label-text {
  vertical-align: middle;
}

table.stats-table tbody td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.stats-table tbody tr:hover {
  background: var(--panel-alt);
}

table.stats-table tbody tr:last-child td {
  border-bottom: none;
}

table.stats-table tbody td a {
  color: var(--accent);
  text-decoration: none;
}

table.stats-table tbody td a:hover {
  text-decoration: underline;
}

.pagination {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  color: var(--text-dim);
  font-size: 13px;
}

.pagination button {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--accent);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: default;
}

@media (max-width: 720px) {
  .layout {
    flex-direction: column;
  }
  .sidebar {
    width: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}
