:root {
  --bg: #0f0f1a;
  --bg2: #1a1a2e;
  --bg3: #25253d;
  --purple: #7c3aed;
  --purple-light: #a78bfa;
  --gold: #f59e0b;
  --gold-light: #fbbf24;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --green: #10b981;
  --red: #ef4444;
  --blue: #3b82f6;
  --yellow: #eab308;
  --radius: 12px;
}

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

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

.container { max-width: 600px; margin: 0 auto; padding: 16px; }

/* Nav */
.nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--bg3);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand { font-size: 1.3rem; font-weight: 700; }
.nav-brand span { color: var(--gold); }
.nav-links { display: flex; gap: 12px; align-items: center; }
.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  cursor: pointer;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--gold); }

/* Auth */
.auth-container {
  max-width: 400px;
  margin: 60px auto;
  padding: 0 16px;
}
.auth-card {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 32px 24px;
  border: 1px solid var(--bg3);
}
.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}
.auth-subtitle {
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 24px;
  font-size: 0.9rem;
}
.auth-toggle {
  text-align: center;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.auth-toggle a {
  color: var(--purple-light);
  cursor: pointer;
  text-decoration: none;
}

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--purple);
}
.form-textarea { min-height: 120px; resize: vertical; font-family: inherit; }
.form-select { appearance: none; cursor: pointer; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}
.btn-primary { background: var(--purple); color: white; }
.btn-primary:hover { background: #6d28d9; }
.btn-gold { background: var(--gold); color: #000; }
.btn-gold:hover { background: var(--gold-light); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--bg3);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--purple); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; width: auto; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Cards */
.card {
  background: var(--bg2);
  border-radius: var(--radius);
  border: 1px solid var(--bg3);
  padding: 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--purple); }
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.card-title { font-weight: 600; font-size: 1.1rem; }
.card-meta { color: var(--text-dim); font-size: 0.85rem; margin-top: 4px; }
.card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-received { background: var(--bg3); color: var(--text-dim); }
.badge-analyzing { background: rgba(59,130,246,0.15); color: var(--blue); }
.badge-recommendations { background: rgba(234,179,8,0.15); color: var(--yellow); }
.badge-submitted { background: rgba(124,58,237,0.15); color: var(--purple-light); }
.badge-offers { background: rgba(16,185,129,0.15); color: var(--green); }
.badge-funded { background: rgba(16,185,129,0.25); color: var(--green); }
.badge-declined { background: rgba(239,68,68,0.15); color: var(--red); }

/* File upload */
.upload-zone {
  border: 2px dashed var(--bg3);
  border-radius: var(--radius);
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 16px;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--purple);
  background: rgba(124,58,237,0.05);
}
.upload-zone-icon { font-size: 2rem; margin-bottom: 8px; }
.upload-zone-text { color: var(--text-dim); font-size: 0.9rem; }
.upload-zone-hint { color: var(--text-dim); font-size: 0.75rem; margin-top: 4px; }

.file-list { margin-top: 8px; }
.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.85rem;
}
.file-item-name { color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-remove {
  color: var(--red);
  cursor: pointer;
  margin-left: 8px;
  font-size: 1.1rem;
}

/* Deal detail */
.detail-section {
  background: var(--bg2);
  border-radius: var(--radius);
  border: 1px solid var(--bg3);
  padding: 20px;
  margin-bottom: 16px;
}
.detail-section h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--gold);
}
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.9rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-dim); }
.detail-value { font-weight: 500; text-align: right; }

/* Timeline */
.timeline-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.85rem;
}
.timeline-dot {
  width: 8px;
  height: 8px;
  background: var(--purple);
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.timeline-time { color: var(--text-dim); font-size: 0.75rem; margin-top: 2px; }

/* Recommendations */
.funder-card {
  background: var(--bg);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 8px;
  border: 1px solid var(--bg3);
}
.funder-card.selected { border-color: var(--green); }
.funder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.funder-name { font-weight: 600; }
.funder-fit { font-size: 0.8rem; color: var(--green); }
.funder-details { font-size: 0.85rem; color: var(--text-dim); line-height: 1.5; }
.funder-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  cursor: pointer;
}
.funder-check input { accent-color: var(--purple); width: 18px; height: 18px; }

/* Offer card */
.offer-card {
  background: var(--bg);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 8px;
  border-left: 3px solid var(--green);
}
.offer-amount { font-size: 1.3rem; font-weight: 700; color: var(--green); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { color: var(--text); margin-bottom: 8px; }

/* Notes display */
.notes-block {
  background: var(--bg);
  border-radius: 8px;
  padding: 14px;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Page header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0 16px;
}
.page-title { font-size: 1.3rem; font-weight: 700; }

/* Loading */
.loading { text-align: center; padding: 40px; color: var(--text-dim); }
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--bg3);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg2);
  border: 1px solid var(--bg3);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 1000;
  animation: slideUp 0.3s ease;
}
.toast-error { border-color: var(--red); }
.toast-success { border-color: var(--green); }
@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Responsive */
@media (min-width: 768px) {
  .container { max-width: 700px; padding: 24px; }
}
