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

/* ... (Base Variables from v3.8.0) ... */
:root {
    --fx-void: #060A12;
    --fx-deep-cobalt: #06185A;
    --fx-deep-cobalt-dim: rgba(6, 24, 90, 0.5);

    --fx-frosted-slate: #415255;
    --fx-neon-gray-core: #A5ADAD;
    --fx-neon-gray-dim: rgba(165, 173, 173, 0.5);

    --fx-chrome-halo: #F2F5F8;
    --fx-accent-cyan: #06B6D4;
    --fx-accent-alert: #EF4444;
    --fx-accent-success: #10B981;
    --fx-accent-warning: #EAB308;

    --fx-glass-border: rgba(165, 173, 173, 0.15);

    --dock-width-collapsed: 72px;
    --dock-width-expanded: 240px;
    --dock-width: var(--dock-width-collapsed);

    --gap-sm: 12px;
    --gap-md: 24px;

    --header-height: 48px;
    --ticker-height: 32px;
}

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

body {
    background-color: var(--fx-void);
    background-image: radial-gradient(circle at 10% 20%, var(--fx-deep-cobalt-dim) 0%, transparent 40%), radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 40%);
    color: var(--fx-neon-gray-core);
    font-family: 'Exo 2', sans-serif;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

h1,
h2,
h3,
h4 {
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    color: var(--fx-chrome-halo);
}

.fx-label {
    font-family: 'Exo 2', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 10px;
    color: var(--fx-frosted-slate);
    font-weight: 600;
}

/* GLOBAL HEADER */
#fx-global-header {
    width: 100%;
    height: var(--header-height);
    background: rgba(6, 10, 18, 0.95);
    border-bottom: 1px solid var(--fx-glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    font-family: 'Exo 2', sans-serif;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

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

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

.logo-icon {
    color: var(--fx-accent-cyan);
    font-size: 20px;
}

.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;
    background: linear-gradient(90deg, rgba(5, 8, 16, 0.9) 0%, rgba(5, 8, 16, 0.6) 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    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%;
}

.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-deep-cobalt);
    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;
}

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

.fx-dock-item .material-icons-round {
    font-size: 20px;
    width: 24px;
    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);
}

.fx-dock-item.active {
    color: var(--fx-chrome-halo);
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.1) 0%, transparent 100%);
    border-left: 2px solid var(--fx-accent-cyan);
}

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

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

/* TICKER BAR */
.fx-ticker-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: var(--ticker-height);
    background: #020408;
    border-top: 1px solid var(--fx-accent-cyan);
    display: flex;
    align-items: center;
    overflow: hidden;
    z-index: 9999;
}

.fx-ticker-wrapper {
    display: flex;
    white-space: nowrap;
    animation: ticker 45s linear infinite;
}

.fx-ticker-content {
    display: flex;
    align-items: center;
}

.ticker-item {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--fx-neon-gray-core);
    margin-right: 32px;
    display: flex;
    align-items: center;
}

.ticker-item .label {
    color: var(--fx-frosted-slate);
    margin-right: 6px;
    font-weight: 600;
}

.ticker-sep {
    color: var(--fx-deep-cobalt);
    margin-right: 32px;
    font-size: 10px;
}

@keyframes ticker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* 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: rgba(6, 10, 18, 0.9);
    border: 1px solid var(--fx-glass-border);
    backdrop-filter: blur(16px);
    padding: 16px;
    border-radius: 8px;
    color: var(--fx-chrome-halo);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    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: 3px solid var(--fx-frosted-slate);
}

.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-cyan);
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(6, 10, 18, 0.95) 100%);
}

.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-accent-cyan);
    color: #000;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.fx-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(6, 182, 212, 0.3);
}

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

.fx-btn-text:hover {
    color: var(--fx-chrome-halo);
}

.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);
}


/* Other Components (Retained) */
.fx-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
    border-top: 1px solid rgba(165, 173, 173, 0.15);
    border-radius: 12px;
    padding: 24px;
    position: relative;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.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: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 60px;
}

.scenario-road {
    position: absolute;
    top: 50%;
    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: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
    margin-right: 120px;
    opacity: 0.4;
    transition: all 0.4s ease;
}

.scenario-node.complete {
    opacity: 1;
    color: var(--fx-accent-success);
}

.scenario-node.active {
    opacity: 1;
    color: var(--fx-accent-cyan);
    transform: scale(1.1);
}

.scenario-node.future {
    opacity: 0.3;
    color: var(--fx-frosted-slate);
    border-style: dashed;
}

.node-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--fx-void);
    border: 2px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    margin-bottom: 12px;
}

.scenario-node.active .node-icon {
    box-shadow: 0 0 30px var(--fx-accent-cyan);
    animation: pulse-node 2s infinite;
    background: rgba(6, 182, 212, 0.1);
}

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

.node-sub {
    font-size: 10px;
    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: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--fx-chrome-halo);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Exo 2', sans-serif;
}