/**
 * Globlex Executive Trade & Capital OS Design System v2.0
 * Unified Design Tokens, Glassmorphic Command Surfaces & Tabular Grid System
 * Architecture: Dark Executive OS by default with Full Light / High-Contrast Theme support
 * WCAG 2.1 AA Compliant (Contrast Ratios >= 4.5:1, 2px focus-visible rings)
 */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;1,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ==========================================================================
   1. DESIGN TOKENS & ROOT VARIABLES (CLAUDE DESIGN V2 + PERFOPS V2)
   ========================================================================== */
:root {
  /* Claude Design v2 Core Semantic Tokens */
  --color-bg: #edeae2;
  --color-surface: #e4e0d6;
  --color-text: #13161b;
  --color-accent: #416180;
  --color-accent-700: #2b445c;
  --color-divider: rgba(19, 22, 27, 0.14);

  /* Color Palette — Core Executive Paper & Technical Palette */
  --gx-bg-base: #edeae2;
  --gx-bg-surface: #e4e0d6;
  --gx-bg-elevated: #ebe7de;
  --gx-bg-card: #e4e0d6;
  --gx-bg-card-hover: #dedad0;
  --gx-bg-glass: rgba(228, 224, 214, 0.88);
  --gx-bg-glass-heavy: rgba(228, 224, 214, 0.96);
  --gx-bg-input: #f4f1ea;

  /* Borders & Dividers */
  --gx-border-subtle: rgba(19, 22, 27, 0.14);
  --gx-border-medium: rgba(19, 22, 27, 0.24);
  --gx-border-highlight: rgba(65, 97, 128, 0.45);
  --gx-border-focus: #416180;

  /* Accent Colors */
  --gx-gold: #c28830;
  --gx-gold-bright: #d4983e;
  --gx-gold-dim: rgba(194, 136, 48, 0.14);
  --gx-gold-gradient: linear-gradient(135deg, #c28830 0%, #9e6c1e 100%);

  --gx-cobalt: #416180;
  --gx-cobalt-bright: #5980a6;
  --gx-cobalt-dim: rgba(65, 97, 128, 0.14);
  --gx-cobalt-gradient: linear-gradient(135deg, #416180 0%, #2b445c 100%);

  --gx-emerald: #2e7a5c;
  --gx-emerald-bright: #3c9b76;
  --gx-emerald-dim: rgba(46, 122, 92, 0.14);
  --gx-emerald-gradient: linear-gradient(135deg, #2e7a5c 0%, #1e5942 100%);

  --gx-rose: #b83d4f;
  --gx-rose-bright: #cf4d60;
  --gx-rose-dim: rgba(184, 61, 79, 0.14);

  --gx-indigo: #485c8a;
  --gx-indigo-dim: rgba(72, 92, 138, 0.14);

  /* Typography Colors */
  --gx-text-primary: #13161b;
  --gx-text-secondary: rgba(19, 22, 27, 0.75);
  --gx-text-muted: rgba(19, 22, 27, 0.56);
  --gx-text-on-accent: #edeae2;

  /* Typography Stacks — Claude Design v2 Standard */
  --gx-font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --gx-font-heading: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --gx-font-mono: 'IBM Plex Mono', 'JetBrains Mono', monospace;
  --font-heading: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', 'JetBrains Mono', monospace;

  /* Radii — Blueprint Zero-Radius Doctrine */
  --gx-radius-xs: 0px;
  --gx-radius-sm: 0px;
  --gx-radius-md: 0px;
  --gx-radius-lg: 0px;
  --gx-radius-xl: 0px;
  --gx-radius-full: 0px;

  /* Shadows & Ambient Glows */
  --gx-shadow-sm: 0 1px 3px rgba(19, 22, 27, 0.08);
  --gx-shadow-md: 0 4px 12px rgba(19, 22, 27, 0.10);
  --gx-shadow-lg: 0 10px 24px rgba(19, 22, 27, 0.14);
  --gx-shadow-glow-gold: 0 0 20px rgba(194, 136, 48, 0.20);
  --gx-shadow-glow-cobalt: 0 0 20px rgba(65, 97, 128, 0.20);
  --gx-shadow-glow-emerald: 0 0 20px rgba(46, 122, 92, 0.20);

  /* Glassmorphism */
  --gx-blur-base: blur(12px);
  --gx-blur-heavy: blur(20px);

  /* Animation Timings */
  --gx-transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --gx-transition-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --gx-transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   2. LIGHT THEME (DEFAULT TECHNICAL PAPER) [data-theme="light"]
   ========================================================================== */
[data-theme="light"],
body.theme-light {
  --color-bg: #edeae2;
  --color-surface: #e4e0d6;
  --color-text: #13161b;
  --color-accent: #416180;
  --color-accent-700: #2b445c;
  --color-divider: rgba(19, 22, 27, 0.14);

  --gx-bg-base: #edeae2;
  --gx-bg-surface: #e4e0d6;
  --gx-bg-elevated: #ebe7de;
  --gx-bg-card: #e4e0d6;
  --gx-bg-card-hover: #dedad0;
  --gx-bg-glass: rgba(228, 224, 214, 0.88);
  --gx-bg-glass-heavy: rgba(228, 224, 214, 0.96);
  --gx-bg-input: #f4f1ea;

  --gx-border-subtle: rgba(19, 22, 27, 0.14);
  --gx-border-medium: rgba(19, 22, 27, 0.24);
  --gx-border-highlight: rgba(65, 97, 128, 0.45);
  --gx-border-focus: #416180;

  --gx-gold: #c28830;
  --gx-gold-bright: #d4983e;
  --gx-gold-dim: rgba(194, 136, 48, 0.14);
  --gx-gold-gradient: linear-gradient(135deg, #c28830 0%, #9e6c1e 100%);

  --gx-cobalt: #416180;
  --gx-cobalt-bright: #2b445c;
  --gx-cobalt-dim: rgba(65, 97, 128, 0.14);
  --gx-cobalt-gradient: linear-gradient(135deg, #416180 0%, #2b445c 100%);

  --gx-emerald: #2e7a5c;
  --gx-emerald-bright: #3c9b76;
  --gx-emerald-dim: rgba(46, 122, 92, 0.14);
  --gx-emerald-gradient: linear-gradient(135deg, #2e7a5c 0%, #1e5942 100%);

  --gx-rose: #b83d4f;
  --gx-rose-bright: #cf4d60;
  --gx-rose-dim: rgba(184, 61, 79, 0.14);

  --gx-indigo: #485c8a;
  --gx-indigo-dim: rgba(72, 92, 138, 0.14);

  --gx-text-primary: #13161b;
  --gx-text-secondary: rgba(19, 22, 27, 0.75);
  --gx-text-muted: rgba(19, 22, 27, 0.56);
  --gx-text-on-accent: #edeae2;

  --gx-shadow-sm: 0 1px 3px rgba(19, 22, 27, 0.08);
  --gx-shadow-md: 0 4px 12px rgba(19, 22, 27, 0.10);
  --gx-shadow-lg: 0 10px 24px rgba(19, 22, 27, 0.14);
  --gx-shadow-glow-gold: 0 0 20px rgba(194, 136, 48, 0.20);
  --gx-shadow-glow-cobalt: 0 0 20px rgba(65, 97, 128, 0.20);
  --gx-shadow-glow-emerald: 0 0 20px rgba(46, 122, 92, 0.20);
}

/* ==========================================================================
   2B. DARK THEME [data-theme="dark"]
   ========================================================================== */
[data-theme="dark"],
body.theme-dark {
  --color-bg: #13161b;
  --color-surface: #1b2027;
  --color-text: #edeae2;
  --color-accent: #5980a6;
  --color-accent-700: #416180;
  --color-divider: rgba(237, 234, 226, 0.14);

  --gx-bg-base: #13161b;
  --gx-bg-surface: #1b2027;
  --gx-bg-elevated: #242b35;
  --gx-bg-card: #1b2027;
  --gx-bg-card-hover: #222933;
  --gx-bg-glass: rgba(27, 32, 39, 0.88);
  --gx-bg-glass-heavy: rgba(19, 22, 27, 0.96);
  --gx-bg-input: #101317;

  --gx-border-subtle: rgba(237, 234, 226, 0.14);
  --gx-border-medium: rgba(237, 234, 226, 0.24);
  --gx-border-highlight: rgba(89, 128, 166, 0.45);
  --gx-border-focus: #5980a6;

  --gx-cobalt: #5980a6;
  --gx-cobalt-bright: #728fab;
  --gx-cobalt-dim: rgba(89, 128, 166, 0.14);
  --gx-cobalt-gradient: linear-gradient(135deg, #5980a6 0%, #416180 100%);

  --gx-text-primary: #edeae2;
  --gx-text-secondary: rgba(237, 234, 226, 0.75);
  --gx-text-muted: rgba(237, 234, 226, 0.56);
  --gx-text-on-accent: #13161b;

  --gx-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --gx-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
  --gx-shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.55);
}

/* High Contrast Override */
[data-contrast="high"] {
  --gx-border-subtle: rgba(148, 163, 184, 0.45) !important;
  --gx-border-medium: rgba(148, 163, 184, 0.75) !important;
  --gx-text-muted: #CBD5E1 !important;
  --gx-bg-card: var(--gx-bg-surface) !important;
}

/* ==========================================================================
   3. GLOBAL BASE, TYPOGRAPHY & TABULAR NUMBERS
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  background-color: var(--gx-bg-base);
  color: var(--gx-text-primary);
  font-family: var(--gx-font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* Headings */
h1, h2, h3, h4, h5, h6,
.gx-heading {
  font-family: var(--gx-font-heading);
  letter-spacing: -0.025em;
  color: var(--gx-text-primary);
  margin-top: 0;
}

/* Tabular Numbers Specification (WCAG Financial Data Standard) */
.tabular-nums,
[data-tabular="true"],
.gx-num,
.gx-currency,
.gx-price,
.gx-inn,
.gx-sku,
.gx-rate,
.gx-metric-val,
.gx-ticker-val,
.gx-bento-val,
.av-card-price,
.av-stat-val,
.av-spec-val,
table td.numeric,
table td:nth-child(n+2) {
  font-family: var(--gx-font-mono);
  font-variant-numeric: tabular-nums;
  -moz-font-feature-settings: "tnum";
  -webkit-font-feature-settings: "tnum";
  font-feature-settings: "tnum" 1;
}

/* WCAG 2.1 AA Focus Rings */
:focus-visible {
  outline: 2px solid var(--gx-gold) !important;
  outline-offset: 2px !important;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

/* Accessible Skip Link */
.gx-skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--gx-gold);
  color: #060A12;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--gx-radius-sm);
  z-index: 10000;
  transition: top 0.2s ease;
  text-decoration: none;
}
.gx-skip-link:focus {
  top: 16px;
}

/* ==========================================================================
   4. GLASSMORPHIС COMMAND HEADER
   ========================================================================== */
.gx-command-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--gx-bg-glass);
  backdrop-filter: var(--gx-blur-base);
  -webkit-backdrop-filter: var(--gx-blur-base);
  border-bottom: 1px solid var(--gx-border-subtle);
  transition: background var(--gx-transition-smooth), border-color var(--gx-transition-smooth);
}

.gx-command-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.gx-brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.gx-brand-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--gx-radius-sm);
  background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
  border: 1px solid var(--gx-border-highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gx-gold);
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.gx-brand-titles {
  display: flex;
  flex-direction: column;
}

.gx-brand-title {
  font-family: var(--gx-font-heading);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--gx-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.gx-brand-os-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gx-gold);
  background: var(--gx-gold-dim);
  border: 1px solid var(--gx-border-highlight);
  padding: 2px 6px;
  border-radius: var(--gx-radius-xs);
}

.gx-brand-subtitle {
  font-size: 11px;
  color: var(--gx-text-muted);
  font-weight: 500;
}

/* Command Header Navigation */
.gx-command-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gx-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: var(--gx-radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--gx-text-secondary);
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  transition: all var(--gx-transition-fast);
  cursor: pointer;
}

.gx-nav-tab:hover {
  color: var(--gx-text-primary);
  background: var(--gx-bg-elevated);
  border-color: var(--gx-border-subtle);
}

.gx-nav-tab.active {
  color: var(--gx-gold-bright);
  background: var(--gx-gold-dim);
  border-color: var(--gx-border-highlight);
}

/* Quick Search / Cmd+K Trigger Button */
.gx-command-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 7px 14px;
  border-radius: var(--gx-radius-md);
  background: var(--gx-bg-input);
  border: 1px solid var(--gx-border-subtle);
  color: var(--gx-text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--gx-transition-fast);
}

