/*
 * ╔══════════════════════════════════════════════════════════════════╗
 * ║  TREASURE TROVE — layout.css  v4.2                               ║
 * ║  Layout: Container, Grid, Sections, Header, Footer,              ║
 * ║          Auth Layout, Dashboard (Sidebar + Topbar), Responsive   ║
 * ║  Breakpoints: mobile <768px · tablet 768–1279px · desktop 1280+  ║
 * ╚══════════════════════════════════════════════════════════════════╝
 */


/* ═══════════════════════════════════════════════════════════════════ */
/*  CONTAINER                                                           */
/*  No max-width — content truly stretches on 4K / 8K screens.        */
/*  Padding scales fluidly with clamp so gutters never collapse.       */
/* ═══════════════════════════════════════════════════════════════════ */

.container {
  width: 100%;
  padding-left:  clamp(1rem, calc(1rem + 3vw), 5rem);
  padding-right: clamp(1rem, calc(1rem + 3vw), 5rem);
}

/* Narrow variant — centred prose / auth / confirmation pages */
.container-narrow {
  width: 100%;
  max-width: 820px;
  margin-left:  auto;
  margin-right: auto;
  padding-left:  clamp(1rem, 3vw, 3rem);
  padding-right: clamp(1rem, 3vw, 3rem);
}


/* ═══════════════════════════════════════════════════════════════════ */
/*  SECTION SPACING                                                     */
/* ═══════════════════════════════════════════════════════════════════ */

.section    { padding-top: var(--space-9);  padding-bottom: var(--space-9); }
.section-sm { padding-top: var(--space-7);  padding-bottom: var(--space-7); }
.section-xs { padding-top: var(--space-5);  padding-bottom: var(--space-5); }

.section-header {
  margin-bottom: var(--space-7);
  text-align: center;
}

/* Decorative label above section title */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-light);
  margin-bottom: var(--space-3);
}

.section-label::before,
.section-label::after {
  content: '';
  display: block;
  width: clamp(18px, 3vw, 38px);
  height: 1px;
  background: var(--primary);
  opacity: 0.55;
}

.section-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--text-bright);
  margin-bottom: var(--space-3);
  letter-spacing: -0.03em;
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 58ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}


/* ═══════════════════════════════════════════════════════════════════ */
/*  GRID SYSTEM                                                         */
/*  auto-fit grids stretch naturally on ultra-wide displays.           */
/*  minmax() ensures columns never get unreasonably wide.              */
/* ═══════════════════════════════════════════════════════════════════ */

.grid { display: grid; gap: var(--space-5); }

/* Auto-fit — columns add as viewport grows (true stretch) */
.grid-auto-sm {
  grid-template-columns: repeat(auto-fit, minmax(clamp(150px, 15vw, 260px), 1fr));
}
.grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(clamp(220px, 20vw, 360px), 1fr));
}
.grid-auto-lg {
  grid-template-columns: repeat(auto-fit, minmax(clamp(280px, 26vw, 460px), 1fr));
}

/* Fixed column grids */
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

/* Sidebar + content splits */
.grid-sidebar-main {
  display: grid;
  grid-template-columns: clamp(220px, 25vw, 360px) 1fr;
  gap: var(--space-6);
  align-items: start;
}

.grid-main-sidebar {
  display: grid;
  grid-template-columns: 1fr clamp(220px, 25vw, 360px);
  gap: var(--space-6);
  align-items: start;
}

