@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* -- Reset ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* -- Design Tokens ------------------------------------------------------------ */
:root {
  --bg:           #06060e;
  --bg2:          #08081a;
  --surface:      #0c0c1e;
  --surface2:     #101026;
  --surface3:     #14142e;
  --glass:        rgba(255,255,255,0.028);
  --glass2:       rgba(255,255,255,0.05);
  --glass3:       rgba(255,255,255,0.08);

  --border:       rgba(255,255,255,0.055);
  --border2:      rgba(255,255,255,0.095);
  --border3:      rgba(255,255,255,0.14);

  --text:         #f0f0fc;
  --text-muted:   #6060a0;
  --text-dim:     #28284a;

  --accent:       #6366f1;
  --accent2:      #818cf8;
  --accent3:      #a5b4fc;
  --accent-glow:  rgba(99,102,241,0.35);
  --accent-soft:  rgba(99,102,241,0.1);

  --green:        #10b981;
  --green-glow:   rgba(16,185,129,0.3);
  --green-soft:   rgba(16,185,129,0.08);

  --red:          #f43f5e;
  --red-glow:     rgba(244,63,94,0.3);
  --red-soft:     rgba(244,63,94,0.08);

  --orange:       #f59e0b;
  --orange-glow:  rgba(245,158,11,0.3);
  --orange-soft:  rgba(245,158,11,0.08);

  --cyan:         #06b6d4;
  --cyan-glow:    rgba(6,182,212,0.3);
  --cyan-soft:    rgba(6,182,212,0.08);

  --purple:       #a78bfa;
  --purple-glow:  rgba(167,139,250,0.3);
  --purple-soft:  rgba(167,139,250,0.08);

  --radius:     14px;
  --radius-sm:  9px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --shadow:    0 1px 12px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.04);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.04);
  --shadow-xl: 0 24px 80px rgba(0,0,0,0.75), 0 0 0 1px rgba(255,255,255,0.05);

  --sidebar-w: 220px;
  --header-h:  56px;
  --bnav-h:    72px;

  --tab-home:      #6366f1;
  --tab-inventory: #06b6d4;
  --tab-sales:     #10b981;
  --tab-packages:  #f59e0b;
  --tab-analytics: #a78bfa;
  --tab-admin:     #f43f5e;
}

/* -- Base --------------------------------------------------------------------- */
html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* -- Cursor glow -------------------------------------------------------------- */
.cursor-glow {
  position: fixed;
  pointer-events: none;
  z-index: 9997;
  width: 900px;
  height: 900px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.055) 0%, transparent 60%);
  transform: translate(-50%, -50%);
  transition: left 0.06s linear, top 0.06s linear;
  will-change: left, top;
}

/* -- Noise overlay ------------------------------------------------------------ */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* -- Background Orbs ---------------------------------------------------------- */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  animation: orb-drift linear infinite;
}

.orb-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle at 40% 40%, rgba(99,102,241,0.18), transparent 70%);
  top: -300px; left: -200px;
  animation-duration: 30s;
}
.orb-2 {
  width: 600px; height: 600px;
  background: radial-gradient(circle at 60% 60%, rgba(139,92,246,0.14), transparent 70%);
  bottom: -280px; right: -180px;
  animation-duration: 38s;
  animation-delay: -14s;
}
.orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle at 50% 50%, rgba(6,182,212,0.08), transparent 70%);
  top: 40%; left: 55%;
  animation-duration: 24s;
  animation-delay: -8s;
}

@keyframes orb-drift {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(40px, -30px) scale(1.06); }
  50%  { transform: translate(20px, 40px) scale(0.96); }
  75%  { transform: translate(-30px, 20px) scale(1.03); }
  100% { transform: translate(0, 0) scale(1); }
}

/* -- Screens ------------------------------------------------------------------ */
.screen { height: 100vh; width: 100vw; position: relative; z-index: 1; }

/* -- Login -------------------------------------------------------------------- */
#screen-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow-y: auto;
}

#screen-pending {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

/* -- Landing page ------------------------------------------------------------ */

.landing {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.landing-hero {
  text-align: center;
  padding: 100px 0 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.landing-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 999px;
  letter-spacing: 0.3px;
  animation: fadeInUp 0.6s ease both;
}

.landing-h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1.1;
  color: var(--text);
  animation: fadeInUp 0.6s ease 0.1s both;
}

