/* ================================================================
   LynSync — Premium Dark Glassmorphism Design System
   Font: Inter (Google Fonts)
   ================================================================ */

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

/* ── Design Tokens ──────────────────────────────────────────────── */
:root {
  --bg-0:        #06060f;
  --bg-1:        #0c0c1e;
  --bg-2:        #10102a;
  --surface:     rgba(255,255,255,0.05);
  --surface-2:   rgba(255,255,255,0.09);
  --surface-3:   rgba(255,255,255,0.14);
  --border:      rgba(99,102,241,0.12);
  --border-2:    rgba(99,102,241,0.22);

  --primary:       #6366f1;
  --primary-light: #818cf8;
  --primary-dark:  #4f46e5;
  --secondary:     #a78bfa;
  --accent:        #22d3ee;
  --success:       #10b981;
  --warning:       #f59e0b;
  --error:         #f43f5e;

  --text:          #f0f4ff;
  --text-muted:    #94a3b8;
  --text-dim:      #4a5568;

  --radius-xs:   6px;
  --radius-sm:   10px;
  --radius:      14px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-full: 9999px;

  --shadow-sm:   0 2px 12px rgba(0,0,0,0.4);
  --shadow:      0 4px 32px rgba(0,0,0,0.5);
  --shadow-lg:   0 12px 60px rgba(0,0,0,0.6);
  --glow:        0 0 48px rgba(99,102,241,0.22);
  --glow-sm:     0 0 24px rgba(99,102,241,0.16);

  --sidebar-w:   260px;
  --topbar-h:    64px;
  --transition:  200ms cubic-bezier(0.4,0,0.2,1);
}

.light-theme {
  /* Rich background: multi-layer aurora gradient */
  --lp-bg: linear-gradient(140deg, #e0e7ff 0%, #f0e6ff 30%, #fde8f5 60%, #e0f2fe 100%);

  --bg-0:        #f1f4ff;
  --bg-1:        #ffffff;
  --bg-2:        #f8faff;
  --surface:     rgba(255,255,255,0.72);
  --surface-2:   rgba(255,255,255,0.90);
  --surface-3:   rgba(255,255,255,0.98);
  --border:      rgba(255,255,255,0.80);
  --border-2:    rgba(255,255,255,0.95);

  --text:          #0f172a;
  --text-muted:    #3b4a6b;
  --text-dim:      #64748b;

  --shadow-sm:   0 2px 12px rgba(99,102,241,0.06);
  --shadow:      0 4px 32px rgba(99,102,241,0.10);
  --shadow-lg:   0 16px 60px rgba(99,102,241,0.14);
  --glow:        0 8px 48px rgba(99,102,241,0.20);
  --glow-sm:     0 4px 24px rgba(99,102,241,0.16);
}

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-0);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Full aurora background for landing */
.light-theme {
  background: var(--lp-bg) fixed;
}
/* Override generic body::before for landing */
.light-theme::before {
  background:
    radial-gradient(ellipse 55% 45% at 8% 12%, rgba(167,139,250,0.50) 0%, transparent 60%),
    radial-gradient(ellipse 40% 50% at 90% 80%, rgba(252,165,165,0.45) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 55% 20%, rgba(99,102,241,0.30) 0%, transparent 50%),
    radial-gradient(ellipse 35% 40% at 30% 85%, rgba(34,211,238,0.25) 0%, transparent 55%),
    radial-gradient(ellipse 60% 60% at 75% 40%, rgba(244,114,182,0.20) 0%, transparent 60%);
  animation: bgPulse 10s ease-in-out infinite alternate;
  opacity: 1;
}

/* Orbs: vivid for light theme */
.light-theme .orb { opacity: 0.7; filter: blur(60px); }
.light-theme .orb-1 { width: 560px; height: 560px; background: radial-gradient(circle, rgba(139,92,246,0.60), rgba(99,102,241,0.15), transparent); top: -180px; left: -150px; animation-duration: 16s; }
.light-theme .orb-2 { width: 480px; height: 480px; background: radial-gradient(circle, rgba(251,113,133,0.55), rgba(244,114,182,0.15), transparent); bottom: -120px; right: -120px; animation-duration: 20s; animation-delay: -6s; }
.light-theme .orb-3 { width: 420px; height: 420px; background: radial-gradient(circle, rgba(34,211,238,0.35), rgba(59,130,246,0.15), transparent); top: 35%; right: 18%; animation-duration: 24s; animation-delay: -3s; }
.light-theme .orb-4 { width: 300px; height: 300px; background: radial-gradient(circle, rgba(252,211,77,0.30), transparent); top: 60%; left: 5%; animation-duration: 28s; animation-delay: -10s; }

/* ── Floating Orbs (base) ─────────────────────────────────────── */
.orb {
  position: fixed;
  border-radius: var(--radius-full);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  animation: orbFloat 20s ease-in-out infinite alternate;
}
.orb-1 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(99,102,241,0.35), transparent); top: -100px; left: -100px; animation-duration: 18s; }
.orb-2 { width: 350px; height: 350px; background: radial-gradient(circle, rgba(167,139,250,0.25), transparent); bottom: -80px; right: -80px; animation-duration: 22s; animation-delay: -8s; }
.orb-3 { width: 300px; height: 300px; background: radial-gradient(circle, rgba(34,211,238,0.15), transparent); top: 50%; right: 20%; animation-duration: 25s; animation-delay: -4s; }

@keyframes orbFloat {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30px, -40px) scale(1.05); }
}

