/* ============================================================
   GORGO COMMAND CENTER — Global Stylesheet
   KORVA Sentinel Brand Kit Conversion  v2.1
   Layout model preserved exactly from v1.0.
   Only colors, fonts, and surface treatments changed.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES
   All original variable names preserved exactly.
   ============================================================ */
:root {
  /* ════════════════════════════════════════════════════════
     CANONICAL KORVA TOKENS — shared with securemywater.site
     One value set for both surfaces. The legacy --hud / --teal
     / --amber names below are now ALIASES that point here, so
     the storefront and Sentinel speak the same design language.
     Edit color values ONLY in this block.
     ════════════════════════════════════════════════════════ */
  --obsidian:    #05091B;
  --obsidian-2:  #080E27;
  --obsidian-3:  #0E1638;
  --obsidian-4:  #111C42;
  --royal:       #123B8F;
  --royal-2:     #1B4FB0;
  --signal:      #0AA6C2;
  --signal-2:    #14C4DD;
  --gold:        #C9A24D;
  --gold-2:      #E0BB6B;   /* aligned to securemywater (was #E0BD68) */
  --gold-dim:    rgba(201, 162, 77, 0.13);
  --white:       #F7F8FF;
  --danger:      #E84545;
  --ok:          #22C77F;
  --text-2:      rgba(247, 248, 255, 0.70);   /* was 0.65 */
  --text-3:      rgba(247, 248, 255, 0.42);   /* was 0.35 */
  --text-4:      rgba(247, 248, 255, 0.22);   /* was 0.15 */
  --line:        rgba(247, 248, 255, 0.07);
  --line-2:      rgba(247, 248, 255, 0.13);
  --line-3:      rgba(247, 248, 255, 0.20);

  /* --- Core Backgrounds (legacy aliases → canonical) --- */
  --hud-bg:        var(--obsidian);
  --hud-panel:     var(--obsidian-2);
  --hud-panel2:    var(--obsidian-3);
  --hud-panel3:    var(--obsidian-4);
  --hud-surface:   #0A1230;

  /* --- Border Colors (legacy aliases) --- */
  --hud-border:    var(--line);
  --hud-border2:   var(--line-2);
  --hud-border3:   var(--line-3);

  /* --- Ocean Signal teal (legacy aliases) --- */
  --teal:          var(--signal);
  --teal-dim:      rgba(10, 166, 194, 0.45);
  --teal-dark:     var(--signal);
  --teal-glow:     rgba(10, 166, 194, 0.07);
  --teal-glow2:    rgba(10, 166, 194, 0.14);

  /* --- Status Colors (legacy aliases) --- */
  --amber:         var(--gold);
  --amber-dim:     rgba(201, 162, 77, 0.55);
  --amber-glow:    rgba(201, 162, 77, 0.09);
  --red:           var(--danger);
  --red-dim:       rgba(232, 69, 69, 0.55);
  --red-glow:      rgba(232, 69, 69, 0.09);
  --green:         var(--ok);
  --green-dim:     rgba(34, 199, 127, 0.55);
  --green-glow:    rgba(34, 199, 127, 0.09);
  --blue:          var(--signal-2);
  --blue-dim:      rgba(20, 196, 221, 0.45);
  --blue-glow:     rgba(20, 196, 221, 0.09);

  /* --- Text Hierarchy (legacy aliases) --- */
  --text-primary:   var(--white);
  --text-secondary: var(--text-2);
  --text-dim:       var(--text-3);
  --text-ghost:     var(--text-4);

  /* --- Typography --- */
  --font-mono:      'JetBrains Mono', 'Courier New', monospace;
  --font-display:   'Outfit', system-ui, sans-serif;
  --font-ui:        'Outfit', system-ui, sans-serif;
  --mono:           'JetBrains Mono', 'Courier New', monospace;
  --disp:           'Outfit', system-ui, sans-serif;
  --body:           'Manrope', system-ui, sans-serif;

  /* --- Layout (original values) --- */
  --topbar-height:  52px;
  --left-nav-width: 210px;
  --right-panel-width: 180px;
  --max:            1320px;                 /* shared with securemywater */
  --gutter:         clamp(20px, 4vw, 48px); /* shared with securemywater */

  /* --- Transitions (original values) --- */
  --t-fast:  0.12s ease;
  --t-med:   0.2s ease;
  --t-slow:  0.35s ease;

  /* --- Scanline --- */
  --scanline: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(201, 162, 77, 0.007) 2px,
    rgba(201, 162, 77, 0.007) 4px
  );

  /* --- Corner Bracket Size --- */
  --corner-size: 16px;
}