.landing-h1 .gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent2), #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-p {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.7;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.btn-landing-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 36px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 24px var(--accent-glow), 0 0 0 1px rgba(99,102,241,0.3);
  animation: fadeInUp 0.6s ease 0.3s both;
}
.btn-landing-cta:hover { transform: translateY(-3px); box-shadow: 0 8px 40px var(--accent-glow); }
.btn-landing-cta:active { transform: translateY(0); }

.landing-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  width: 100%;
  padding: 20px 0 80px;
  animation: fadeInUp 0.6s ease 0.4s both;
}

.landing-feature {
  background: rgba(12,12,30,0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: all 0.3s;
  backdrop-filter: blur(20px);
}
.landing-feature:hover {
  border-color: var(--border2);
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.landing-feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.landing-feature h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.landing-feature p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.landing-login-section {
  padding: 40px 0 60px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.landing-footer {
  padding: 24px 0 40px;
  text-align: center;
}
.landing-footer p {
  font-size: 13px;
  color: var(--text-dim);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .landing-hero { padding: 60px 0 40px; }
  .landing-features { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .landing-p { font-size: 15px; }
}

@media (max-width: 480px) {
  .landing-features { grid-template-columns: 1fr; }
}

/* -- Profile / Settings page ------------------------------------------------- */

.profile-page {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.profile-card {
  background: rgba(12,12,30,0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  backdrop-filter: blur(20px);
}

.profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 0 24px var(--accent-glow);
}

.profile-username {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.profile-discord-id {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--mono);
}

.profile-joined {
  font-size: 13px;
  color: var(--text-dim);
}

.settings-section {
  background: rgba(12,12,30,0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  backdrop-filter: blur(20px);
}

.settings-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.3px;
}

.settings-row {
  display: flex;
  gap: 10px;
}
.settings-row .input {
  flex: 1;
}
.settings-row .btn-primary {
  white-space: nowrap;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.settings-toggle-row:last-child { border-bottom: none; }

.settings-toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.settings-danger {
  border-color: rgba(244,63,94,0.2);
}
.settings-danger .btn-secondary.danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--red);
  border-color: rgba(244,63,94,0.3);
}
.settings-danger .btn-secondary.danger:hover {
  background: var(--red-soft);
}

/* -- Onboarding overlay ------------------------------------------------------ */

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(4,4,14,0.85);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.onboarding-card {
  background: rgba(12,12,30,0.95);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: 52px 48px 36px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}

.onboarding-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent);
}

.onboarding-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: fadeInUp 0.35s ease;
}

.onboarding-icon {
  width: 80px;
  height: 80px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 8px 40px var(--accent-glow);
  margin-bottom: 4px;
}

.onboarding-icon.ob-inv     { background: linear-gradient(135deg, #6366f1, #818cf8); }
.onboarding-icon.ob-sales   { background: linear-gradient(135deg, #10b981, #34d399); }
.onboarding-icon.ob-pkg     { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.onboarding-icon.ob-analytics { background: linear-gradient(135deg, #ec4899, #f472b6); }
.onboarding-icon.ob-ready   { background: linear-gradient(135deg, #10b981, #6366f1); }

.onboarding-step h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.onboarding-step p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 340px;
}

.onboarding-dots {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}

.ob-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border2);
  transition: all 0.3s;
}
.ob-dot.active {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  width: 24px;
  border-radius: 4px;
}

.onboarding-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 4px;
}
.onboarding-actions .btn-secondary,
.onboarding-actions .btn-primary {
  flex: 1;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* -- Login card -------------------------------------------------------------- */

.login-card {
  background: rgba(12,12,30,0.85);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: 52px 44px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(40px);
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,0.7), rgba(139,92,246,0.7), transparent);
}

.login-logo {
  width: 70px;
  height: 70px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  box-shadow: 0 8px 40px var(--accent-glow), 0 0 0 1px rgba(99,102,241,0.3);
}

.login-title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--text) 0%, rgba(240,240,252,0.6) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.btn-discord {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 20px;
  background: #5865F2;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 24px rgba(88,101,242,0.45), inset 0 1px 0 rgba(255,255,255,0.15);
  letter-spacing: -0.2px;
}
.btn-discord:hover { background: #4752c4; transform: translateY(-2px); box-shadow: 0 8px 32px rgba(88,101,242,0.55); }
.btn-discord:active { transform: translateY(0); }

.login-error {
  font-size: 13px;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid rgba(244,63,94,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  width: 100%;
}

.pending-avatar {
  width: 84px; height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border2);
  box-shadow: 0 0 0 6px rgba(255,255,255,0.03);
}
.pending-name { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.pending-badge {
  font-size: 12px; font-weight: 600;
  background: var(--orange-soft);
  color: var(--orange);
  border: 1px solid rgba(245,158,11,0.2);
  padding: 4px 14px; border-radius: 30px;
}
.pending-msg { font-size: 13px; color: var(--text-muted); line-height: 1.6; max-width: 280px; }

/* -- App Shell ---------------------------------------------------------------- */
#screen-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* -- Header ------------------------------------------------------------------- */
.app-header {
  height: var(--header-h);
  background: rgba(6,6,14,0.75);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 12px;
  flex-shrink: 0;
  z-index: 50;
  position: relative;
}

.hamburger {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 7px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.hamburger:hover { background: var(--glass2); color: var(--text); }

.header-brand {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.5px;
  flex: 1;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 130%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-right { display: flex; align-items: center; gap: 6px; }

.theme-toggle {
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
}
.theme-toggle:hover { background: var(--glass2); border-color: var(--border2); color: var(--text); }

.header-user { display: flex; align-items: center; gap: 8px; }

.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border2);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.user-name { font-size: 13px; font-weight: 600; color: var(--text); }

.btn-logout {
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
}
.btn-logout:hover { background: var(--red-soft); color: var(--red); border-color: rgba(244,63,94,0.25); }

/* -- App Body ----------------------------------------------------------------- */
.app-body { display: flex; flex: 1; overflow: hidden; }

/* -- Sidebar ------------------------------------------------------------------ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: rgba(6,6,14,0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.25s cubic-bezier(0.4,0,0.2,1);
}

.sidebar.collapsed { width: 58px; }
.sidebar.collapsed .nav-item span { display: none; }
.sidebar.collapsed .sidebar-footer { display: none; }

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  white-space: nowrap;
  width: 100%;
  position: relative;
}

.nav-item:hover { background: var(--glass2); color: var(--text); }
.nav-item.active { color: var(--text); font-weight: 600; }

.nav-item.active.nav-home      { color: var(--tab-home);      background: rgba(99,102,241,0.1);  }
.nav-item.active.nav-inventory { color: var(--tab-inventory); background: rgba(6,182,212,0.08); }
.nav-item.active.nav-sales     { color: var(--tab-sales);     background: rgba(16,185,129,0.08); }
.nav-item.active.nav-packages  { color: var(--tab-packages);  background: rgba(245,158,11,0.08); }
.nav-item.active.nav-analytics { color: var(--tab-analytics); background: rgba(167,139,250,0.08); }
.nav-item.active.nav-admin     { color: var(--tab-admin);     background: rgba(244,63,94,0.08); }

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 22%; bottom: 22%;
  width: 2.5px;
  border-radius: 0 4px 4px 0;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.sidebar-version { font-size: 11px; color: var(--text-dim); }

/* -- Main Content ------------------------------------------------------------- */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px;
  background: var(--bg2);
  background-image:
    radial-gradient(ellipse 100% 40% at 50% 0%, rgba(99,102,241,0.07) 0%, transparent 60%);
  position: relative;
  z-index: 1;
}

.view { display: none; }
.view.active {
  display: block;
  animation: view-enter 0.32s cubic-bezier(0.22,1,0.36,1) both;
}

@keyframes view-enter {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* -- Page Header -------------------------------------------------------------- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.7px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--text) 0%, rgba(240,240,252,0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-count {
  font-size: 11px;
  font-weight: 600;
  background: var(--glass2);
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  -webkit-text-fill-color: var(--text-muted);
}

.page-actions { display: flex; align-items: center; gap: 8px; }

@keyframes hero-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* -- Hero Band ---------------------------------------------------------------- */
.hero-band {
  animation: hero-in 0.5s cubic-bezier(0.22,1,0.36,1) both;
  background: linear-gradient(135deg,
    rgba(99,102,241,0.09) 0%,
    rgba(139,92,246,0.05) 50%,
    rgba(6,182,212,0.03) 100%);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.hero-band::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(99,102,241,0.7) 30%,
    rgba(139,92,246,0.7) 70%,
    transparent 100%);
}

.hero-band::after {
  content: '';
  position: absolute;
  right: -80px; top: -80px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(99,102,241,0.1) 0%, transparent 65%);
  pointer-events: none;
}

.hero-greeting {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}

.hero-name {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.1;
  background: linear-gradient(90deg,
    #f0f0fc 0%,
    #a5b4fc 20%,
    #818cf8 38%,
    #c4b5fd 55%,
    #a5b4fc 72%,
    #f0f0fc 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: text-shimmer 5s linear infinite;
}

@keyframes text-shimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 220% center; }
}

.hero-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 400;
}

.hero-right { text-align: right; flex-shrink: 0; }

.hero-date {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.hero-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.hero-sync-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--green);
  margin-top: 8px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.hero-sync-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 2.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--green); }
  50% { opacity: 0.4; box-shadow: 0 0 4px var(--green); }
}

