/* =========================================================
   AI Trading Platform — Terminal aesthetic
   Dark, data-dense, mono accents, amber/green/red signals
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg:        #0a0e14;
  --bg-2:      #0f141d;
  --panel:     #131a24;
  --panel-2:   #1a2330;
  --line:      #222d3d;
  --line-soft: #1a2230;
  --txt:       #e6edf3;
  --txt-dim:   #8b98a9;
  --txt-faint: #5a6675;
  --accent:    #00e0b8;   /* teal */
  --accent-2:  #ffb000;   /* amber */
  --up:        #2dd47f;
  --down:      #ff5c5c;
  --buy:       #2dd47f;
  --sell:      #ff5c5c;
  --radius:    10px;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Space Grotesk', system-ui, sans-serif;
}

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

body {
  font-family: var(--sans);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(0,224,184,.06), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(255,176,0,.05), transparent 55%),
    var(--bg);
  color: var(--txt);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: .1px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- Auth screens ---------------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 20px; letter-spacing: -.3px;
}
.brand .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent);
}
.brand small { color: var(--txt-faint); font-family: var(--mono); font-weight: 400; }
.auth-card h1 { font-size: 22px; margin: 22px 0 4px; }
.auth-card p.sub { color: var(--txt-dim); font-size: 14px; margin-bottom: 22px; }

/* ---------------- Forms ---------------- */
label { display:block; font-size:12px; text-transform:uppercase; letter-spacing:.8px;
        color: var(--txt-dim); margin: 14px 0 6px; }
input, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--txt);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
  font-family: var(--sans);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,224,184,.12);
}
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  background: var(--accent);
  color: #04201b;
  border: none;
  border-radius: var(--radius);
  padding: 12px 18px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--sans);
  transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.08); text-decoration:none; }
.btn:active { transform: translateY(1px); }
.btn.full { width: 100%; margin-top: 20px; }
.btn.ghost { background: transparent; color: var(--txt); border:1px solid var(--line); }
.btn.amber { background: var(--accent-2); color:#241800; }
.btn.green { background: var(--up); color:#042414; }
.btn.red   { background: var(--down); color:#2a0606; }
.btn.sm    { padding: 7px 12px; font-size: 12px; border-radius: 8px; }

.muted-link { display:block; text-align:center; margin-top:18px; color: var(--txt-dim); font-size:13px; }

/* ---------------- App shell ---------------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
}
.sidebar .brand { font-size: 18px; padding: 0 8px 18px; }
.nav { display:flex; flex-direction:column; gap:2px; margin-top: 8px; }
.nav a {
  display:flex; align-items:center; justify-content:space-between;
  color: var(--txt-dim); padding: 11px 12px; border-radius: 9px;
  font-size: 14px; font-weight: 500;
}
.nav a:hover { background: var(--panel); color: var(--txt); text-decoration:none; }
.nav a.active { background: var(--panel-2); color: var(--txt); }
.nav a.active::before { content:''; }
.nav .badge {
  background: var(--accent-2); color:#241800; font-family:var(--mono);
  font-size: 11px; font-weight:700; padding: 1px 7px; border-radius: 20px;
}
.sidebar .spacer { flex: 1; }
.sidebar .who { padding: 12px; border-top:1px solid var(--line); font-size:13px; color:var(--txt-dim); }
.sidebar .who b { color: var(--txt); display:block; }

.main { padding: 26px 30px 60px; }
.topbar { display:flex; align-items:center; justify-content:space-between; margin-bottom: 24px; flex-wrap:wrap; gap:12px; }
.topbar h1 { font-size: 22px; font-weight:700; letter-spacing:-.4px; }
.topbar .sub { color: var(--txt-dim); font-size: 13px; }

/* ---------------- Cards / stats ---------------- */
.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: 1.4fr 1fr; }

.stat {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.stat .k { font-size:12px; text-transform:uppercase; letter-spacing:.8px; color:var(--txt-dim); }
.stat .v { font-family: var(--mono); font-size: 26px; font-weight: 700; margin-top: 8px; }
.stat .v.green { color: var(--up); }
.stat .v.amber { color: var(--accent-2); }
.stat .v.teal  { color: var(--accent); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel .head {
  padding: 14px 18px; border-bottom:1px solid var(--line);
  display:flex; align-items:center; justify-content:space-between;
  font-weight:600; font-size:15px;
}
.panel .body { padding: 18px; }

/* ---------------- Tables ---------------- */
table { width:100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align:left; color: var(--txt-dim); font-weight:600;
  text-transform:uppercase; letter-spacing:.6px; font-size:11px;
  padding: 12px 14px; border-bottom:1px solid var(--line);
}
tbody td { padding: 13px 14px; border-bottom:1px solid var(--line-soft); }
tbody tr:hover { background: var(--panel-2); }
tbody tr:last-child td { border-bottom: none; }
td.mono, th.mono, .mono { font-family: var(--mono); }

/* ---------------- Pills / badges ---------------- */
.pill {
  display:inline-block; font-family:var(--mono); font-size:11px; font-weight:700;
  padding: 3px 9px; border-radius: 20px; letter-spacing:.4px;
}
.pill.pending  { background: rgba(255,176,0,.14);  color: var(--accent-2); }
.pill.approved { background: rgba(45,212,127,.14); color: var(--up); }
.pill.rejected { background: rgba(255,92,92,.14);  color: var(--down); }
.pill.win      { background: rgba(45,212,127,.14); color: var(--up); }
.pill.loss     { background: rgba(255,92,92,.14);  color: var(--down); }
.pill.buy      { background: rgba(45,212,127,.14); color: var(--buy); }
.pill.sell     { background: rgba(255,92,92,.14);  color: var(--sell); }
.pill.signal   { background: rgba(0,224,184,.12);  color: var(--accent); }

.pos { color: var(--up); }
.neg { color: var(--down); }

/* ---------------- Flash ---------------- */
.flash {
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px;
  font-size: 14px; border:1px solid;
}
.flash.success { background: rgba(45,212,127,.1); border-color: rgba(45,212,127,.3); color:#a8f0cb; }
.flash.error   { background: rgba(255,92,92,.1); border-color: rgba(255,92,92,.3); color:#ffc0c0; }
.flash.info    { background: rgba(0,224,184,.08); border-color: rgba(0,224,184,.25); color:#bdf2e8; }

/* ---------------- Misc ---------------- */
.row { display:flex; gap: 12px; flex-wrap: wrap; }
.row .col { flex:1; min-width: 0; }
.inline-form { display:inline; }
.empty { text-align:center; color: var(--txt-faint); padding: 40px 0; font-size:14px; }
.ticker {
  display:flex; gap: 22px; overflow:hidden; white-space:nowrap;
  font-family: var(--mono); font-size: 13px; padding: 10px 0; color: var(--txt-dim);
  border-bottom: 1px solid var(--line); margin-bottom: 22px;
}
.ticker b { color: var(--txt); }
.help { color: var(--txt-faint); font-size: 12px; margin-top: 6px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction:row; flex-wrap:wrap; }
  .sidebar .spacer, .sidebar .who { display:none; }
  .cols-4 { grid-template-columns: repeat(2,1fr); }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
}
