:root {
  --bg: #f7f8fc;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --ink: #111827;
  --muted: #667085;
  --soft: #e7eaf3;
  --primary: #5b5cf6;
  --primary-dark: #4338ca;
  --accent: #06b6d4;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.10);
  --radius: 24px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, rgba(124, 58, 237, 0.12), transparent 32%),
    radial-gradient(circle at 90% 20%, rgba(6, 182, 212, 0.14), transparent 30%),
    linear-gradient(135deg, #f8fafc 0%, #eef2ff 45%, #f8fafc 100%);
  overflow-x: hidden;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(4px);
  opacity: 0.36;
  pointer-events: none;
  z-index: 0;
}
.orb-a { width: 300px; height: 300px; left: -120px; top: 110px; background: #a78bfa; }
.orb-b { width: 260px; height: 260px; right: -80px; bottom: 60px; background: #67e8f9; }

#app { position: relative; z-index: 1; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 28px;
  padding: 34px;
  align-items: center;
  max-width: 1220px;
  margin: 0 auto;
}

.hero-card, .login-card, .panel, .upload-card, .file-card, .stat-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.hero-card {
  min-height: 650px;
  border-radius: 34px;
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}
.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -60px -100px auto;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(91, 92, 246, 0.18), rgba(6, 182, 212, 0.2));
}
.logo-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo-row img { height: 58px; width: auto; }
.pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(91, 92, 246, 0.10);
  color: #3730a3;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.hero-copy { max-width: 620px; position: relative; z-index: 1; }
.hero-copy h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 74px);
  line-height: 0.94;
  letter-spacing: -0.065em;
}
.gradient-text {
  background: linear-gradient(135deg, #4338ca, #0891b2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-copy p {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
  max-width: 560px;
}
.feature-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.feature {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(226, 232, 240, 0.8);
}
.feature b { display: block; margin-bottom: 6px; }
.feature span { color: var(--muted); font-size: 13px; line-height: 1.5; }

.login-card {
  border-radius: 34px;
  padding: 34px;
}
.login-card h2, .panel h2, .upload-card h2 {
  margin: 0 0 10px;
  letter-spacing: -0.03em;
}
.subtext { color: var(--muted); margin: 0 0 22px; line-height: 1.65; }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 8px; }
.field label, .label { font-weight: 800; font-size: 13px; color: #344054; }
.input, .select {
  width: 100%;
  border: 1px solid #d7dce8;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 16px;
  padding: 14px 15px;
  outline: none;
  transition: 0.2s ease;
}
.input:focus, .select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(91, 92, 246, 0.13);
}
.btn {
  border: none;
  border-radius: 16px;
  padding: 13px 17px;
  font-weight: 900;
  transition: 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--accent)); color: white; box-shadow: 0 14px 30px rgba(91, 92, 246, 0.28); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 18px 38px rgba(91, 92, 246, 0.34); }
.btn-soft { background: #eef2ff; color: #3730a3; }
.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-small { padding: 9px 11px; border-radius: 12px; font-size: 12px; }
.demo-box {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #475569;
  font-size: 13px;
  line-height: 1.7;
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px;
  background: rgba(255, 255, 255, 0.72);
  border-right: 1px solid rgba(226, 232, 240, 0.88);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.sidebar img { height: 56px; width: 210px; object-fit: contain; object-position: left; }
.nav { display: grid; gap: 8px; }
.nav button {
  text-align: left;
  border: none;
  background: transparent;
  padding: 13px 14px;
  border-radius: 16px;
  color: #475569;
  font-weight: 800;
}
.nav button.active { background: #eef2ff; color: #3730a3; }
.account-card {
  margin-top: auto;
  padding: 16px;
  border-radius: 20px;
  background: white;
  border: 1px solid #e2e8f0;
}
.account-card strong { display: block; margin-bottom: 4px; }
.account-card span { color: var(--muted); font-size: 13px; }
.content { padding: 28px; max-width: 1180px; width: 100%; margin: 0 auto; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}
.topbar h1 { margin: 0; letter-spacing: -0.05em; font-size: clamp(30px, 4vw, 48px); }
.topbar p { margin: 8px 0 0; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card { border-radius: 24px; padding: 20px; }
.stat-card span { color: var(--muted); font-weight: 700; font-size: 13px; }
.stat-card strong { display: block; font-size: 32px; margin-top: 8px; letter-spacing: -0.05em; }
.workspace { display: grid; grid-template-columns: 0.95fr 1.35fr; gap: 18px; align-items: start; }
.panel, .upload-card { border-radius: var(--radius); padding: 22px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-header h2 { margin: 0; }
.drop-zone {
  border: 1.6px dashed #b9c2d5;
  background: rgba(248, 250, 252, 0.76);
  border-radius: 22px;
  padding: 28px;
  text-align: center;
  transition: 0.2s ease;
}
.drop-zone.dragover { border-color: var(--primary); background: rgba(91, 92, 246, 0.08); }
.drop-icon { font-size: 36px; margin-bottom: 10px; }
.drop-zone p { margin: 0 0 12px; color: var(--muted); }
.file-name { margin-top: 10px; color: #111827; font-weight: 800; word-break: break-all; }
.checks { display: grid; gap: 10px; margin: 16px 0; }
.check { display: flex; align-items: center; gap: 10px; color: #475569; font-weight: 700; }
.user-picker { display: grid; gap: 8px; max-height: 160px; overflow: auto; padding: 6px 2px; }
.files-grid { display: grid; gap: 12px; }
.file-card {
  border-radius: 20px;
  padding: 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}
.file-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(91, 92, 246, 0.12), rgba(6, 182, 212, 0.14));
  color: #3730a3;
  font-size: 20px;
}
.file-title { font-weight: 900; word-break: break-word; }
.file-meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
}
.file-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 650px; }
th, td { padding: 13px 10px; text-align: left; border-bottom: 1px solid #edf0f7; }
th { color: #64748b; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
td { color: #334155; font-weight: 600; }
.empty {
  border: 1px dashed #cbd5e1;
  border-radius: 20px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,0.6);
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  pointer-events: none;
  background: #111827;
  color: white;
  padding: 13px 16px;
  border-radius: 14px;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.22);
  transition: 0.25s ease;
  z-index: 10;
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.mobile-logo { display: none; }

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; padding: 18px; }
  .hero-card { min-height: auto; gap: 34px; padding: 28px; }
  .feature-grid { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 16px; }
  .sidebar > img { display: none; }
  .mobile-logo { display: block; height: 50px; margin-bottom: 12px; }
  .nav { display: flex; min-width: max-content; }
  .account-card { margin-top: 0; min-width: 210px; }
  .content { padding: 18px; }
  .workspace { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .file-card { grid-template-columns: auto 1fr; }
  .file-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 560px) {
  .logo-row { flex-direction: column; align-items: flex-start; }
  .topbar { flex-direction: column; }
  .hero-copy h1 { font-size: 42px; }
  .login-card, .hero-card, .panel, .upload-card { border-radius: 24px; }
}