/* -- Bento Grid --------------------------------------------------------------- */
.bento-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr 1fr;
  grid-template-rows: 215px 155px;
  gap: 16px;
  margin-bottom: 0;
}

.bento-inv    { grid-area: 1 / 1 / 3 / 2; }
.bento-profit { grid-area: 1 / 2 / 2 / 3; }
.bento-roi    { grid-area: 1 / 3 / 2 / 4; }
.bento-sold   { grid-area: 2 / 2 / 3 / 4; }

.bento-val-xl {
  font-size: 38px !important;
  letter-spacing: -2px !important;
}

.bento-spark {
  height: 56px !important;
  margin-top: auto !important;
  position: absolute !important;
  bottom: 18px;
  left: 18px;
  right: 18px;
}

.bento-inv {
  display: flex;
  flex-direction: column;
}

.bento-inv .stat-sparkline {
  flex: 1;
  min-height: 0;
  margin-top: 12px;
}

/* ROI ring */
.roi-ring-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}

.roi-ring-svg-wrap {
  position: relative;
  width: 70px;
  height: 70px;
  flex-shrink: 0;
}

.roi-svg {
  width: 70px;
  height: 70px;
  display: block;
}

.roi-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.roi-ring-center .stat-value {
  font-size: 15px !important;
  letter-spacing: -0.5px;
}

