/* Main CSS - v3.9.0 Input System */

/* ... (Base Variables from v3.8.0) ... */

/* FLUXIVE CORPORATE CLEAN UI - PROTOCOL V1 */
:root {

    /* 1. TYPOGRAPHY */
    --font-heading: 'Inter', 'Roboto', sans-serif;
    --font-body: 'Inter', 'Roboto', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* 2. PALETTE: FLUXIVE EXECUTIVE (MATT BLACK - DEFAULT) */
    --fx-bg-primary: #000000;
    --fx-bg-surface: #0a0a0c;
    --fx-bg-glass: rgba(10, 10, 12, 0.75);
    --fx-border-subtle: rgba(255, 255, 255, 0.04);
    --fx-text-primary: #f8fafc;
    --fx-text-secondary: #94a3b8;
    /* Executive Slate */

    /* ACCENTS */
    --fx-accent-os: #ece8e1; /* Brushed Titanium White */
    --fx-accent: var(--fx-accent-os);
    --fx-accent-success: #10b981; /* Muted Emerald */
    --fx-accent-warning: #fbbf24; /* Subtle Gold */
    --fx-accent-alert: #ef4444;
    --fx-accent-blue: #38bdf8;
    --fx-accent-purple: #818cf8;

    /* MAPPINGS TO OLD VARIABLES (BACKWARD COMPATIBILITY) */
    --fx-void: var(--fx-bg-primary);
    --fx-deep-cobalt: #0f1c4a;
    /* Slightly deeper for corporate feel */
    --fx-frosted-slate: var(--fx-text-secondary);
    --fx-neon-gray-core: var(--fx-text-primary);
    --fx-chrome-halo: var(--fx-text-primary);
    --fx-glass-border: rgba(255, 255, 255, 0.1);
    --fx-neon-cyan: var(--fx-accent);
    /* Map old cyan to new accent */
    --fx-accent-cyan: var(--fx-accent);

    /* PREMIUM DATA CARDS (DEFAULT DARK) */
    --fx-premium-card-bg: linear-gradient(180deg, rgba(15, 20, 30, 0.95) 0%, rgba(5, 10, 15, 0.95) 100%);
    --fx-premium-border: rgba(0, 243, 255, 0.15);
    --fx-premium-border-hover: rgba(0, 243, 255, 0.3);
    --fx-premium-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.05);

    /* LAYOUT */
    --dock-width-collapsed: 48px;
    --dock-width-expanded: 220px;
    --dock-width: var(--dock-width-collapsed);
    --gap-sm: 8px;
    --gap-md: 16px;
    --header-height: 48px;
    --ticker-height: 24px;
}

/* 2b. PALETTE: REFRACTIVE LITE (LAB MODE) */
[data-theme="light"] {
    --fx-bg-primary: #FFFFFF;
    /* Clean White */
    --fx-bg-surface: #F8F9FA;
    --fx-bg-glass: rgba(255, 255, 255, 0.85);
    --fx-border-subtle: rgba(7, 228, 168, 0.2);
    --fx-text-primary: #202122;
    /* Strict Shark */
    --fx-text-secondary: #505050;
    /* Dark Gray */

    --fx-glass-border: rgba(7, 228, 168, 0.3);
    --fx-void: #E0E0E0;
    --fx-frosted-slate: #202122;
    /* Much darker gray for light mode text */
    --fx-neon-gray-core: #202122;
    --fx-chrome-halo: #202122;
    /* Deep slate instead of blue halo for high contrast */

    --fx-accent: #07E4A8;
    --fx-accent-cyan: #07E4A8;
    /* Caribbean Green for text/active items */
    --fx-accent-dim: rgba(7, 228, 168, 0.15);

    /* SHADOW DOM CONTRAST FIXES - Founder Standard */
    --guest-action-color: #0F172A;
    /* Strict Dark Text on Buttons */
    --guest-action-bg: rgba(0, 102, 255, 0.1);
    /* Light Blue Tint */
    --guest-action-border: rgba(0, 102, 255, 0.4);

    /* PREMIUM DATA CARDS (LITE MODE) */
    --fx-premium-card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    --fx-premium-border: rgba(7, 228, 168, 0.25);
    --fx-premium-border-hover: rgba(7, 228, 168, 0.4);
    --fx-premium-shadow: 0 4px 20px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255,255,255,0.5);
    --fx-premium-inner-accent: rgba(7, 228, 168, 0.1);
}

