:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-elevated: #22324d;
  --accent: #2dd4bf;
  --accent-strong: #14b8a6;
  --accent-2: #38bdf8;
  --text-primary: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --danger: #f87171;
  --success: #34d399;
  --border: rgba(255, 255, 255, 0.12);
  --grid: rgba(255, 255, 255, 0.08);
  --input-bg: #020617;
  --input-border: #334155;
}

body {
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-secondary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-primary);
}

.bg-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.6;
  z-index: 0;
}

.bg-shape-a {
  width: 420px;
  height: 420px;
  background: rgba(56, 189, 248, 0.18);
  top: -120px;
  right: -120px;
}

.bg-shape-b {
  width: 520px;
  height: 520px;
  background: rgba(45, 212, 191, 0.16);
  bottom: -180px;
  left: -160px;
}

main,
nav {
  position: relative;
  z-index: 2;
}

.hero-panel {
  padding: 2rem;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  animation: rise 0.7s ease both;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--accent);
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.25);
  animation: rise 0.7s ease both;
}

.metric {
  font-size: 1.6rem;
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
  color: var(--text-primary);
}

.subtle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.status-pill {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
  font-weight: 600;
  transition: all 0.3s ease;
}

.status-pill.inactive {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.table {
  margin-bottom: 0;
}

.table thead th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.85rem;
}

.table tbody tr {
  border-bottom: 1px solid var(--grid);
}

.tag {
  background: rgba(148, 163, 184, 0.2);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pnl-positive {
  color: var(--success);
}

.pnl-negative {
  color: var(--danger);
}

.chart-wrap {
  height: 320px;
  position: relative;
}

.chat-panel .card-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-window {
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  max-height: 260px;
  overflow-y: auto;
}

.chat-message {
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  margin-bottom: 0.6rem;
  line-height: 1.4;
  font-size: 0.92rem;
}

.chat-message-ai {
  background: rgba(34, 197, 94, 0.12);
  color: var(--text-secondary);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.chat-message-user {
  background: rgba(56, 189, 248, 0.12);
  color: var(--text-primary);
  border: 1px solid rgba(56, 189, 248, 0.2);
  align-self: flex-end;
}

.chat-form {
  display: flex;
  gap: 0.75rem;
}

.chat-form .form-control {
  flex: 1;
}

.chat-form .btn {
  min-width: 120px;
}

@media (max-width: 768px) {
  .chat-form {
    flex-direction: column;
  }

  .chat-form .btn {
    width: 100%;
  }
}

.chart-message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.5);
  color: var(--text-muted);
  text-align: center;
  border-radius: 16px;
  z-index: 2;
}

.chart-wrap canvas {
  position: relative;
  z-index: 1;
}

.text-muted {
  color: var(--text-muted) !important;
}

.login-card {
  max-width: 420px;
  margin: 8vh auto;
  padding: 2rem;
}

.admin-panel {
  margin-top: 2rem;
}

.btn-primary {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #020617;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #020617;
}

.btn-outline-light {
  border-color: #475569;
  color: var(--text-secondary);
}

.btn-outline-light:hover,
.btn-outline-light:focus {
  background: rgba(71, 85, 105, 0.3);
  border-color: #475569;
  color: var(--text-primary);
}

.label,
.text-secondary {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.value,
.text-primary {
  color: var(--text-primary);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-group .form-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.card-header {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.05rem;
  background: transparent;
  border: 0;
  padding: 0;
  margin-bottom: 0.5rem;
}

.form-control {
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  color: #f1f5f9;
  box-shadow: none;
  width: 100%;
  display: block;
  box-sizing: border-box;
  min-height: 48px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

.form-control:focus {
  background-color: var(--input-bg);
  border-color: var(--accent-2);
  color: #f1f5f9;
  box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.15);
}

.form-control::placeholder {
  color: #64748b;
}

@keyframes rise {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