/* Wide sold card */
.bento-sold-inner {
  display: flex;
  align-items: stretch;
  gap: 20px;
  height: 100%;
}

.bento-sold-left {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}

.bento-sold-spark {
  flex: 1;
  display: flex;
  align-items: flex-end;
  padding-bottom: 2px;
}

.bento-sold-spark .stat-sparkline {
  width: 100%;
  height: 60px !important;
  margin-top: 0 !important;
}

/* Ripple on buttons */
.btn-add, .btn-primary, .btn-secondary, .btn-danger, .btn-discord {
  position: relative;
  overflow: hidden;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  width: 8px; height: 8px;
  background: rgba(255,255,255,0.45);
  transform: translate(-50%, -50%) scale(0);
  animation: ripple-expand 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes ripple-expand {
  to { transform: translate(-50%, -50%) scale(22); opacity: 0; }
}

/* Spinning gradient border on stat card hover */
@property --ba {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.stat-card:hover {
  --ba: 0deg;
  animation: ba-spin 4s linear infinite !important;
}

@keyframes ba-spin { to { --ba: 360deg; } }

.stat-card:hover .spin-border {
  opacity: 1;
}

.spin-border {
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius) + 1px);
  background: conic-gradient(from var(--ba, 0deg),
    transparent 0deg,
    transparent 200deg,
    rgba(99,102,241,0.55) 230deg,
    rgba(139,92,246,0.55) 245deg,
    rgba(6,182,212,0.4) 260deg,
    transparent 290deg);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 1px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 3;
}