/* ── Particles (auth page) ───────────────────────────────────── */
.light-theme .bg-particles { opacity: 0.6; }
.bg-particles { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.particle {
  position: absolute;
  width: 2px; height: 2px;
  background: rgba(99,102,241,0.5);
  border-radius: 50%;
  animation: particleDrift linear infinite;
}
.particle:nth-child(1)  { left: 15%; top: 80%; animation-duration: 20s; animation-delay:   0s; width: 3px; height: 3px; }
.particle:nth-child(2)  { left: 35%; top: 70%; animation-duration: 25s; animation-delay:  -5s; }
.particle:nth-child(3)  { left: 55%; top: 90%; animation-duration: 18s; animation-delay:  -2s; background: rgba(167,139,250,0.5); }
.particle:nth-child(4)  { left: 70%; top: 75%; animation-duration: 22s; animation-delay:  -8s; }
.particle:nth-child(5)  { left: 85%; top: 60%; animation-duration: 30s; animation-delay: -15s; background: rgba(34,211,238,0.4); width: 3px; height: 3px; }
.particle:nth-child(6)  { left: 5%;  top: 50%; animation-duration: 26s; animation-delay: -10s; }

@keyframes particleDrift {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-100vh) translateX(40px); opacity: 0; }
}

/* ============================================================
   AUTH PAGE / LANDING
   ============================================================ */

/* Floating Navbar */
.landing-nav {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 100; width: calc(100% - 48px); max-width: 960px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.85);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 24px rgba(99,102,241,0.10);
  animation: slideDown 0.6s cubic-bezier(0.4,0,0.2,1) both;
}
.landing-nav-brand { display: flex; align-items: center; gap: 10px; }
.landing-nav-brand span { font-size: 17px; font-weight: 800; color: var(--text); letter-spacing: -0.4px; }
.landing-nav-links { display: flex; align-items: center; gap: 24px; }
.landing-nav-links a { font-size: 14px; font-weight: 500; color: var(--text-muted); text-decoration: none; transition: color var(--transition); }
.landing-nav-links a:hover { color: var(--primary); }
.landing-nav-cta {
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  color: #fff; border: none; border-radius: var(--radius-full);
  padding: 9px 20px; font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; letter-spacing: 0.2px; transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}
.landing-nav-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(99,102,241,0.40); }

@keyframes slideDown { from { opacity: 0; transform: translateX(-50%) translateY(-16px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* Main layout */
.landing-layout {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 100px 40px 60px;
  gap: 72px; flex-wrap: wrap;
  position: relative; z-index: 1;
}

/* Hero text */
.landing-hero { max-width: 520px; animation: fadeSlideUp 0.8s cubic-bezier(0.4,0,0.2,1) 0.15s both; }
.landing-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(99,102,241,0.10); border: 1px solid rgba(99,102,241,0.25);
  color: var(--primary); border-radius: var(--radius-full);
  padding: 5px 14px; font-size: 12px; font-weight: 700; letter-spacing: 0.5px;
  margin-bottom: 20px; text-transform: uppercase;
}
.landing-badge svg { width: 12px; height: 12px; }

.landing-title {
  font-size: clamp(40px, 5vw, 60px); font-weight: 900;
  line-height: 1.05; letter-spacing: -1.5px;
  margin-bottom: 20px; color: var(--text);
}
.landing-title .gradient-text {
  background: linear-gradient(120deg, #6366f1 0%, #a78bfa 40%, #f472b6 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.landing-subtitle {
  font-size: 17px; color: var(--text-muted); margin-bottom: 36px;
  line-height: 1.6; max-width: 440px;
}

/* Feature pills */
.landing-features { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.landing-feature {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.80); border: 1px solid rgba(255,255,255,0.95);
  border-radius: var(--radius-full); padding: 8px 16px;
  font-size: 13px; font-weight: 600; color: var(--text);
  box-shadow: 0 2px 12px rgba(99,102,241,0.07);
  backdrop-filter: blur(8px);
  transition: transform var(--transition), box-shadow var(--transition);
}
.landing-feature:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99,102,241,0.12); }
.landing-feature svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; }

/* Stat bar */
.landing-stats { display: flex; gap: 32px; }
.landing-stat-num { display: block; font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.landing-stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* Auth container */
.auth-container { width: 100%; max-width: 440px; flex-shrink: 0; animation: fadeSlideUp 0.8s cubic-bezier(0.4,0,0.2,1) 0.3s both; }

@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

/* Brand */
.auth-brand { text-align: center; margin-bottom: 28px; }
.brand-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius);
  margin-bottom: 10px;
  box-shadow: 0 8px 24px rgba(99,102,241,0.35);
}
.brand-icon svg { color: #fff; }
.brand-name { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.5px; color: var(--text); }
.brand-tagline { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Auth Card */
.auth-card {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(40px) saturate(220%);
  -webkit-backdrop-filter: blur(40px) saturate(220%);
  border: 1px solid rgba(255,255,255,0.95);
  border-radius: 24px;
  padding: 32px;
  box-shadow:
    0 20px 60px rgba(99,102,241,0.14),
    0 4px 16px rgba(0,0,0,0.04),
    inset 0 1px 0 rgba(255,255,255,0.8);
}

/* Tabs */
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  background: rgba(99,102,241,0.07);
  border-radius: var(--radius);
  padding: 4px; position: relative;
  margin-bottom: 28px; overflow: hidden;
  border: 1px solid rgba(99,102,241,0.12);
}
.auth-tab {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 16px; border-radius: calc(var(--radius) - 2px);
  position: relative; z-index: 1; transition: color var(--transition);
}
.auth-tab.active { color: var(--primary); }
.auth-tab-indicator {
  position: absolute; top: 4px; left: 4px;
  width: calc(50% - 4px); height: calc(100% - 8px);
  background: rgba(255,255,255,0.95); border-radius: calc(var(--radius) - 3px);
  transition: transform 200ms cubic-bezier(0.4,0,0.2,1);
  border: 1px solid rgba(99,102,241,0.15);
  box-shadow: 0 2px 8px rgba(99,102,241,0.08);
}

/* Messages */
.auth-message {
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 16px;
  animation: fadeSlideIn 200ms ease;
}
.auth-message--error   { background: rgba(244,63,94,0.08);  border: 1px solid rgba(244,63,94,0.25);  color: #e11d48; }
.auth-message--success { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.25); color: #059669; }
.auth-message--info    { background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.25); color: var(--primary); }

/* Form */
.auth-form { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text-muted); }