.gx-command-search-btn:hover {
  border-color: var(--gx-border-highlight);
  color: var(--gx-text-secondary);
  background: var(--gx-bg-elevated);
}

.gx-kbd-shortcut {
  font-family: var(--gx-font-mono);
  font-size: 11px;
  font-weight: 600;
  background: var(--gx-bg-elevated);
  border: 1px solid var(--gx-border-subtle);
  color: var(--gx-text-secondary);
  padding: 2px 6px;
  border-radius: var(--gx-radius-xs);
}

/* Header Utilities & Switchers */
.gx-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gx-ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--gx-radius-sm);
  background: var(--gx-bg-surface);
  border: 1px solid var(--gx-border-subtle);
  color: var(--gx-text-secondary);
  cursor: pointer;
  transition: all var(--gx-transition-fast);
}

.gx-ctrl-btn:hover {
  color: var(--gx-text-primary);
  border-color: var(--gx-border-medium);
  background: var(--gx-bg-elevated);
}

.gx-lang-toggle {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  background: var(--gx-bg-surface);
  border: 1px solid var(--gx-border-subtle);
  border-radius: var(--gx-radius-sm);
}

.gx-lang-btn {
  padding: 4px 8px;
  border-radius: var(--gx-radius-xs);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gx-text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--gx-transition-fast);
}