/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--hud-bg);
}

body {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

input, textarea {
  font-family: inherit;
  outline: none;
}

::-webkit-scrollbar             { width: 3px; height: 3px; }
::-webkit-scrollbar-track       { background: var(--hud-bg); }
::-webkit-scrollbar-thumb       { background: rgba(201, 162, 77, 0.28); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(201, 162, 77, 0.50); }


/* ============================================================
   HUD ROOT SHELL
   Original layout: display:flex flex-direction:column — unchanged.
   ============================================================ */
#hud-root {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--hud-bg);
  background-image: var(--scanline);
  position: relative;
  overflow: hidden;
}

#hud-root::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 68% -5%,  rgba(18, 59, 143, 0.28) 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at -5% 105%,  rgba(10, 166, 194, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.scanline-overlay {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 3px,
    rgba(201, 162, 77, 0.004) 3px,
    rgba(201, 162, 77, 0.004) 4px
  );
  pointer-events: none;
  z-index: 9999;
}


/* ============================================================
   CORNER BRACKETS
   ============================================================ */
.corner-bracket { display: none !important; }


/* ============================================================
   TOP BAR
   ============================================================ */
#top-bar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--hud-border2);
  background: rgba(8, 14, 39, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

#top-bar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #123B8F, #0AA6C2 45%, transparent 80%);
  opacity: 0.65;
}

#top-bar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 162, 77, 0.18) 40%, rgba(201, 162, 77, 0.18) 60%, transparent);
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

/* Brain image — actual img tag (new index.html) */
.logo-brain {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(201, 162, 77, 0.20));
}

/* Legacy SVG hex — still in old HTML, constrain it to same size */
.logo-hex {
  width: 42px !important;
  height: 42px !important;
  flex-shrink: 0;
  display: block !important;
  overflow: hidden;
}

.logo-text-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1;
}

/* KORVA SENTINEL wordmark
   Old HTML: logo-name = "GORGO", logo-tagline = "Command Center v1.0"
   New HTML: logo-name has spans, logo-parent = "A GORGO Company"
   Both cases get the same visual treatment */
.logo-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  color: var(--text-primary);
}
/* Span color control for new HTML */
.logo-k        { color: var(--gold);        font-weight: 700; }
.logo-orva     { color: var(--text-primary); font-weight: 700; }
.logo-sentinel { color: var(--teal);         font-weight: 700; letter-spacing: 0.02em; }

/* logo-tagline: old HTML shows "Command Center v1.0", new shows nothing / logo-parent used instead */
.logo-tagline {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  text-transform: uppercase;
  line-height: 1;
}
/* logo-parent: "A GORGO Company" — new HTML only */
.logo-parent {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
  line-height: 1;
}

.system-identity {
  text-align: center;
  line-height: 1.4;
}

.sys-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.sys-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.10em;
}

.top-indicators {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--green);
  letter-spacing: 0.10em;
  padding: 3px 9px;
  border: 1px solid rgba(34, 199, 127, 0.22);
  border-radius: 999px;
  background: rgba(34, 199, 127, 0.07);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2.2s ease-in-out infinite;
}

.threat-badge {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 600;
  padding: 3px 10px;
  border: 1px solid rgba(201, 162, 77, 0.28);
  color: var(--gold-2);
  background: var(--amber-glow);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
}

.topbar-btn {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 12px;
  border: 1px solid var(--hud-border2);
  color: var(--text-secondary);
  background: transparent;
  letter-spacing: 0.04em;
  border-radius: 6px;
  transition: all var(--t-fast);
  cursor: pointer;
}

.topbar-btn:hover,
.topbar-btn.active {
  border-color: rgba(201, 162, 77, 0.40);
  color: var(--gold-2);
  background: var(--gold-dim);
}


/* ============================================================
   MAIN BODY LAYOUT
   Original: flex row — unchanged.
   ============================================================ */