[data-theme="light"] body {
    background: #F8F9FA;
}

/* ... (Standard Global Reset) ... */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--fx-bg-primary);
    background-image: none; /* Removed sci-fi radial gradient */
    color: var(--fx-text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: background-color 0.8s cubic-bezier(0.16, 1, 0.3, 1), color 0.5s;
}

[data-theme="dark"] .fx-glass-panel,
.fx-glass-panel {
    background: var(--fx-bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--fx-border-subtle);
}

/* SOLAR SWAP OVERLAY (REFRACTIVE GLASS WAVE) */
.solar-overlay {
    position: fixed;
    z-index: 99999;
    pointer-events: none;
    border-radius: 50%;
    transform: scale(0);
    opacity: 0;
    will-change: transform, opacity, backdrop-filter;
    backdrop-filter: blur(0px);
    /* Animated in JS */
}

/* 2c. REFRACTIVE LITE GRAPHICS */
[data-theme="light"] body::before {
    content: none; /* Removed colorful background orbs for cleaner data look */
}

[data-theme="light"] .product-title {
    background: var(--fx-text-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

[data-theme="light"] .fx-glass-panel {
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .icon-container {
    background: #F1F5F9;
    border-color: #E2E8F0;
    box-shadow: none;
}

[data-theme="light"] .icon-container svg {
    stroke: #334155;
    filter: none;
}

[data-theme="light"] .status-dot {
    background: #0070FF;
    box-shadow: 0 0 12px #0070FF;
}

[data-theme="light"] .ticker-bar {
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(0, 112, 255, 0.15);
    color: var(--fx-text-primary);
}

[data-theme="light"] .fx-dock {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(233, 237, 242, 0.95) 100%);
    border-right: 1px solid var(--fx-glass-border);
}

[data-theme="light"] .fx-dock-item,
[data-theme="light"] .fx-dock-text,
[data-theme="light"] .fx-dock-toggle {
    color: #1E293B !important;
    /* Strict Dark Slate for Menu */
}

[data-theme="light"] .fx-dock-item:hover,
[data-theme="light"] .fx-dock-item.active {
    color: #000000 !important;
    background: rgba(0, 112, 255, 0.1);
}

[data-theme="light"] .context-text,
[data-theme="light"] .brand-text {
    color: #0F172A !important;
    opacity: 1;
}

[data-theme="light"] .sep {
    color: #0F172A;
    opacity: 0.2;
}

[data-theme="light"] .ticker-bar,
[data-theme="light"] .ticker-bar a,
[data-theme="light"] .ticker-bar span,
[data-theme="light"] .ticker-bar i,
[data-theme="light"] .ticker-bar .label {
    color: #1E293B !important;
    font-weight: 600;
}

[data-theme="light"] .fx-dock-item .material-icons-round,
[data-theme="light"] .fx-dock-toggle .material-icons-round {
    color: #1E293B !important;
}

[data-theme="light"] .fx-section-label {
    color: #475569 !important;
    font-weight: 700;
}

[data-theme="light"] .status-icon {
    color: #0066FF !important;
}

[data-theme="light"] .fx-label {
    color: #334155 !important;
}

/* VISION MARK (Rebrand Protocol) */
.vision-mark-container {
    position: absolute;
    top: 25px;
    right: 30px;
    pointer-events: none;
}

.vision-mark-text {
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    letter-spacing: 0.1em;
    font-size: 14px;
    background: linear-gradient(180deg, #051A45 0%, #0066FF 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 0.5px rgba(255, 255, 255, 0.5);
    filter: drop-shadow(0 0 10px rgba(0, 102, 255, 0.3));
}

.vision-mark-sup {
    background: linear-gradient(90deg, #0066FF, #00F3FF);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 0.6em;
    margin-left: 2px;
}

/* LITE MODE OVERRIDE (MORE COLOR) */
[data-theme="light"] .vision-mark-text {
    background: linear-gradient(135deg, #0070FF 0%, #C297FF 100%);
    -webkit-text-stroke: 0.2px rgba(0, 112, 255, 0.4);
    filter: drop-shadow(0 2px 4px rgba(0, 112, 255, 0.2));
}

[data-theme="light"] .vision-mark-sup {
    background: linear-gradient(90deg, #0070FF, #00F3FF);
}

[data-theme="light"] .product-subtitle {
    color: #0070FF;
    text-shadow: 0 0 10px rgba(0, 112, 255, 0.2);
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 500;
    /* Roboto Medium per protocol */
    color: var(--fx-text-primary);
}

.fx-label {
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 10px;
    color: var(--fx-text-secondary);
    font-weight: 600;
}

/* GLOBAL HEADER */
/* GLOBAL HEADER */
/* GLOBAL HEADER */
/* GLOBAL HEADER */
#fx-global-header {
    width: 100%;
    height: var(--header-height);
    background: rgba(10, 10, 12, 0.9); /* More solid, less glass */
    border-bottom: 1px solid rgba(255, 255, 255, 0.08); /* Cleaner border */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    backdrop-filter: blur(12px); /* Reduced blur */
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* MACHINEFORCE STANDARD SOLAR TOGGLE FAB */
.solar-toggle-fab {
    position: fixed;
    top: 6px;
    right: clamp(10px, 2vw, 20px);
    z-index: 99999;
    width: clamp(48px, 6vw, 62px);
    height: clamp(54px, 7vw, 68px);
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    outline: none;
}

/* MFORCE ENGINEER SYSTEM MENU (BOTTOM RIGHT) */
.mforce-engineer-menu {
    position: fixed;
    bottom: 50px;
    right: 130px;
    z-index: 99999;
    display: flex;
    flex-direction: row-reverse;
    gap: 12px;
    font-family: 'Play', sans-serif;
}

.mforce-engineer-item {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--fx-bg-surface);
    border: 1px solid var(--fx-border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    color: var(--fx-text-primary);
}

.mforce-engineer-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mforce-engineer-item .material-icons-round {
    font-size: 18px;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.mforce-engineer-item:hover .material-icons-round {
    opacity: 1;
}

/* X-Ray specific state */
[data-fxrp-active="true"] .mforce-engineer-item.xray-btn {
    background: rgba(56, 189, 248, 0.1);
    border-color: var(--fx-accent-blue);
    color: var(--fx-accent-blue);
}

[data-fxrp-active="true"] .mforce-engineer-item.xray-btn .material-icons-round {
    color: var(--fx-accent-blue);
    opacity: 1;
}

.solar-toggle-fab svg {
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.solar-toggle-fab:hover svg {
    transform: scale(1.05); /* Removed excessive rotation and drop-shadows */
}

/* Lunar Mode (Default) Icons */
.solar-toggle-fab .sun-icon {
    opacity: 0;
    transform: translateY(20px) scale(0.5);
}

.solar-toggle-fab .moon-icon {
    opacity: 1;
    transform: translateY(0px) scale(1);
}

/* Solar Mode Icons */
[data-theme="light"] .solar-toggle-fab .sun-icon,
.solar-mode .solar-toggle-fab .sun-icon {
    opacity: 1 !important;
    transform: translateY(0px) scale(1) !important;
}

[data-theme="light"] .solar-toggle-fab .moon-icon,
.solar-mode .solar-toggle-fab .moon-icon {
    opacity: 0 !important;
    transform: translateY(20px) scale(0.5) !important;
}

[data-theme="light"] .solar-toggle-fab:hover svg,
.solar-mode .solar-toggle-fab:hover svg {
    filter: drop-shadow(0 0 15px rgba(251, 191, 36, 0.6)) !important;
}

/* Timezone Label Style */
.timezone-label {
    transition: color 0.5s ease;
    font-family: 'Share Tech Mono', monospace;
}

[data-theme="light"] .timezone-label,
.solar-mode .timezone-label {
    color: var(--fx-text-primary);
}

/* THEME TRANSITION (VIEW TRANSITIONS API) */
::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

html.transition-to-solar::view-transition-old(root) {
    z-index: 1;
}

html.transition-to-solar::view-transition-new(root) {
    z-index: 9999;
}

html.transition-to-lunar::view-transition-old(root) {
    z-index: 9999;
}

html.transition-to-lunar::view-transition-new(root) {
    z-index: 1;
}


.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: var(--fx-text-secondary);
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

.brand-text {
    font-weight: 700;
    color: var(--fx-chrome-halo);
    font-size: 16px;
    letter-spacing: 0.05em;
}

.brand-text .highlight {
    color: var(--fx-frosted-slate);
    font-weight: 300;
}

.sep {
    color: var(--fx-glass-border);
}

.context-text {
    font-size: 12px;
    letter-spacing: 0.05em;
    opacity: 0.7;
}

#sys-time {
    font-family: 'JetBrains Mono', monospace;
}

.status-icon {
    font-size: 16px;
    color: var(--fx-accent-success);
}


/* MAIN LAYOUT */
#fx-app-container {
    display: flex;
    width: 100%;
    height: calc(100vh - var(--header-height) - var(--ticker-height));
    position: relative;
    z-index: 10;
}

/* DOCK STYLES */
.fx-dock {
    width: var(--dock-width);
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    /* Brighter, bluer gradient */
    /* Brighter, bluer gradient for dark mode, overridden in light */
    background: linear-gradient(180deg, rgba(15, 37, 110, 0.15) 0%, rgba(15, 19, 25, 0.7) 100%);
    border-right: 1px solid var(--fx-glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
    position: relative;
    flex-shrink: 0;
}

.fx-dock.expanded {
    width: var(--dock-width-expanded);
}

.fx-dock-toggle {
    height: 48px;
    display: flex;
    align-items: center;
    padding-left: 24px;
    cursor: pointer;
    color: var(--fx-frosted-slate);
    transition: color 0.2s;
    margin-bottom: 20px;
}

.fx-dock-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

/* TOOLTIP LOGIC FOR COLLAPSED STATE */
.fx-dock:not(.expanded) .fx-dock-item:hover::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    /* Position to the right of the icon */
    top: 50%;
    transform: translateY(-50%);
    background: var(--fx-deep-cobalt);
    color: var(--fx-chrome-halo);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    margin-left: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--fx-glass-border);
    animation: fadeIn 0.2s ease;
}

.fx-dock-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    padding: 0 12px;
}

.fx-section-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fx-accent);
    margin: 8px 0 4px 12px;
    opacity: 0;
    transition: opacity 0.2s;
    height: 0;
    overflow: hidden;
    white-space: nowrap;
}

.fx-dock.expanded .fx-section-label {
    opacity: 1;
    height: auto;
    margin-bottom: 8px;
    color: var(--fx-frosted-slate);
}

.fx-dock-divider {
    width: 100%;
    height: 1px;
    background: var(--fx-glass-border);
    margin: 16px 0;
    opacity: 0.5;
}

.fx-dock-item {
    width: 100%;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: var(--fx-frosted-slate);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    /* Ensure tooltip doesn't break layout if inside, but we positioned absolute outside */
    overflow: visible;
    /* Changing to visible for tooltip to show outside */
}

.fx-dock:not(.expanded) .fx-dock-item {
    padding: 0;
    justify-content: center;
}

.fx-dock-item .material-icons-round {
    font-size: 18px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.fx-dock-text {
    margin-left: 12px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.2s ease;
}

.fx-dock.expanded .fx-dock-text {
    opacity: 1;
    transform: translateX(0);
}

.fx-dock-item:hover {
    color: var(--fx-chrome-halo);
    background: rgba(255, 255, 255, 0.05); /* Softer hover */
}

.fx-dock-item.active {
    color: var(--fx-chrome-halo);
    background: rgba(255, 255, 255, 0.08); /* Clean active state */
    border-left: 3px solid var(--fx-accent-os); /* Use OS accent instead of neon cyan */
}

.fx-dock-item.active .material-icons-round {
    color: var(--fx-accent-os);
}

.fx-dock-footer {
    width: 100%;
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* TICKER BAR (V3 STANDARD) */
.ticker-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--ticker-height);
    background-color: var(--fx-bg-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    box-sizing: border-box;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--fx-text-secondary);
    z-index: 100;
    border-top: 1px solid var(--fx-glass-border);
}

.ticker-bar a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.ticker-bar a:hover {
    color: #00f3ff;
    /* --neon-cyan */
    text-shadow: 0 0 8px #00f3ff;
}

/* Ensure Center is Center */
.ticker-bar .system-status {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* STAGE */
.fx-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.01), transparent 50%);
}

