/* Netrion "Jarvis HUD" theme — same dark navy / cyan-accent visual identity
   used by Kestrion and Satrion (ported from their index.css token set), applied
   on top of Bootstrap 5.3 so Netrion reads as the same product family.
   Load this AFTER bootstrap.min.css in every template. */

:root {
  --hud-bg: #04080c;
  --hud-panel: #0a121a;
  --hud-panel2: #0f1d28;
  --hud-border: #1c4a5c;
  --hud-accent: #00e5ff;
  --hud-red: #ff3b30;
  --hud-yellow: #ffb300;
  --hud-blue: #5e9cff;
  --hud-purple: #b388ff;
  --hud-on-accent: #04141a;
  --hud-on-danger: #1a0505;
  --hud-status-info-bg: #124e78;
  --hud-status-info-fg: #eafdff;
  --hud-status-watch-bg: #005f73;
  --hud-status-watch-fg: #eafdff;
  --hud-status-moderate-bg: #5a3d82;
  --hud-status-moderate-fg: #eafdff;
  --hud-text: #aee0f0;
  /* Secondary copy must remain readable on both panel surfaces. */
  --hud-dim: #73a6b8;
  --hud-white: #eafdff;
  --hud-profit: #00e676;

  color-scheme: dark;

  --bs-body-bg: var(--hud-bg);
  --bs-body-color: var(--hud-text);
  --bs-border-color: var(--hud-border);
  --bs-primary: var(--hud-accent);
  --bs-primary-rgb: 0, 229, 255;
  --bs-secondary: var(--hud-dim);
  --bs-secondary-rgb: 74, 125, 143;
  --bs-success: var(--hud-profit);
  --bs-success-rgb: 0, 230, 118;
  --bs-danger: var(--hud-red);
  --bs-danger-rgb: 255, 59, 48;
  --bs-warning: var(--hud-yellow);
  --bs-warning-rgb: 255, 179, 0;
  --bs-info: var(--hud-blue);
  --bs-info-rgb: 94, 156, 255;
  --bs-light: var(--hud-panel2);
  --bs-light-rgb: 15, 29, 40;
  --bs-dark: var(--hud-bg);
  --bs-dark-rgb: 4, 8, 12;
  --bs-link-color: var(--hud-accent);
  --bs-link-hover-color: var(--hud-white);
  --bs-emphasis-color: var(--hud-white);
  --bs-secondary-bg: var(--hud-panel2);
  --bs-tertiary-bg: var(--hud-panel);
  --bs-secondary-color: var(--hud-dim);
  --bs-white: var(--hud-panel2);
  --bs-white-rgb: 15, 29, 40;

  /* "-subtle" utility variants (bg-success-subtle, border-danger-subtle, etc.) */
  --bs-success-bg-subtle: rgba(0, 230, 118, 0.12);
  --bs-success-border-subtle: rgba(0, 230, 118, 0.35);
  --bs-success-text-emphasis: var(--hud-profit);
  --bs-danger-bg-subtle: rgba(255, 59, 48, 0.12);
  --bs-danger-border-subtle: rgba(255, 59, 48, 0.35);
  --bs-danger-text-emphasis: var(--hud-red);
  --bs-warning-bg-subtle: rgba(255, 179, 0, 0.12);
  --bs-warning-border-subtle: rgba(255, 179, 0, 0.35);
  --bs-warning-text-emphasis: var(--hud-yellow);
  --bs-info-bg-subtle: rgba(41, 121, 255, 0.12);
  --bs-info-border-subtle: rgba(41, 121, 255, 0.35);
  --bs-info-text-emphasis: var(--hud-blue);
  --bs-primary-bg-subtle: rgba(0, 229, 255, 0.12);
  --bs-primary-border-subtle: rgba(0, 229, 255, 0.35);
  --bs-primary-text-emphasis: var(--hud-accent);
  --bs-secondary-bg-subtle: var(--hud-panel2);
  --bs-secondary-border-subtle: var(--hud-border);
  --bs-secondary-text-emphasis: var(--hud-dim);
  --bs-light-bg-subtle: var(--hud-panel2);
  --bs-light-border-subtle: var(--hud-border);
  --bs-dark-bg-subtle: var(--hud-bg);
  --bs-dark-border-subtle: var(--hud-border);
}

