/* ============================================================
   NexoVision Dashboard — Dark Finance Theme
   ============================================================ */

:root {
  --bg-900:    #0b1120;
  --bg-800:    #0f172a;
  --bg-700:    #1e293b;
  --bg-600:    #263246;
  --bg-card:   #141c2e;
  --border:    #1e293b;
  --border-lg: #2d3f55;
  --text-1:    #f1f5f9;
  --text-2:    #94a3b8;
  --text-3:    #475569;
  --primary:   #3b82f6;
  --primary-d: #2563eb;
  --success:   #22c55e;
  --danger:    #ef4444;
  --warning:   #eab308;
  --info:      #38bdf8;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }

body {
  background: var(--bg-900);
  color: var(--text-1);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  font-size: 14px;
}

.bg-dark-900 { background: var(--bg-900) !important; }

/* ============================================================
   NAVBAR
   ============================================================ */
.nv-navbar {
  background: var(--bg-800) !important;
  border-bottom: 1px solid var(--border);
  min-height: 52px;
}
.nv-navbar .navbar-brand { font-size: 18px; letter-spacing: -0.5px; }
.nv-navbar .nav-link {
  color: var(--text-2) !important;
  font-size: 13px;
  padding: 6px 10px !important;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.nv-navbar .nav-link:hover,
.nv-navbar .nav-link.active {
  color: var(--text-1) !important;
  background: var(--bg-700);
}

/* ============================================================
   CARDS
   ============================================================ */
.nv-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.nv-card-header {
  background: var(--bg-700);
  border-bottom: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
}
.nv-card-kpi {
  text-align: center;
  padding: 14px 10px;
}
.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-2);
  margin-bottom: 4px;
}
.kpi-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-1);
}

/* ============================================================
   TABLE
   ============================================================ */
.nv-table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: rgba(59,130,246,0.07);
  font-size: 13px;
}
.nv-table thead tr th {
  background: var(--bg-700) !important;
  color: var(--text-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-lg) !important;
  padding: 10px 12px;
  white-space: nowrap;
}
.nv-table tbody tr td {
  border-bottom: 1px solid rgba(30,41,59,0.6) !important;
  padding: 9px 12px;
  vertical-align: middle;
}
.nv-table tbody tr:last-child td { border-bottom: none !important; }
.nv-table tbody tr:hover td { background: rgba(59,130,246,0.05) !important; }