/* Gap variants */
.gap-0 { gap: 0; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-x-2 { column-gap: var(--space-2); }
.gap-x-3 { column-gap: var(--space-3); }
.gap-x-4 { column-gap: var(--space-4); }
.gap-y-2 { row-gap: var(--space-2); }
.gap-y-3 { row-gap: var(--space-3); }
.gap-y-4 { row-gap: var(--space-4); }

/* Column spans */
.col-span-2    { grid-column: span 2; }
.col-span-3    { grid-column: span 3; }
.col-span-full { grid-column: 1 / -1; }


/* ═══════════════════════════════════════════════════════════════════ */
/*  FLEX HELPERS                                                        */
/* ═══════════════════════════════════════════════════════════════════ */

.flex          { display: flex; }
.flex-col      { display: flex; flex-direction: column; }
.flex-wrap     { flex-wrap: wrap; }
.flex-nowrap   { flex-wrap: nowrap; }
.flex-1        { flex: 1; }
.flex-auto     { flex: 0 0 auto; }
.flex-shrink-0 { flex-shrink: 0; }

.items-start   { align-items: flex-start; }
.items-center  { align-items: center; }
.items-end     { align-items: flex-end; }
.items-stretch { align-items: stretch; }

.justify-start   { justify-content: flex-start; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around  { justify-content: space-around; }

.self-start  { align-self: flex-start; }
.self-center { align-self: center; }
.self-end    { align-self: flex-end; }


/* ═══════════════════════════════════════════════════════════════════ */
/*  SITE HEADER / NAVBAR                                                */
/* ═══════════════════════════════════════════════════════════════════ */

.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  height: clamp(58px, calc(48px + 1.5vw), 74px);
  background: rgba(15, 14, 23, 0.72);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid rgba(45, 43, 85, 0.55);
  display: flex;
  align-items: center;
  transition: background var(--t), box-shadow var(--t);
}

.site-header.scrolled {
  background: rgba(15, 14, 23, 0.96);
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.55),
              0 0 28px rgba(108, 99, 255, 0.07);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  height: 100%;
}

/* ─── Logo ─── */
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo-icon {
  width:  clamp(28px, 2.8vw, 42px);
  height: clamp(28px, 2.8vw, 42px);
  flex-shrink: 0;
}

.site-logo-text {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

/* ─── Nav links ─── */
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 2.2rem);
}

.site-nav-link {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  padding: var(--space-1) 0;
  position: relative;
  transition: color var(--t-fast);
  white-space: nowrap;
}

.site-nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--t-spring);
}

.site-nav-link:hover,
.site-nav-link.active {
  color: var(--text-bright);
}

.site-nav-link:hover::after,
.site-nav-link.active::after {
  transform: scaleX(1);
}

/* ─── Header right actions ─── */
.site-header-cta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* ─── Frontend Header: Logged-in User Area ─── */
.header-user-area {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.header-notif-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
}

.header-notif-btn:hover {
  background: rgba(108, 99, 255, 0.1);
  color: var(--primary-light);
}

.header-user-menu {
  position: relative;
  flex-shrink: 0;
}

.header-avatar-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: background var(--t-fast);
}

.header-avatar-btn:hover {
  background: rgba(108, 99, 255, 0.1);
}

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-username {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.header-chevron {
  color: var(--text-muted);
  transition: transform var(--t-fast);
  flex-shrink: 0;
}

.header-avatar-btn[aria-expanded="true"] .header-chevron {
  transform: rotate(180deg);
}

/* ─── Hamburger (mobile) ─── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  transition: background var(--t-fast);
  background: none;
  border: none;
}

.hamburger:hover { background: rgba(108, 99, 255, 0.1); }

.hamburger-line {
  display: block;
  width: clamp(20px, 2.2vw, 26px);
  height: 2px;
  background: var(--text);
  border-radius: var(--radius-full);
  transition: transform var(--t), opacity var(--t), background var(--t);
}

.hamburger.open .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg);  }
.hamburger.open .hamburger-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Mobile nav overlay ─── */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  top: clamp(58px, calc(48px + 1.5vw), 74px);
  background: rgba(13, 13, 26, 0.98);
  backdrop-filter: blur(24px);
  z-index: var(--z-sidebar);
  padding: 0;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-nav.open { display: flex; }

/* Mobile nav header — just the close button */
.nav-mobile__header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.nav-mobile__close {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast), color var(--t-fast);
}