.fx-hud {
    padding: 0 var(--gap-md);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    margin-bottom: var(--gap-md);
    flex-shrink: 0;
}

.fx-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--gap-md);
    padding: 0 var(--gap-md) 40px var(--gap-md);
}

/* NOTIFICATIONS */
#fx-notification-area {
    position: fixed;
    top: 72px;
    right: 24px;
    width: 350px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.fx-toast {
    background: var(--fx-bg-surface);
    border: 1px solid var(--fx-border-subtle);
    backdrop-filter: blur(12px);
    padding: 16px;
    border-radius: 8px;
    color: var(--fx-text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); /* Softer shadow */
    display: flex;
    align-items: flex-start;
    gap: 12px;
    pointer-events: auto;
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.3s ease;
    border-left: 4px solid var(--fx-frosted-slate); /* Thicker, cleaner border */
}

.fx-toast.closing {
    opacity: 0;
    transform: translateX(20px);
}

.fx-toast.success {
    border-color: var(--fx-accent-success);
}

.fx-toast.error {
    border-color: var(--fx-accent-alert);
}

.fx-toast.system-update {
    border-color: var(--fx-accent-blue);
    background: var(--fx-bg-surface);
}

.toast-icon {
    padding-top: 2px;
}

.fx-toast.success .toast-icon {
    color: var(--fx-accent-success);
}