.input-wrapper {
  position: relative; display: flex; align-items: center;
}
.input-wrapper input,
.input-wrapper select {
  width: 100%; padding: 12px 14px 12px 42px;
  background: rgba(255,255,255,0.90);
  border: 1.5px solid rgba(99,102,241,0.15);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: inherit; font-size: 14px; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-shadow: 0 1px 4px rgba(99,102,241,0.05);
}
.input-wrapper select { padding-left: 14px; cursor: pointer; }
.input-wrapper input:focus,
.input-wrapper select:focus {
  border-color: rgba(99,102,241,0.55);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12), 0 1px 4px rgba(99,102,241,0.06);
  background: #fff;
}
.input-wrapper input::placeholder { color: #a0aec0; }
.input-icon {
  position: absolute; left: 13px; width: 16px; height: 16px;
  color: #94a3b8; pointer-events: none;
}
.input-toggle-vis {
  position: absolute; right: 10px; padding: 4px;
  background: none; border: none; cursor: pointer; color: #94a3b8;
  display: flex; transition: color var(--transition);
}
.input-toggle-vis:hover { color: var(--primary); }
.input-toggle-vis svg { width: 16px; height: 16px; }

/* Password strength */
.password-strength { height: 3px; background: rgba(99,102,241,0.10); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.pw-bar { height: 100%; width: 0; border-radius: 2px; transition: width 300ms ease, background 300ms ease; }
.pw-label { font-size: 11px; margin-top: 3px; }

/* E2E notice */
.e2e-notice {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(16,185,129,0.06), rgba(99,102,241,0.06));
  border: 1px solid rgba(16,185,129,0.2); border-radius: var(--radius-sm);
  font-size: 12px; color: #065f46; line-height: 1.4;
}
.e2e-notice svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; color: #10b981; }

/* Buttons */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, #6366f1 0%, #a78bfa 50%, #f472b6 100%);
  background-size: 200% 200%; background-position: 0% 50%;
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 13px 20px; font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; position: relative; overflow: hidden; transition: all var(--transition);
  white-space: nowrap; letter-spacing: 0.2px;
  box-shadow: 0 4px 20px rgba(99,102,241,0.40);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(99,102,241,0.50); background-position: 100% 50%; }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary svg { width: 16px; height: 16px; }

.btn-upload {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 9px 18px; font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.btn-upload:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(34,211,238,0.3); }
.btn-upload svg { width: 15px; height: 15px; }

.btn-ghost {
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
  border-radius: var(--radius-sm); padding: 9px 16px; font-family: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-muted); cursor: pointer;
  transition: all var(--transition); flex-shrink: 0;
}
.btn-icon:hover  { background: var(--surface-2); color: var(--text); }
.btn-icon.active { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.4); color: var(--primary-light); }
.btn-icon svg { width: 16px; height: 16px; }

.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: var(--radius); }
.btn-spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite; display: inline-block;
}

/* Auth footer */
.auth-footer {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 20px; font-size: 12px; color: var(--text-dim);
}
.auth-footer svg { width: 14px; height: 14px; color: var(--success); }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */

.dashboard-body {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: #06060f;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  /* Deep indigo tint — clearly different from content area */
  background: linear-gradient(180deg, #0e0d24 0%, #0b0a1e 60%, #0d0c22 100%);
  border-right: 1px solid rgba(99,102,241,0.20);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  gap: 6px;
  flex-shrink: 0;
  transition: transform var(--transition);
  z-index: 100;
  position: relative;
  box-shadow: 2px 0 24px rgba(0,0,0,0.4);
}
/* Glowing right border */
.sidebar::after {
  content: '';
  position: absolute;
  top: 20%; right: -1px; bottom: 20%; width: 1px;
  background: linear-gradient(180deg, transparent, rgba(99,102,241,0.6) 40%, rgba(167,139,250,0.6) 60%, transparent);
  pointer-events: none;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 18px;
  border-bottom: 1px solid rgba(99,102,241,0.10);
  margin-bottom: 6px;
}
.sidebar-logo-text {
  font-size: 18px; font-weight: 800; letter-spacing: -0.3px;
  background: linear-gradient(120deg, #e0e7ff, #a78bfa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* Nav */
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 14px; font-weight: 500;
  text-decoration: none; cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; transition: transform var(--transition); }
.nav-item:hover { background: rgba(99,102,241,0.08); color: var(--text); }
.nav-item:hover svg { transform: scale(1.1); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(99,102,241,0.18), rgba(99,102,241,0.06));
  color: #a5b4fc;
  border-left: 2px solid var(--primary);
  margin-left: -2px;
  padding-left: 14px;
  box-shadow: inset 0 0 20px rgba(99,102,241,0.05);
}
.nav-item.active svg { color: var(--primary-light); }

.sidebar-divider { height: 1px; background: rgba(99,102,241,0.08); margin: 8px 0; }

/* Storage widget */
.storage-widget {
  padding: 12px;
  background: rgba(99,102,241,0.06);
  border: 1px solid rgba(99,102,241,0.10);
  border-radius: var(--radius);
  margin: 4px 0;
}
.storage-label { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.storage-pct { font-weight: 700; font-size: 11px; color: var(--primary-light); }
.storage-pct--warn { color: var(--error); }
.storage-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  overflow: hidden; margin-bottom: 6px;
}
.storage-fill { height: 100%; border-radius: var(--radius-full); transition: width 800ms cubic-bezier(0.4,0,0.2,1); }
.storage-detail { font-size: 11px; color: var(--text-dim); }

/* Profile */
.sidebar-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 10px; border-radius: var(--radius-sm);
  border-top: 1px solid rgba(99,102,241,0.08); margin-top: auto;
  transition: background var(--transition);
}
.sidebar-profile:hover { background: rgba(255,255,255,0.03); }
.profile-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a78bfa, #f472b6);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(99,102,241,0.25), 0 0 16px rgba(99,102,241,0.2);
  letter-spacing: -0.5px;
}
.profile-info { flex: 1; overflow: hidden; }
.profile-name  { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e2e8f0; }
.profile-email { display: block; font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-logout {
  color: var(--text-dim); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-xs); text-decoration: none; transition: all var(--transition); flex-shrink: 0;
  border: 1px solid transparent;
}
.profile-logout:hover { background: rgba(244,63,94,0.12); color: var(--error); border-color: rgba(244,63,94,0.2); }
.profile-logout svg { width: 16px; height: 16px; }

