@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --brand:         #96D1EE;
  --brand-muted:   rgba(150, 209, 238, 0.12);
  --brand-border:  rgba(150, 209, 238, 0.20);

  --bg:            #0a0d11;
  --bg-1:          #0f1318;
  --bg-2:          #151a21;
  --bg-3:          #1c232c;
  --border:        rgba(255,255,255,0.07);
  --border-md:     rgba(255,255,255,0.11);

  --text:          #dde3ea;
  --text-2:        #7a8a99;
  --text-3:        #3d4f5e;

  --red:           #d95f5f;
  --green:         #4bbd85;
  --yellow:        #e6a83a;
  --purple:        #8b72d8;

  --radius:        4px;
  --radius-md:     6px;
  --sidebar-w:     220px;
  --font:          'Inter', sans-serif;
  --mono:          'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 2px; }

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.vcp-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--border);
}
.logo-mark { display: flex; align-items: center; gap: 8px; }
.logo-icon {
  width: 28px; height: 28px;
  background: var(--brand-muted);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
  display: grid; place-items: center;
}
.logo-icon svg { width: 14px; height: 14px; fill: var(--brand); }
.logo-name {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
}
.logo-name span { color: var(--brand); }
.logo-sub {
  font-size: 0.67rem;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
  padding-left: 36px;
}

.sidebar-nav { flex: 1; padding: 10px 10px; overflow-y: auto; }

.nav-section-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 8px 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 0.84rem;
  font-weight: 500;
  transition: all 0.12s;
  position: relative;
}
.nav-item:hover { background: var(--bg-2); color: var(--text); }
.nav-item.active {
  background: var(--brand-muted);
  color: var(--brand);
  border-left: 2px solid var(--brand);
  padding-left: 8px;
}
.nav-item svg { width: 14px; height: 14px; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--border);
}
.user-avatar {
  width: 26px; height: 26px;
  border-radius: var(--radius);
  background: var(--brand-muted);
  border: 1px solid var(--brand-border);
  display: grid; place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand);
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role { font-size: 0.68rem; color: var(--text-3); }
.logout-btn {
  background: none; border: none;
  color: var(--text-3);
  padding: 3px;
  border-radius: 3px;
  display: grid; place-items: center;
  transition: color 0.12s;
  flex-shrink: 0;
}
.logout-btn:hover { color: var(--red); }
.logout-btn svg { width: 13px; height: 13px; }

