/* ============================================================
   ИСКБ — HUD Command Center Theme
   ============================================================ */

:root {
  --bg-0: #03060f;
  --bg-1: #0a1628;
  --bg-panel: rgba(0, 229, 255, 0.04);
  --bg-panel-2: rgba(10, 22, 40, 0.65);

  --cyan: #00e5ff;
  --cyan-dim: rgba(0, 229, 255, 0.35);
  --blue: #2196f3;
  --red: #ff2d55;
  --amber: #ffb300;
  --green: #00e676;

  --text: #d6ecf5;
  --text-dim: #7d99b0;
  --text-mute: #4a6478;

  --border: rgba(0, 229, 255, 0.25);
  --border-strong: rgba(0, 229, 255, 0.55);

  --glow-cyan: 0 0 12px rgba(0, 229, 255, 0.35), 0 0 24px rgba(0, 229, 255, 0.12);
  --glow-red: 0 0 12px rgba(255, 45, 85, 0.5), 0 0 24px rgba(255, 45, 85, 0.2);

  --font-display: 'Orbitron', 'Rajdhani', sans-serif;
  --font-ui: 'Rajdhani', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --cut: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(0,229,255,0.08), transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(33,150,243,0.08), transparent 60%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
  color: var(--text);
  font-family: var(--font-ui);
  min-height: 100vh;
  overflow-x: hidden;
  letter-spacing: 0.02em;
}

.grid-bg {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(0,229,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}

.scanlines {
  position: fixed; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,229,255,0.025) 0 1px, transparent 1px 3px);
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
}

/* ============================================================
   HEADER
   ============================================================ */
.hud-header {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(0,229,255,0.05), transparent);
}

.hud-header__center { text-align: center; }
.brand {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 0.4em;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(0,229,255,0.55), 0 0 32px rgba(0,229,255,0.25);
}
.brand__sub {
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 0.45em;
  color: var(--text-dim);
  margin-top: 2px;
  text-transform: uppercase;
}
.brand__decor {
  display: flex; justify-content: center; gap: 8px; margin-top: 8px;
}
.brand__decor span {
  width: 40px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0.7;
}
.brand__decor span:nth-child(2) { width: 80px; }

.hud-header__side { display: flex; align-items: center; gap: 14px; }
.hud-header__right { justify-content: flex-end; }

.clock {
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  padding: 10px 16px;
  background: var(--bg-panel-2);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  box-shadow: var(--glow-cyan);
}
.clock__time { font-size: 22px; color: var(--cyan); font-weight: 500; letter-spacing: 0.15em; }
.clock__date { font-size: 11px; color: var(--text-dim); letter-spacing: 0.2em; }

.status-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.status-pill--ok { border-color: rgba(0,230,118,0.45); box-shadow: 0 0 12px rgba(0,230,118,0.25); }
.status-pill--warn { border-color: rgba(255,179,0,0.45); box-shadow: 0 0 12px rgba(255,179,0,0.25); }
.status-pill__label { font-size: 9px; letter-spacing: 0.25em; color: var(--text-mute); }
.status-pill__value { font-family: var(--font-display); font-size: 14px; font-weight: 700; letter-spacing: 0.15em; }
.status-pill--ok .status-pill__value { color: var(--green); }
.status-pill--warn .status-pill__value { color: var(--amber); }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot--green { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot--amber { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.dot--red { background: var(--red); box-shadow: 0 0 8px var(--red); }
.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.threat-bars { display: flex; gap: 3px; margin-top: 4px; }
.threat-bars .bar {
  width: 10px; height: 5px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,179,0,0.3);
}
.threat-bars .bar.on { background: var(--amber); box-shadow: 0 0 6px var(--amber); }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.dashboard {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 24px;
  padding: 24px 28px 100px;
  max-width: 1920px;
  margin: 0 auto;
}

.column { display: flex; flex-direction: column; gap: 18px; }

.module-title {
  display: flex; align-items: center; gap: 14px;
  padding: 6px 4px;
}
.module-title h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--cyan);
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(0,229,255,0.4);
}
.module-title__bar {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

/* ============================================================
   PANEL
   ============================================================ */
.panel {
  position: relative;
  background: var(--bg-panel);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  clip-path: polygon(
    var(--cut) 0,
    100% 0,
    100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%,
    0 100%,
    0 var(--cut)
  );
  padding: 16px 18px;
  box-shadow: var(--glow-cyan), inset 0 0 30px rgba(0,229,255,0.03);
}
.panel::before, .panel::after {
  content: ''; position: absolute; width: 18px; height: 18px;
  border: 1px solid var(--cyan); opacity: 0.6;
}
.panel::before { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.panel::after { bottom: -1px; left: -1px; border-right: none; border-top: none; }

.panel--row { padding: 14px 18px; }

.panel__header {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 10px; margin-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}
.panel__ico { color: var(--cyan); font-size: 14px; }
.panel__title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--cyan);
  flex: 1;
}
.panel__id, .panel__live {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.2em;
}
.panel__live { display: flex; align-items: center; gap: 6px; color: var(--red); }

