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

:root {
  --purple: #534AB7;
  --purple-light: #EEEDFE;
  --purple-dark: #3C3489;
  --sidebar-bg: #0f0f1a;
  --sidebar-hover: #1a1a2e;
  --sidebar-border: #2a2a3e;
  --sidebar-text: #c8c8d8;
  --sidebar-text-muted: #666680;
  --text: #1a1a1a;
  --text-2: #555;
  --text-3: #888;
  --border: #e5e5e5;
  --bg: #f7f7f5;
  --bg2: #fff;
  --radius: 10px;
  --radius-sm: 7px;
  --sidebar-width: 220px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #f0f0f0;
    --text-2: #aaa;
    --text-3: #666;
    --border: #2e2e2e;
    --bg: #111;
    --bg2: #1c1c1c;
    --purple-light: #1e1b3a;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
}

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

.sidebar-logo {
  padding: 20px 16px 16px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo span { color: var(--purple); }

.sidebar-account {
  padding: 12px;
  border-bottom: 1px solid var(--sidebar-border);
}

.account-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--sidebar-hover);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
}

.account-btn:hover { background: #252540; }

.account-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--purple);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #fff;
  flex-shrink: 0;
}

.account-name { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.account-chevron { font-size: 10px; color: var(--sidebar-text-muted); }

.sidebar-nav { flex: 1; padding: 8px 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--sidebar-text);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-hover); color: #fff; border-left: 2px solid var(--purple); }

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg, .nav-item:hover svg { opacity: 1; }

.nav-divider { height: 1px; background: var(--sidebar-border); margin: 8px 12px; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--sidebar-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 8px 16px 4px;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--sidebar-border);
  font-size: 11px;
  color: var(--sidebar-text-muted);
}

.sidebar-footer a { color: var(--sidebar-text-muted); text-decoration: none; margin-right: 8px; }
.sidebar-footer a:hover { color: var(--sidebar-text); }

/* ── MAIN CONTENT ── */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1.5rem;
}

.page { width: 100%; max-width: 520px; display: none; }
.page.active { display: block; }

/* ── TABS ── */
.tabs {
  display: flex;
  background: var(--bg2);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 24px;
  gap: 3px;
}

.tab {
  flex: 1; padding: 8px;
  font-size: 13px; font-weight: 400;
  border: none; background: transparent;
  border-radius: 5px; cursor: pointer;
  color: var(--text-2); transition: all 0.15s;
}

.tab.active { background: var(--purple); color: #fff; font-weight: 500; }

.tab-content { display: none; }
.tab-content.active { display: block; }
.screen { display: none; }
.screen.active { display: block; }

/* ── DROP ZONE ── */
.drop-zone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  background: var(--bg2);
  margin-bottom: 20px;
}

.drop-zone:hover, .drop-zone.over { background: var(--purple-light); border-color: var(--purple); }

.drop-icon {
  width: 48px; height: 48px;
  background: var(--purple-light);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  color: var(--purple);
}

.drop-icon svg { width: 22px; height: 22px; }
.drop-title { font-weight: 500; font-size: 15px; margin-bottom: 6px; }
.drop-sub { font-size: 13px; color: var(--text-2); margin-bottom: 16px; }

/* ── OPTIONS ── */
.options { margin-bottom: 20px; display: flex; flex-direction: column; gap: 16px; }

.option-group label {
  display: block; font-size: 13px; font-weight: 500;
  margin-bottom: 8px; color: var(--text);
}

.optional { font-weight: 400; color: var(--text-3); font-size: 12px; }

.pills { display: flex; gap: 6px; flex-wrap: wrap; }

.pill {
  font-size: 12px; padding: 5px 12px;
  border-radius: 99px;
  border: 0.5px solid var(--border);
  cursor: pointer; background: var(--bg2);
  color: var(--text-2); transition: all 0.12s;
}

.pill.active { background: var(--purple-light); border-color: var(--purple); color: var(--purple-dark); font-weight: 500; }

/* ── INPUTS ── */
input[type="text"], input[type="password"], input[type="number"], input[type="email"] {
  width: 100%; padding: 9px 12px;
  font-size: 14px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg2); color: var(--text);
  outline: none; transition: border-color 0.15s;
}

input:focus { border-color: var(--purple); }

/* ── BUTTONS ── */
.btn-primary {
  width: 100%; padding: 11px;
  font-size: 14px; font-weight: 500;
  background: var(--purple); color: #fff;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; transition: background 0.15s;
}

.btn-primary:hover { background: var(--purple-dark); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-outline {
  padding: 8px 18px; font-size: 13px;
  background: transparent;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-2);
  transition: background 0.12s;
}