/* ── Main Content ──────────────────────────────────────────────── */
.main-content {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}

/* ── Top Bar ──────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar-h); padding: 0 24px;
  /* Slightly lighter than body to create separation */
  background: #0c0b1d;
  border-bottom: 1px solid rgba(99,102,241,0.15);
  flex-shrink: 0;
  position: relative;
}
/* Glowing bottom accent line */
.topbar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(99,102,241,0.5) 30%, rgba(167,139,250,0.7) 50%, rgba(99,102,241,0.5) 70%, transparent 100%);
  pointer-events: none;
}
.sidebar-toggle { display: none; background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: var(--radius-xs); }
.sidebar-toggle svg { width: 20px; height: 20px; }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 6px; flex: 1; flex-wrap: nowrap; overflow: hidden; }
.breadcrumb-item {
  font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer;
  white-space: nowrap; padding: 3px 8px; border-radius: var(--radius-xs);
  transition: all var(--transition);
}
.breadcrumb-item:hover { background: rgba(99,102,241,0.08); color: var(--text); }
.breadcrumb-item.active { color: var(--text); cursor: default; }
.breadcrumb-sep { color: var(--text-dim); font-size: 12px; }

/* Search */
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(99,102,241,0.12);
  border-radius: var(--radius-full); padding: 8px 14px;
  width: 240px; transition: all var(--transition);
}
.search-box:focus-within {
  border-color: rgba(99,102,241,0.4);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.08);
  width: 290px;
  background: rgba(255,255,255,0.06);
}
.search-box svg { width: 15px; height: 15px; color: var(--text-dim); flex-shrink: 0; }
.search-box input { background: none; border: none; outline: none; color: var(--text); font-family: inherit; font-size: 13px; width: 100%; }
.search-box input::placeholder { color: var(--text-dim); }

/* Topbar actions */
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── Content Area ──────────────────────────────────────────────── */
/* Slightly different shade from sidebar for clear separation */
.content-area { flex: 1; overflow-y: auto; padding: 24px; position: relative; background: #08071a; }

/* Custom scrollbar */
.content-area::-webkit-scrollbar { width: 5px; }
.content-area::-webkit-scrollbar-track { background: transparent; }
.content-area::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 3px; }
.content-area::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.5); }

/* ── Drop overlay ─────────────────────────────────────────────── */
.drop-overlay {
  position: absolute; inset: 0;
  background: rgba(7,7,17,0.85); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 50; border-radius: var(--radius);
  border: 2px dashed rgba(99,102,241,0.5);
}
.drop-overlay.active { opacity: 1; pointer-events: all; }
.drop-overlay-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.drop-overlay-inner svg { width: 80px; height: 80px; animation: dropBounce 1s ease-in-out infinite alternate; }
.drop-overlay-inner p { font-size: 18px; font-weight: 600; color: var(--primary-light); }

@keyframes dropBounce { from { transform: translateY(0); } to { transform: translateY(-8px); } }

/* ── File Grid ──────────────────────────────────────────────────── */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  animation: fadeIn 300ms ease;
}
.file-grid--list {
  grid-template-columns: 1fr;
  gap: 6px;
}

/* File Card */
.file-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 220ms cubic-bezier(0.4,0,0.2,1);
  position: relative;
  animation: cardSlideIn 300ms ease both;
}
.file-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(99,102,241,0.06) 0%, transparent 60%);
  opacity: 0; transition: opacity var(--transition);
  pointer-events: none;
}
.file-card:hover {
  background: rgba(99,102,241,0.08);
  border-color: rgba(99,102,241,0.40);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(99,102,241,0.25), 0 0 20px rgba(99,102,241,0.10);
}
.file-card:hover::before { opacity: 1; }
.file-card:hover .file-card-actions { opacity: 1; }

/* List mode card */
.file-grid--list .file-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.025);
}
.file-grid--list .file-card:hover {
  transform: none; background: rgba(255,255,255,0.05);
  box-shadow: none; border-color: rgba(99,102,241,0.2);
}
.file-grid--list .file-card-thumb { width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--radius-xs); overflow: hidden; }
.file-grid--list .file-card-thumb svg { width: 40px; height: 40px; }
.file-grid--list .file-card-info { flex: 1; min-width: 0; }
.file-grid--list .file-card-name { display: block; }
.file-grid--list .file-card-actions { position: static; opacity: 1; background: none; padding: 0; flex-shrink: 0; gap: 4px; }

.file-card-thumb {
  width: 100%; aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(99,102,241,0.04), rgba(0,0,0,0.2));
  position: relative;
}
.file-card-thumb svg { width: 64px; height: 64px; }
.file-card-thumb img, .file-card-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 400ms ease; }
.file-card:hover .file-card-thumb img,
.file-card:hover .file-card-thumb video { transform: scale(1.04); }

.folder-thumb { background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(167,139,250,0.04)); }
.folder-thumb svg { width: 56px; height: 56px; }