.gx-lang-btn.active {
  background: var(--gx-bg-elevated);
  color: var(--gx-text-primary);
  border: 1px solid var(--gx-border-subtle);
}

/* ==========================================================================
   5. LIVE EURASIAN / GLOBAL TRADE CORRIDOR TICKER BAR
   ========================================================================== */
.gx-corridor-ticker-wrap {
  position: relative;
  overflow: hidden;
  background: var(--gx-bg-base);
  border-bottom: 1px solid var(--gx-border-subtle);
  font-size: 12px;
  height: 38px;
  display: flex;
  align-items: center;
  user-select: none;
}

.gx-ticker-badge-fixed {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  height: 100%;
  background: var(--gx-bg-surface);
  border-right: 1px solid var(--gx-border-subtle);
  font-family: var(--gx-font-heading);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gx-gold);
  z-index: 5;
}

.gx-ticker-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gx-emerald);
  box-shadow: 0 0 8px var(--gx-emerald);
  animation: gxPulseGlow 1.5s infinite ease-in-out;
}

@keyframes gxPulseGlow {
  0%, 100% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
}

.gx-ticker-track-container {
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
  position: relative;
}

.gx-ticker-track {
  display: inline-flex;
  align-items: center;
  animation: gxTickerScroll 55s linear infinite;
}