.nav-mobile__close:hover {
  background: rgba(255,23,68,0.1);
  color: var(--danger);
}

/* Logged-in user info in mobile nav */
.nav-mobile__user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.nav-mobile__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: var(--text-base);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-mobile__username {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-bright);
}

/* Nav links list */
.nav-mobile__list {
  list-style: none;
  margin: 0;
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-mobile__link {
  display: block;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius-sm);
  transition: color var(--t-fast), background var(--t-fast), padding-left var(--t);
}

.nav-mobile__link:hover,
.nav-mobile__link.active {
  color: var(--text-bright);
  background: rgba(108, 99, 255, 0.08);
  padding-left: var(--space-4);
}

/* Footer buttons */
.nav-mobile__footer {
  padding: var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex-shrink: 0;
}

.mobile-nav-link {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
  transition: color var(--t-fast), padding-left var(--t);
}

.mobile-nav-link:hover {
  color: var(--text-bright);
  padding-left: var(--space-3);
}

.mobile-nav-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-3) 0;
}


/* ═══════════════════════════════════════════════════════════════════ */
/*  SITE FOOTER                                                         */
/* ═══════════════════════════════════════════════════════════════════ */

.site-footer {
  background: var(--bg-card-3);
  border-top: 1px solid var(--border);
  padding-top: var(--space-8);
  padding-bottom: var(--space-5);
  position: relative;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(160px, 18vw, 260px), 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-7);
}

.footer-tagline {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.7;
  margin: var(--space-4) 0;
}

.footer-social {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.footer-social-link {
  width:  clamp(32px, 3vw, 44px);
  height: clamp(32px, 3vw, 44px);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--text-base);
  text-decoration: none;
  transition: all var(--t);
}

.footer-social-link:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(108, 99, 255, 0.1);
  box-shadow: var(--glow-sm);
}

.footer-col-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-bright);
  margin-bottom: var(--space-5);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-link {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t-fast);
}

.footer-link:hover { color: var(--primary-light); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.footer-copyright {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.footer-legal-links {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.footer-legal-link {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t-fast);
}

.footer-legal-link:hover { color: var(--primary-light); }

/* Indian legal disclaimer */
.footer-disclaimer {
  font-size: var(--text-xs);
  color: var(--text-muted);
  opacity: 0.55;
  text-align: center;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(45, 43, 85, 0.4);
  line-height: 1.65;
}


/* ═══════════════════════════════════════════════════════════════════ */
/*  AUTH LAYOUT  (login · register · forgot-password · verify-otp)    */
/* ═══════════════════════════════════════════════════════════════════ */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
}

/* Glow orbs behind auth card */
.auth-page::before {
  content: '';
  position: absolute;
  top: -30%; left: -20%;
  width: 60%; height: 80%;
  background: radial-gradient(ellipse, rgba(108, 99, 255, 0.11) 0%, transparent 70%);
  pointer-events: none;
}

.auth-page::after {
  content: '';
  position: absolute;
  bottom: -20%; right: -10%;
  width: 50%; height: 60%;
  background: radial-gradient(ellipse, rgba(255, 215, 0, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: clamp(340px, 42vw, 520px);
  position: relative;
  z-index: var(--z-raised);
}


/* ═══════════════════════════════════════════════════════════════════ */
/*  DASHBOARD LAYOUT                                                    */
/*  Fixed sidebar + scrollable main area                               */
/* ═══════════════════════════════════════════════════════════════════ */

/* ─── Skip Link ─── */
.skip-link {
  position: fixed;
  top: -9999px;
  left: -9999px;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  z-index: 99999;
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { top: 0; left: 0; }

.dashboard-body {
  display: flex;
  min-height: 100vh;
}

.dashboard-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ─── Sidebar ─── */
.dashboard-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-card-3);
  border-right: 1px solid var(--border);
  position: fixed;
  left: 0; top: 0;
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--t-slow), transform var(--t-slow);
}

/* Icon-only collapsed state (toggle button adds this) */
.dashboard-sidebar.collapsed {
  width: clamp(52px, 4.5vw, 68px);
}

/* ─── Main content area ─── */
.dashboard-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--t-slow);
}

