/* ── Investor Portal — Fintech Minimal Theme ─────────────────────────────── */
:root {
  --bg:      #0a0f1e;
  --surface: #111827;
  --border:  rgba(255,255,255,0.06);
  --text:    #e2e8f0;
  --muted:   #64748b;
  --accent:  #3b82f6;
  --green:   #10b981;
  --red:     #ef4444;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', -apple-system, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Top Bar ── */
.top-bar {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 1200px; margin: 0 auto;
  padding: 20px 32px;
}
.logo {
  color: #fff; text-decoration: none;
}
.user-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 100px; font-size: 0.8rem; color: var(--muted);
}
.user-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 8px rgba(16,185,129,0.4);
}

/* ── Page ── */
.page { max-width: 1200px; margin: 0 auto; padding: 0 32px 48px; }

/* ── Bot Cards ── */
.bot-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-bottom: 48px; }
.bot-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px;
  transition: all 0.25s ease; cursor: pointer;
  text-decoration: none; color: inherit;
  position: relative; overflow: hidden; display: block;
}
.bot-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity 0.3s ease;
}
.bot-card:hover { border-color: rgba(59,130,246,0.3); transform: translateY(-2px); }
.bot-card:hover::before { opacity: 1; }

.bot-name {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted); margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}
.bot-status { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.bot-pnl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.2rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 4px;
}
.pnl-pos { color: var(--green); }
.pnl-neg { color: var(--red); }
.pnl-zero { color: var(--muted); }
.bot-label { font-size: 0.78rem; color: var(--muted); margin-bottom: 24px; }
.bot-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  border-top: 1px solid var(--border); padding-top: 20px;
}
.stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem; font-weight: 600; color: #fff;
}
.stat-label {
  font-size: 0.68rem; color: var(--muted); margin-top: 2px;
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* ── Section Labels ── */
.section-label {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Trade Table ── */
.trade-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 48px; }
.trade-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.trade-table th {
  padding: 14px 20px; text-align: left;
  font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted);
  background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--border);
}
.trade-table td {
  padding: 14px 20px; font-size: 0.85rem; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.trade-table tr:last-child td { border-bottom: none; }
.mono { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; }
.chip {
  display: inline-flex; padding: 3px 10px; border-radius: 6px;
  font-size: 0.7rem; font-weight: 600;
}
.chip-long  { background: rgba(16,185,129,0.1); color: var(--green); }
.chip-short { background: rgba(239,68,68,0.1);  color: var(--red); }

/* ── Calculator ── */
.calc-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px;
}
.calc-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 16px; align-items: end;
}
.calc-field label {
  display: block; font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 8px;
}
.calc-field input, .calc-field select {
  width: 100%; padding: 12px 16px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; color: #fff;
  font-family: 'JetBrains Mono', monospace; font-size: 0.9rem;
  outline: none; transition: border-color 0.2s;
}
.calc-field input:focus, .calc-field select:focus { border-color: var(--accent); }
.calc-field select option { background: var(--surface); }
.calc-btn {
  padding: 12px 28px; background: var(--accent); color: #fff;
  border: none; border-radius: 10px; font-weight: 600;
  font-size: 0.85rem; cursor: pointer; font-family: 'Outfit', sans-serif;
  transition: all 0.2s; white-space: nowrap;
}
.calc-btn:hover { background: #2563eb; }
.calc-result {
  margin-top: 24px; padding: 24px;
  background: rgba(16,185,129,0.05); border: 1px solid rgba(16,185,129,0.15);
  border-radius: 12px; display: none;
  justify-content: space-between; align-items: center;
}
.calc-result.visible { display: flex; }
.calc-result-label { font-size: 0.85rem; color: var(--muted); }
.calc-result-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.6rem; font-weight: 700; color: var(--green);
}
.calc-result-pct {
  font-size: 0.85rem; color: var(--green); margin-top: 2px;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Bot Detail ── */
.detail-header { margin-bottom: 32px; }
.detail-title { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 4px; }
.detail-sub { font-size: 0.85rem; color: var(--muted); }
.period-tabs { display: flex; gap: 8px; margin-bottom: 32px; }
.period-tab {
  padding: 8px 16px; border-radius: 8px; font-size: 0.8rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; text-decoration: none;
  transition: all 0.2s;
}
.period-tab:hover { border-color: rgba(59,130,246,0.3); color: #fff; }
.period-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.metrics-grid {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 32px;
}
.metric-card {
  padding: 20px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
}
.metric-label {
  color: var(--muted); font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; margin-bottom: 6px; letter-spacing: 0.06em;
}
.metric-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem; font-weight: 700;
}

.chart-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 24px; margin-bottom: 32px;
}
.chart-card canvas { width: 100% !important; height: 300px !important; }

.load-more-btn {
  display: block; width: 100%; padding: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; color: var(--muted); font-weight: 600;
  font-size: 0.85rem; cursor: pointer; text-align: center;
  font-family: 'Outfit', sans-serif; transition: all 0.2s;
  margin-top: 16px;
}
.load-more-btn:hover { border-color: rgba(59,130,246,0.3); color: #fff; }

/* ── Login ── */
.login-container {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
.login-card {
  width: 100%; max-width: 400px; padding: 48px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
}
.login-title {
  font-size: 1.8rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 4px;
}
.login-sub { font-size: 0.85rem; color: var(--muted); margin-bottom: 32px; }
.login-error {
  padding: 12px 16px; background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2); border-radius: 10px;
  color: var(--red); font-size: 0.85rem; margin-bottom: 20px;
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 8px;
}
.form-group input {
  width: 100%; padding: 14px 16px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; color: #fff; font-size: 0.95rem;
  font-family: 'Outfit', sans-serif; outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--accent); }
.login-btn {
  width: 100%; padding: 14px; background: var(--accent);
  border: none; border-radius: 10px; color: #fff;
  font-weight: 700; font-size: 0.95rem; cursor: pointer;
  font-family: 'Outfit', sans-serif; transition: all 0.2s;
}
.login-btn:hover { background: #2563eb; }

/* ── Error Page ── */
.error-page { text-align: center; padding: 120px 0; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--muted); }
.error-msg { font-size: 1rem; color: var(--muted); margin-bottom: 24px; }
.error-link {
  color: var(--accent); text-decoration: none; font-weight: 600;
  font-size: 0.9rem;
}
.error-link:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .page { padding: 0 16px 32px; }
  .top-bar { padding: 16px; }
  .bot-cards { grid-template-columns: 1fr; }
  .calc-row { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2,1fr); }
  .bot-pnl { font-size: 1.6rem; }
  .detail-title { font-size: 1.5rem; }
}