.fx-toast.error .toast-icon {
    color: var(--fx-accent-alert);
}

.fx-toast.system-update .toast-icon {
    color: var(--fx-accent-cyan);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    display: block;
}

.toast-msg {
    font-size: 0.8rem;
    color: var(--fx-neon-gray-core);
    line-height: 1.4;
}

.toast-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.fx-btn-xs {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--fx-chrome-halo);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
}

.fx-btn-xs.primary {
    background: var(--fx-accent-cyan);
    color: #000;
    font-weight: 600;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* NEW: DATA ENTRY FORM MODAL */
.fx-modal-glass.small-form {
    width: 500px;
    height: auto;
    max-height: 90vh;
}

.fx-modal-footer {
    border-top: 1px solid var(--fx-glass-border);
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.fx-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: 'Exo 2', sans-serif;
    transition: all 0.2s;
    border: none;
}

.fx-btn.primary {
    background: var(--fx-text-primary);
    color: var(--fx-bg-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.fx-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    background: #ffffff; /* Brighter white for dark mode */
}

.fx-btn-text {
    background: transparent;
    color: var(--fx-text-secondary);
}

.fx-btn-text:hover {
    color: var(--fx-text-primary);
    background: rgba(255, 255, 255, 0.05); /* Slight hover state */
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    color: var(--fx-frosted-slate);
    font-size: 0.8rem;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--fx-glass-border);
    color: var(--fx-chrome-halo);
    padding: 10px 12px;
    border-radius: 6px;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.95rem;
    transition: border 0.2s;
}

.form-input:focus {
    border-color: var(--fx-accent-cyan);
    outline: none;
    background: rgba(6, 182, 212, 0.05);
}


/* GLASSMORPHISM PROTOCOL V2 - Corporate */
.fx-glass-panel {
    background: var(--fx-bg-surface);
    border: 1px solid var(--fx-border-subtle);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* Soft drop shadow */
    transition: all 0.2s ease;
}

[data-theme="light"] .fx-glass-panel {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.fx-card {
    background: var(--fx-premium-card-bg);
    border: 1px solid var(--fx-premium-border);
    border-radius: 12px;
    padding: 24px;
    position: relative;
    box-shadow: var(--fx-premium-shadow);
    transition: transform 0.2s ease, background 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.fx-card:hover {
    border-color: var(--fx-premium-border-hover);
}

/* STANDARDIZED CREATE BUTTONS */
.fx-create-btn {
    background: var(--fx-text-primary);
    border: 1px solid transparent;
    color: var(--fx-bg-primary);
    padding: 6px 16px;
    border-radius: 6px; /* Flatter radius */
    font-size: 0.8rem;
    font-weight: 500;
    font-family: var(--font-body);
    text-transform: none; /* Corporate buttons usually avoid ALL CAPS */
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    height: 32px;
}

.fx-create-btn:hover {
    background: #ffffff; /* Solid hover */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.fx-create-btn .material-icons-round {
    font-size: 16px;
}

.fx-card.wide {
    grid-column: span 2;
}

.fx-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.fx-metric-large {
    font-size: 3rem;
    font-weight: 200;
    color: var(--fx-chrome-halo);
}

.fx-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    width: 100%;
    margin-top: 12px;
    overflow: hidden;
}

.fx-progress-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--fx-accent-cyan), var(--fx-deep-cobalt));
    box-shadow: 0 0 10px var(--fx-accent-cyan);
}

