/* ── App Shell ── */
#app { min-height: 100vh; }

/* ── Auth Pages ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  background: var(--bg);
}

.auth-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-8);
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--sp-6);
}

.auth-logo .logo-icon {
  width: 48px;
  height: 48px;
  background: var(--primary);
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-3);
}

.auth-logo .logo-icon svg { color: white; }

.auth-logo h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-1);
}

.auth-logo p {
  font-size: 0.875rem;
  color: var(--text-3);
  margin-top: var(--sp-1);
}

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

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

.sidebar-header {
  padding: var(--sp-5) var(--sp-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo svg { color: white; }

.sidebar-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.2;
}

.sidebar-subtitle {
  font-size: 0.75rem;
  color: var(--text-3);
}

.sidebar-nav {
  flex: 1;
  padding: var(--sp-3) var(--sp-2);
  overflow-y: auto;
}

.nav-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  padding: var(--sp-3) var(--sp-3) var(--sp-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover { background: var(--bg); color: var(--text-1); }

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-item svg { flex-shrink: 0; opacity: 0.8; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: var(--sp-3) var(--sp-2);
  border-top: 1px solid var(--border);
}

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

.topbar {
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-6);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.page-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-1);
}

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

.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.page-content {
  flex: 1;
  padding: var(--sp-6);
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* ── Bottom Nav (mobile) ── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 0 var(--sp-2);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: var(--sp-2);
  border-radius: var(--r-md);
  color: var(--text-3);
  font-size: 0.6875rem;
  font-weight: 500;
  cursor: pointer;
  min-width: 56px;
  transition: color 0.15s;
  border: none;
  background: none;
}

.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item svg { width: 22px; height: 22px; }

/* ── Mobile Header ── */
.mobile-header {
  display: none;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-4);
  position: sticky;
  top: 0;
  z-index: 50;
}

.mobile-header .logo-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* ── Onboarding ── */
.onboarding-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}

.onboarding-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-8);
  width: 100%;
  max-width: 560px;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  background: var(--border);
  transition: background 0.2s, width 0.2s;
}

.step-dot.active {
  background: var(--primary);
  width: 24px;
}

.step-dot.done { background: var(--success); }

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding-bottom: var(--bottom-nav-h); }
  .topbar { display: none; }
  .bottom-nav { display: block; }
  .mobile-header { display: flex; }
  .page-content { padding: var(--sp-4); }
  .onboarding-card { padding: var(--sp-5); }
  .auth-card { padding: var(--sp-5); }
}

@media (min-width: 769px) {
  .mobile-header { display: none; }
}