.gx-corridor-ticker-wrap:hover .gx-ticker-track {
  animation-play-state: paused;
}

@keyframes gxTickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.gx-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  border-right: 1px dashed var(--gx-border-subtle);
}

.gx-ticker-label {
  color: var(--gx-text-muted);
  font-weight: 600;
}

.gx-ticker-val {
  font-weight: 700;
  color: var(--gx-text-primary);
}

.gx-ticker-change {
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.gx-ticker-change.up {
  color: var(--gx-emerald);
}

.gx-ticker-change.down {
  color: var(--gx-rose);
}

.gx-ticker-change.neutral {
  color: var(--gx-text-muted);
}

/* ==========================================================================
   6. TACTILE BENTO METRIC CARDS & HERO EXECUTIVE HUD
   ========================================================================== */
.gx-bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.gx-bento-card {
  position: relative;
  background: var(--gx-bg-card);
  border: 1px solid var(--gx-border-subtle);
  border-radius: var(--gx-radius-lg);
  padding: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--gx-shadow-sm);
  transition: transform var(--gx-transition-smooth),
              border-color var(--gx-transition-smooth),
              box-shadow var(--gx-transition-smooth),
              background var(--gx-transition-smooth);
}

.gx-bento-card:hover {
  transform: translateY(-2px);
  border-color: var(--gx-border-medium, rgba(148, 163, 184, 0.35));
  box-shadow: var(--gx-shadow-md);
  background: var(--gx-bg-card-hover);
}

.gx-bento-col-3 { grid-column: span 3; }
.gx-bento-col-4 { grid-column: span 4; }
.gx-bento-col-6 { grid-column: span 6; }
.gx-bento-col-8 { grid-column: span 8; }
.gx-bento-col-12 { grid-column: span 12; }

.gx-bento-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.gx-bento-icon-box {
  width: 42px;
  height: 42px;
  border-radius: var(--gx-radius-md);
  background: var(--gx-bg-elevated);
  border: 1px solid var(--gx-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.gx-bento-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--gx-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.gx-bento-val {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--gx-text-primary);
  margin: 4px 0 8px;
}

.gx-bento-sub {
  font-size: 12.5px;
  color: var(--gx-text-muted);
  line-height: 1.45;
  margin: 0;
}

.gx-bento-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--gx-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
}

/* ==========================================================================
   7. STATUS BADGES & VERIFICATION SEALS
   ========================================================================== */
.gx-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--gx-radius-full);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  border: 1px solid transparent;
  white-space: nowrap;
}