body {
  background: var(--hud-bg) !important;
  color: var(--hud-text);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--hud-bg); }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--hud-accent) 40%, transparent); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--hud-accent); }

/* Surfaces */
.card, .navbar, .list-group-item, .modal-content, .dropdown-menu, .offcanvas {
  background-color: var(--hud-panel);
  color: var(--hud-text);
  border-color: var(--hud-border);
}
.card-header, .card-footer { background-color: var(--hud-panel2) !important; border-color: var(--hud-border); }
.dropdown-item { color: var(--hud-text); }
.dropdown-item:hover, .dropdown-item:focus { background-color: var(--hud-panel2); color: var(--hud-white); }

/* Tables */
.table {
  color: var(--hud-text);
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(174, 224, 240, 0.04);
  --bs-table-hover-bg: rgba(0, 229, 255, 0.06);
  border-color: var(--hud-border);
}
.table > :not(caption) > * > * { border-bottom-color: var(--hud-border); }
.table-light, thead.table-light, .table > thead {
  background-color: var(--hud-panel2) !important;
  color: var(--hud-dim) !important;
}

/* Forms */
.form-control, .form-select {
  background-color: var(--hud-panel2);
  border-color: var(--hud-border);
  color: var(--hud-white);
}
.form-control:focus, .form-select:focus {
  background-color: var(--hud-panel2);
  border-color: var(--hud-accent);
  color: var(--hud-white);
  box-shadow: 0 0 0 0.2rem rgba(0, 229, 255, 0.15);
}
.form-control::placeholder { color: var(--hud-dim); opacity: 1; }
.form-control:disabled, .form-select:disabled { background-color: var(--hud-panel); color: var(--hud-dim); }
.form-check-input { background-color: var(--hud-panel2); border-color: var(--hud-border); }
.form-check-input:checked { background-color: var(--hud-accent); border-color: var(--hud-accent); }
.input-group-text { background-color: var(--hud-panel2); border-color: var(--hud-border); color: var(--hud-dim); }