/* ============================================================
   CANDIDATE
   ============================================================ */
.candidate { display: flex; gap: 18px; align-items: stretch; }
.candidate__avatar {
  border: 1px solid var(--border);
  padding: 6px;
  background: rgba(0,0,0,0.3);
}
.candidate__fields { flex: 1; display: grid; gap: 8px; align-content: center; }
.field {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13px;
  border-bottom: 1px dotted rgba(0,229,255,0.12);
  padding-bottom: 4px;
}
.field span { color: var(--text-dim); letter-spacing: 0.1em; text-transform: uppercase; font-size: 11px; }
.field b { color: var(--text); font-weight: 600; font-family: var(--font-mono); font-size: 12px; }

/* ============================================================
   FOOTPRINT
   ============================================================ */
.footprint { list-style: none; display: grid; gap: 6px; max-height: 240px; overflow-y: auto; padding-right: 4px; }
.footprint::-webkit-scrollbar { width: 4px; }
.footprint::-webkit-scrollbar-thumb { background: var(--cyan-dim); }
.footprint li {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  background: rgba(0,229,255,0.03);
  border-left: 2px solid var(--cyan);
  font-size: 12px;
  transition: background 0.2s;
}
.footprint li:hover { background: rgba(0,229,255,0.08); }
.fp-ico { width: 22px; text-align: center; }
.fp-ico--red { color: var(--red); }
.fp-text { flex: 1; color: var(--text); letter-spacing: 0.05em; }
.fp-time { font-family: var(--font-mono); color: var(--text-mute); font-size: 11px; }

/* ============================================================
   GAUGE
   ============================================================ */
.gauge { text-align: center; }
.gauge__legend {
  display: flex; justify-content: center; gap: 18px;
  font-size: 10px; color: var(--text-dim); letter-spacing: 0.2em; margin-top: 6px;
}
.gauge__legend i {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 4px; vertical-align: middle;
}

/* ============================================================
   PSYCHO
   ============================================================ */
.psycho { display: grid; grid-template-columns: 140px 1fr; gap: 14px; align-items: center; }
.psycho__brain { text-align: center; }
.psycho__label {
  font-family: var(--font-display);
  font-size: 10px; letter-spacing: 0.25em; color: var(--cyan); margin-top: 4px;
}
.psycho__radar svg { width: 100%; height: auto; max-height: 240px; }

.alerts { display: grid; gap: 6px; margin-top: 12px; }
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 45, 85, 0.08);
  border: 1px solid rgba(255,45,85,0.35);
  border-left-width: 3px;
  font-size: 12px;
  font-family: var(--font-display);
  letter-spacing: 0.2em;
  color: #ff8095;
}
.alert__ico { color: var(--red); }
.alert--strong { background: rgba(255,45,85,0.18); color: #fff; box-shadow: var(--glow-red); animation: pulse 2s infinite; }

/* ============================================================
   INN FORM
   ============================================================ */
.inn-form { width: 100%; }
.inn-label {
  display: block;
  font-family: var(--font-display);
  font-size: 11px; letter-spacing: 0.3em; color: var(--text-dim);
  margin-bottom: 6px;
}
.inn-controls { display: flex; gap: 10px; }
#inn-input {
  flex: 1;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 16px;
  padding: 10px 14px;
  letter-spacing: 0.15em;
  outline: none;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
#inn-input:focus { border-color: var(--cyan); box-shadow: var(--glow-cyan); }

.btn {
  cursor: pointer;
  background: linear-gradient(180deg, rgba(0,229,255,0.25), rgba(0,229,255,0.08));
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.3em;
  padding: 10px 22px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: all 0.2s;
  box-shadow: var(--glow-cyan);
}
.btn:hover { background: rgba(0,229,255,0.35); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: wait; }

.select {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.2em;
  padding: 10px 14px;
  outline: none;
  cursor: pointer;
}

/* ============================================================
   GRAPH
   ============================================================ */
.panel--graph { padding-bottom: 12px; }
.graph-wrap { position: relative; background: rgba(0,0,0,0.35); border: 1px solid rgba(0,229,255,0.15); margin-top: 4px; }
#graph-svg { display: block; }

.graph-tooltip {
  position: absolute;
  background: rgba(3,6,15,0.95);
  border: 1px solid var(--cyan);
  padding: 8px 12px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text);
  pointer-events: none;
  box-shadow: var(--glow-cyan);
  z-index: 10;
}