/* -- Stat Cards --------------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 0;
}

.stat-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
  cursor: default;
  --sx: 50%; --sy: 50%;
}

/* Staggered entrance animation */
.stats-grid .stat-card:nth-child(1) { animation: card-rise 0.55s cubic-bezier(0.34,1.56,0.64,1) 0.05s both; }
.stats-grid .stat-card:nth-child(2) { animation: card-rise 0.55s cubic-bezier(0.34,1.56,0.64,1) 0.11s both; }
.stats-grid .stat-card:nth-child(3) { animation: card-rise 0.55s cubic-bezier(0.34,1.56,0.64,1) 0.17s both; }
.stats-grid .stat-card:nth-child(4) { animation: card-rise 0.55s cubic-bezier(0.34,1.56,0.64,1) 0.23s both; }

@keyframes card-rise {
  from { opacity: 0; transform: translateY(22px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Mouse-position spotlight */
.stat-card .spotlight {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--sx) var(--sy), rgba(255,255,255,0.06) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
  z-index: 0;
}
.stat-card:hover .spotlight { opacity: 1; }

.stat-card:hover {
  border-color: var(--border3);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Always-visible gradient top stripe */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
  transition: opacity 0.2s, left 0.2s, right 0.2s;
}
.stat-card:hover::before { left: 5%; right: 5%; opacity: 1; }
.stat-card.stat-green::before  { background: linear-gradient(90deg, transparent, var(--green), transparent); }
.stat-card.stat-orange::before { background: linear-gradient(90deg, transparent, var(--orange), transparent); }
.stat-card.stat-teal::before   { background: linear-gradient(90deg, transparent, var(--cyan), transparent); }

/* Subtle glow behind card on hover */
.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s;
  background: radial-gradient(ellipse 60% 60% at 30% 0%, var(--accent-soft), transparent);
  pointer-events: none;
}
.stat-card:hover::after { opacity: 1; }
.stat-card.stat-green:hover::after  { background: radial-gradient(ellipse 60% 60% at 30% 0%, var(--green-soft), transparent); }
.stat-card.stat-orange:hover::after { background: radial-gradient(ellipse 60% 60% at 30% 0%, var(--orange-soft), transparent); }
.stat-card.stat-teal:hover::after   { background: radial-gradient(ellipse 60% 60% at 30% 0%, var(--cyan-soft), transparent); }

.stat-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.stat-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.stat-trend {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  position: relative;
  z-index: 1;
}
.stat-trend.up   { background: var(--green-soft); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.stat-trend.down { background: var(--red-soft);   color: var(--red);   border: 1px solid rgba(244,63,94,0.2); }
.stat-trend.flat { background: var(--glass2);    color: var(--text-muted); border: 1px solid var(--border); }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--text-muted);
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.stat-value {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -1.5px;
  margin-bottom: 5px;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-dim);
  position: relative;
  z-index: 1;
}

.stat-green  .stat-value { color: var(--green); }
.stat-orange .stat-value { color: var(--orange); }
.stat-teal   .stat-value { color: var(--cyan); }
.stat-purple .stat-value { color: var(--purple); }

/* Sparkline inside stat card */
.stat-sparkline {
  margin-top: 14px;
  height: 36px;
  position: relative;
  z-index: 1;
  opacity: 0.65;
}
.stat-sparkline svg { width: 100%; height: 36px; display: block; }

/* -- Home Grid ---------------------------------------------------------------- */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }

/* -- Sales Stats Row ---------------------------------------------------------- */
.stats-row {
  display: flex;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.mini-stat {
  flex: 1;
  background: var(--glass);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: background 0.15s;
}
.mini-stat:hover { background: var(--glass2); }

.mini-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
}

.mini-val { font-size: 17px; font-weight: 800; letter-spacing: -0.5px; }
.mini-val.profit { color: var(--green); }

/* -- Card --------------------------------------------------------------------- */
.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* -- Table Card --------------------------------------------------------------- */
.table-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th {
  background: rgba(0,0,0,0.2);
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.12s; }
.data-table tbody tr:hover td { background: rgba(255,255,255,0.025); }
.data-table tbody tr:hover td:first-child { box-shadow: inset 2.5px 0 0 var(--accent); }

.cell-muted { color: var(--text-muted); }
.cell-dim   { color: var(--text-dim); font-size: 12px; }