.scenario-viewport {
    width: 100%;
    height: 300px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--fx-glass-border);
    border-radius: 12px;
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    align-items: flex-end;
    /* Align to bottom */
    justify-content: flex-start;
    padding: 0 60px 120px 60px;
    /* Add bottom padding for node space */
}

.scenario-road {
    position: absolute;
    bottom: 50px;
    /* Position line at the bottom, matching padding */
    top: auto;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--fx-accent-success) 0%, var(--fx-accent-cyan) 33%, var(--fx-frosted-slate) 33%, rgba(255, 255, 255, 0.05) 100%);
    z-index: 1;
}

.scenario-node {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 220px;
    flex: 0 0 auto;
    margin-right: 80px;
    transition: all 0.2s ease;

    background: var(--fx-bg-surface);
    border: 1px solid var(--fx-border-subtle);
    padding: 16px;
    border-radius: 8px; /* Standardize radii */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

    opacity: 1;
    color: var(--fx-text-secondary);
}

.scenario-node:hover {
    transform: translateY(-2px);
    border-color: var(--fx-text-primary);
    color: var(--fx-text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.scenario-node.selected-node {
    border-color: var(--fx-text-primary);
    background: var(--fx-bg-primary);
    color: var(--fx-text-primary);
    transform: scale(1.02) translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.scenario-node.complete {
    color: var(--fx-accent-success);
    border-color: rgba(16, 185, 129, 0.3);
}

.scenario-node.future {
    opacity: 0.5; /* Muted but professional */
    color: var(--fx-text-secondary);
    border-style: dashed;
}

.node-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--fx-bg-primary);
    border: 1px solid var(--fx-border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
    color: inherit;
}

.scenario-node.active .node-icon {
    border-color: var(--fx-text-primary);
    background: var(--fx-bg-surface);
}

.node-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    text-align: center;
}

.node-sub {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: center;
}

.future-fog {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40%;
    background: linear-gradient(90deg, transparent 0%, var(--fx-void) 100%);
    pointer-events: none;
    z-index: 3;
}

@keyframes pulse-node {
    0% {
        box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(6, 182, 212, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(6, 182, 212, 0);
    }
}

.scenario-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--fx-glass-border);
}

