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

:root {
  --bg-base: #1e293b;
  --bg-alt: #0f172a;
  --bg-sidebar: #0f172a;
  --bg-card: #1e293b;
  --primary: #818cf8;
  --primary-glow: rgba(129, 140, 248, 0.3);
  --secondary: #34d399;
  --text-main: #f8fafc;
  --text-dim: #94a3b8;
  --text-silver: #f1f5f9;
  --border: rgba(255, 255, 255, 0.1);
  --shadow-rich: 0 10px 30px -5px rgba(0, 0, 0, 0.4);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 280px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-base);
  color: var(--text-main);
  overflow-x: hidden;
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
.brand-font {
  font-family: 'Outfit', sans-serif;
}

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-alt);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

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

/* ─── Sidebar ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  z-index: 1000;
  overflow: hidden;
}

/* Scrollable nav area — grows to fill space, scrolls if needed */
.sidebar-nav-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2rem 1.5rem 1rem;
  scrollbar-width: thin;
}

/* Pinned user/logout area at the bottom — never overlaps nav */
.sidebar-user-area {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 2.5rem;
  display: block;
  letter-spacing: -1px;
}

.nav-group {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-link-custom {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.2rem;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: 12px;
  margin-bottom: 0.4rem;
  transition: var(--transition);
  font-weight: 500;
  white-space: nowrap;
}

.nav-link-custom:hover,
.nav-link-custom.active {
  background: var(--bg-base);
  color: white;
}

.nav-link-custom i {
  margin-right: 12px;
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* ─── Main Content ──────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 3rem;
  min-width: 0;
}

/* ─── Hamburger Toggle ──────────────────────────────────── */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1100;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: 10px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: var(--transition);
}

.sidebar-toggle:hover {
  background: var(--bg-base);
  border-color: var(--primary);
  color: var(--primary);
}

/* ─── Mobile Overlay ────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
  backdrop-filter: blur(2px);
}

/* ─── Cards ─────────────────────────────────────────────── */
.elite-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: var(--shadow-rich);
  transition: var(--transition);
}

.elite-card:hover {
  border-color: var(--primary-glow);
  transform: translateY(-2px);
}

/* ─── Typography ─────────────────────────────────────────── */
.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn-elite {
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  border: none;
  transition: var(--transition);
}

.btn-elite:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px var(--primary-glow);
  filter: brightness(1.1);
  color: white;
}

/* ─── Forms ──────────────────────────────────────────────── */
.form-control {
  background: var(--bg-base);
  border: 1px solid var(--border);
  color: white;
  border-radius: 10px;
  padding: 0.8rem;
}

.form-control:focus {
  background: var(--bg-base);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 0 4px var(--primary-glow);
}

/* ─── Responsive ─────────────────────────────────────────── */

/* Tablet: slightly narrower sidebar */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 240px;
  }

  .main-content {
    padding: 2rem;
  }
}

/* Mobile: collapsed sidebar with hamburger toggle */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0, 0, 0, 0.6);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .sidebar-toggle {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    padding: 1.5rem 1rem;
    padding-top: 4.5rem;
  }

  .elite-card {
    padding: 1.25rem;
    border-radius: 16px;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .main-content {
    padding: 1rem 0.75rem;
    padding-top: 4.5rem;
  }

  .elite-card {
    padding: 1rem;
  }

  h1.h3 {
    font-size: 1.1rem;
  }
}