/* ── PAGE SHELL ──────────────────────────────────── 
.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}*/

.app {
  display: block;
  min-height: 100vh;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  margin-left: var(--sidebar-width);
}

.page-body {
  flex: 1;
  padding: var(--sp-6) var(--sp-8);
  animation: fadeIn .2s ease;
}

/* ── TOPBAR ──────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-8);
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-left { display: flex; flex-direction: column; gap: 2px; }
.topbar-left h1 { font-size: 1.25rem; font-weight: 700; line-height: 1; }
.topbar-left p  { font-size: 12px; color: var(--text-muted); }

.topbar-right { display: flex; align-items: center; gap: var(--sp-3); }

.topbar-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--r);
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer; transition: all var(--t);
}
.topbar-btn:hover { background: var(--gray-100); color: var(--text-primary); }

.topbar-user {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 6px 10px; border-radius: var(--r);
  cursor: pointer; transition: background var(--t);
  border: 1px solid var(--border);
}
.topbar-user:hover { background: var(--gray-50); }
.topbar-user-info { display: flex; flex-direction: column; }
.topbar-user-name  { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1; }
.topbar-user-role  { font-size: 11px; color: var(--text-muted); }

/* ── SIDEBAR ─────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow: hidden;
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-5);
  border-bottom: 1px solid var(--sidebar-border);
  text-decoration: none;
}
.sidebar-logo {
  width: 36px; height: 36px; border-radius: var(--r);
  background: var(--brand); display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-brand-text { display: flex; flex-direction: column; }
.sidebar-brand-name { font-size: 15px; font-weight: 700; color: #fff; line-height: 1; }
.sidebar-brand-sub  { font-size: 11px; color: var(--sidebar-text); margin-top: 2px; }

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: var(--sp-4) var(--sp-3);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #475569;
  padding: var(--sp-4) var(--sp-3) var(--sp-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px var(--sp-3);
  border-radius: var(--r);
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--t);
  position: relative;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: #e2e8f0;
}
.nav-item.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px var(--brand-glow);
}
.nav-item.active svg { color: #fff; }
.nav-item svg { flex-shrink: 0; opacity: .85; }
.nav-item.active svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-full);
}
.nav-item.active .nav-badge { background: rgba(255,255,255,.25); }

/* Sidebar Footer */
.sidebar-footer {
  padding: var(--sp-4) var(--sp-3);
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r);
  cursor: pointer;
  transition: background var(--t);
  margin-bottom: var(--sp-3);
}
.sidebar-user:hover { background: var(--sidebar-hover); }
.sidebar-user-info  { flex: 1; min-width: 0; }
.sidebar-user-name  { font-size: 13px; font-weight: 600; color: #e2e8f0; }
.sidebar-user-email { font-size: 11px; color: var(--sidebar-text); }

.btn-logout {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  width: 100%; padding: 9px; border-radius: var(--r);
  background: transparent; border: 1px solid var(--sidebar-border);
  color: var(--sidebar-text); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all var(--t);
}
.btn-logout:hover { background: var(--sidebar-hover); color: #e2e8f0; border-color: #334155; }

/* ── PAGE HEADER ─────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
  gap: var(--sp-4);
}
.page-header-left h1 { font-size: 1.375rem; margin-bottom: 4px; }
.page-header-left p  { font-size: 13px; color: var(--text-muted); margin: 0; }
.page-header-right   { display: flex; gap: var(--sp-3); flex-shrink: 0; }

/* ── STATS ROW ───────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-5);
  margin-bottom: var(--sp-6);
}

/* ── CONTENT GRID ────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }

/* ── FILTERS BAR ─────────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.filter-tabs { display: flex; gap: var(--sp-2); }
.filter-tab {
  padding: 7px 14px; border-radius: var(--r-full); font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary);
  cursor: pointer; transition: all var(--t);
}
.filter-tab:hover   { background: var(--gray-100); }
.filter-tab.active  { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ── AUTH LAYOUT ─────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
}

.auth-left {
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--sp-10);
  position: relative;
  overflow: hidden;
}
.auth-left::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(99,102,241,.2) 0%, transparent 70%);
  pointer-events: none;
}
.auth-left-brand { display: flex; align-items: center; gap: var(--sp-3); }
.auth-left-brand-name { font-size: 20px; font-weight: 700; color: #fff; }

.auth-left-content { max-width: 400px; }
.auth-left-content h1 { color: #fff; font-size: 2rem; margin-bottom: var(--sp-4); }
.auth-left-content p  { color: #94a3b8; font-size: 15px; line-height: 1.7; }

.auth-features { display: flex; flex-direction: column; gap: var(--sp-4); margin-top: var(--sp-8); }
.auth-feature  { display: flex; align-items: center; gap: var(--sp-3); }
.auth-feature-icon {
  width: 36px; height: 36px; background: rgba(99,102,241,.2);
  border-radius: var(--r); display: flex; align-items: center; justify-content: center;
  color: var(--brand); flex-shrink: 0;
}
.auth-feature-text { font-size: 14px; color: #94a3b8; }
.auth-feature-text strong { color: #e2e8f0; display: block; margin-bottom: 2px; }

.auth-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-10);
}
.auth-box { width: 100%; max-width: 420px; }
.auth-box-header { margin-bottom: var(--sp-8); }
.auth-box-header h2 { font-size: 1.625rem; margin-bottom: var(--sp-2); }
.auth-box-header p  { color: var(--text-muted); font-size: 14px; }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); transition: transform var(--t-slow); }
  .sidebar.open { transform: translateX(0); }
  .page-body { padding: var(--sp-4); }
  .topbar { padding: 0 var(--sp-4); }
  .auth-page { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .stats-row { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ── SIGNUP EXTRAS ───────────────────────────────── */
.strength-bar {
  height: 4px; flex: 1; border-radius: var(--r-full);
  background: var(--border); transition: background .3s;
}