/* Rank badge */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}
.rank-1 { background: linear-gradient(135deg,#f59e0b,#d97706); color:#000; }
.rank-2 { background: linear-gradient(135deg,#94a3b8,#64748b); color:#000; }
.rank-3 { background: linear-gradient(135deg,#cd7c3c,#92400e); color:#fff; }
.rank-other { background: var(--bg-700); color: var(--text-2); }

/* Score badge */
.score-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 12px;
}
.score-high   { background: rgba(34,197,94,0.15);  color: #22c55e; border:1px solid rgba(34,197,94,0.3); }
.score-medium { background: rgba(234,179,8,0.15);  color: #eab308; border:1px solid rgba(234,179,8,0.3); }
.score-low    { background: rgba(239,68,68,0.15);  color: #ef4444; border:1px solid rgba(239,68,68,0.3); }

/* Signal badges */
.signal-badge {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 4px;
  font-weight: 600;
}
.signal-bullish     { background: rgba(34,197,94,0.15);  color:#22c55e; }
.signal-bearish     { background: rgba(239,68,68,0.15);  color:#ef4444; }
.signal-neutral     { background: rgba(148,163,184,0.15);color:var(--text-2); }

/* ============================================================
   SCORE CIRCLE (asset detail)
   ============================================================ */
.score-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  border: 3px solid;
}
.score-circle[data-score] { border-color: var(--primary); color: var(--primary); }

/* ============================================================
   INDICATOR CARDS
   ============================================================ */
.indicator-card {
  background: var(--bg-700);
  border: 1px solid var(--border-lg);
  border-radius: 8px;
  padding: 10px 12px;
}
.indicator-name {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-2);
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.indicator-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
}
.indicator-bar {
  height: 4px;
  background: var(--bg-600);
  border-radius: 2px;
  overflow: hidden;
}
.indicator-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.indicator-score-label {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ============================================================
   SVP
   ============================================================ */
.svp-section {
  background: var(--bg-700);
  border: 1px solid var(--border-lg);
  border-radius: 8px;
}
.svp-score-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  border: 2px solid;
  flex-shrink: 0;
}
.svp-positive { border-color: var(--success); color: var(--success); }
.svp-negative { border-color: var(--danger);  color: var(--danger); }
.svp-neutral  { border-color: var(--text-3);  color: var(--text-2); }

/* ============================================================
   SIMULATION RESULTS
   ============================================================ */
.sim-result-card {
  background: var(--bg-700);
  border: 1px solid var(--border-lg);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
}
.sim-result-card.small-card { padding: 8px 10px; }
.sim-result-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-2);
  letter-spacing: 0.3px;
  margin-bottom: 3px;
}
.sim-result-value {
  font-size: 16px;
  font-weight: 700;
}
.sim-result-card.small-card .sim-result-value { font-size: 14px; }

/* ============================================================
   NEWS
   ============================================================ */
.news-item { padding: 10px 14px; }
.news-headline {
  color: var(--text-1);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
  flex: 1;
}
.news-headline:hover { color: var(--primary); }
.news-meta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}
.sentiment-badge {
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}
.sentiment-badge.positive { color: var(--success); }
.sentiment-badge.negative { color: var(--danger); }
.sentiment-badge.neutral  { color: var(--text-3); }

/* ============================================================
   MACRO BAR
   ============================================================ */
.nv-macro-bar {
  background: rgba(234,179,8,0.1);
  border: 1px solid rgba(234,179,8,0.3);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: #fde68a;
}

/* ============================================================
   IMPACT BADGES (macro)
   ============================================================ */
.impact-badge {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.impact-high   { color: var(--danger); }
.impact-medium { color: var(--warning); }
.impact-low    { color: var(--text-2); }

/* Table subtle row tints */
.table-danger-subtle  td { background: rgba(239,68,68,0.04) !important; }
.table-warning-subtle td { background: rgba(234,179,8,0.04) !important; }

/* ============================================================
   FORMS / INPUTS
   ============================================================ */

/* Override Bootstrap .text-muted su sfondo scuro */
.text-muted { color: var(--text-2) !important; }

/* Etichette form — leggibili sul tema scuro */
.form-label {
  color: var(--text-2) !important;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 5px;
}
.form-text { color: var(--text-3) !important; font-size: 11px; }

/* Dropdown select Bootstrap su tema scuro */
.form-select {
  background-color: var(--bg-700) !important;
  border-color: var(--border-lg) !important;
  color: var(--text-1) !important;
}
.form-select option {
  background: var(--bg-700);
  color: var(--text-1);
}
.form-check-label { color: var(--text-2) !important; }

.nv-input, .nv-select {
  background: var(--bg-700) !important;
  border: 1px solid var(--border-lg) !important;
  color: var(--text-1) !important;
  border-radius: 7px !important;
}
.nv-input:focus, .nv-select:focus {
  background: var(--bg-600) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.2) !important;
  color: var(--text-1) !important;
}
.nv-input::placeholder { color: var(--text-3) !important; }
.nv-input-icon {
  background: var(--bg-700) !important;
  border: 1px solid var(--border-lg) !important;
  color: var(--text-2) !important;
}

/* ============================================================
   MODALS
   ============================================================ */
.nv-modal {
  background: var(--bg-800) !important;
  border: 1px solid var(--border-lg);
}
.nv-modal .modal-header,
.nv-modal .modal-footer { border-color: var(--border-lg) !important; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-lg);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.login-logo {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
}
.login-title { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }

/* ============================================================
   TICKER BADGE (asset detail)
   ============================================================ */
.ticker-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 8px;
  letter-spacing: 0.5px;
}
.price-display {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-1);
}

/* ============================================================
   REASONS LIST
   ============================================================ */
.reasons-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.reasons-list li {
  padding: 8px 0;
  color: var(--text-1);
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.reasons-list li:last-child { border-bottom: none; }

/* ============================================================
   PROFILE AVATAR
   ============================================================ */
.profile-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-xs {
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 4px;
}
.btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
}
.btn-primary:hover {
  background: var(--primary-d) !important;
  border-color: var(--primary-d) !important;
}

/* ============================================================
   MARKET STATUS BADGES
   ============================================================ */
.market-open  { background: var(--success) !important; }
.market-close { background: var(--text-3)  !important; }

/* ============================================================
   DROPDOWN DARK
   ============================================================ */
.dropdown-menu-dark {
  background: var(--bg-700) !important;
  border: 1px solid var(--border-lg) !important;
}
.dropdown-menu-dark .dropdown-item { color: var(--text-2) !important; font-size: 13px; }
.dropdown-menu-dark .dropdown-item:hover { background: var(--bg-600) !important; color: var(--text-1) !important; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-800); }
::-webkit-scrollbar-thumb { background: var(--bg-600); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-lg); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .kpi-value { font-size: 18px; }
  .price-display { font-size: 22px; }
  .login-card { padding: 28px 20px; margin: 16px; }
}
