@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #4f46e5;
  --primary-2: #7c3aed;
  --primary-3: #a855f7;
  --ink: #0f172a;
  --muted: #64748b;
  --bg: #f6f7fb;
  --card: #ffffff;
  --border: #e6e8f0;
  --success: #16a34a;
  --success-bg: #ecfdf5;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --shadow: 0 20px 60px -18px rgba(15, 23, 42, 0.18);
  --shadow-sm: 0 8px 24px -8px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ── Auth shell (login / register) ───────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.auth-aside {
  position: relative;
  overflow: hidden;
  padding: 56px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background:
    radial-gradient(1200px 600px at -10% -20%, rgba(255,255,255,0.16), transparent 60%),
    linear-gradient(135deg, #4338ca 0%, #6d28d9 55%, #9333ea 100%);
}

.auth-aside::before, .auth-aside::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.auth-aside::before { width: 420px; height: 420px; right: -140px; top: -160px; }
.auth-aside::after { width: 300px; height: 300px; left: -100px; bottom: -120px; background: rgba(255,255,255,0.06); }

.aside-content { position: relative; z-index: 1; }

.aside-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 56px; }
.aside-logo-mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: block;
}
.aside-logo-text { font-weight: 800; font-size: 20px; letter-spacing: 0.2px; }
.aside-logo-badge {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.18); letter-spacing: 0.4px;
}

.aside-headline { font-size: 34px; font-weight: 800; line-height: 1.25; margin: 0 0 16px; max-width: 460px; }
.aside-sub { font-size: 15px; line-height: 1.6; color: rgba(255,255,255,0.82); margin: 0 0 36px; max-width: 420px; }

.feature-list { display: flex; flex-direction: column; gap: 16px; }
.feature-item { display: flex; align-items: flex-start; gap: 12px; font-size: 14.5px; color: rgba(255,255,255,0.95); }
.feature-icon {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center;
  font-size: 13px; margin-top: 1px;
}

.aside-footer {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 14px;
  padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.18);
  font-size: 13px; color: rgba(255,255,255,0.75);
}
.aside-footer strong { color: #fff; font-size: 15px; }

/* ── Form side ────────────────────────────────────────────────────── */
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 44px 40px;
  box-shadow: var(--shadow);
}
.auth-card--wide { max-width: 520px; }

.mobile-brand { display: none; }

.title { margin: 0 0 6px; font-size: 24px; font-weight: 800; }
.subtitle { margin: 0 0 28px; font-size: 14px; color: var(--muted); line-height: 1.5; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.label { font-size: 13px; color: var(--ink); font-weight: 600; }

input {
  background: #fbfbfe;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--ink);
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input::placeholder { color: #a3a9b7; }
input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.btn {
  width: 100%;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 6px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 24px -10px rgba(79, 70, 229, 0.55);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 16px 28px -10px rgba(79, 70, 229, 0.6); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

.link { color: var(--primary); text-decoration: none; font-weight: 700; }
.link:hover { text-decoration: underline; }

.foot { margin-top: 24px; font-size: 14px; color: var(--muted); text-align: center; }

.alert {
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 18px;
  display: none;
  align-items: center;
  gap: 8px;
}
.alert--error { background: var(--danger-bg); border: 1px solid #fecaca; color: var(--danger); }
.alert--ok { background: var(--success-bg); border: 1px solid #a7f3d0; color: var(--success); }
.alert.show { display: flex; }

.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--primary);
  margin: 22px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .mobile-brand {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-bottom: 28px;
  }
  .mobile-brand-mark {
    width: 34px; height: 34px; border-radius: 10px;
    display: block;
  }
  .mobile-brand-text { font-weight: 800; font-size: 18px; }
  .mobile-brand-badge {
    font-size: 10px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
    background: #ede9fe; color: var(--primary-2);
  }
}

@media (max-width: 480px) {
  .auth-card { padding: 32px 22px; border-radius: 18px; }
  .field-row { grid-template-columns: 1fr; gap: 18px; }
}

/* ── Dashboard ────────────────────────────────────────────────────── */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 252px;
  flex-shrink: 0;
  height: 100%;
  overflow-y: auto;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
}

.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 28px; }
.sidebar-brand-mark { width: 36px; height: 36px; border-radius: 10px; display: block; }
.sidebar-brand-text { font-weight: 800; font-size: 17px; line-height: 1.2; }
.sidebar-brand-badge {
  font-size: 10px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: #ede9fe; color: var(--primary-2);
}

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 14px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: #f5f3ff; color: var(--ink); }
.nav-item.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 10px 20px -10px rgba(79, 70, 229, 0.55);
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--border); }

.main-content { flex: 1; min-width: 0; height: 100%; overflow-y: auto; }

@media (max-width: 780px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    flex-shrink: 0;
    overflow-y: visible;
    flex-direction: row;
    align-items: center;
    padding: 14px 16px;
    gap: 16px;
  }
  .sidebar-brand { padding: 0; flex-shrink: 0; }
  .sidebar-nav { flex-direction: row; flex: 1; overflow-x: auto; }
  .nav-item { white-space: nowrap; }
  .sidebar-footer { padding-top: 0; margin-top: 0; border-top: none; flex-shrink: 0; }
}

.btn-outline {
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--ink);
  border-radius: 10px;
  padding: 9px 18px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.dashboard { max-width: 880px; margin: 0 auto; padding: 40px 32px 64px; }

.hero-card {
  border-radius: 24px;
  padding: 36px 40px;
  color: #fff;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(255,255,255,0.14), transparent 60%),
    linear-gradient(135deg, #4338ca, #7c3aed 70%);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.hero-eyebrow { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.75); margin-bottom: 6px; }
.hero-name { font-size: 28px; font-weight: 800; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 24px; }

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.stat-label { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.stat-value {
  font-size: 26px; font-weight: 800; letter-spacing: 1.5px;
  color: var(--primary);
}

.info-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--muted); }
.info-row span:last-child { font-weight: 600; }

.copy-row { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.copy-status { font-size: 13px; color: var(--success); font-weight: 600; }

.referral-link {
  font-size: 13.5px;
  color: var(--primary);
  font-weight: 600;
  background: #fbfbfe;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  word-break: break-all;
}

.section-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.section-title { font-size: 17px; font-weight: 800; margin: 0 0 4px; }
.section-desc { font-size: 13px; color: var(--muted); margin: 0 0 18px; }

.badge {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.badge--green { background: var(--success-bg); color: var(--success); }
.badge--gray { background: #f1f5f9; color: var(--muted); }
.badge--amber { background: #fffbeb; color: #b45309; }

.empty-state { padding: 24px 0; text-align: center; color: var(--muted); font-size: 13.5px; }

.list-items { display: flex; flex-direction: column; gap: 10px; }

.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.list-item:hover { box-shadow: var(--shadow-sm); border-color: #d6d9e6; }

.item-avatar {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-main { flex: 1; min-width: 0; }
.item-title {
  font-weight: 700;
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.item-side { flex-shrink: 0; text-align: right; }
.item-amount { font-weight: 800; font-size: 15.5px; color: var(--ink); }
.item-date { font-size: 12px; color: var(--muted); margin-top: 4px; }

@media (max-width: 560px) {
  .item-title { max-width: 160px; }
}

@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .dashboard { padding: 28px 16px 48px; }
  .hero-card { padding: 28px 24px; }
}