.dashboard-main.sidebar-collapsed {
  margin-left: clamp(52px, 4.5vw, 68px);
}

/* ─── Topbar ─── */
.dashboard-topbar {
  height: var(--topbar-height);
  background: rgba(13, 13, 26, 0.82);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: var(--space-4);
  flex-shrink: 0;
}

/* ─── Content area ─── */
.dashboard-content {
  flex: 1;
  padding: 16px 16px;
  position: relative;
  z-index: var(--z-base);
}

/* ─── Sidebar: Logo area ─── */
.sidebar-logo-area {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  text-decoration: none;
  overflow: hidden;
}

.sidebar-logo-text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  transition: opacity var(--t), width var(--t);
}

.dashboard-sidebar.collapsed .sidebar-logo-text {
  opacity: 0;
  width: 0;
  pointer-events: none;
}

/* ─── Sidebar: User block ─── */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-user-info {
  overflow: hidden;
  flex: 1;
  transition: opacity var(--t);
}

.sidebar-user-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-balance {
  font-size: var(--text-xs);
  color: var(--accent);
  font-weight: 600;
  margin-top: 2px;
}

.dashboard-sidebar.collapsed .sidebar-user-info { opacity: 0; }

/* ─── Sidebar: Nav ─── */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-4) 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(108,99,255,0.3) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(108,99,255,0.3); border-radius: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(108,99,255,0.6); }

.sidebar-nav-section { margin-bottom: var(--space-2); }

.sidebar-nav-section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-4);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--t);
}

.dashboard-sidebar.collapsed .sidebar-nav-section-title { opacity: 0; }

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition: color var(--t-fast), background var(--t-fast);
}

/* Active indicator bar on left */
.sidebar-nav-link::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--gradient-primary);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  transform: scaleY(0);
  transform-origin: center;
  transition: transform var(--t-spring);
}

.sidebar-nav-link:hover {
  color: var(--text);
  background: rgba(108, 99, 255, 0.06);
}

.sidebar-nav-link.active {
  color: var(--primary-light);
  background: rgba(108, 99, 255, 0.1);
}

.sidebar-nav-link.active::before { transform: scaleY(1); }

.sidebar-nav-icon {
  width: clamp(16px, 1.5vw, 22px);
  height: clamp(16px, 1.5vw, 22px);
  font-size: clamp(14px, 1.4vw, 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-nav-label {
  flex: 1;
  overflow: hidden;
  transition: opacity var(--t);
}

.dashboard-sidebar.collapsed .sidebar-nav-label { opacity: 0; }

.sidebar-nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 0.1em 0.45em;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
  transition: opacity var(--t);
}

.dashboard-sidebar.collapsed .sidebar-nav-badge { opacity: 0; }

/* ─── Sidebar: Footer (logout) ─── */
.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ─── Topbar elements ─── */
.topbar-left,
.dashboard-topbar__left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}

.topbar-toggle,
.topbar-hamburger {
  display: none;
  width:  clamp(34px, 3vw, 46px);
  height: clamp(34px, 3vw, 46px);
  border-radius: var(--radius-sm);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: var(--text-xl);
  transition: background var(--t-fast), color var(--t-fast);
  flex-shrink: 0;
  background: none;
  border: none;
}

.topbar-toggle:hover,
.topbar-hamburger:hover {
  background: rgba(108, 99, 255, 0.1);
  color: var(--primary-light);
}

.topbar-hamburger__bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: var(--radius-full);
  transition: transform var(--t), opacity var(--t);
}

.topbar-page-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}

.topbar-page-title h1.topbar-title {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  margin: 0;
  line-height: 1.2;
}

/* Breadcrumb below page title in topbar */
.topbar-breadcrumb { display: none; }