/* Buttons */
.btn-primary, .btn-accent {
  background: var(--hud-accent);
  border-color: var(--hud-accent);
  color: var(--hud-on-accent);
  font-weight: 600;
}
.btn-primary:hover, .btn-primary:focus, .btn-accent:hover {
  background: color-mix(in srgb, var(--hud-accent) 85%, white);
  border-color: var(--hud-accent);
  color: var(--hud-on-accent);
}
.btn-outline-primary { color: var(--hud-accent); border-color: var(--hud-accent); }
.btn-outline-primary:hover { background: var(--hud-accent); color: var(--hud-on-accent); }
.btn-outline-secondary { color: var(--hud-dim); border-color: var(--hud-border); }
.btn-outline-secondary:hover { background: var(--hud-panel2); color: var(--hud-white); border-color: var(--hud-dim); }
.btn-outline-danger { color: var(--hud-red); border-color: var(--hud-red); }
.btn-outline-danger:hover { background: var(--hud-red); color: #1a0505; }
.btn-outline-warning { color: var(--hud-yellow); border-color: var(--hud-yellow); }
.btn-outline-warning:hover { background: var(--hud-yellow); color: #1a1300; }
.btn-outline-light-soft { border: 1px solid var(--hud-border); color: var(--hud-white); font-weight: 500; }
.btn-outline-light-soft:hover { background: rgba(0, 229, 255, 0.08); color: var(--hud-white); }

/* Badges */
.badge.bg-primary { background-color: var(--hud-accent) !important; color: var(--hud-on-accent) !important; }
.badge.bg-success { background-color: var(--hud-profit) !important; color: #04140a !important; }
.badge.bg-danger { background-color: var(--hud-red) !important; color: var(--hud-on-danger) !important; }
.badge.bg-warning { background-color: var(--hud-yellow) !important; color: #1a1300 !important; }
.badge.bg-secondary { background-color: var(--hud-panel2) !important; color: var(--hud-dim) !important; border: 1px solid var(--hud-border); }
.badge.bg-info { background-color: var(--hud-status-info-bg) !important; color: var(--hud-status-info-fg) !important; }
.badge.bg-light { background-color: var(--hud-panel2) !important; color: var(--hud-dim) !important; }

/* Semantic indication labels shared by dashboard, screener, and issuer views. */
.risk-level--critical {
  background: var(--hud-red) !important;
  color: var(--hud-on-danger) !important;
}
.risk-level--high {
  background: var(--hud-yellow) !important;
  color: #1a1300 !important;
}
.risk-level--moderate {
  background: var(--hud-status-moderate-bg) !important;
  color: var(--hud-status-moderate-fg) !important;
}
.risk-level--watch {
  background: var(--hud-status-watch-bg) !important;
  color: var(--hud-status-watch-fg) !important;
}
.risk-level--normal {
  background: var(--hud-panel2) !important;
  color: var(--hud-text) !important;
  border: 1px solid var(--hud-border);
}

/* Alerts */
.alert { border: 1px solid var(--hud-border); background-color: var(--hud-panel2); color: var(--hud-text); }
.alert-primary { background-color: rgba(0, 229, 255, 0.08); border-color: rgba(0, 229, 255, 0.35); color: var(--hud-accent); }
.alert-success { background-color: rgba(0, 230, 118, 0.08); border-color: rgba(0, 230, 118, 0.35); color: var(--hud-profit); }
.alert-danger { background-color: rgba(255, 59, 48, 0.08); border-color: rgba(255, 59, 48, 0.35); color: var(--hud-red); }
.alert-warning { background-color: rgba(255, 179, 0, 0.08); border-color: rgba(255, 179, 0, 0.35); color: var(--hud-yellow); }
.alert-info { background-color: rgba(41, 121, 255, 0.08); border-color: rgba(41, 121, 255, 0.35); color: var(--hud-blue); }
.alert-light { background-color: var(--hud-panel2); border-color: var(--hud-border); color: var(--hud-dim); }
.alert-link { color: var(--hud-accent); font-weight: 700; }

/* Nav pills / tabs */
.nav-pills .nav-link { color: var(--hud-dim); }
.nav-pills .nav-link.active { background: var(--hud-accent); color: #04141a; }

/* Text utilities */
.text-muted, .text-secondary { color: var(--hud-dim) !important; }
/* .text-dark is intentionally left at Bootstrap's default (resolves dark via
   --bs-dark-rgb above) — it's used to keep ink dark on bright chips like
   bg-warning/bg-light, which would be unreadable if forced light here. Spots
   that use text-dark for plain emphasis text on the dark page background are
   fixed at the call site instead. */
.text-primary { color: var(--hud-accent) !important; }
.text-success { color: var(--hud-profit) !important; }
.text-danger { color: var(--hud-red) !important; }
.text-warning { color: var(--hud-yellow) !important; }
.text-info { color: var(--hud-blue) !important; }

a { color: var(--hud-accent); }
a:hover { color: var(--hud-white); }

hr { border-color: var(--hud-border); opacity: 1; }
code { color: var(--hud-accent); background: var(--hud-panel2); padding: 1px 5px; border-radius: 4px; }

.spinner-border, .spinner-border-sm { color: var(--hud-accent); }

.shadow, .shadow-sm { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important; }

.progress { background-color: var(--hud-panel2); }

/* Stock codes / numeric identifiers read as mono, matching the desktop app's HUD */
.mono, .kode { font-family: Consolas, "Courier New", monospace; }
