:root {
  --sidebar-width: 260px;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #fff;
  --sidebar-active-bg: rgba(255,255,255,0.08);
  --sidebar-section: #475569;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f1f5f9;
  margin: 0;
}

/* ── Sidebar ─────────────────────────────────── */
#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 8px;
}

.brand-logo {
  width: 36px; height: 36px;
  background: #fff;
  color: #0f172a;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}

.brand-name {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.3px;
}

.sidebar-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--sidebar-section);
  padding: 16px 20px 6px;
  text-transform: uppercase;
}

#sidebar .nav-link {
  color: var(--sidebar-text);
  padding: 9px 20px;
  border-radius: 0;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  transition: all 0.15s;
  text-decoration: none;
}

#sidebar .nav-link:hover {
  color: var(--sidebar-active);
  background: var(--sidebar-active-bg);
}

#sidebar .nav-link.active {
  color: var(--sidebar-active);
  background: var(--sidebar-active-bg);
  border-left: 3px solid #fff;
}

#sidebar .nav-link.active .bi,
#sidebar .nav-link:hover .bi {
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }

.admin-avatar {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.admin-name {
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-role {
  color: var(--sidebar-section);
  font-size: 11px;
  text-transform: capitalize;
}

.btn-logout {
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}
.btn-logout:hover { color: #f87171; }

/* ── Page content ────────────────────────────── */
#page-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: calc(100% - var(--sidebar-width));
}

.top-bar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.online-badge {
  font-size: 12px;
  color: #64748b;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 20px;
}

.main-content {
  padding: 24px;
  flex: 1;
}

/* ── Page header ─────────────────────────────── */
.page-header {
  margin-bottom: 24px;
}
.page-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}
.page-subtitle {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}

/* ── Stat cards ──────────────────────────────── */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  height: 100%;
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}
.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}
.stat-label {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}
.stat-change {
  font-size: 12px;
  margin-top: 8px;
}

/* ── Cards ───────────────────────────────────── */
.card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: none;
}
.card-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 14px 20px;
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
  border-radius: 12px 12px 0 0 !important;
}

/* ── Tables ──────────────────────────────────── */
.table th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.table td { font-size: 13px; vertical-align: middle; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* ── Login page ──────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
}
.login-logo {
  width: 52px; height: 52px;
  background: #0f172a;
  color: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 24px;
  margin: 0 auto 20px;
}
.login-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  text-align: center;
}
.login-subtitle {
  font-size: 13px;
  color: #64748b;
  text-align: center;
  margin-bottom: 28px;
}

/* ── Misc ────────────────────────────────────── */
.badge { font-weight: 600; font-size: 11px; }
.member-id { font-family: monospace; font-size: 13px; letter-spacing: 1px; }
.points-value { font-weight: 800; color: #0f172a; }
.search-bar { max-width: 280px; }

@media (max-width: 768px) {
  #sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  #sidebar.open { transform: translateX(0); }
  #page-content { margin-left: 0; width: 100%; }
}