#main-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
  z-index: 1;
}


/* ============================================================
   LEFT NAVIGATION
   ============================================================ */
#left-nav {
  width: var(--left-nav-width);
  background: var(--hud-panel);
  border-right: 1px solid var(--hud-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}

.nav-section {
  padding: 10px 0 4px;
  border-bottom: 1px solid var(--hud-border);
}

.nav-section-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 0.18em;
  padding: 0 14px 6px;
  text-transform: uppercase;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  cursor: pointer;
  transition: all var(--t-fast);
  border-left: 2px solid transparent;
  position: relative;
  user-select: none;
  text-decoration: none;
  color: inherit;
}

.nav-item:hover { background: var(--gold-dim); }

.nav-item.active {
  border-left-color: var(--gold);
  background: rgba(201, 162, 77, 0.09);
}

.nav-item.active .nav-label { color: var(--gold-2); }

.nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-dot.green  { background: var(--green); }
.nav-dot.amber  { background: var(--amber); }
.nav-dot.red    { background: var(--red);   box-shadow: 0 0 5px var(--red-dim); }
.nav-dot.blue   { background: var(--blue); }
.nav-dot.teal   { background: var(--teal); }
.nav-dot.dim    { background: var(--text-dim); }

.nav-label {
  font-family: var(--body);
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  font-family: var(--font-mono);
  font-size: 8px;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}

.nav-badge.red    { background: rgba(232,69,69,0.12);   color: var(--red);   border: 1px solid rgba(232,69,69,0.22); }
.nav-badge.amber  { background: rgba(201,162,77,0.12);  color: var(--amber); border: 1px solid rgba(201,162,77,0.22); }
.nav-badge.green  { background: rgba(34,199,127,0.10);  color: var(--green); border: 1px solid rgba(34,199,127,0.18); }
.nav-badge.blue   { background: rgba(20,196,221,0.10);  color: var(--blue);  border: 1px solid rgba(20,196,221,0.18); }
.nav-badge.dim    { background: rgba(247,248,255,0.04); color: var(--text-dim); border: 1px solid rgba(247,248,255,0.10); }


/* ============================================================
   CENTER PANEL
   Original: flex-1, flex-direction:column — unchanged.
   ============================================================ */
#center-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.overview-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid var(--hud-border);
  flex-shrink: 0;
}

.overview-cell {
  padding: 10px 14px;
  border-right: 1px solid var(--hud-border);
  cursor: pointer;
  transition: background var(--t-fast);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.overview-cell:last-child { border-right: none; }
.overview-cell:hover      { background: var(--gold-dim); }

.ov-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  margin-bottom: 3px;
  text-transform: uppercase;
  text-align: center;
}

.ov-number {
  font-family: var(--body);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 2px;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.ov-number.green { color: var(--green); }
.ov-number.amber { color: var(--amber); }
.ov-number.red   { color: var(--red); }
.ov-number.blue  { color: var(--blue); }
.ov-number.dim   { color: var(--text-dim); }
.ov-number.teal  { color: var(--teal); }

.ov-sub {
  font-size: 10px;
  color: var(--text-dim);
  text-align: center;
}

.posture-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--hud-border);
  flex-shrink: 0;
}

.pb-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 0.14em;
  white-space: nowrap;
  text-transform: uppercase;
}

