/* ================================================================
   Portfolio Dashboard – Custom Styles (dark theme)
   ================================================================ */

:root {
  --color-gain: #00c853;
  --color-loss: #ff1744;
  --color-neutral: #9e9e9e;
  /* Override Bootstrap's muted/secondary color for dark theme */
  --bs-secondary-color: rgba(180, 180, 180, 0.75);
  --bs-body-color: #e0e0e0;
}

/* Force text-muted to be readable on dark background */
.text-muted { color: #aaa !important; }

body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background-color: #121212;
  color: #e0e0e0;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background-color: #1e1e1e;
  border: 1px solid #333;
  border-radius: 12px;
}
.card-header {
  background-color: #262626;
  border-bottom: 1px solid #333;
  color: #e0e0e0 !important;
}
.card-header a,
.card-header .btn {
  color: inherit;
}
.card-body {
  color: #e0e0e0;
}
.card {
  color: #e0e0e0;
}

/* ── Stat cards ─────────────────────────────────────────────── */
.stat-card {
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  background: #1e1e1e;
  border: 1px solid #333;
}
.stat-card .stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
}
.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 0.25rem;
}
.stat-card .stat-sub {
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

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

/* ── Tables ─────────────────────────────────────────────────── */
.table {
  color: #e0e0e0;
}
.table-dark {
  --bs-table-bg: #1e1e1e;
  --bs-table-striped-bg: #252525;
  --bs-table-hover-bg: #2a2a2a;
  --bs-table-border-color: #333;
}
.table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  border-bottom: 1px solid #444;
}
.table td { vertical-align: middle; }

/* ── Form controls ──────────────────────────────────────────── */
.form-control, .form-select {
  background-color: #2a2a2a;
  border-color: #444;
  color: #e0e0e0;
}
.form-control:focus, .form-select:focus {
  background-color: #333;
  border-color: #ffc107;
  color: #fff;
  box-shadow: 0 0 0 0.2rem rgba(255,193,7,.25);
}
.form-control::placeholder { color: #999; }

/* ── Input group addon ──────────────────────────────────────── */
.input-group-text {
  background-color: #3a3a3a;
  border-color: #555;
  color: #ccc;
}

/* ── Nav ────────────────────────────────────────────────────── */
.navbar { padding: 0.5rem 1rem; }
.nav-link.active { color: #ffc107 !important; }

/* ── Badge type colors ──────────────────────────────────────── */
.badge-type {
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ── Chart containers ───────────────────────────────────────── */
.chart-container {
  position: relative;
  width: 100%;
}

/* ── Allocation bar ─────────────────────────────────────────── */
.alloc-bar { height: 8px; border-radius: 4px; background: #333; overflow: hidden; margin-top: 4px; }
.alloc-fill { height: 100%; border-radius: 4px; transition: width .6s ease; }

/* ── Public badge ───────────────────────────────────────────── */
.public-url-box {
  background: #1a2a1a;
  border: 1px solid #198754;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  word-break: break-all;
}
.public-url-box small { color: #81c784 !important; }
.public-url-box code  { color: #c8e6c9 !important; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 576px) {
  .stat-card .stat-value { font-size: 1.2rem; }
  .table { font-size: 0.82rem; }
}
