/* ============================================================
   HGP Unified App Visual Layer
   Makes all HGP pages feel like one Command Center application.
   This layer is additive and does not delete business data.
   ============================================================ */

:root {
  --hgp-bg: #020816;
  --hgp-bg-2: #031427;
  --hgp-panel: rgba(5,20,35,.84);
  --hgp-panel-2: rgba(7,30,50,.90);
  --hgp-line: rgba(40,231,255,.24);
  --hgp-line-strong: rgba(40,231,255,.48);
  --hgp-cyan: #28e7ff;
  --hgp-green: #43ffbd;
  --hgp-yellow: #ffd166;
  --hgp-red: #ff4d75;
  --hgp-text: #eaffff;
  --hgp-muted: #9fc0d5;
  --hgp-font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

html,
body {
  font-family: var(--hgp-font) !important;
  color: var(--hgp-text) !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body {
  background:
    radial-gradient(circle at 16% 12%, rgba(40,231,255,.14), transparent 28%),
    radial-gradient(circle at 80% 10%, rgba(67,255,189,.09), transparent 30%),
    linear-gradient(135deg, var(--hgp-bg) 0%, var(--hgp-bg-2) 50%, #061b2e 100%) !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(40,231,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40,231,255,.045) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

/* Generic panels/cards across old and new pages */
section,
article,
.card,
.panel,
.hud-panel,
.hgp-pro-panel,
.bs-file-card,
.bs-accounts-panel,
.bs-dashboard-panel,
.bs-form-card,
.bs-history-card {
  border-color: var(--hgp-line) !important;
}

/* Normalize old product pages without breaking their tables */
body:not(.hgp-pro-body):not(.bs-body) {
  font-family: var(--hgp-font) !important;
}

body:not(.hgp-pro-body):not(.bs-body) h1,
body:not(.hgp-pro-body):not(.bs-body) h2,
body:not(.hgp-pro-body):not(.bs-body) h3,
body:not(.hgp-pro-body):not(.bs-body) h4 {
  font-family: var(--hgp-font) !important;
  letter-spacing: -0.045em !important;
  text-transform: none !important;
}

body:not(.hgp-pro-body):not(.bs-body) h1,
body:not(.hgp-pro-body):not(.bs-body) h2 {
  color: #fff !important;
  text-shadow: none !important;
}

/* Old HUD buttons normalized */
body:not(.hgp-pro-body):not(.bs-body) button,
body:not(.hgp-pro-body):not(.bs-body) a {
  font-family: var(--hgp-font) !important;
}

/* Tables stay readable and professional */
table {
  font-family: var(--hgp-font) !important;
}

th {
  color: var(--hgp-green) !important;
  letter-spacing: .08em !important;
}

td {
  color: var(--hgp-text) !important;
}

/* Product pages: reduce glitch/pixel effect */
[data-hgp-cleaned-title="true"] {
  font-family: var(--hgp-font) !important;
  letter-spacing: -0.05em !important;
  text-shadow: none !important;
}

/* Corrupted dynamic text gets removed safely by JS */
.hgp-client-hidden {
  display: none !important;
}

.hgp-clean-placeholder {
  color: var(--hgp-muted) !important;
  font-style: normal !important;
}

/* Product cards/tables should remain visible */
.hgp-safe-table,
.hgp-safe-table * {
  visibility: visible;
}

/* Unified nav label appearance */
a[href*="hgp-cockpit"],
a[href*="hgp-summary"],
a[href*="hgp-category"],
a[href*="hgp-product"],
a[href*="hgp-library"],
a[href*="hgp-reconciliation"],
a[href*="hgp-balance-reconciliation"] {
  font-family: var(--hgp-font) !important;
}

/* Balance reader status */
.hgp-reader-inline-status {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(40,231,255,.22);
  border-radius: 14px;
  background: rgba(40,231,255,.06);
  color: var(--hgp-muted);
  font-weight: 800;
}