.profit-pos  { color: var(--green); font-weight: 700; }
.profit-neg  { color: var(--red); font-weight: 700; }
.profit-zero { color: var(--text-muted); }

/* -- Thumbnail ---------------------------------------------------------------- */
.inv-thumb {
  width: 40px; height: 40px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--surface3);
  border: 1px solid var(--border);
  cursor: pointer;
  display: block;
  transition: transform 0.15s, box-shadow 0.15s;
}
.inv-thumb:hover { transform: scale(1.08); box-shadow: 0 4px 16px rgba(0,0,0,0.4); }

.thumb-placeholder {
  width: 40px; height: 40px;
  border-radius: 9px;
  background: var(--surface3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

/* -- Platform Badge ----------------------------------------------------------- */
.platform-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

/* -- Empty State -------------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 70px 24px;
  gap: 12px;
  text-align: center;
}

.empty-icon {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: var(--glass2);
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 4px;
}
.empty-title { font-size: 16px; font-weight: 700; color: var(--text-muted); }
.empty-sub   { font-size: 13px; color: var(--text-dim); }

/* -- Recent Lists ------------------------------------------------------------- */
.recent-list { }

.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  transition: background 0.1s;
}
.recent-item:last-child { border-bottom: none; }
.recent-item:hover { background: rgba(255,255,255,0.02); }

.recent-name { flex: 1; font-weight: 600; }
.recent-meta { color: var(--text-muted); font-size: 12px; }
.recent-val  { font-weight: 700; text-align: right; white-space: nowrap; }

/* -- Packages ----------------------------------------------------------------- */
.pkg-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.pkg-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
  overflow: hidden;
}
.pkg-card:hover { border-color: var(--border2); transform: translateY(-3px); }

.pkg-card::before {
  content: '';
  position: absolute;
  top: 0; left: 25%; right: 25%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,158,11,0.6), transparent);
  transition: left 0.2s, right 0.2s;
}
.pkg-card:hover::before { left: 5%; right: 5%; }

.pkg-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.pkg-name { font-size: 14px; font-weight: 700; line-height: 1.3; }
.pkg-tracking { font-size: 11px; color: var(--text-dim); font-family: 'SF Mono', 'Fira Code', monospace; margin-top: 3px; }

.pkg-status {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.2px;
}

.pkg-status-ordered   { background: var(--glass2); color: var(--text-muted); border: 1px solid var(--border); }
.pkg-status-shipped   { background: var(--cyan-soft); color: var(--cyan); border: 1px solid rgba(6,182,212,0.2); }
.pkg-status-transit   { background: var(--orange-soft); color: var(--orange); border: 1px solid rgba(245,158,11,0.2); }
.pkg-status-delivery  { background: var(--orange-soft); color: var(--orange); border: 1px solid rgba(245,158,11,0.25); }
.pkg-status-delivered { background: var(--green-soft); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }

.pkg-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.pkg-actions { display: flex; gap: 6px; }

/* -- Analytics ---------------------------------------------------------------- */
.analytics-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.chart-card { padding: 20px; }
.chart-card canvas { max-height: 300px; }

.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-dim);
  font-size: 13px;
}