.pb-track {
  flex: 1;
  height: 4px;
  background: rgba(247, 248, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.pb-fill {
  height: 100%;
  background: linear-gradient(90deg, #123B8F, #0AA6C2 55%, #C9A24D 100%);
  border-radius: 2px;
  position: relative;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.pb-fill::after {
  content: '';
  position: absolute;
  right: 0; top: -2px; bottom: -2px;
  width: 2px;
  background: var(--gold-2);
  opacity: 0.9;
  box-shadow: 0 0 6px rgba(224, 189, 104, 0.8);
}

.pb-pct {
  font-family: var(--body);
  font-size: 11px;
  font-weight: 800;
  color: var(--gold-2);
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.pb-deadline {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  white-space: nowrap;
}

.table-header {
  display: grid;
  grid-template-columns: 26px 1fr 110px 100px 72px 76px;
  padding: 5px 16px;
  border-bottom: 1px solid var(--hud-border);
  background: rgba(14, 22, 56, 0.50);
  flex-shrink: 0;
}

.th-col {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

#compliance-rows {
  flex: 1;
  overflow-y: auto;
}

.cat-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 4px;
  background: rgba(14, 22, 56, 0.55);
  border-bottom: 1px solid var(--hud-border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.cgh-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 0.16em;
  white-space: nowrap;
  text-transform: uppercase;
  font-weight: 600;
}

.cgh-line {
  flex: 1;
  height: 1px;
  background: var(--hud-border);
}

.cgh-count {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  white-space: nowrap;
}

.comp-row {
  display: grid;
  grid-template-columns: 26px 1fr 110px 100px 72px 76px;
  padding: 7px 16px;
  border-bottom: 1px solid rgba(13, 58, 82, 0.4);
  cursor: pointer;
  transition: all var(--t-fast);
  align-items: center;
  animation: row-fade-in 0.2s ease both;
}

.comp-row:hover  { background: var(--gold-dim); }

.comp-row.selected {
  background: rgba(201, 162, 77, 0.08);
  border-left: 2px solid var(--gold);
  padding-left: 14px;
}

.status-icon {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.status-icon.green { background: rgba(34,199,127,0.18);  border: 1px solid var(--green); }
.status-icon.amber { background: rgba(201,162,77,0.15);  border: 1px solid var(--amber); }
.status-icon.red   { background: rgba(232,69,69,0.18);   border: 1px solid var(--red);   box-shadow: 0 0 4px rgba(232,69,69,0.28); }
.status-icon.blue  { background: rgba(20,196,221,0.14);  border: 1px solid var(--blue); }
.status-icon.dim   { background: rgba(247,248,255,0.06); border: 1px solid var(--text-dim); }

.req-name {
  font-family: var(--body);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.req-sub {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 1px;
}

.deadline-val {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.3;
}

.deadline-val.urgent { color: var(--red); }
.deadline-val.soon   { color: var(--amber); }
.deadline-val.ok     { color: var(--text-secondary); }

.status-pill {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  display: inline-block;
  white-space: nowrap;
  text-transform: uppercase;
}

.sp-complete { background: rgba(34,199,127,0.08);  color: var(--green); border: 1px solid rgba(34,199,127,0.20); }
.sp-action   { background: rgba(232,69,69,0.08);   color: var(--red);   border: 1px solid rgba(232,69,69,0.20); }
.sp-review   { background: rgba(201,162,77,0.08);  color: var(--amber); border: 1px solid rgba(201,162,77,0.20); }
.sp-pending  { background: rgba(20,196,221,0.08);  color: var(--blue);  border: 1px solid rgba(20,196,221,0.20); }
.sp-na       { background: rgba(247,248,255,0.04); color: var(--text-dim); border: 1px solid rgba(247,248,255,0.10); }

.risk-bar { display: flex; gap: 2px; align-items: center; }
.rb-seg   { width: 9px; height: 9px; border-radius: 1px; }

.row-action-btn {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--hud-border2);
  color: var(--text-dim);
  background: transparent;
  transition: all var(--t-fast);
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
}

.row-action-btn:hover {
  background: var(--gold-dim);
  border-color: rgba(201, 162, 77, 0.40);
  color: var(--gold-2);
}

#detail-tray {
  border-top: 1px solid var(--hud-border2);
  background: var(--hud-panel2);
  padding: 10px 18px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  min-height: 88px;
  max-height: 130px;
  flex-shrink: 0;
  position: relative;
}

#detail-tray::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 162, 77, 0.35), transparent);
}

.dt-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 0.14em;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.dt-content {
  font-family: var(--body);
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.dt-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 7px;
}

.dt-btn {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--t-fast);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.dt-btn.primary {
  border: 1px solid rgba(201, 162, 77, 0.42);
  color: var(--gold-2);
  background: var(--gold-dim);
}

.dt-btn.primary:hover {
  background: rgba(201, 162, 77, 0.22);
  border-color: var(--gold);
}

.dt-btn.secondary {
  border: 1px solid var(--hud-border2);
  color: var(--text-secondary);
  background: transparent;
}

.dt-btn.secondary:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.dt-authority {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  white-space: pre-line;
  line-height: 1.6;
  min-width: 140px;
  text-align: right;
}


/* ============================================================
   RIGHT PANEL
   ============================================================ */
#right-panel {
  width: var(--right-panel-width);
  border-left: 1px solid var(--hud-border);
  background: var(--hud-panel);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}

.rp-section {
  padding: 10px 12px;
  border-bottom: 1px solid var(--hud-border);
  flex-shrink: 0;
}

.rp-title {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.18em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

/* Threat Vector Matrix — item titles: readable weight, not heavy */
.tv-name,
.vector-name,
.tvm-name,
.threat-vector-name,
.rp-section b,
.rp-section strong {
  font-weight: 500;
}

.countdown-item {
  margin-bottom: 9px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(13, 58, 82, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.countdown-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.cd-name {
  font-family: var(--body);
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 2px;
  line-height: 1.4;
  text-align: center;
}

.cd-days {
  font-family: var(--body);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 1px;
  letter-spacing: -0.02em;
  text-align: center;
}

.cd-days.red   { color: var(--red); }
.cd-days.amber { color: var(--amber); }
.cd-days.green { color: var(--green); }

.cd-date {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-secondary);
  text-align: center;
}

.mini-gauges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mg-item { text-align: center; }

.mg-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mg-ring-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  margin: 0 auto 3px;
}

.mg-ring-wrap svg { width: 52px; height: 52px; }

.mg-ring-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--body);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.threat-item {
  display: flex;
  gap: 7px;
  margin-bottom: 8px;
  align-items: flex-start;
}

.threat-item:last-child { margin-bottom: 0; }

.ti-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.ti-dot.red   { background: var(--red); }
.ti-dot.amber { background: var(--amber); }
.ti-dot.blue  { background: var(--blue); }

.ti-text { font-family: var(--body); font-size: 9px; color: var(--text-secondary); line-height: 1.45; }
.ti-time { font-family: var(--font-mono); font-size: 8px; color: var(--text-dim); margin-top: 1px; }


/* ============================================================
   STATUS BAR
   ============================================================ */
#status-bar {
  height: 22px;
  border-top: 1px solid var(--hud-border);
  background: var(--hud-panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  flex-shrink: 0;
  z-index: 10;
}

.sb-left, .sb-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sb-item {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.sb-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
}

.sb-dot.green { background: var(--green); box-shadow: 0 0 5px var(--green-dim); }
.sb-dot.amber { background: var(--amber); }


/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 30px;
  right: 16px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toast {
  font-family: var(--body);
  font-size: 11px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  border-left: 2px solid var(--teal);
  background: rgba(8, 14, 39, 0.96);
  color: var(--text-secondary);
  animation: toast-in 0.2s ease both;
  max-width: 280px;
  line-height: 1.4;
  backdrop-filter: blur(10px);
}

.toast.error { border-left-color: var(--red); }
.toast.warn  { border-left-color: var(--amber); color: var(--gold-2); }


/* ============================================================
   MODAL OVERLAY
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 9, 27, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.15s ease;
}

.modal-box {
  background: var(--hud-panel2);
  border: 1px solid var(--hud-border2);
  padding: 24px 28px;
  border-radius: 14px;
  min-width: 380px;
  max-width: 520px;
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,0.50);
}

.modal-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(90deg, #123B8F, #0AA6C2 45%, transparent 80%);
  opacity: 0.65;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-2);
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}


/* ============================================================
   ANIMATIONS  — all original keyframe names preserved
   ============================================================ */
@keyframes pulse-dot {
  0%, 100% { opacity: 1;    transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

@keyframes row-fade-in {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes typing-bounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40%           { transform: scale(1.1); opacity: 1; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* filter:brightness required — makes position:absolute work on #popout-overlay */
@keyframes hud-boot {
  from { opacity: 0; filter: brightness(0.3); }
  to   { opacity: 1; filter: brightness(1); }
}

#hud-root { animation: hud-boot 0.6s ease both; }

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.97) translateY(-8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}


/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.hidden   { display: none !important; }
.flex     { display: flex; }
.flex-col { flex-direction: column; }
.gap-2    { gap: 2px; }
.gap-4    { gap: 4px; }
.gap-8    { gap: 8px; }
.mt-4     { margin-top: 4px; }
.mt-8     { margin-top: 8px; }
.mono     { font-family: var(--font-mono); }
.text-teal      { color: var(--teal); }
.text-amber     { color: var(--amber); }
.text-red       { color: var(--red); }
.text-green     { color: var(--green); }
.text-dim       { color: var(--text-dim); }
.text-secondary { color: var(--text-secondary); }
.primary        { color: var(--gold-2); }
.secondary      { color: var(--text-secondary); }
.urgent         { color: var(--red); }
.soon           { color: var(--amber); }
.com            { color: var(--green); }
.teal           { color: var(--teal); }


/* ============================================================
   POPOUT OVERLAY SYSTEM
   position:absolute preserved — required by hud-boot filter:brightness
   ============================================================ */
#popout-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 9, 27, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.15s ease;
  padding: 20px;
}

#popout-modal {
  background: var(--hud-panel2);
  border: 1px solid var(--hud-border2);
  border-radius: 14px;
  width: 100%;
  max-width: 660px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: modal-in 0.2s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 30px 80px rgba(0,0,0,0.50);
}

#popout-modal::before,
#popout-split::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #123B8F, #0AA6C2 45%, transparent 80%);
  opacity: 0.65;
}

#popout-modal::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 77, 0.05);
}

#popout-split {
  background: var(--hud-panel2);
  border: 1px solid var(--hud-border2);
  border-radius: 14px;
  width: 100%;
  max-width: 1100px;
  height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: modal-in 0.2s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 30px 80px rgba(0,0,0,0.50);
}

.pop-header, .split-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hud-border);
  flex-shrink: 0;
  gap: 12px;
}