.file-preview-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5); opacity: 0; transition: opacity var(--transition);
  color: rgba(255,255,255,0.9); backdrop-filter: blur(2px);
}
.file-preview-overlay svg { width: 36px; height: 36px; filter: drop-shadow(0 2px 8px rgba(99,102,241,0.5)); }
.file-card:hover .file-preview-overlay { opacity: 1; }

.file-card-info { padding: 10px 12px 12px; }
.file-card-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block; margin-bottom: 3px;
}
.file-card-meta { font-size: 11px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.file-shared-badge {
  display: inline-block;
  background: linear-gradient(90deg, rgba(34,211,238,0.15), rgba(99,102,241,0.10));
  color: var(--accent);
  border: 1px solid rgba(34,211,238,0.25); border-radius: 4px;
  padding: 1px 6px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
}

.file-card-actions {
  position: absolute; top: 0; right: 0;
  display: flex; align-items: center; gap: 4px; padding: 8px;
  opacity: 0; transition: opacity var(--transition);
  background: linear-gradient(to bottom right, rgba(8,8,18,0.92), rgba(8,8,18,0.7));
  border-bottom-left-radius: var(--radius);
  backdrop-filter: blur(4px);
}
.file-action-btn {
  width: 28px; height: 28px; border-radius: var(--radius-xs);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.10);
  color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.file-action-btn:hover { background: rgba(99,102,241,0.2); color: #a5b4fc; border-color: rgba(99,102,241,0.3); }
.file-action-btn--danger:hover { background: rgba(244,63,94,0.2); color: var(--error); border-color: rgba(244,63,94,0.3); }
.file-action-btn svg { width: 14px; height: 14px; }

/* Folder card */
.folder-card { cursor: pointer; }

/* Skeleton loading */
.skeleton-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius);
  aspect-ratio: 4/3;
  position: relative;
  overflow: hidden;
}
.skeleton-card::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    transparent 20%,
    rgba(99,102,241,0.06) 40%,
    rgba(167,139,250,0.04) 50%,
    rgba(99,102,241,0.06) 60%,
    transparent 80%);
  animation: shimmer 1.8s ease-in-out infinite;
}
@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 80px 40px; text-align: center; min-height: 60vh;
}
.empty-state svg { width: 120px; height: 120px; opacity: 0.4; }
.empty-state h3 { font-size: 20px; font-weight: 700; color: var(--text); }
.empty-state p  { font-size: 14px; color: var(--text-muted); max-width: 320px; line-height: 1.6; }

/* ── Upload Panel ───────────────────────────────────────────────── */
.upload-panel {
  position: fixed; bottom: 24px; right: 24px;
  width: 360px;
  background: rgba(10,11,25,0.96);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(99,102,241,0.08), 0 0 40px rgba(99,102,241,0.08);
  z-index: 200; overflow: hidden;
  animation: slideUp 300ms cubic-bezier(0.4,0,0.2,1);
}
.upload-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid rgba(99,102,241,0.10);
  font-size: 14px; font-weight: 700;
  background: rgba(99,102,241,0.04);
}
.upload-panel-header button { background: none; border: none; color: var(--text-muted); cursor: pointer; display: flex; border-radius: var(--radius-xs); padding: 4px; transition: all var(--transition); }
.upload-panel-header button svg { width: 16px; height: 16px; }
.upload-panel-header button:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.upload-list { max-height: 300px; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.upload-item {
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  animation: fadeSlideIn 200ms ease;
  transition: border-color var(--transition);
}
.upload-item--done { opacity: 0.55; }
.upload-item-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.upload-item-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.upload-item-size { font-size: 11px; color: var(--text-dim); flex-shrink: 0; margin-left: 8px; }
.upload-item-progress { display: flex; flex-direction: column; gap: 4px; }
.upload-progress-bar { height: 3px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a78bfa, #f472b6);
  background-size: 200% 100%;
  border-radius: 2px;
  transition: width 100ms ease;
  animation: progressShine 2s linear infinite;
}
@keyframes progressShine {
  from { background-position: 0% 50%; }
  to   { background-position: 200% 50%; }
}
.upload-item-status { font-size: 11px; color: var(--text-dim); }
.upload-item-status--encrypting { color: #fbbf24; }
.upload-item-status--uploading  { color: var(--accent); }
.upload-item-status--done       { color: var(--success); }
.upload-item-status--error      { color: var(--error); }

/* ── Lightbox ───────────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(20px);
  opacity: 0; transition: opacity 300ms ease;
}
.lightbox--visible { opacity: 1; }

.lightbox-content {
  max-width: min(90vw, 1200px); max-height: 85vh;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.lightbox-img   { max-width: 100%; max-height: 85vh; border-radius: var(--radius); object-fit: contain; box-shadow: var(--shadow-lg); }
.lightbox-video { max-width: 90vw; max-height: 80vh; border-radius: var(--radius); outline: none; box-shadow: var(--shadow-lg); }
.lightbox-pdf   { width: min(80vw, 900px); height: 80vh; border: none; border-radius: var(--radius); }
.lightbox-audio-wrapper { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.lightbox-audio-icon svg { width: 80px; height: 80px; }
.lightbox-audio { width: 360px; }
.lightbox-generic { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 40px; text-align: center; }
.lightbox-generic .lightbox-file-icon svg { width: 80px; height: 80px; }
.lightbox-filename { font-size: 16px; font-weight: 600; }
.lightbox-filesize { font-size: 13px; color: var(--text-muted); }
.lightbox-error { padding: 40px; text-align: center; color: var(--error); }

.lightbox-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}

.lightbox-close {
  position: fixed; top: 20px; right: 20px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: none;
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background var(--transition); z-index: 510;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }
.lightbox-close svg { width: 18px; height: 18px; }

.lightbox-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: none;
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background var(--transition); z-index: 510;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-nav svg { width: 20px; height: 20px; }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-info {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.5); backdrop-filter: blur(8px);
  padding: 6px 16px; border-radius: var(--radius-full);
  font-size: 13px; color: rgba(255,255,255,0.8);
  max-width: 80vw; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Context Menu ───────────────────────────────────────────────── */
.context-menu {
  position: fixed; z-index: 300;
  background: rgba(13,14,31,0.95); backdrop-filter: blur(20px);
  border: 1px solid var(--border-2); border-radius: var(--radius);
  padding: 6px; min-width: 160px;
  box-shadow: var(--shadow-lg);
  animation: fadeSlideIn 150ms ease;
}
.context-menu button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 12px;
  background: none; border: none; border-radius: var(--radius-xs);
  color: var(--text-muted); font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; text-align: left; transition: all var(--transition);
}
.context-menu button svg { width: 15px; height: 15px; flex-shrink: 0; }
.context-menu button:hover { background: var(--surface-2); color: var(--text); }
.context-menu .ctx-danger:hover { background: rgba(244,63,94,0.1); color: var(--error); }
.ctx-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Modals ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 200ms ease;
  padding: 20px;
}
.modal-card {
  background: rgba(13,14,31,0.98); backdrop-filter: blur(20px);
  border: 1px solid var(--border-2); border-radius: var(--radius-xl);
  padding: 28px; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 200ms ease;
}
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* Share link box */
.share-link-box {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
}
.share-link-box input {
  flex: 1; padding: 9px 12px;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: inherit; font-size: 12px; outline: none;
}

