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

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #070714;
  --sidebar: #0d0d1f;
  --card: rgba(255,255,255,0.035);
  --card-border: rgba(255,255,255,0.07);
  --indigo: #6366f1;
  --purple: #8b5cf6;
  --text: #e2e4f0;
  --muted: rgba(255,255,255,0.4);
}

html, body { height: 100%; }
body { 
  font-family: 'Inter', sans-serif; 
  background: var(--bg); 
  color: var(--text); 
  display: flex; 
  min-height: 100vh; 
  overflow-x: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
  width: 240px; min-height: 100vh; background: var(--sidebar);
  border-right: 1px solid rgba(255,255,255,0.05);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.05);
  text-decoration: none;
}
.logo-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--indigo), var(--purple));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px rgba(99,102,241,0.4); flex-shrink: 0;
}
.logo-icon svg { width: 16px; height: 16px; }
.logo-name { font-size: 15px; font-weight: 800; color: white; letter-spacing: -0.4px; }

.sidebar-section { padding: 20px 12px 0; }
.sidebar-label { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.25); text-transform: uppercase; letter-spacing: 1px; padding: 0 8px; margin-bottom: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  font-size: 13.5px; font-weight: 500; color: var(--muted);
  text-decoration: none; transition: all 0.15s; margin-bottom: 2px;
  position: relative; border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: white; }
.nav-item.active { background: rgba(99,102,241,0.15); color: white; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%; width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(135deg, var(--indigo), var(--purple));
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.nav-item.active .nav-icon { opacity: 1; }

.sidebar-bottom { margin-top: auto; padding: 16px 12px; border-top: 1px solid rgba(255,255,255,0.05); }
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,0.04); cursor: pointer; transition: 0.15s;
}
.user-card:hover { background: rgba(255,255,255,0.08); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white;
}
.user-name { font-size: 13px; font-weight: 600; color: white; }
.user-email { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }

/* ── MOBILE HEADER (Hidden on desktop) ── */
.mobile-header {
  display: none; height: 60px; background: rgba(7,7,20,0.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  align-items: center; justify-content: space-between; padding: 0 20px;
  position: sticky; top: 0; z-index: 90;
}
.mobile-toggle {
  background: transparent; border: none; color: white; padding: 8px; cursor: pointer;
}

/* ── MAIN CONTENT ── */
.main {
  margin-left: 240px; flex: 1; display: flex; flex-direction: column; min-height: 100vh;
  width: calc(100% - 240px);
}
.topbar {
  height: 60px; border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; background: rgba(7,7,20,0.8); backdrop-filter: blur(20px);
  position: sticky; top: 0; z-index: 40;
}
.page-title { font-size: 16px; font-weight: 700; color: white; letter-spacing: -0.3px; }
.content { padding: 32px; flex: 1; display: flex; flex-direction: column; }

/* ── COMMON UI ELEMENTS ── */
.card { background: var(--card); border: 1px solid var(--card-border); border-radius: 16px; overflow: hidden; }
.btn-primary { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 10px; font-size: 13px; font-weight: 700; background: linear-gradient(135deg, var(--indigo), var(--purple)); color: white; border: none; cursor: pointer; transition: all 0.2s; box-shadow: 0 0 20px rgba(99,102,241,0.35); text-decoration: none; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 30px rgba(99,102,241,0.5); }

/* ── EMPTY STATES ── */
.empty-state { padding: 100px 24px; text-align: center; flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-title { font-size: 18px; font-weight: 700; color: white; margin-bottom: 8px; }
.empty-desc { font-size: 14px; color: var(--muted); margin-bottom: 24px; max-width: 400px; }

/* ── RESPONSIVE DESIGN ── */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); box-shadow: 20px 0 50px rgba(0,0,0,0.5); }
  .main { margin-left: 0; width: 100%; }
  .mobile-header { display: flex; }
  .topbar { display: none; } /* On mobile, we use mobile-header instead of topbar to save space, or merge them. We'll hide topbar for simplicity if mobile-header is active. */
  .content { padding: 20px; }
}

/* Base grids for layout scaling */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