.topbar-breadcrumb__list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
}

.topbar-breadcrumb__link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t-fast);
}

.topbar-breadcrumb__link:hover { color: var(--primary-light); }

.topbar-breadcrumb__sep {
  color: var(--text-muted);
  opacity: 0.5;
  font-size: 0.7rem;
}

.topbar-breadcrumb__current {
  color: var(--text);
  font-weight: 600;
}

.topbar-right,
.dashboard-topbar__right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.topbar-coin-balance {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.22);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.topbar-bell {
  position: relative;
  width:  clamp(34px, 3vw, 46px);
  height: clamp(34px, 3vw, 46px);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: var(--text-lg);
  transition: all var(--t-fast);
  background: none;
  border: none;
}

.topbar-bell:hover {
  background: rgba(108, 99, 255, 0.1);
  color: var(--primary-light);
}

.topbar-bell-badge {
  position: absolute;
  top: 5px; right: 5px;
  min-width: 16px; height: 16px;
  background: var(--danger);
  border-radius: var(--radius-full);
  font-size: 0.6rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.25em;
  border: 2px solid var(--bg);
}


/* ─── Topbar User Menu ─── */
.topbar-user-menu {
  position: relative;
  flex-shrink: 0;
}

.topbar-avatar-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: background var(--t-fast);
}

.topbar-avatar-btn:hover {
  background: rgba(108, 99, 255, 0.1);
}

.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: var(--text-sm);
}

.topbar-avatar-img { width: 100%; height: 100%; object-fit: cover; }

.topbar-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%; height: 100%;
  font-weight: 700;
  font-size: var(--text-sm);
}

.topbar-username {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.topbar-chevron {
  color: var(--text-muted);
  transition: transform var(--t-fast);
  flex-shrink: 0;
}

.topbar-avatar-btn[aria-expanded="true"] .topbar-chevron {
  transform: rotate(180deg);
}

/* ─── Sidebar: Bottom Action Buttons ─── */
.sidebar-bottom-actions {
  padding: var(--space-3) var(--space-3);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex-shrink: 0;
}

.sidebar-action-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
  overflow: hidden;
  border: 1px solid transparent;
}

.sidebar-action-btn svg {
  flex-shrink: 0;
}

.sidebar-action-btn--ghost {
  color: var(--text-muted);
  border-color: var(--border);
  background: transparent;
}

.sidebar-action-btn--ghost:hover {
  color: var(--text-bright);
  background: rgba(108, 99, 255, 0.08);
  border-color: var(--primary);
}

.sidebar-action-btn--danger {
  color: var(--danger);
  border-color: rgba(255, 23, 68, 0.3);
  background: rgba(255, 23, 68, 0.05);
}

.sidebar-action-btn--danger:hover {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.dashboard-sidebar.collapsed .sidebar-action-btn .sidebar-nav-label {
  opacity: 0;
  width: 0;
  pointer-events: none;
}

/* Mobile overlay for sidebar */
.sidebar-overlay,
.dashboard-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: calc(var(--z-sidebar) - 1);
  backdrop-filter: blur(4px);
}

.sidebar-overlay.active,
.dashboard-sidebar-overlay.active,
.dashboard-sidebar-overlay.is-visible { display: block; }


/* ═══════════════════════════════════════════════════════════════════ */
/*  PAGE HEADER (inside dashboard pages)                               */
/* ═══════════════════════════════════════════════════════════════════ */

.page-header {
  margin-bottom: var(--space-6);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.page-header-left { flex: 1; min-width: 0; }

.page-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--text-bright);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-1);
}

