:root {
  --bg: #0a0d12;
  --surface: #111520;
  --surface2: #1a2030;
  --accent: #00e5ff;
  --accent2: #7c3aed;
  --green: #00c853;
  --red: #ff1744;
  --text: #e8eaf0;
  --muted: #6b7280;
  --border: #1e2535;
  --radius: 12px;
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.screen { min-height: 100vh; }
.hidden { display: none !important; }

/* Login */
.login-card {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 100vh; gap: 24px;
}
.login-card .logo { font-size: 2rem; font-weight: 800; color: var(--accent); letter-spacing: -1px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; width: 280px; }
.login-card input {
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); padding: 12px 16px; font-size: 1rem; outline: none;
}
.login-card input:focus { border-color: var(--accent); }
.error { color: var(--red); font-size: .875rem; }

/* Header */
header {
  display: flex; align-items: center; gap: 16px; padding: 16px 24px;
  border-bottom: 1px solid var(--border); background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}
.logo { font-weight: 800; color: var(--accent); font-size: 1.1rem; white-space: nowrap; }
nav { display: flex; gap: 4px; flex: 1; }
.tab-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: 6px 14px; border-radius: 8px; font-size: .875rem; transition: all .15s;
}
.tab-btn.active, .tab-btn:hover { background: var(--surface2); color: var(--text); }
.tab-btn.active { color: var(--accent); }
.icon-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; }

/* Tabs */
.tab-content { display: none; padding: 24px; max-width: 960px; margin: 0 auto; }
.tab-content.active { display: block; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-header h2 { font-size: 1.25rem; font-weight: 700; }

/* Buttons */
.primary-btn {
  background: var(--accent); color: #000; border: none; border-radius: 8px;
  padding: 8px 18px; font-weight: 600; cursor: pointer; font-size: .875rem; transition: opacity .15s;
}
.primary-btn:hover { opacity: .85; }
.ghost-btn {
  background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 8px;
  padding: 8px 14px; cursor: pointer; font-size: .875rem; transition: all .15s;
}
.ghost-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; position: relative;
}
.card-ticker { font-size: 1.1rem; font-weight: 700; }
.card-market { font-size: .75rem; color: var(--muted); margin-left: 6px; }
.card-price { font-size: 1.4rem; font-weight: 800; margin: 8px 0 4px; }
.card-change { font-size: .875rem; font-weight: 600; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.card-meta { font-size: .75rem; color: var(--muted); margin-top: 8px; }
.card-pnl { font-size: .9rem; font-weight: 600; margin-top: 4px; }
.card-delete {
  position: absolute; top: 12px; right: 12px; background: none; border: none;
  color: var(--muted); cursor: pointer; font-size: 1rem;
}
.card-delete:hover { color: var(--red); }

/* Modal */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex;
  align-items: center; justify-content: center; z-index: 100;
}
.modal-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; width: 340px; display: flex; flex-direction: column; gap: 12px;
}
.modal-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }

/* Inputs */
input, select {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 10px 14px; font-size: .9rem; outline: none; width: 100%;
}
input:focus, select:focus { border-color: var(--accent); }
select option { background: var(--surface2); }

/* Analysis */
.analysis-input { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.analysis-input input { flex: 1; min-width: 120px; }
.analysis-input select { width: auto; }
.analysis-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.indicators { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.indicator-card { background: var(--surface2); border-radius: 8px; padding: 12px; }
.indicator-label { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.indicator-value { font-size: 1.1rem; font-weight: 700; margin-top: 4px; }
.ai-text { line-height: 1.7; color: var(--text); white-space: pre-wrap; font-size: .95rem; }

/* Alerts */
.alert-input { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.alert-input input { flex: 1; min-width: 100px; }
.alert-input select { width: auto; }
.card-list { display: flex; flex-direction: column; gap: 10px; }
.alert-row {
  display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px; gap: 12px;
}
.alert-row .tag { background: var(--surface2); border-radius: 6px; padding: 2px 8px; font-size: .75rem; }
.alert-row .spacer { flex: 1; }

@media (max-width: 600px) {
  header { flex-wrap: wrap; }
  .tab-btn { padding: 6px 10px; }
  .tab-content { padding: 16px; }
}