/* -- Admin -------------------------------------------------------------------- */
.admin-banner {
  background: var(--cyan-soft);
  color: var(--cyan);
  border: 1px solid rgba(6,182,212,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  margin-bottom: 16px;
  font-weight: 500;
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.2px;
}
.badge-approved { background: var(--green-soft); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.badge-pending  { background: var(--orange-soft); color: var(--orange); border: 1px solid rgba(245,158,11,0.2); }
.badge-admin    { background: var(--accent-soft); color: var(--accent2); border: 1px solid rgba(99,102,241,0.2); }

/* -- Buttons ------------------------------------------------------------------ */
.btn-add {
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 14px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.15);
  letter-spacing: -0.2px;
}

.btn-add-inv   {
  background: linear-gradient(135deg, var(--cyan), #0891b2);
  box-shadow: 0 2px 14px var(--cyan-glow), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-add-sales {
  background: linear-gradient(135deg, var(--green), #059669);
  box-shadow: 0 2px 14px var(--green-glow), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-add-pkg {
  background: linear-gradient(135deg, var(--orange), #d97706);
  box-shadow: 0 2px 14px var(--orange-glow), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-add:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn-add:active { transform: translateY(0); }

.btn-primary {
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 14px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.15);
  letter-spacing: -0.2px;
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; filter: none; }
.btn-primary.btn-sales {
  background: linear-gradient(135deg, var(--green), #059669);
  box-shadow: 0 2px 14px var(--green-glow), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary.btn-pkg {
  background: linear-gradient(135deg, var(--orange), #d97706);
  box-shadow: 0 2px 14px var(--orange-glow), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-secondary {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  background: var(--glass2);
  color: var(--text-muted);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-secondary:hover { background: var(--glass3); color: var(--text); border-color: var(--border3); }

.btn-danger {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  background: linear-gradient(135deg, var(--red), #be123c);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 14px var(--red-glow), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-danger:hover { transform: translateY(-2px); filter: brightness(1.1); }

.btn-icon {
  background: var(--glass2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  width: 30px; height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-icon:hover { background: var(--glass3); color: var(--text); border-color: var(--border2); }
.btn-icon.danger:hover { background: var(--red-soft); color: var(--red); border-color: rgba(244,63,94,0.25); }

.btn-year {
  background: var(--glass2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  width: 32px; height: 32px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.btn-year:hover { background: var(--glass3); color: var(--text); }

.year-label { font-size: 14px; font-weight: 700; min-width: 44px; text-align: center; letter-spacing: -0.3px; }

/* -- Search ------------------------------------------------------------------- */
.search-input {
  padding: 9px 14px;
  font-size: 13px;
  font-family: inherit;
  background: var(--glass2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  width: 220px;
  transition: all 0.15s;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); background: var(--glass3); }
.search-input::placeholder { color: var(--text-dim); }

/* -- Form Inputs -------------------------------------------------------------- */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.grow { flex: 1; }
.form-group.w100 { width: 80px; flex-shrink: 0; }
.form-group.w120 { width: 100px; flex-shrink: 0; }
.form-group.w160 { width: 140px; flex-shrink: 0; }

.form-group label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
}

.form-input {
  padding: 10px 13px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  transition: all 0.15s;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent);
  background: var(--surface3);
}

.form-input::placeholder { color: var(--text-dim); }
textarea.form-input { resize: vertical; }

select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236060a0' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
}

input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }

.form-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

/* -- Photo Zone --------------------------------------------------------------- */
.photo-zone {
  position: relative;
  width: 100%;
  height: 170px;
  border-radius: var(--radius);
  border: 2px dashed var(--border2);
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s;
  margin-bottom: 16px;
}

.photo-zone:hover { border-color: var(--accent); background: var(--surface3); box-shadow: 0 0 0 3px var(--accent-soft); }
.photo-zone.has-photo { border-style: solid; border-color: var(--accent); }

.photo-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  font-size: 13px;
  color: var(--text-muted);
}

.photo-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(99,102,241,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent2);
  font-size: 20px;
}

.photo-zone.has-photo .photo-placeholder { opacity: 0; }

.photo-zone img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-remove {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2;
  backdrop-filter: blur(8px);
}
.photo-zone.has-photo .photo-remove { display: flex; }

/* -- Modal -------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-box {
  background: rgba(12,12,30,0.95);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  animation: modal-in 0.22s cubic-bezier(0.34,1.56,0.64,1);
  backdrop-filter: blur(40px);
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-sm .modal-box { max-width: 380px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
}
.modal-header::before {
  content: '';
  position: absolute;
  top: 0; left: 15%; right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.modal-close {
  background: var(--glass2);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--glass3); color: var(--text); }

.modal-body {
  padding: 22px 24px;
  flex: 1;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  background: rgba(0,0,0,0.2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* -- Toast -------------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: rgba(12,12,30,0.95);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
  max-width: 380px;
  z-index: 999;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
  backdrop-filter: blur(24px);
}
.toast.show { transform: translateY(0); opacity: 1; }

.toast-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.toast.success .toast-icon { background: var(--green-soft); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.toast.error   .toast-icon { background: var(--red-soft);   color: var(--red);   border: 1px solid rgba(244,63,94,0.2); }

.toast-title { font-size: 13.5px; font-weight: 700; }
.toast-msg   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* -- Bottom Nav (mobile) ------------------------------------------------------ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  height: var(--bnav-h);
  background: rgba(6,6,14,0.9);
  border-top: 1px solid var(--border);
  z-index: 100;
  backdrop-filter: blur(24px);
}

.bnav-item {
  flex: 1;
  height: 100%;
  background: none;
  border: none;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.bnav-item.active { color: var(--accent2); }

/* -- Scrollbar ---------------------------------------------------------------- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* -- Sortable Headers --------------------------------------------------------- */
.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.sortable:hover { color: var(--accent2); }
.sort-icon { font-size: 10px; opacity: 0.4; }
.sort-icon.asc::after  { content: ' ▲'; opacity: 1; }
.sort-icon.desc::after { content: ' ▼'; opacity: 1; }

/* -- Filter Bar --------------------------------------------------------------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.filter-select, .filter-input {
  padding: 7px 11px;
  font-size: 12px;
  font-family: inherit;
  background: var(--glass2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  transition: all 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.filter-select:focus, .filter-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.filter-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236060a0' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 26px;
  min-width: 130px;
}
.filter-input { width: 130px; }
.filter-input::-webkit-calendar-picker-indicator { filter: invert(0.5); }
.filter-clear {
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-clear:hover { background: var(--glass2); color: var(--text); border-color: var(--border2); }

/* -- Spinner ------------------------------------------------------------------ */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* -- Lightbox ----------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  backdrop-filter: blur(16px);
}
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
  object-fit: contain;
  box-shadow: var(--shadow-xl);
}

/* -- Responsive --------------------------------------------------------------- */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .analytics-grid { grid-template-columns: 1fr; }
  .bento-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }
  .bento-inv    { grid-area: auto; }
  .bento-profit { grid-area: auto; }
  .bento-roi    { grid-area: auto; }
  .bento-sold   { grid-area: auto; grid-column: 1 / 3; }
}

@media (max-width: 768px) {
  .bento-grid { grid-template-columns: 1fr; }
  .bento-sold { grid-column: auto; }
  .bento-sold-inner { flex-direction: column; }
  .sidebar { display: none; }
  .bottom-nav { display: flex; }
  .main-content { padding: 16px 14px calc(var(--bnav-h) + 16px); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-actions { width: 100%; justify-content: space-between; }
  .search-input { flex: 1; width: auto; }
  .hide-sm { display: none; }
  .stats-row { flex-wrap: wrap; }
  .mini-stat { min-width: 50%; }
  .pkg-list { grid-template-columns: 1fr; }
  .toast { bottom: calc(var(--bnav-h) + 12px); right: 12px; left: 12px; min-width: unset; }
  .hero-band { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero-right { text-align: left; }
  .home-grid { grid-template-columns: 1fr; }

  /* Header: hide username on mobile, keep avatar */
  .user-name { display: none; }
  .header-brand { font-size: 14px; }

  /* Tables: ensure horizontal scroll on mobile */
  .data-table { min-width: 600px; }
  .data-table th, .data-table td { padding: 10px 10px; font-size: 12px; white-space: nowrap; }

  /* Filter bar: stack on mobile */
  .filter-bar { gap: 6px; }
  .filter-select, .filter-input { flex: 1; min-width: 0; }

  /* Modals: nearly full-width */
  .modal-box { max-width: calc(100vw - 24px); margin: 12px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 14px 16px; }
  .modal-header { padding: 16px; }

  /* Profile page */
  .profile-card { padding: 28px 20px; }
  .profile-avatar { width: 72px; height: 72px; }
  .settings-section { padding: 18px; }
  .settings-row { flex-direction: column; }
}

@media (max-width: 480px) {
  .login-card { padding: 40px 24px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero-name { font-size: 22px; }
  .app-header { padding: 0 12px; gap: 8px; }
  .main-content { padding: 12px 10px calc(var(--bnav-h) + 12px); }
  .view-header h1 { font-size: 20px; }
  .pkg-card { padding: 14px; }
  .pkg-name { font-size: 14px; }
  .filter-bar { flex-direction: column; }
  .filter-select, .filter-input { width: 100%; }
}