.graph-loader {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(3,6,15,0.7);
  z-index: 5;
}
.scan-line {
  width: 80%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 12px var(--cyan);
  animation: scan 1.6s infinite;
}
.loader-text {
  margin-top: 16px;
  font-family: var(--font-display);
  letter-spacing: 0.35em;
  color: var(--cyan);
  font-size: 12px;
}
@keyframes scan {
  0% { transform: translateY(-100px); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateY(100px); opacity: 0; }
}

.graph-legend {
  display: flex; flex-wrap: wrap; gap: 16px;
  padding: 10px 4px 0;
  font-size: 11px; color: var(--text-dim); letter-spacing: 0.1em;
}
.graph-legend .lg {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: middle;
}
.lg--main { background: var(--blue); box-shadow: 0 0 8px var(--blue); }
.lg--company { background: #4a8ed4; }
.lg--person { background: #8fb8d0; }
.lg--mass { background: var(--red); box-shadow: 0 0 8px var(--red); }
.lg-line { display: inline-block; width: 22px; height: 0; vertical-align: middle; margin-right: 6px; }
.lg-line--solid { border-top: 2px solid var(--cyan); }
.lg-line--dashed { border-top: 2px dashed rgba(150,180,200,0.6); }

/* ============================================================
   PROBABILITY
   ============================================================ */
.prob { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.prob__num {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 900;
  color: var(--red);
  text-shadow: var(--glow-red);
  line-height: 1;
}
.prob__num span { font-size: 24px; color: var(--text-dim); margin-left: 4px; }
.prob__bar { position: relative; }
.prob__bar::before {
  content: ''; display: block;
  height: 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
}
.prob__fill {
  position: absolute; top: 1px; left: 1px; height: 16px;
  background: linear-gradient(90deg, var(--green), var(--amber) 50%, var(--red));
  box-shadow: 0 0 12px rgba(255,45,85,0.5);
  transition: width 1.2s ease;
}
.prob__ticks {
  display: flex; justify-content: space-between;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 10px; color: var(--text-mute);
}

/* ============================================================
   RISK SIGNS
   ============================================================ */
.risk-signs { list-style: none; display: grid; gap: 6px; }
.risk-signs li {
  position: relative;
  padding: 7px 10px 7px 26px;
  background: rgba(255,45,85,0.06);
  border-left: 2px solid var(--red);
  font-size: 13px;
}
.risk-signs li::before {
  content: '●';
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--red);
  text-shadow: 0 0 6px var(--red);
}

/* ============================================================
   SOURCES TABLE
   ============================================================ */
.sources { width: 100%; border-collapse: collapse; font-size: 12px; }
.sources th {
  text-align: left;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--text-dim);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.sources td {
  padding: 8px 10px;
  border-bottom: 1px dotted rgba(0,229,255,0.1);
  font-family: var(--font-mono);
}
.sources td.ok { color: var(--green); }
.sources td.warn { color: var(--amber); }

/* ============================================================
   TAB BAR
   ============================================================ */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: center; gap: 4px;
  padding: 8px 20px;
  background: linear-gradient(180deg, transparent, var(--bg-0));
  border-top: 1px solid var(--border);
  backdrop-filter: blur(8px);
  z-index: 5;
}
.tab {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 10px; letter-spacing: 0.2em;
  padding: 8px 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.tab__ico { font-size: 16px; }
.tab:hover { color: var(--cyan); }
.tab--active {
  color: var(--cyan);
  border-color: var(--border);
  background: rgba(0,229,255,0.08);
  box-shadow: var(--glow-cyan);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.badge {
  position: absolute; top: 2px; right: 2px;
  font-size: 9px; padding: 1px 5px; border-radius: 8px;
  font-family: var(--font-mono);
}
.badge--red { background: var(--red); color: #fff; box-shadow: 0 0 6px var(--red); }
.badge--amber { background: var(--amber); color: #000; }

/* ============================================================
   GRAPH NODES STYLES (SVG)
   ============================================================ */
.node circle { cursor: pointer; transition: filter 0.2s; }
.node:hover circle { filter: brightness(1.3); }
.node text {
  font-family: var(--font-ui);
  font-size: 10px;
  fill: var(--text);
  pointer-events: none;
  letter-spacing: 0.05em;
}
.link { stroke-opacity: 0.6; }
.link--solid { stroke: var(--cyan); stroke-width: 1.2; }
.link--dashed { stroke: #8fb8d0; stroke-dasharray: 4 3; stroke-width: 1; opacity: 0.5; }
.link--red { stroke: var(--red); stroke-width: 1.5; filter: drop-shadow(0 0 4px var(--red)); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1279px) {
  .dashboard { grid-template-columns: 1fr; }
  .hud-header { grid-template-columns: 1fr; gap: 14px; }
  .hud-header__side { justify-content: center; }
  .brand { font-size: 32px; }
}