.phase-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--fx-glass-border);
    border-radius: 8px;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.phase-card.active {
    border-color: var(--fx-accent-cyan);
    background: rgba(6, 182, 212, 0.05);
}

.phase-card h5 {
    color: var(--fx-frosted-slate);
    font-size: 0.85rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.phase-card.active h5 {
    color: var(--fx-accent-cyan);
}

.phase-items {
    list-style: none;
    font-size: 0.8rem;
    color: var(--fx-neon-gray-core);
}

.phase-items li {
    margin-bottom: 6px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
}

.phase-items li::before {
    content: '•';
    color: var(--fx-frosted-slate);
}

.log-stream {
    max-height: 400px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid var(--fx-glass-border);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.log-entry {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    display: grid;
    grid-template-columns: 120px 100px 1fr;
    gap: 10px;
    color: var(--fx-neon-gray-core);
}

.log-entry:hover {
    background: rgba(255, 255, 255, 0.02);
}

.log-time {
    color: var(--fx-frosted-slate);
}

.log-type {
    color: var(--fx-accent-cyan);
    font-weight: 600;
}

.log-type.error {
    color: var(--fx-accent-alert);
}

.log-type.success {
    color: var(--fx-accent-success);
}

.fx-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--fx-neon-gray-core);
    font-size: 0.9rem;
}