.btn-outline:hover { background: var(--bg); }
.btn-outline.full { width: 100%; margin-top: 8px; }

/* ── FILE CARD ── */
.file-card {
  background: var(--bg2); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}

.file-icon {
  width: 40px; height: 40px;
  background: var(--purple-light);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--purple);
}

.file-icon svg { width: 18px; height: 18px; }
.file-icon.large { width: 52px; height: 52px; margin: 0 auto 12px; }
.file-icon.large svg { width: 24px; height: 24px; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 12px; color: var(--text-2); margin-top: 2px; }

.progress-bar { height: 3px; background: var(--bg); border-radius: 99px; margin-top: 8px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--purple); border-radius: 99px; width: 0%; transition: width 0.2s; }
.progress-pct { font-size: 13px; color: var(--purple); font-weight: 500; flex-shrink: 0; }

.hint { font-size: 13px; color: var(--text-3); text-align: center; }

/* ── STATS ── */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }

.stat { background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.stat-label { font-size: 11px; color: var(--text-3); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.4px; }
.stat-val { font-size: 18px; font-weight: 500; }

/* ── SHARE BOX ── */
.share-box { background: var(--purple-light); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 12px; }
.share-title { font-size: 14px; font-weight: 500; color: var(--purple-dark); }
.share-sub { font-size: 12px; color: var(--purple); margin-top: 2px; margin-bottom: 10px; }
.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1; font-size: 12px; font-family: monospace; background: #fff; color: var(--text-2); border-color: rgba(83,74,183,0.3); }

.btn-copy { background: var(--purple); color: #fff; border: none; border-radius: var(--radius-sm); padding: 8px 16px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background 0.12s; }
.btn-copy:hover { background: var(--purple-dark); }

.toast { background: #27500A; color: #EAF3DE; font-size: 13px; padding: 8px 16px; border-radius: var(--radius-sm); text-align: center; margin-bottom: 10px; display: none; }
.toast.show { display: block; }

/* ── RECEIVE CARD ── */
.receive-card { background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--radius); padding: 1.5rem; text-align: center; margin-top: 16px; }
.file-meta { font-size: 13px; color: var(--text-2); margin-top: 4px; }

.btn-download { display: inline-flex; align-items: center; gap: 8px; background: var(--purple); color: #fff; border: none; border-radius: var(--radius-sm); padding: 10px 22px; font-size: 14px; font-weight: 500; cursor: pointer; margin-top: 16px; transition: background 0.12s; }
.btn-download:hover { background: var(--purple-dark); }

/* ── ERROR/SUCCESS CARDS ── */
.error-card { background: #FCEBEB; border: 0.5px solid #F09595; border-radius: var(--radius); padding: 1rem 1.25rem; margin-top: 16px; color: #A32D2D; font-size: 14px; text-align: center; }
.error-msg { color: #A32D2D; font-size: 13px; margin-top: 8px; min-height: 18px; }
.success-card { background: #EAF3DE; border: 0.5px solid #97C459; border-radius: var(--radius); padding: 1rem 1.25rem; margin-top: 16px; color: #27500A; font-size: 14px; text-align: center; }

/* ── AUTH PAGES ── */
.auth-card { background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--radius); padding: 2rem; margin-top: 1rem; }
.auth-title { font-size: 22px; font-weight: 500; margin-bottom: 6px; }
.auth-sub { font-size: 14px; color: var(--text-2); margin-bottom: 24px; }

/* ── LEGAL PAGES ── */
.legal-page { padding: 1rem 0 3rem; }
.legal-page h1 { font-size: 22px; font-weight: 500; margin-bottom: 6px; }
.legal-date { font-size: 13px; color: var(--text-3); margin-bottom: 2rem; }
.legal-page h2 { font-size: 16px; font-weight: 500; margin: 1.5rem 0 8px; }
.legal-page p { font-size: 14px; color: var(--text-2); line-height: 1.7; margin-bottom: 10px; }
.legal-page ul { padding-left: 1.25rem; margin-bottom: 10px; }
.legal-page ul li { font-size: 14px; color: var(--text-2); line-height: 1.7; margin-bottom: 4px; }
.legal-page a { color: var(--purple); }

/* ── DASHBOARD ── */
.page-title { font-size: 20px; font-weight: 500; margin-bottom: 4px; }
.page-sub { font-size: 13px; color: var(--text-2); margin-bottom: 20px; }

/* ── MOBILE ── */
.mobile-header { display: none; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 1rem; }
  .mobile-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--sidebar-bg); color: #fff; margin-bottom: 1rem; border-radius: var(--radius); }
  .mobile-header .logo { font-size: 18px; font-weight: 700; color: #fff; }
  .mobile-header .logo span { color: var(--purple); }
  .hamburger { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }
}