.pop-header-left, .split-header-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.pop-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.pop-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.pop-sub {
  font-size: 9px;
  color: var(--text-dim);
  margin-top: 2px;
}

.pop-close-btn {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border: 1px solid var(--hud-border2);
  color: var(--text-dim);
  background: transparent;
  cursor: pointer;
  transition: all var(--t-fast);
  letter-spacing: 0.06em;
  border-radius: 5px;
}

.pop-close-btn:hover {
  border-color: rgba(201, 162, 77, 0.40);
  color: var(--gold-2);
  background: var(--gold-dim);
}

.pop-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 10px 18px;
  border-bottom: 1px solid var(--hud-border);
  flex-shrink: 0;
  background: rgba(14, 22, 56, 0.40);
}

.pop-meta-cell {
  min-width: 120px;
  flex: 1;
  padding-right: 16px;
}

.pop-meta-label {
  font-family: var(--font-mono);
  font-size: 7px;
  color: var(--gold);
  letter-spacing: 0.14em;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.pop-meta-val {
  font-size: 10px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 4px;
}

.pop-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pop-section { display: flex; flex-direction: column; gap: 5px; }

.pop-section-label {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--gold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

.pop-detail-text {
  font-family: var(--body);
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.pop-footer {
  border-top: 1px solid var(--hud-border);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 8px;
}

.pop-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.pop-gorgo-product {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
}

.pop-product-label { color: var(--text-dim); letter-spacing: 0.10em; }
.pop-product-name  { color: var(--teal); }

.split-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.split-left {
  border-right: 1px solid var(--hud-border);
  padding: 14px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.split-right {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.split-right-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--hud-border);
  flex-shrink: 0;
}

.log-timeline {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.log-entry {
  display: flex;
  gap: 12px;
  padding-bottom: 14px;
  position: relative;
}

.log-entry:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 4px; top: 12px; bottom: 0;
  width: 1px;
  background: var(--hud-border);
}

.log-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--teal-dark);
  border: 1px solid var(--teal-dim);
  flex-shrink: 0;
  margin-top: 3px;
  position: relative;
  z-index: 1;
}

.log-content { flex: 1; min-width: 0; }

.log-action {
  font-family: var(--body);
  font-size: 10px;
  color: var(--text-primary);
  line-height: 1.55;
  margin-bottom: 3px;
}

.log-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.log-who      { font-family: var(--font-mono); font-size: 8px; color: var(--teal-dim); }
.log-date     { font-family: var(--font-mono); font-size: 8px; color: var(--text-dim); }
.log-evidence { font-family: var(--font-mono); font-size: 8px; color: var(--blue); margin-top: 3px; display: block; }