.gx-badge-kyb {
  background: var(--gx-emerald-dim);
  color: var(--gx-emerald-bright);
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.gx-badge-escrow {
  background: var(--gx-gold-dim);
  color: var(--gx-gold-bright);
  border-color: var(--gx-border-highlight);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.gx-badge-iso {
  background: var(--gx-cobalt-dim);
  color: var(--gx-cobalt-bright);
  border-color: rgba(59, 130, 246, 0.35);
}

.gx-badge-manufacturer {
  background: rgba(168, 85, 247, 0.14);
  color: #C084FC;
  border-color: rgba(168, 85, 247, 0.35);
}

.gx-badge-fns {
  background: rgba(14, 165, 233, 0.14);
  color: #38BDF8;
  border-color: rgba(14, 165, 233, 0.35);
}

.gx-badge-upd {
  background: rgba(244, 63, 94, 0.14);
  color: var(--gx-rose-bright);
  border-color: rgba(244, 63, 94, 0.35);
}

/* ==========================================================================
   8. REFINED TABULAR DATA GRIDS
   ========================================================================== */
.gx-table-container {
  width: 100%;
  overflow-x: auto;
  background: var(--gx-bg-surface);
  border: 1px solid var(--gx-border-subtle);
  border-radius: var(--gx-radius-lg);
  box-shadow: var(--gx-shadow-sm);
  margin: 20px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--gx-border-subtle) transparent;
}

.gx-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  text-align: left;
}

.gx-table thead th {
  position: sticky;
  top: 0;
  background: var(--gx-bg-elevated);
  backdrop-filter: var(--gx-blur-base);
  color: var(--gx-text-secondary);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gx-border-medium);
  white-space: nowrap;
}

.gx-table tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--gx-border-subtle);
  color: var(--gx-text-primary);
  transition: background var(--gx-transition-fast);
}

.gx-table tbody tr:hover td {
  background: var(--gx-bg-card-hover);
}

.gx-table tbody tr:last-child td {
  border-bottom: none;
}

.gx-table td.numeric,
.gx-table th.numeric {
  text-align: right;
}

/* ==========================================================================
   9. GLOBAL COMMAND PALETTE (CMD+K / CTRL+K OVERLAY)
   ========================================================================== */
.gx-palette-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(2, 6, 14, 0.75);
  backdrop-filter: var(--gx-blur-heavy);
  -webkit-backdrop-filter: var(--gx-blur-heavy);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px 20px;
  animation: gxFadeIn 0.15s ease-out;
}

@keyframes gxFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.gx-palette-modal {
  width: 100%;
  max-width: 680px;
  background: var(--gx-bg-surface);
  border: 1px solid var(--gx-border-highlight);
  border-radius: var(--gx-radius-xl);
  box-shadow: var(--gx-shadow-lg), var(--gx-shadow-glow-gold);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gx-palette-search-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--gx-border-subtle);
  background: var(--gx-bg-input);
}

.gx-palette-search-box svg {
  color: var(--gx-gold);
  flex-shrink: 0;
}

.gx-palette-input {
  width: 100%;
  background: transparent;
  border: none;
  font-family: var(--gx-font-sans);
  font-size: 16px;
  font-weight: 500;
  color: var(--gx-text-primary);
  outline: none;
}

.gx-palette-input::placeholder {
  color: var(--gx-text-muted);
}

.gx-palette-results {
  max-height: 420px;
  overflow-y: auto;
  padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--gx-border-subtle) transparent;
}

.gx-palette-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gx-text-muted);
  padding: 8px 12px 4px;
}

.gx-palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--gx-radius-md);
  color: var(--gx-text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--gx-transition-fast);
}

.gx-palette-item:hover,
.gx-palette-item.active {
  background: var(--gx-bg-elevated);
  border: 1px solid var(--gx-border-subtle);
  color: var(--gx-gold-bright);
}

.gx-palette-item-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gx-palette-item-icon {
  font-size: 18px;
  width: 28px;
  text-align: center;
}

.gx-palette-item-title {
  font-size: 13.5px;
  font-weight: 600;
}

.gx-palette-item-meta {
  font-size: 11.5px;
  color: var(--gx-text-muted);
}

.gx-palette-footer {
  padding: 12px 20px;
  background: var(--gx-bg-elevated);
  border-top: 1px solid var(--gx-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--gx-text-muted);
}

.gx-palette-keys {
  display: flex;
  gap: 12px;
}

/* ==========================================================================
   10. RESPONSIVE MOBILE DRAWER & LAYOUT ADAPTATIONS
   ========================================================================== */
@media (max-width: 1024px) {
  .gx-bento-col-3 { grid-column: span 6; }
  .gx-bento-col-4 { grid-column: span 6; }
  .gx-bento-col-6 { grid-column: span 12; }
  .gx-bento-col-8 { grid-column: span 12; }
}