/* ── Toast Notifications ─────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 600;
  pointer-events: none;
}
.toast {
  padding: 10px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px;
  backdrop-filter: blur(12px); transform: translateY(20px); opacity: 0;
  transition: all 300ms cubic-bezier(0.4,0,0.2,1);
  box-shadow: var(--shadow-lg); white-space: nowrap;
}
.toast--visible { transform: translateY(0); opacity: 1; }
.toast--success { background: rgba(16,185,129,0.15);  border: 1px solid rgba(16,185,129,0.3);  color: #6ee7b7; }
.toast--error   { background: rgba(244,63,94,0.15);   border: 1px solid rgba(244,63,94,0.3);   color: #fda4af; }
.toast--info    { background: rgba(99,102,241,0.15);  border: 1px solid rgba(99,102,241,0.3);  color: #a5b4fc; }
.toast--warning { background: rgba(245,158,11,0.15);  border: 1px solid rgba(245,158,11,0.3);  color: #fcd34d; }
.toast-icon { font-size: 15px; }

/* ============================================================
   SHARED PAGE
   ============================================================ */

.shared-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.shared-container { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 16px; }

.shared-header { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; color: var(--text-muted); }

.shared-card { padding: 36px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.glass-card {
  background: rgba(13,14,31,0.75); backdrop-filter: blur(24px);
  border: 1px solid var(--border-2); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
.shared-file-icon svg { width: 64px; height: 64px; }
.shared-filename { font-size: 20px; font-weight: 700; word-break: break-all; }
.shared-meta { font-size: 13px; color: var(--text-muted); }

.shared-preview { width: 100%; border-radius: var(--radius); overflow: hidden; background: var(--bg-1); min-height: 120px; display: flex; align-items: center; justify-content: center; }
.shared-preview-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px; }
.shared-preview-loading p { font-size: 13px; color: var(--text-muted); }
.shared-preview-img   { max-width: 100%; max-height: 60vh; border-radius: var(--radius); }
.shared-preview-video { max-width: 100%; max-height: 60vh; border-radius: var(--radius); outline: none; }
.shared-preview-audio { width: 100%; }

.shared-e2e-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2); border-radius: var(--radius-sm);
  font-size: 12px; color: #6ee7b7; line-height: 1.4;
  width: 100%; text-align: left;
}
.shared-e2e-badge svg { width: 16px; height: 16px; flex-shrink: 0; }
.shared-actions { display: flex; gap: 12px; width: 100%; }
.shared-actions .btn-primary { width: 100%; justify-content: center; }
.shared-footer { text-align: center; font-size: 13px; color: var(--text-dim); }
.shared-footer a { color: var(--primary-light); text-decoration: none; }
.shared-footer a:hover { text-decoration: underline; }

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeIn      { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp     { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn     { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes spin        { to { transform: rotate(360deg); } }
@keyframes cardSlideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }

  .sidebar {
    position: fixed; left: 0; top: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar--open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }

  .main-content { width: 100%; }

  .topbar { padding: 0 16px; gap: 8px; }
  .search-box { width: auto; flex: 1; }
  .search-box:focus-within { width: auto; }

  .file-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .content-area { padding: 16px; }

  .upload-panel { width: calc(100vw - 32px); bottom: 16px; right: 16px; }

  .lightbox-nav { display: none; }
}

@media (max-width: 480px) {
  .topbar-actions .btn-icon { display: none; }
  .topbar-actions .btn-primary { padding: 8px 12px; font-size: 13px; }
  .file-grid { grid-template-columns: 1fr 1fr; }
}

/* Landing page responsive */
@media (max-width: 960px) {
  .landing-nav-links { display: none; }
  .landing-layout { gap: 48px; padding: 90px 24px 48px; justify-content: flex-start; flex-direction: column; }
  .landing-hero { max-width: 100%; }
  .auth-container { max-width: 100%; }
}

@media (max-width: 600px) {
  .landing-nav { width: calc(100% - 24px); padding: 10px 16px; }
  .landing-title { font-size: 36px; letter-spacing: -1px; }
  .landing-subtitle { font-size: 15px; }
  .landing-stats { gap: 20px; }
  .landing-stat-num { font-size: 20px; }
}

/* ── Selection styles ──────────────────────────────────────────── */
::selection { background: rgba(99,102,241,0.25); color: var(--primary); }

/* ============================================================
   DASHBOARD — LIGHT THEME OVERRIDES
   (Applied when .light-theme is on .dashboard-body)
   ============================================================ */

/* Body & background */
.light-theme.dashboard-body {
  background: var(--lp-bg);
  background-attachment: fixed;
}
.light-theme.dashboard-body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 5% 10%,  rgba(167,139,250,0.45) 0%, transparent 55%),
    radial-gradient(ellipse 40% 50% at 92% 85%, rgba(252,165,165,0.40) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 55% 5%,  rgba(99,102,241,0.25) 0%, transparent 50%),
    radial-gradient(ellipse 35% 40% at 20% 90%, rgba(34,211,238,0.20) 0%, transparent 55%),
    radial-gradient(ellipse 60% 60% at 75% 50%, rgba(244,114,182,0.18) 0%, transparent 60%);
  animation: bgPulse 10s ease-in-out infinite alternate;
}