.fx-table th {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--fx-glass-border);
}

.fx-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.fx-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--fx-frosted-slate);
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 12px;
}

.fx-tag.blue {
    color: var(--fx-accent-cyan);
    background: rgba(6, 182, 212, 0.1);
}

.fx-tag.green {
    color: var(--fx-accent-success);
    background: rgba(16, 185, 129, 0.1);
}

.fx-btn-sm {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--fx-chrome-halo);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
}

.fx-btn-sm:hover {
    background: var(--fx-accent-cyan);
    color: #000;
}

.fx-icon-btn {
    background: none;
    border: none;
    color: var(--fx-frosted-slate);
    cursor: pointer;
    padding: 4px;
}

.fx-icon-btn:hover {
    color: var(--fx-accent-alert);
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.checklist-item.danger {
    border-left: 2px solid var(--fx-accent-alert);
    padding-left: 12px;
}

.fx-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.fx-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.fx-modal-glass {
    width: 800px;
    height: 600px;
    background: rgba(10, 14, 25, 0.95);
    border: 1px solid var(--fx-glass-border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fx-modal-header {
    height: 60px;
    border-bottom: 1px solid var(--fx-glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.fx-modal-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.settings-group h4 {
    color: var(--fx-accent-cyan);
    font-size: 0.8rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--fx-glass-border);
    margin-bottom: 12px;
    padding-bottom: 8px;
}

.input-row {
    margin-bottom: 12px;
}

.input-label {
    display: block;
    font-size: 0.8rem;
    color: var(--fx-frosted-slate);
    margin-bottom: 4px;
}

.fx-input {
    width: 100%;
    background: var(--fx-premium-inner-accent);
    border: 1px solid var(--fx-border-subtle);
    color: var(--fx-text-primary);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace; /* Modern input style */
    transition: all 0.2s ease;
}
.fx-input:focus {
    border-color: var(--fx-neon-cyan);
    outline: none;
}

/* --- SCENARIO MAP ENHANCEMENTS --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.fx-table tr {
    transition: background-color 0.2s;
}

.fx-table tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* FXRP - FLUXIVE X-RAY PROTOCOL STYLES */
[data-fxrp-active="true"] .fxrp-element {
    position: relative !important;
    outline: 1px dashed rgba(0, 255, 242, 0.3) !important;
}

[data-fxrp-active="true"] .fxrp-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
    font-family: 'Play', 'Courier New', monospace;
    gap: 2px;
}

[data-fxrp-active="true"] .fxrp-id-tag {
    background: #000;
    color: #00fff2;
    padding: 1px 3px;
    border-radius: 3px;
    font-size: 8px;
    border: 1px solid #00fff2;
    box-shadow: 0 0 5px rgba(0, 255, 242, 0.5);
}

[data-fxrp-active="true"] .fxrp-data-tag {
    background: #1a001a;
    color: #ff00ff;
    padding: 1px 3px;
    border-radius: 3px;
    font-size: 8px;
    border: 1px solid #ff00ff;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
}

[data-fxrp-active="true"] .fxrp-badge-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

[data-fxrp-active="true"] .fxrp-nav-tree-container {
    position: relative;
    display: inline-block;
}

[data-fxrp-active="true"] .fxrp-hover-tree {
    position: absolute;
    bottom: calc(100% + 5px);
    right: 0;
    width: 200px;
    background: rgba(6, 10, 18, 0.95);
    border: 1px solid var(--fx-glass-border);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
    font-family: 'Exo 2', 'Play', sans-serif;
    color: var(--fx-chrome-halo);
}

[data-fxrp-active="true"] .fxrp-nav-tree-container:hover .fxrp-hover-tree {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

[data-fxrp-active="true"] .fxrp-hover-title {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--fx-accent-cyan);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(6, 182, 212, 0.3);
    font-weight: 600;
    letter-spacing: 0.5px;
}

[data-fxrp-active="true"] .fxrp-tree-item {
    font-size: 11px;
    padding: 3px 0;
    color: var(--fx-frosted-slate);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-fxrp-active="true"] .fxrp-tree-item:last-child {
    color: var(--fx-chrome-halo);
    font-weight: 500;
}

/* Smart Expand */
[data-fxrp-active="true"] .fxrp-element:hover .fxrp-data-tag,
[data-fxrp-active="true"] .fxrp-element:hover .fxrp-bug-link,
[data-fxrp-active="true"] .fxrp-element:hover .fxrp-tree-btn,
[data-fxrp-active="true"] .fxrp-element:hover .fxrp-schema-btn {
    opacity: 1;
}

/* Data Schema Hover Enhancements */
[data-fxrp-active="true"] .fxrp-hover-schema {
    width: 240px;
}

[data-fxrp-active="true"] .fxrp-schema-db-title {
    font-size: 9px;
    color: var(--fx-neon-gray-core);
    margin-bottom: 6px;
    font-family: 'JetBrains Mono', monospace;
}

[data-fxrp-active="true"] .fxrp-schema-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 6px;
    border-radius: 4px;
}

[data-fxrp-active="true"] .fxrp-schema-ui {
    color: var(--fx-chrome-halo);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-fxrp-active="true"] .fxrp-schema-link-icon {
    font-size: 10px;
    color: var(--fx-accent-success);
    margin: 0 6px;
}

[data-fxrp-active="true"] .fxrp-schema-db {
    color: var(--fx-accent-cyan);
    font-family: 'JetBrains Mono', monospace;
    flex: 1;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-fxrp-active="true"] .fxrp-bug-link {
    background: rgba(0, 0, 0, 0.8);
    color: var(--fx-neon-cyan);
    font-size: 11px;
    padding: 2px;
    border-radius: 4px;
    border: 1px solid var(--fx-neon-cyan);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

[data-fxrp-active="true"] .fxrp-bug-link:hover {
    transform: scale(1.15);
    box-shadow: 0 0 8px var(--fx-neon-cyan);
}

/* Ghost Objects (Missing ID) */
[data-fxrp-active="true"] .fxrp-ghost {
    outline: 2px solid #ffaa00 !important;
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
}