@media (max-width: 768px) {
  .gx-command-inner {
    padding: 8px 16px;
    flex-wrap: wrap;
  }
  .gx-command-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-top: 6px;
  }
  .gx-bento-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .gx-bento-col-3,
  .gx-bento-col-4,
  .gx-bento-col-6,
  .gx-bento-col-8,
  .gx-bento-col-12 {
    grid-column: span 1;
  }
  .gx-palette-backdrop {
    padding: 20px 12px;
  }
  .gx-palette-modal {
    max-height: 90vh;
  }
}

/* ==========================================================================
   11. B2B DOCK & WAVE-12 STOREFRONT THEME OVERRIDES (OBSIDIAN & SOVEREIGN GOLD / COBALT)
   ========================================================================== */
#globex-b2b-dock-root,
#globlex-avito-root {
  position: relative !important;
  inset: auto !important;
  z-index: 10 !important;
  background: transparent !important;
  color: var(--gx-text-primary, #F8FAFC) !important;
  font-family: var(--gx-font-sans) !important;
  margin-top: 24px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#globex-b2b-dock-root .av-topbar,
#globlex-avito-root .av-topbar {
  background: var(--gx-bg-surface, #0D1422) !important;
  border-bottom: 1px solid var(--gx-border-subtle, rgba(148, 163, 184, 0.12)) !important;
  border-radius: var(--gx-radius-md, 12px) !important;
  margin-bottom: 16px !important;
}

#globex-b2b-dock-root .av-card,
#globlex-avito-root .av-card,
#globex-b2b-dock-root .av-listing-card,
#globlex-avito-root .av-listing-card,
#globex-b2b-dock-root .av-filter-box,
#globlex-avito-root .av-filter-box,
#globex-b2b-dock-root .av-stats-strip,
#globlex-avito-root .av-stats-strip,
#globex-b2b-dock-root .av-search-bar,
#globlex-avito-root .av-search-bar {
  background: var(--gx-bg-surface, #0D1422) !important;
  border: 1px solid var(--gx-border-subtle, rgba(148, 163, 184, 0.15)) !important;
  border-radius: var(--gx-radius-md, 12px) !important;
  color: var(--gx-text-primary, #F8FAFC) !important;
  box-shadow: var(--gx-shadow-md, 0 4px 18px rgba(0, 0, 0, 0.45)) !important;
}

#globex-b2b-dock-root .av-card:hover,
#globlex-avito-root .av-card:hover {
  border-color: var(--gx-gold, #F59E0B) !important;
  box-shadow: var(--gx-shadow-glow-gold, 0 0 28px rgba(245, 158, 11, 0.28)) !important;
}

#globex-b2b-dock-root .av-card-title,
#globlex-avito-root .av-card-title,
#globex-b2b-dock-root h1,
#globex-b2b-dock-root h2,
#globex-b2b-dock-root h3,
#globex-b2b-dock-root h4 {
  color: var(--gx-text-primary, #F8FAFC) !important;
}

#globex-b2b-dock-root .av-price-val,
#globlex-avito-root .av-price-val {
  color: var(--gx-gold-bright, #FBBF24) !important;
  font-family: var(--gx-font-mono, monospace) !important;
  font-weight: 700 !important;
}

#globex-b2b-dock-root .av-role-hero,
#globlex-avito-root .av-role-hero {
  background: linear-gradient(135deg, var(--gx-bg-surface, #0D1422) 0%, var(--gx-bg-elevated, #131D31) 100%) !important;
  border: 1px solid var(--gx-border-medium, rgba(148, 163, 184, 0.2)) !important;
  border-radius: var(--gx-radius-lg, 16px) !important;
  color: var(--gx-text-primary, #F8FAFC) !important;
}

#globex-b2b-dock-root input,
#globex-b2b-dock-root select,
#globex-b2b-dock-root textarea,
#globlex-avito-root input,
#globlex-avito-root select,
#globlex-avito-root textarea {
  background: var(--gx-bg-input, rgba(6, 10, 18, 0.65)) !important;
  border: 1px solid var(--gx-border-medium, rgba(148, 163, 184, 0.22)) !important;
  color: var(--gx-text-primary, #F8FAFC) !important;
}

#globex-b2b-dock-root input::placeholder,
#globlex-avito-root input::placeholder {
  color: var(--gx-text-muted, #64748B) !important;
}

#globex-b2b-dock-root table,
#globlex-avito-root table {
  background: var(--gx-bg-surface, #0D1422) !important;
  color: var(--gx-text-primary, #F8FAFC) !important;
}

#globex-b2b-dock-root th,
#globlex-avito-root th {
  background: var(--gx-bg-elevated, #131D31) !important;
  color: var(--gx-gold-bright, #FBBF24) !important;
  border-bottom: 1px solid var(--gx-border-medium, rgba(148, 163, 184, 0.2)) !important;
}

#globex-b2b-dock-root td,
#globlex-avito-root td {
  border-bottom: 1px solid var(--gx-border-subtle, rgba(148, 163, 184, 0.12)) !important;
  color: var(--gx-text-primary, #F8FAFC) !important;
}

/* Wave 12 Global Storefront modal overrides */
.glx-w12-modal {
  background: var(--gx-bg-surface, #0D1422) !important;
  color: var(--gx-text-primary, #F8FAFC) !important;
  border: 1px solid var(--gx-border-medium, rgba(148, 163, 184, 0.22)) !important;
}
.glx-w12-tabs {
  background: var(--gx-bg-base, #060A12) !important;
  border-bottom: 1px solid var(--gx-border-subtle, rgba(148, 163, 184, 0.15)) !important;
}
.glx-w12-tab {
  background: var(--gx-bg-elevated, #131D31) !important;
  color: var(--gx-text-secondary, #94A3B8) !important;
  border: 1px solid var(--gx-border-subtle, rgba(148, 163, 184, 0.15)) !important;
}
.glx-w12-tab.active {
  background: var(--gx-cobalt, #3B82F6) !important;
  color: #FFFFFF !important;
  border-color: var(--gx-cobalt-bright, #60A5FA) !important;
}
.glx-w12-body {
  background: var(--gx-bg-base, #060A12) !important;
}
.glx-w12-card {
  background: var(--gx-bg-surface, #0D1422) !important;
  border: 1px solid var(--gx-border-subtle, rgba(148, 163, 184, 0.15)) !important;
  color: var(--gx-text-primary, #F8FAFC) !important;
}
.glx-w12-table th {
  background: var(--gx-bg-elevated, #131D31) !important;
  color: var(--gx-gold-bright, #FBBF24) !important;
  border-bottom: 1px solid var(--gx-border-medium, rgba(148, 163, 184, 0.2)) !important;
}
.glx-w12-table td {
  border-bottom: 1px solid var(--gx-border-subtle, rgba(148, 163, 184, 0.12)) !important;
  color: var(--gx-text-primary, #F8FAFC) !important;
}
.glx-w12-input {
  background: var(--gx-bg-input, rgba(6, 10, 18, 0.65)) !important;
  border: 1px solid var(--gx-border-medium, rgba(148, 163, 184, 0.22)) !important;
  color: var(--gx-text-primary, #F8FAFC) !important;
}
.glx-w12-wf-step {
  background: var(--gx-bg-surface, #0D1422) !important;
  border: 1px solid var(--gx-border-subtle, rgba(148, 163, 184, 0.15)) !important;
  color: var(--gx-text-secondary, #94A3B8) !important;
}
.glx-w12-wf-step.active {
  background: var(--gx-emerald-dim, rgba(16, 185, 129, 0.14)) !important;
  border-color: var(--gx-emerald, #10B981) !important;
  color: var(--gx-emerald-bright, #34D399) !important;
}

/* ==========================================================================
   INSTITUTIONAL ZERO-SLOP SUPPRESSIONS & CLEAN ARCHITECTURE
   ========================================================================== */
#gx-top-corridor-ticker,
#globex-instant-shell.is-hidden,
#globex-wave12-root,
#globex-wave13-root,
#globex-wave14-root,
#globex-wave14-dock,
#globex-es-root,
#globex-ent-command-bar,
#globex-wave13-fab,
#globex-wave13-top-btn,
.av-bottom-dock,
#globlex-minimized-pill,
.av-pro-command-strip,
.av-role-hero {
  display: none !important;
}

/* ==========================================================================
   CLAUDE DESIGN V2 — BLUEPRINT GEOMETRY, DRAFTING GRID & CORNERS
   ========================================================================== */

/* Universal Zero-Radius Doctrine for Blueprint Orthogonal Aesthetic */
#globex-b2b-dock-root *,
#globex-b2b-dock-root *::before,
#globex-b2b-dock-root *::after,
.av-card,
.av-btn,
.av-pill,
.av-input,
.av-modal,
.av-tab,
.av-badge,
.blueprint {
  border-radius: 0px !important;
}

/* 48px Drafting Grid */
body,
#globex-b2b-dock-root,
.gx-drafting-grid {
  background-color: var(--color-bg, #edeae2);
  background-image:
    linear-gradient(to right, rgba(19, 22, 27, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(19, 22, 27, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  color: var(--color-text, #13161b);
  font-family: var(--font-body, 'IBM Plex Sans', sans-serif);
}

[data-theme="dark"] body,
[data-theme="dark"] #globex-b2b-dock-root,
.theme-dark body,
.theme-dark #globex-b2b-dock-root {
  background-color: var(--color-bg, #13161b);
  background-image:
    linear-gradient(to right, rgba(237, 234, 226, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(237, 234, 226, 0.04) 1px, transparent 1px);
  color: var(--color-text, #edeae2);
}

/* Blueprint Corner Marker Elements */
.blueprint {
  position: relative;
  border: 1px solid var(--border-color, var(--color-divider, rgba(19, 22, 27, 0.14)));
  background: var(--bg-surface, var(--color-surface, #e4e0d6));
}

.blueprint > .corner,
.corner {
  position: absolute;
  width: 7px;
  height: 7px;
  pointer-events: none;
  z-index: 3;
}
.blueprint > .corner.tl, .corner.tl { top: -1px; left: -1px; border-top: 2px solid var(--color-accent, #416180); border-left: 2px solid var(--color-accent, #416180); }
.blueprint > .corner.tr, .corner.tr { top: -1px; right: -1px; border-top: 2px solid var(--color-accent, #416180); border-right: 2px solid var(--color-accent, #416180); }
.blueprint > .corner.bl, .corner.bl { bottom: -1px; left: -1px; border-bottom: 2px solid var(--color-accent, #416180); border-left: 2px solid var(--color-accent, #416180); }
.blueprint > .corner.br, .corner.br { bottom: -1px; right: -1px; border-bottom: 2px solid var(--color-accent, #416180); border-right: 2px solid var(--color-accent, #416180); }

/* Strict Tabular Numbers for Technical Data */
.tabular-nums,
[data-tabular="true"],
.av-price,
.av-kpi-val,
.gx-kpi-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Headings Typography */
h1, h2, h3, h4,
.av-heading,
.gx-heading,
.av-tab {
  font-family: var(--font-heading, 'Barlow Condensed', 'Arial Narrow', sans-serif);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ==========================================================================
   Modern Web Guidance Baseline Rules (2023-2026 Standards)
   1. validate-input-after-interaction (:user-invalid / :user-valid)
   2. defer-rendering-heavy-content (content-visibility: auto)
   3. light-dismiss-a-dialog (dialog::backdrop & modal styling)
   ========================================================================== */

/* Modern Web Baseline: Validate Input After Interaction (Baseline 2023) */
input:user-invalid,
select:user-invalid,
textarea:user-invalid,
.user-invalid-fallback {
  border-color: #ef4444;
  outline-color: #ef4444;
}

input:user-valid,
select:user-valid,
textarea:user-valid,
.user-valid-fallback {
  border-color: #10b981;
}

/* Modern Web Baseline: Defer Rendering Heavy Content Below-the-fold */
.gx-deferred-section {
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 320px;
}

/* Modern Web Baseline: Light-Dismiss Dialog Backdrop & Modal Styling */
dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.gx-cookie-dialog,
.gx-cabinet-dialog {
  border: 1px solid var(--color-divider, rgba(255, 255, 255, 0.15));
  border-radius: 8px;
  background: var(--color-bg, #0c1017);
  color: var(--color-text, #f0f4f8);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65);
  padding: 0;
}


/* Modern Web Guidance: Top-Layer Transitions & WebMCP Support */
dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
}

dialog,
[popover] {
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.25s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

dialog[open],
[popover]:popover-open {
  opacity: 1;
  transform: scale(1);
}

@starting-style {
  dialog[open],
  [popover]:popover-open {
    opacity: 0;
    transform: scale(0.95);
  }
}

dialog::backdrop,
[popover]::backdrop {
  transition-property: opacity, display, overlay;
  transition-duration: 0.25s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

@starting-style {
  dialog[open]::backdrop,
  [popover]:popover-open::backdrop {
    opacity: 0;
  }
}

form:tool-form-active,
form.gx-tool-form-active {
  outline: 2px dashed var(--color-accent, #5980a6);
  outline-offset: 4px;
}

.gx-skip-link {
  position: absolute;
  top: -9999px;
  left: 12px;
  background: var(--color-surface, #161d28);
  color: var(--color-accent, #5980a6);
  padding: 8px 16px;
  border: 1px solid var(--color-accent, #5980a6);
  border-radius: 4px;
  z-index: 99999;
  text-decoration: none;
  font-weight: 600;
}

.gx-skip-link:focus {
  top: 12px;
}

dialog:not([open]) { display: none !important; }
