/* Vapor Hub Dashboard */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0f1117;
  --surface:  #1a1d27;
  --border:   #2a2d3e;
  --accent:   #5b8dee;
  --accent2:  #7c6bea;
  --green:    #43c47a;
  --yellow:   #f0c040;
  --red:      #e05555;
  --text:     #d4d8f0;
  --muted:    #6b6f8a;
  --radius:   8px;
  --font:     'Segoe UI', system-ui, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  min-height: 100vh;
}

/* ---- Header ---- */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

header h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
}

#logout-btn {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: color .15s, border-color .15s;
}
#logout-btn:hover { color: var(--text); border-color: var(--muted); }

.header-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-left: auto;
}

.hstat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.hstat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.hstat-value { font-size: 18px; font-weight: 700; color: var(--text); }

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  display: inline-block;
  margin-right: 6px;
}
.status-dot.offline { background: var(--red); box-shadow: 0 0 6px var(--red); }

/* ---- Tabs ---- */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 2px;
  padding: 0 24px;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 12px 16px;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- Main content ---- */
main { padding: 24px; max-width: 1400px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
}
td {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}
tr:hover td { background: rgba(91,141,238,.05); }

.mono { font-family: 'Cascadia Code', 'Fira Code', monospace; font-size: 12px; color: var(--muted); }
.name { font-weight: 600; }

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-green  { background: rgba(67,196,122,.15); color: var(--green); }
.badge-yellow { background: rgba(240,192,64,.15);  color: var(--yellow); }
.badge-red    { background: rgba(224,85,85,.15);   color: var(--red); }
.badge-blue   { background: rgba(91,141,238,.15);  color: var(--accent); }

/* ---- Lobby cards ---- */
.lobby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.lobby-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s;
}
.lobby-card:hover { border-color: var(--accent); }

.lobby-header {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
}
.lobby-title { font-weight: 700; font-size: 14px; }
.lobby-sub   { font-size: 11px; color: var(--muted); margin-top: 2px; }

.lobby-body { padding: 12px 16px; }

.lobby-members {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.member-chip {
  background: rgba(91,141,238,.12);
  border: 1px solid rgba(91,141,238,.25);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 12px;
}

.lobby-kvs {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.lobby-kv {
  display: flex;
  gap: 8px;
  font-size: 12px;
}
.lobby-kv-key   { color: var(--muted); min-width: 100px; }
.lobby-kv-value { color: var(--text); word-break: break-all; }

/* ---- Stats ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-card-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.stat-card-value { font-size: 32px; font-weight: 700; margin-top: 4px; color: var(--accent); }

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
}
.bar-label { min-width: 80px; color: var(--muted); }
.bar-track {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 4px;
  transition: width .4s ease;
}
.bar-count { min-width: 40px; text-align: right; color: var(--text); }

/* ---- Empty state ---- */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .4; }
.empty-text { font-size: 14px; }

/* ---- Filters ---- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.toolbar select, .toolbar input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 6px 10px;
}
.toolbar select:focus, .toolbar input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