/* ── Main ────────────────────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Background image — right side */
.main-content::before {
  content: '';
  position: fixed;
  top: 0;
  right: 0;
  width: calc(100vw - var(--sidebar-w));
  height: 100vh;
  background-image: url('/assets/img/bg.png');
  background-size: cover;
  background-position: center;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

/* ── Topbar ──────────────────────────────────────────────────────────────────── */
.topbar {
  height: 50px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 22px;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.topbar-sep   { color: var(--text-3); font-size: 0.75rem; }
.topbar-sub   { font-size: 0.82rem; color: var(--text-2); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.server-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-2);
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius);
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 4px var(--green);
  animation: pulse 2.5s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ── Page content ─────────────────────────────────────────────────────────────── */
.page-body {
  flex: 1;
  padding: 20px 22px;
  position: relative;
  z-index: 1;
}

/* ── Stats grid ───────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.stat-icon {
  width: 28px; height: 28px;
  border-radius: var(--radius);
  background: var(--brand-muted);
  border: 1px solid var(--brand-border);
  display: grid; place-items: center;
  margin-bottom: 10px;
}
.stat-icon svg { width: 13px; height: 13px; fill: var(--brand); }
.stat-icon.red    { background: rgba(217,95,95,0.10);  border-color: rgba(217,95,95,0.20); }
.stat-icon.red svg { fill: var(--red); }
.stat-icon.green  { background: rgba(75,189,133,0.10); border-color: rgba(75,189,133,0.20); }
.stat-icon.green svg { fill: var(--green); }
.stat-icon.yellow { background: rgba(230,168,58,0.10); border-color: rgba(230,168,58,0.20); }
.stat-icon.yellow svg { fill: var(--yellow); }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 3px; }
.stat-label { font-size: 0.75rem; color: var(--text-2); }
.stat-trend { font-size: 0.7rem; margin-top: 8px; color: var(--text-3); }
.stat-trend .up   { color: var(--green); }
.stat-trend .down { color: var(--red); }

/* ── Cards ─────────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.card-header {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Actions always on the LEFT, title pushed to the right */
.card-header { flex-direction: row-reverse; justify-content: flex-end; }
.card-header .card-title { margin-right: auto; }
/* Overrides for non-action headers */
.card-header.no-reverse { flex-direction: row; }
.card-header.no-reverse .card-title { margin-right: auto; }

.card-title { font-size: 0.86rem; font-weight: 600; color: var(--text); }
.card-body { padding: 0; }

/* ── Table ──────────────────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.data-table td {
  padding: 10px 18px;
  font-size: 0.82rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.1s; }
.data-table tbody tr:hover { background: var(--bg-2); }

/* ── Player cell ────────────────────────────────────────────────────────────────── */
.player-cell { display: flex; align-items: center; gap: 8px; }
.mc-avatar { width: 26px; height: 26px; border-radius: 3px; image-rendering: pixelated; background: var(--bg-3); }
.player-name { font-weight: 600; font-size: 0.83rem; }
.player-uuid { font-size: 0.7rem; color: var(--text-3); font-family: var(--mono); }

/* ── Badges ──────────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius);
  font-size: 0.68rem;
  font-weight: 600;
}
.badge-blue   { background: var(--brand-muted);           color: var(--brand); border: 1px solid var(--brand-border); }
.badge-red    { background: rgba(217,95,95,0.10);         color: var(--red);   border: 1px solid rgba(217,95,95,0.22); }
.badge-green  { background: rgba(75,189,133,0.10);        color: var(--green); border: 1px solid rgba(75,189,133,0.22); }
.badge-yellow { background: rgba(230,168,58,0.10);        color: var(--yellow);border: 1px solid rgba(230,168,58,0.22); }
.badge-purple { background: rgba(139,114,216,0.10);       color: var(--purple);border: 1px solid rgba(139,114,216,0.22); }
.badge-grey   { background: rgba(255,255,255,0.05);       color: var(--text-2);border: 1px solid var(--border); }

/* ── Buttons ──────────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.79rem;
  font-weight: 600;
  border: none;
  transition: all 0.12s;
  white-space: nowrap;
}
.btn svg { width: 12px; height: 12px; }
.btn-primary { background: var(--brand); color: #061018; }
.btn-primary:hover { background: #aaddf5; }
.btn-ghost {
  background: var(--bg-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border-md); color: var(--text); }
.btn-danger { background: rgba(217,95,95,0.10); color: var(--red); border: 1px solid rgba(217,95,95,0.22); }
.btn-danger:hover { background: rgba(217,95,95,0.18); }
.btn-sm { padding: 4px 9px; font-size: 0.75rem; }

/* ── Forms ───────────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.form-control {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border-md);
  border-radius: var(--radius);
  padding: 7px 11px;
  color: var(--text);
  font-size: 0.83rem;
  outline: none;
  transition: border-color 0.12s;
}
.form-control:focus { border-color: var(--brand); }
.form-control::placeholder { color: var(--text-3); }

/* ── Search ──────────────────────────────────────────────────────────────────────── */
.search-wrap { position: relative; display: inline-flex; }
.search-wrap svg {
  position: absolute; left: 9px; top: 50%;
  transform: translateY(-50%);
  width: 13px; height: 13px;
  fill: var(--text-3); pointer-events: none;
}
.search-input {
  background: var(--bg-2);
  border: 1px solid var(--border-md);
  border-radius: var(--radius);
  padding: 6px 11px 6px 28px;
  color: var(--text);
  font-size: 0.79rem;
  outline: none; width: 200px;
  transition: border-color 0.12s, width 0.2s;
}
.search-input:focus { border-color: var(--brand); width: 240px; }
.search-input::placeholder { color: var(--text-3); }

/* ── Alert ───────────────────────────────────────────────────────────────────────── */
.alert {
  padding: 9px 14px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  margin-bottom: 14px;
  border: 1px solid;
}
.alert-error   { background: rgba(217,95,95,0.08);  border-color: rgba(217,95,95,0.22);  color: #e07070; }
.alert-success { background: rgba(75,189,133,0.08); border-color: rgba(75,189,133,0.22); color: #5ec896; }

/* ── Modal ────────────────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(5,8,13,0.75);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-1);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-md);
  width: 440px;
  max-width: 95vw;
  padding: 22px;
}
.modal-title { font-size: 0.93rem; font-weight: 700; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ── Login ────────────────────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.login-bg-img {
  position: absolute; inset: 0;
  background-image: url('/assets/img/bg.png');
  background-size: cover;
  background-position: center;
  opacity: 0.06;
  pointer-events: none;
}
.login-bg-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 70% at 50% 50%, rgba(150,209,238,0.04) 0%, transparent 70%);
  pointer-events: none;
}
.login-box {
  background: var(--bg-1);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-md);
  padding: 36px 32px;
  width: 380px;
  max-width: 95vw;
  position: relative;
  z-index: 1;
}
.login-logo { text-align: center; margin-bottom: 26px; }
.login-logo-icon {
  width: 42px; height: 42px;
  background: var(--brand-muted);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  display: inline-grid; place-items: center;
  margin-bottom: 12px;
}
.login-logo-icon svg { width: 20px; height: 20px; fill: var(--brand); }
.login-title { font-size: 1.25rem; font-weight: 700; }
.login-title span { color: var(--brand); }
.login-sub { font-size: 0.78rem; color: var(--text-3); margin-top: 4px; letter-spacing: 0.05em; text-transform: uppercase; }
.login-submit {
  width: 100%;
  padding: 9px;
  background: var(--brand);
  color: #061018;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s;
  margin-top: 4px;
}
.login-submit:hover { background: #aaddf5; }

/* ── Utilities ────────────────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mt-16  { margin-top: 16px; }
.mt-20  { margin-top: 20px; }
.flex-gap     { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