/* Sidebar */
.light-theme .sidebar {
  background: rgba(255,255,255,0.60);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border-right: 1px solid rgba(255,255,255,0.80);
  box-shadow: 4px 0 24px rgba(99,102,241,0.08);
  z-index: 100;
}
.light-theme .sidebar::after { display: none; }
.light-theme .sidebar::before {
  content: '';
  position: absolute;
  top: 0; right: -1px; bottom: 0; width: 1px;
  background: linear-gradient(180deg, transparent, rgba(99,102,241,0.35) 40%, rgba(167,139,250,0.35) 60%, transparent);
  pointer-events: none;
}
.light-theme .sidebar-brand { border-bottom-color: rgba(99,102,241,0.12); }
.light-theme .sidebar-logo-text {
  background: linear-gradient(120deg, #4f46e5, #7c3aed);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.light-theme .nav-item { color: #475569; }
.light-theme .nav-item:hover { background: rgba(99,102,241,0.08); color: #1e1b4b; }
.light-theme .nav-item.active {
  background: linear-gradient(90deg, rgba(99,102,241,0.15), rgba(99,102,241,0.04));
  color: var(--primary); border-left-color: var(--primary);
}
.light-theme .nav-item.active svg { color: var(--primary); }
.light-theme .sidebar-divider { background: rgba(99,102,241,0.10); }
.light-theme .storage-widget {
  background: rgba(99,102,241,0.06);
  border-color: rgba(99,102,241,0.15);
}
.light-theme .storage-pct { color: var(--primary); }
.light-theme .storage-bar { background: rgba(99,102,241,0.10); }
.light-theme .storage-label { color: #475569; }
.light-theme .storage-detail { color: #64748b; }
.light-theme .sidebar-profile { border-top-color: rgba(99,102,241,0.10); }
.light-theme .sidebar-profile:hover { background: rgba(99,102,241,0.04); }
.light-theme .profile-name { color: #0f172a; }
.light-theme .profile-email { color: #475569; }
.light-theme .profile-logout { color: #94a3b8; }
.light-theme .profile-logout:hover { background: rgba(244,63,94,0.08); color: #e11d48; border-color: rgba(244,63,94,0.2); }

/* Topbar */
.light-theme .topbar {
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.80);
  box-shadow: 0 1px 0 rgba(99,102,241,0.08), 0 4px 16px rgba(99,102,241,0.06);
  position: relative;
}
.light-theme .topbar::after {
  background: linear-gradient(90deg, transparent 0%, rgba(99,102,241,0.4) 30%, rgba(167,139,250,0.6) 50%, rgba(99,102,241,0.4) 70%, transparent 100%);
}
.light-theme .breadcrumb-item { color: #475569; }
.light-theme .breadcrumb-item:hover { background: rgba(99,102,241,0.08); color: #1e1b4b; }
.light-theme .breadcrumb-item.active { color: #0f172a; }
.light-theme .search-box {
  background: rgba(255,255,255,0.80);
  border-color: rgba(99,102,241,0.18);
}
.light-theme .search-box:focus-within {
  background: #fff;
  border-color: rgba(99,102,241,0.45);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.light-theme .search-box input { color: #0f172a; }
.light-theme .search-box input::placeholder { color: #94a3b8; }
.light-theme .btn-icon {
  background: rgba(255,255,255,0.70);
  border-color: rgba(99,102,241,0.15);
  color: #475569;
}
.light-theme .btn-icon:hover { background: rgba(255,255,255,0.95); color: var(--primary); border-color: rgba(99,102,241,0.30); }
.light-theme .btn-icon.active { background: rgba(99,102,241,0.10); border-color: rgba(99,102,241,0.35); color: var(--primary); }

/* Content area */
.light-theme .content-area { background: transparent; }
.light-theme .content-area::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.25); }
.light-theme .content-area::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.45); }

/* File cards */
.light-theme .file-card {
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(255,255,255,0.85);
  box-shadow: 0 2px 12px rgba(99,102,241,0.06);
  backdrop-filter: blur(16px);
}
.light-theme .file-card::before {
  background: linear-gradient(135deg, rgba(99,102,241,0.05) 0%, transparent 60%);
}
.light-theme .file-card:hover {
  background: rgba(255,255,255,0.90);
  border-color: rgba(99,102,241,0.30);
  box-shadow: 0 12px 40px rgba(99,102,241,0.16), 0 0 0 1px rgba(99,102,241,0.20);
  transform: translateY(-4px);
}
.light-theme .file-card-name { color: #0f172a; font-weight: 600; }
.light-theme .file-card-meta { color: #64748b; }
.light-theme .file-card-thumb {
  background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(167,139,250,0.04));
}
.light-theme .folder-thumb {
  background: linear-gradient(135deg, rgba(99,102,241,0.10), rgba(167,139,250,0.06));
}
.light-theme .file-card-actions {
  background: linear-gradient(to bottom right, rgba(255,255,255,0.92), rgba(255,255,255,0.75));
  backdrop-filter: blur(8px);
}
.light-theme .file-action-btn {
  background: rgba(255,255,255,0.90);
  border-color: rgba(99,102,241,0.15);
  color: #475569;
}
.light-theme .file-action-btn:hover { background: rgba(99,102,241,0.10); color: var(--primary); border-color: rgba(99,102,241,0.30); }
.light-theme .file-action-btn--danger:hover { background: rgba(244,63,94,0.08); color: #e11d48; border-color: rgba(244,63,94,0.25); }

/* List mode cards */
.light-theme .file-grid--list .file-card { background: rgba(255,255,255,0.65); }
.light-theme .file-grid--list .file-card:hover { background: rgba(255,255,255,0.90); transform: none; }

/* Skeleton */
.light-theme .skeleton-card {
  background: rgba(255,255,255,0.50);
  border: 1px solid rgba(255,255,255,0.70);
}
.light-theme .skeleton-card::after {
  background: linear-gradient(90deg, transparent 20%, rgba(99,102,241,0.08) 50%, transparent 80%);
}

/* Empty state */
.light-theme .empty-state h3 { color: #0f172a; }
.light-theme .empty-state p { color: #475569; }
.light-theme .empty-state svg { opacity: 0.25; color: #6366f1; }

/* Upload panel */
.light-theme .upload-panel {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(32px);
  border: 1px solid rgba(255,255,255,0.95);
  box-shadow: 0 20px 60px rgba(99,102,241,0.16), 0 4px 16px rgba(0,0,0,0.06);
}
.light-theme .upload-panel-header {
  border-bottom-color: rgba(99,102,241,0.10);
  background: rgba(99,102,241,0.04);
  color: #0f172a;
}
.light-theme .upload-panel-header button { color: #94a3b8; }
.light-theme .upload-panel-header button:hover { background: rgba(99,102,241,0.08); color: var(--primary); }
.light-theme .upload-item {
  background: rgba(255,255,255,0.80);
  border-color: rgba(99,102,241,0.12);
}
.light-theme .upload-item-name { color: #0f172a; }
.light-theme .upload-item-size { color: #94a3b8; }
.light-theme .upload-progress-bar { background: rgba(99,102,241,0.10); }
.light-theme .upload-item-status { color: #94a3b8; }
.light-theme .upload-item-status--encrypting { color: #d97706; }
.light-theme .upload-item-status--uploading  { color: #0284c7; }
.light-theme .upload-item-status--done       { color: #059669; }
.light-theme .upload-item-status--error      { color: #e11d48; }

/* Drop overlay */
.light-theme .drop-overlay { background: rgba(255,255,255,0.85); backdrop-filter: blur(12px); }

/* Modals */
.light-theme .modal-overlay { background: rgba(99,102,241,0.08); backdrop-filter: blur(8px); }
.light-theme .modal {
  background: rgba(255,255,255,0.90);
  backdrop-filter: blur(32px);
  border: 1px solid rgba(255,255,255,0.95);
  box-shadow: 0 24px 64px rgba(99,102,241,0.16), 0 4px 16px rgba(0,0,0,0.06);
  color: #0f172a;
}
.light-theme .modal-title { color: #0f172a; }
.light-theme .modal-close { color: #94a3b8; }
.light-theme .modal-close:hover { background: rgba(99,102,241,0.08); color: var(--primary); }
.light-theme .modal input,
.light-theme .modal select,
.light-theme .modal textarea {
  background: rgba(255,255,255,0.90);
  border-color: rgba(99,102,241,0.18);
  color: #0f172a;
}
.light-theme .modal input:focus,
.light-theme .modal select:focus { border-color: rgba(99,102,241,0.45); box-shadow: 0 0 0 3px rgba(99,102,241,0.10); background: #fff; }
.light-theme .modal label { color: #475569; }
.light-theme .form-hint { color: #64748b; }

/* Toasts */
.light-theme .toast--success { background: rgba(16,185,129,0.10); border-color: rgba(16,185,129,0.25); color: #047857; }
.light-theme .toast--error   { background: rgba(244,63,94,0.10);  border-color: rgba(244,63,94,0.25);  color: #be123c; }
.light-theme .toast--info    { background: rgba(99,102,241,0.10); border-color: rgba(99,102,241,0.25); color: var(--primary); }
.light-theme .toast--warning { background: rgba(245,158,11,0.10); border-color: rgba(245,158,11,0.25); color: #b45309; }

/* Sidebar shared badge */
.light-theme .file-shared-badge {
  background: linear-gradient(90deg, rgba(34,211,238,0.12), rgba(99,102,241,0.08));
  color: #0284c7; border-color: rgba(34,211,238,0.25);
}

/* Auth messages adapted for light */
.light-theme .auth-message--error   { color: #e11d48; }
.light-theme .auth-message--success { color: #059669; }
.light-theme .auth-message--info    { color: var(--primary); }

/* Orbs for dashboard (attached to body) */
.light-theme.dashboard-body .orb { opacity: 0.65; filter: blur(70px); z-index: 0; }
.light-theme.dashboard-body .orb-1 { width: 520px; height: 520px; background: radial-gradient(circle, rgba(139,92,246,0.55), rgba(99,102,241,0.10), transparent); top: -160px; left: -120px; }
.light-theme.dashboard-body .orb-2 { width: 440px; height: 440px; background: radial-gradient(circle, rgba(251,113,133,0.50), rgba(244,114,182,0.10), transparent); bottom: -100px; right: -100px; }
.light-theme.dashboard-body .orb-3 { width: 380px; height: 380px; background: radial-gradient(circle, rgba(34,211,238,0.30), rgba(59,130,246,0.10), transparent); top: 30%; right: 15%; }
