/* ============================================================
   NEXUS CONTROL — Institutional finance theme
   Clean, trustworthy, slightly premium. Bootstrap 5 overrides.
   ============================================================ */

:root {
  --nx-navy: #0d1b2e;
  --nx-navy-2: #14263f;
  --nx-accent: #2f6fed;
  --nx-gold: #c9a227;
  --nx-bg: #f4f6fa;
}

html, body { height: 100%; }

.nx-body {
  background: var(--nx-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

main { flex: 1 0 auto; }

/* ---- Navbar ---- */
.nx-navbar {
  background: linear-gradient(90deg, var(--nx-navy) 0%, var(--nx-navy-2) 100%);
  border-bottom: 2px solid var(--nx-gold);
}
.nx-navbar .nav-link { color: rgba(255, 255, 255, 0.75); border-radius: 6px; }
.nx-navbar .nav-link:hover { color: #fff; }
.nx-navbar .nav-link.active { color: #fff; background: rgba(255, 255, 255, 0.12); }
.nx-logo { color: var(--nx-gold); font-size: 1.35rem; line-height: 1; }
.nx-tagline { color: rgba(255, 255, 255, 0.55); font-weight: 400; font-size: 0.75rem; }

/* ---- Footer ---- */
.nx-footer {
  background: var(--nx-navy);
  color: rgba(255, 255, 255, 0.65);
  border-top: 2px solid var(--nx-gold);
}
.nx-footer .text-muted { color: rgba(255, 255, 255, 0.4) !important; }

/* ---- Auth screens ---- */
.nx-auth-wrap { min-height: calc(100vh - 120px); padding: 2rem 1rem; }
.nx-auth-card { width: 100%; max-width: 440px; border-radius: 14px; }
.nx-auth-logo {
  width: 64px; height: 64px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px; font-size: 2rem; color: #fff;
  background: linear-gradient(135deg, var(--nx-navy) 0%, var(--nx-accent) 100%);
}

/* ---- Cards / stats ---- */
.card { border: 1px solid #e3e8f0; border-radius: 10px; }
.card-header { background: #fff; font-weight: 600; border-bottom: 1px solid #eef1f6; }
.nx-stat-card { transition: transform 0.12s ease, box-shadow 0.12s ease; }
.nx-stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(13, 27, 46, 0.08); }
.nx-stat-icon {
  width: 46px; height: 46px; flex: 0 0 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; font-size: 1.3rem;
}
.nx-stat-value { font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
.nx-stat-label { font-size: 0.78rem; color: #6b7a90; text-transform: uppercase; letter-spacing: 0.04em; }

.nx-badge-live { background: #e7f5ee; color: #157347; font-weight: 600; padding: 0.5rem 0.8rem; }

/* ---- Tables ---- */
.nx-table thead th {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: #6b7a90; background: #f8fafc; border-bottom: 1px solid #e3e8f0;
}
.nx-reason { max-width: 340px; }
.nx-vol-bar { width: 70px; height: 6px; }

/* ---- Status / event badges ---- */
.nx-status-pending       { background: #fff3cd; color: #8a6d1a; }
.nx-status-approved      { background: #d1e7dd; color: #146c43; }
.nx-status-auto_approved { background: #cfe2ff; color: #1f4fa8; }
.nx-status-rejected      { background: #f8d7da; color: #a02734; }
.nx-status-blocked       { background: #e2e3e5; color: #495057; }

.nx-action-buy       { background: #d1e7dd; color: #146c43; }
.nx-action-sell      { background: #f8d7da; color: #a02734; }
.nx-action-rebalance { background: #cfe2ff; color: #1f4fa8; }
.nx-action-transfer  { background: #e7dcf5; color: #5d3d92; }

.nx-event-badge { font-weight: 600; text-transform: capitalize; }
.nx-event-agent_run            { background: #cfe2ff; color: #1f4fa8; }
.nx-event-proposal_created     { background: #fff3cd; color: #8a6d1a; }
.nx-event-policy_check         { background: #e7f5ee; color: #157347; }
.nx-event-policy_block         { background: #f8d7da; color: #a02734; }
.nx-event-action_approved      { background: #d1e7dd; color: #146c43; }
.nx-event-action_auto_approved { background: #cfe2ff; color: #1f4fa8; }
.nx-event-action_rejected      { background: #f8d7da; color: #a02734; }
.nx-event-portfolio_update     { background: #e7dcf5; color: #5d3d92; }
.nx-event-settings_change      { background: #e2e3e5; color: #495057; }
.nx-event-simulation_reset     { background: #ffe5d0; color: #a05a1c; }
.nx-event-auth                 { background: #e2e3e5; color: #495057; }

/* ---- Audit reasoning callout ---- */
.nx-reasoning {
  background: #f8fafc; border-left: 3px solid var(--nx-gold);
  padding: 0.5rem 0.75rem; border-radius: 0 6px 6px 0; color: #4a5568;
}

/* ---- Policies ---- */
.nx-policy-global { border: 1px solid var(--nx-accent); box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.08); }

/* ---- Empty states ---- */
.nx-empty { color: #8b98ab; }
.nx-empty i { color: #c4cddb; }

/* ---- Run-agent inline results ---- */
.nx-run-result { font-size: 0.8rem; border-radius: 8px; padding: 0.6rem 0.75rem; }
.nx-run-result.ok { background: #e7f5ee; color: #157347; }
.nx-run-result.warn { background: #fff3cd; color: #8a6d1a; }
.nx-run-result.err { background: #f8d7da; color: #a02734; }

/* ---- Pills ---- */
.nx-pills .nav-link { font-size: 0.85rem; padding: 0.35rem 0.8rem; }