.page-subtitle {
  font-size: var(--text-base);
  color: var(--text-muted);
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════════════════ */
/*  RESPONSIVE BREAKPOINTS                                              */
/* ═══════════════════════════════════════════════════════════════════ */

/* ── Tablet: 768px – 1279px ─────────────────────────────────────── */
@media (max-width: 1279px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }

  .grid-sidebar-main,
  .grid-main-sidebar { grid-template-columns: 1fr; }

  .col-span-3 { grid-column: span 2; }

  /* Sidebar narrower on tablet — icon only */
  .dashboard-sidebar {
    width: clamp(52px, 4.5vw, 68px);
    min-width: 0;
  }
  .dashboard-sidebar .sidebar-logo-text,
  .dashboard-sidebar .sidebar-user-info,
  .dashboard-sidebar .sidebar-nav-label,
  .dashboard-sidebar .sidebar-nav-section-title,
  .dashboard-sidebar .sidebar-nav-badge {
    opacity: 0;
    width: 0;
    pointer-events: none;
  }
  /* Restore when sidebar is open on tablet/mobile */
  .dashboard-sidebar.is-open .sidebar-logo-text,
  .dashboard-sidebar.is-open .sidebar-user-info,
  .dashboard-sidebar.is-open .sidebar-nav-label,
  .dashboard-sidebar.is-open .sidebar-nav-section-title,
  .dashboard-sidebar.is-open .sidebar-nav-badge {
    opacity: 1 !important;
    width: auto !important;
    pointer-events: auto !important;
  }
  .dashboard-main {
    margin-left: clamp(52px, 4.5vw, 68px);
  }
}

/* ── Mobile: < 768px ────────────────────────────────────────────── */
@media (max-width: 767px) {

  /* Nav → hamburger */
  .site-nav        { display: none; }
  .site-header-cta { display: none; }
  .hamburger       { display: flex; }

  /* Dashboard sidebar — off-canvas slide-in */
  /* Show hamburger on mobile */
  .topbar-hamburger { display: flex; }

  /* Dashboard sidebar — off-canvas slide-in */
  .dashboard-sidebar {
    transform: translateX(-100%);
    width: clamp(240px, 80vw, 320px) !important;
    min-width: 0 !important;
    box-shadow: var(--shadow-lg);
  }

  /* JS uses is-open class */
  .dashboard-sidebar.mobile-open,
  .dashboard-sidebar.is-open {
    transform: translateX(0);
  }

  /* Restore labels when sidebar slides open on mobile */
  .dashboard-sidebar.mobile-open .sidebar-logo-text,
  .dashboard-sidebar.mobile-open .sidebar-user-info,
  .dashboard-sidebar.mobile-open .sidebar-nav-label,
  .dashboard-sidebar.mobile-open .sidebar-nav-section-title,
  .dashboard-sidebar.mobile-open .sidebar-nav-badge,
  .dashboard-sidebar.is-open .sidebar-logo-text,
  .dashboard-sidebar.is-open .sidebar-user-info,
  .dashboard-sidebar.is-open .sidebar-nav-label,
  .dashboard-sidebar.is-open .sidebar-nav-section-title,
  .dashboard-sidebar.is-open .sidebar-nav-badge {
    opacity: 1 !important;
    width: auto !important;
    pointer-events: auto !important;
  }

  .dashboard-main { margin-left: 0 !important; }

  .dashboard-content { padding: 12px; }

  /* Grids collapse to 1 column */
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .grid-5 { grid-template-columns: 1fr; }
  .grid-6 { grid-template-columns: repeat(2, 1fr); }

  .col-span-2,
  .col-span-3 { grid-column: span 1; }

  .page-header         { flex-direction: column; align-items: flex-start; }
  .section-subtitle    { max-width: 100%; }
  .topbar-coin-balance { display: none; }
  .header-username { display: none; }
  .topbar-page-title   { font-size: var(--text-base); }

  .footer-grid         { grid-template-columns: 1fr; }
  .footer-bottom       { flex-direction: column; align-items: flex-start; }
}

/* ── Small mobile: < 480px ──────────────────────────────────────── */
@media (max-width: 479px) {
  .grid-6 { grid-template-columns: 1fr; }
  .auth-card { max-width: 100%; }
}