/* ==========================================================================
   KEX 3.0 // AEROSPACE CHRONO-AVIONICS DESIGN SYSTEM
   The Ultimate Fusion of SpaceX High-Tech Precision & Starfield NASA-punk Utilitarianism
   Clean, Sleek, Tactical, High-Contrast & Deeply Functional
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@500;600;700&family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700;800&family=Rajdhani:wght@500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    /* Layout & Proportions */
    --phi: 1.618;
    --stage-ratio: 61.8%;
    --inspector-ratio: 38.2%;
    --top-bar-h: 46px;
    --bottom-bar-h: 28px;

    /* Typography Families */
    --font-display: 'Rajdhani', 'Space Grotesk', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Chakra Petch', monospace;

    /* Typography Scale */
    --font-xxs: 9.5px;
    --font-xs: 11px;
    --font-sm: 12px;
    --font-base: 13px;
    --font-md: 15px;
    --font-lg: 19px;
    --font-xl: 24px;
    --font-xxl: 28px;

    /* SpaceX Deep Space & Obsidian Palette */
    --ksp-bg: #040609;
    --ksp-bg-deep: #020305;
    --ksp-surface: rgba(10, 14, 22, 0.85);
    --ksp-surface-card: rgba(13, 19, 30, 0.9);
    --ksp-surface-elevated: #141B29;
    --ksp-surface-hud: rgba(6, 9, 14, 0.92);

    /* SpaceX Precision Borders */
    --ksp-border: rgba(255, 255, 255, 0.08);
    --ksp-border-light: rgba(255, 255, 255, 0.15);
    --ksp-border-bright: rgba(255, 255, 255, 0.28);
    --ksp-border-hover: rgba(0, 240, 255, 0.5);
    --ksp-border-active: rgba(255, 122, 0, 0.75);

    /* Starfield Constellation Signature 4-Bar Spectrum */
    --sf-red: #EF4444;
    --sf-orange: #FF7A00;
    --sf-yellow: #FBBF24;
    --sf-blue: #00E5FF;
    --sf-cyan: #00F0FF;

    /* SpaceX Telemetry & Status Accents */
    --spacex-cyan: #00F0FF;
    --spacex-cyan-glow: rgba(0, 240, 255, 0.35);
    --spacex-cyan-soft: #38BDF8;
    --ksp-orange: #FF7A00;
    --ksp-orange-glow: rgba(255, 122, 0, 0.35);
    --ksp-cyan: #00F0FF;
    --ksp-cyan-soft: #38BDF8;
    --ksp-cyan-glow: rgba(0, 240, 255, 0.35);
    --ksp-gold: #FBBF24;
    --ksp-green: #00E599;
    --ksp-green-glow: rgba(0, 229, 153, 0.35);
    --ksp-red: #EF4444;
    --ksp-red-glow: rgba(239, 68, 68, 0.4);
    --ksp-blue: #2563EB;

    /* Tactile Starfield Lunar Titanium & Hierarchy */
    --starfield-titanium: #E2DFD8;
    --c-primary: #E5E7EB;
    --c-primary-bright: #FFFFFF;
    --c-muted: #8E9BAE;
    --c-subtle: #576579;
    --c-nominal: #00E599;
    --c-warning: #FBBF24;
    --c-error: #EF4444;

    /* Starfield NASA-punk Chamfers & Geometric Radii */
    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-pill: 9999px;

    /* SpaceX High-Speed Transitions */
    --trans-fast: 0.12s cubic-bezier(0.4, 0, 0.2, 1);
    --trans-smooth: 0.22s cubic-bezier(0.16, 1, 0.3, 1);

    /* Starfield Hazard Emergency Stripes */
    --hazard-stripes: repeating-linear-gradient(
        -45deg,
        rgba(239, 68, 68, 0.9),
        rgba(239, 68, 68, 0.9) 10px,
        rgba(153, 27, 27, 0.95) 10px,
        rgba(153, 27, 27, 0.95) 20px
    );
}

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

input, textarea, select {
    user-select: text;
    -webkit-user-select: text;
}

html, body {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    overflow: hidden;
    background-color: var(--ksp-bg);
    color: var(--c-primary);
    font-family: var(--font-body);
    font-size: var(--font-base);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Minimalist SpaceX Carbon Scrollbar */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: rgba(4, 6, 9, 0.6);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--spacex-cyan);
    box-shadow: 0 0 8px var(--spacex-cyan);
}

/* ==========================================================================
   DEEP SPACE CANVAS & BLUEPRINT UNDERLAY (SPACEX × STARFIELD)
   ========================================================================== */
.space-canvas-underlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at 85% 15%, rgba(0, 240, 255, 0.07) 0%, transparent 40%),
        radial-gradient(circle at 15% 85%, rgba(255, 122, 0, 0.05) 0%, transparent 35%),
        radial-gradient(circle at 50% 50%, rgba(10, 15, 24, 0.98) 0%, #030407 100%);
}

.space-canvas-underlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 36px 36px;
    opacity: 0.65;
}

/* Starfield Precision Target Crosshair Ticks */
.space-canvas-underlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(0, 240, 255, 0.18) 1px, transparent 1px);
    background-size: 144px 144px;
    opacity: 0.7;
}

/* Desktop App Container */
#astraeus-desktop {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* ==========================================================================
   TOP SYSTEM BAR (CHRONO-AVIONICS CONSOLE)
   ========================================================================== */
.system-topbar {
    height: var(--top-bar-h);
    min-height: var(--top-bar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: rgba(7, 10, 16, 0.92);
    backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--ksp-border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 100;
}

/* Topbar Starfield Constellation Laser Accent Line */
.system-topbar::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--sf-red) 15%, 
        var(--sf-orange) 30%, 
        var(--sf-yellow) 45%, 
        var(--sf-cyan) 60%, 
        transparent 100%
    );
    opacity: 0.45;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--c-primary-bright);
    text-transform: uppercase;
}

/* Starfield Constellation Signature 4-Bar Ribbon */
.constellation-ribbon-pill {
    display: inline-flex;
    height: 9px;
    width: 32px;
    border-radius: 1px;
    overflow: hidden;
    box-shadow: 0 0 12px rgba(255, 122, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ribbon-bar { flex: 1; height: 100%; }
.ribbon-bar.red { background: var(--sf-red); }
.ribbon-bar.orange { background: var(--sf-orange); }
.ribbon-bar.yellow { background: var(--sf-yellow); }
.ribbon-bar.blue { background: var(--sf-cyan); }

/* SpaceX Navigation Mode Tabs (Horizontal Avionics Deck) */
.topbar-nav-tabs {
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(4, 7, 12, 0.75);
    padding: 3px;
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-sm);
}

.nav-tab-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    color: var(--c-muted);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--trans-fast);
    position: relative;
}

.nav-tab-btn:hover {
    color: var(--c-primary-bright);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.nav-tab-btn.active {
    color: #FFFFFF;
    background: rgba(255, 122, 0, 0.14);
    border-color: var(--sf-orange);
    box-shadow: 0 0 14px rgba(255, 122, 0, 0.25);
}

.nav-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 4px;
    right: 4px;
    height: 2px;
    background: var(--sf-orange);
    box-shadow: 0 0 8px var(--sf-orange);
}

.nav-tab-prefix {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--spacex-cyan);
    font-weight: 700;
    opacity: 0.85;
}

/* Center: Starfield Chronomark Universal Flight Clock */
.topbar-center {
    display: flex;
    align-items: center;
}

.clock-display {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 15px;
    background: rgba(6, 9, 15, 0.9);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--trans-fast);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.08);
}

.clock-display:hover {
    border-color: var(--spacex-cyan);
    background: rgba(10, 16, 26, 0.95);
    box-shadow: 0 0 16px var(--spacex-cyan-glow);
}

/* Chronomark Pulsing Dial Tick */
.clock-tick-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--spacex-cyan);
    box-shadow: 0 0 8px var(--spacex-cyan);
    animation: chronomarkTick 1.4s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes chronomarkTick {
    0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 6px var(--spacex-cyan); }
    50% { transform: scale(1.3); opacity: 0.6; box-shadow: 0 0 14px var(--spacex-cyan); }
}

#kerbalClock {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--c-primary-bright);
    letter-spacing: 0.8px;
    font-variant-numeric: tabular-nums;
}

.clock-mode-label {
    font-family: var(--font-display);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--sf-orange);
    text-transform: uppercase;
}

/* Topbar Right Actions & Status Indicators */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.operator-profile-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px;
    background: rgba(6, 9, 15, 0.8);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--starfield-titanium);
    text-transform: uppercase;
}

.operator-avatar-dot {
    width: 6px;
    height: 6px;
    border-radius: 1px;
    background: var(--spacex-cyan);
    box-shadow: 0 0 6px var(--spacex-cyan);
}

.bridge-status-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 11px;
    background: rgba(6, 9, 15, 0.8);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.bridge-status-pill.nominal {
    border-color: rgba(0, 229, 153, 0.5);
    color: var(--c-nominal);
    background: rgba(0, 229, 153, 0.08);
}
.bridge-status-pill.nominal .status-indicator-dot {
    background: var(--c-nominal);
    box-shadow: 0 0 8px var(--c-nominal);
}

.bridge-status-pill.warning {
    border-color: rgba(251, 191, 36, 0.5);
    color: var(--c-warning);
    background: rgba(251, 191, 36, 0.08);
}
.bridge-status-pill.warning .status-indicator-dot {
    background: var(--c-warning);
    box-shadow: 0 0 8px var(--c-warning);
}

.bridge-status-pill.error {
    border-color: rgba(239, 68, 68, 0.5);
    color: var(--c-error);
    background: rgba(239, 68, 68, 0.08);
}
.bridge-status-pill.error .status-indicator-dot {
    background: var(--c-error);
    box-shadow: 0 0 8px var(--c-error);
}

.status-indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: livePulse 1.6s infinite;
}

@keyframes livePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.6; }
}

.btn-topbar-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    color: var(--c-primary);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.btn-topbar-action:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    border-color: var(--ksp-border-light);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   WORKSPACE LAYOUT (GOLDEN RATIO 61.8% / 38.2%)
   ========================================================================== */
.os-workspace-body {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

.app-workspace {
    position: absolute;
    inset: 0;
    display: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--trans-smooth);
}

.app-workspace.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.stage-primary {
    width: var(--stage-ratio);
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 16px 18px;
    overflow: hidden;
    border-right: 1px solid var(--ksp-border);
    background: rgba(5, 7, 12, 0.45);
}

.inspector-secondary {
    width: var(--inspector-ratio);
    height: 100%;
    background: rgba(8, 12, 20, 0.88);
    backdrop-filter: blur(24px) saturate(160%);
    padding: 18px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: -6px 0 30px rgba(0, 0, 0, 0.5);
    border-left: 1px solid var(--ksp-border);
}

/* ==========================================================================
   FLIGHT DECK // STAGE FLOATING HUD & ORBIT VIEW (SPACEX × STARFIELD)
   ========================================================================== */
.starmap-floating-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    z-index: 10;
}

.starmap-title-cluster {
    display: flex;
    flex-direction: column;
}

.starmap-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--sf-orange);
    text-transform: uppercase;
}

.starmap-headline {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--c-primary-bright);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.fleet-view-toggle-bar {
    display: flex;
    gap: 2px;
    background: rgba(4, 7, 12, 0.85);
    padding: 3px;
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
}

.fleet-toggle-btn {
    padding: 5px 13px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--c-muted);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: all var(--trans-fast);
}

.fleet-toggle-btn:hover {
    color: var(--c-primary-bright);
}

.fleet-toggle-btn.active {
    background: rgba(255, 122, 0, 0.18);
    border-color: var(--sf-orange);
    color: #FFFFFF;
    box-shadow: 0 0 10px rgba(255, 122, 0, 0.3);
}

.starmap-filter-bar-group {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 58%;
    min-width: 0;
}

.filter-pills-floating {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.3) transparent;
}

.filter-pills-floating::-webkit-scrollbar {
    height: 3px;
}

.filter-pills-floating::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.3);
    border-radius: 3px;
}

.filter-pill {
    padding: 4px 11px;
    background: rgba(8, 12, 20, 0.8);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    color: var(--c-muted);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--trans-fast);
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-pill:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--ksp-border-light);
}

.filter-pill.active {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--spacex-cyan);
    color: var(--spacex-cyan);
    box-shadow: 0 0 12px var(--spacex-cyan-glow);
}

.filter-pill.custom-body-pill {
    border-color: rgba(229, 131, 46, 0.5);
}

.filter-pill.custom-body-pill.active {
    background: rgba(255, 122, 0, 0.18);
    border-color: var(--sf-orange);
    color: #FFFFFF;
    box-shadow: 0 0 10px rgba(255, 122, 0, 0.3);
}

.btn-manage-bodies {
    padding: 4px 11px;
    background: rgba(229, 131, 46, 0.18);
    border: 1px solid var(--ksp-orange);
    border-radius: var(--radius-xs);
    color: #FFFFFF;
    font-family: var(--font-display);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all var(--trans-fast);
}

.btn-manage-bodies:hover {
    background: var(--ksp-orange);
    color: #0A0D13;
    box-shadow: 0 0 12px var(--ksp-orange-glow);
}

/* Starmap Full-Stage Canvas Viewport */
.starmap-canvas-viewport {
    flex: 1;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, rgba(12, 19, 32, 0.5) 0%, rgba(3, 5, 8, 0.95) 100%);
    border: 1px solid var(--ksp-border);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8);
}

/* SpaceX Corner Target Brackets on Canvas */
.starmap-canvas-viewport::before,
.starmap-canvas-viewport::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-color: var(--spacex-cyan);
    pointer-events: none;
    z-index: 5;
    opacity: 0.7;
}
.starmap-canvas-viewport::before {
    top: 8px;
    left: 8px;
    border-top: 2px solid var(--spacex-cyan);
    border-left: 2px solid var(--spacex-cyan);
}
.starmap-canvas-viewport::after {
    bottom: 8px;
    right: 8px;
    border-bottom: 2px solid var(--spacex-cyan);
    border-right: 2px solid var(--spacex-cyan);
}

#fleetOrbitCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Floating Bottom Vessel Dock */
.vessel-dock-floating {
    position: absolute;
    bottom: 14px;
    left: 18px;
    right: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 14px;
    background: rgba(7, 10, 16, 0.92);
    backdrop-filter: blur(20px);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    z-index: 10;
}

.vessel-dock-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--sf-orange);
    white-space: nowrap;
    text-transform: uppercase;
}

.vessel-chips-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    width: 100%;
    padding: 2px 0;
}

.vessel-chip {
    padding: 5px 12px;
    background: rgba(12, 17, 28, 0.85);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--trans-fast);
}

.vessel-chip:hover {
    background: rgba(18, 26, 44, 0.95);
    border-color: var(--spacex-cyan);
}

.vessel-chip.active {
    background: rgba(255, 122, 0, 0.15);
    border-color: var(--sf-orange);
    box-shadow: 0 0 14px var(--ksp-orange-glow);
}

.vessel-chip-name {
    font-family: var(--font-display);
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--c-primary-bright);
}

.vessel-chip-meta {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--c-muted);
}

/* ==========================================================================
   FLEET CATALOG VIEW (VISUAL CRAFT DIRECTORY)
   ========================================================================== */
.fleet-catalog-viewport {
    position: absolute;
    top: 56px;
    left: 18px;
    right: 18px;
    bottom: 16px;
    background: rgba(8, 12, 20, 0.94);
    backdrop-filter: blur(24px);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-md);
    padding: 18px;
    overflow-y: auto;
    z-index: 5;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}

.catalog-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ksp-border);
}

.catalog-summary-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#catalogCountLabel {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--c-primary-bright);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.vessels-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
}

.vessel-catalog-card {
    background: var(--ksp-surface-card);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    transition: all var(--trans-fast);
    position: relative;
}

.vessel-catalog-card:hover, .vessel-catalog-card.active {
    transform: translateY(-2px);
    border-color: var(--sf-orange);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 16px var(--ksp-orange-glow);
}

.card-craft-graphic {
    width: 100%;
    height: 122px;
    background: #050913;
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.7);
}

.kex-procedural-blueprint-svg {
    width: 100%;
    height: 100%;
    display: block;
    transition: transform var(--trans-smooth);
}

.vessel-catalog-card:hover .kex-procedural-blueprint-svg {
    transform: scale(1.03);
}

/* Custom User Photograph View */
.card-custom-image-view,
.inspector-custom-image-view,
.preview-custom-image-view {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #030712;
}

.vessel-user-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform var(--trans-smooth);
}

.vessel-catalog-card:hover .vessel-user-img {
    transform: scale(1.05);
}

/* Sci-Fi HUD Overlay on Custom Images */
.vessel-hud-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 6px 8px;
    background: linear-gradient(180deg, rgba(5, 9, 19, 0.75) 0%, rgba(5, 9, 19, 0) 30%, rgba(5, 9, 19, 0) 65%, rgba(5, 9, 19, 0.85) 100%);
}

.hud-top-row,
.hud-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hud-tag {
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 2px;
    letter-spacing: 0.5px;
}

.photo-tag {
    background: rgba(16, 185, 129, 0.25);
    border: 1px solid rgba(16, 185, 129, 0.6);
    color: #34d399;
}

.class-tag {
    background: rgba(56, 189, 248, 0.25);
    border: 1px solid rgba(56, 189, 248, 0.6);
    color: #38bdf8;
}

.hud-vessel-stamp {
    font-family: var(--font-mono);
    font-size: 8.5px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.hud-coord-stamp {
    font-family: var(--font-mono);
    font-size: 8px;
    color: var(--ksp-gold);
}

/* Corner Reticle Brackets */
.corner-bracket {
    position: absolute;
    width: 8px;
    height: 8px;
    border-color: #38bdf8;
    border-style: solid;
    pointer-events: none;
}
.corner-bracket.top-left { top: 4px; left: 4px; border-width: 1.5px 0 0 1.5px; }
.corner-bracket.top-right { top: 4px; right: 4px; border-width: 1.5px 1.5px 0 0; }
.corner-bracket.bottom-left { bottom: 4px; left: 4px; border-width: 0 0 1.5px 1.5px; }
.corner-bracket.bottom-right { bottom: 4px; right: 4px; border-width: 0 1.5px 1.5px 0; }

.vessel-scanline-fx {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.12) 1px, transparent 1px, transparent 3px);
    pointer-events: none;
    opacity: 0.65;
}

/* Modal Vessel Preview & Upload Section */
.vessel-modal-preview-wrapper {
    background: rgba(11, 19, 36, 0.75);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vessel-modal-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.vessel-preview-mode-pills {
    display: flex;
    gap: 4px;
    background: rgba(15, 23, 42, 0.9);
    padding: 3px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-preview-pill {
    padding: 3px 10px;
    background: transparent;
    border: none;
    border-radius: var(--radius-pill);
    color: var(--c-muted);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.btn-preview-pill:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.btn-preview-pill.active {
    background: rgba(56, 189, 248, 0.22);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.5);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.vessel-interactive-preview-box {
    width: 100%;
    height: 155px;
    background: #050913;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: var(--radius-xs);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.8), 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* Dropzone for File Upload */
.vessel-image-dropzone {
    border: 2px dashed rgba(56, 189, 248, 0.4);
    border-radius: var(--radius-xs);
    background: rgba(56, 189, 248, 0.04);
    padding: 14px;
    text-align: center;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.vessel-image-dropzone:hover,
.vessel-image-dropzone.dragover {
    border-color: var(--ksp-orange);
    background: rgba(234, 168, 39, 0.12);
    box-shadow: 0 0 14px rgba(234, 168, 39, 0.25);
}

.dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.dropzone-icon {
    font-size: 24px;
}

.dropzone-text {
    font-size: 12px;
    color: #e2e8f0;
}

.highlight-link {
    color: #38bdf8;
    text-decoration: underline;
}

.preview-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 2px;
}

/* Inspector Hero Card for Vessels */
.inspector-vessel-hero-card {
    margin-bottom: 14px;
    background: rgba(10, 16, 28, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.inspector-vessel-graphic-wrap {
    width: 100%;
    height: 165px;
    background: #050913;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inspector-vessel-actions-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.vessel-mode-mini-badge {
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    color: #38bdf8;
}

.btn-icon-hud {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: var(--radius-xs);
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.btn-icon-hud:hover {
    background: #38bdf8;
    color: #060b14;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* Fullscreen / Zoom Display in Modal */
.modal-viewer-display {
    width: 100%;
    height: 420px;
    background: #050913;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.9);
}

.vessel-badge-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.vessel-class-tag {
    font-size: 10px;
    font-family: var(--font-mono);
    font-weight: 700;
    padding: 2px 7px;
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.4);
    color: var(--spacex-cyan);
    border-radius: var(--radius-xs);
    letter-spacing: 0.5px;
}

.vessel-body-tag {
    font-size: 10.5px;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--sf-yellow);
}

.catalog-vessel-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    color: var(--c-primary-bright);
    letter-spacing: 0.5px;
}

.catalog-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    font-size: 10.5px;
    font-family: var(--font-mono);
    background: rgba(4, 7, 12, 0.65);
    padding: 8px 10px;
    border-radius: var(--radius-xs);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.catalog-metrics-grid span {
    color: var(--c-muted);
}

/* ==========================================================================
   INSPECTOR SECONDARY (SPACEX × STARFIELD AVIONICS DIAGNOSTICS)
   ========================================================================== */
.ship-header-cluster {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ksp-border);
}

.ship-manufacturer-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--sf-orange);
    text-transform: uppercase;
}

.ship-designation-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.ship-meta-subtitle {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--c-muted);
    letter-spacing: 0.5px;
}

/* STARFIELD SUBSYSTEM POWER ALLOCATION RACK (COCKPIT PIPS) */
.subsystem-power-rack {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: rgba(4, 7, 12, 0.7);
    padding: 10px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--ksp-border);
}

.power-rack-module {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.power-rack-label {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    color: var(--c-muted);
    letter-spacing: 1px;
}

.power-pip-bar {
    display: flex;
    gap: 3px;
}

.pip {
    width: 6px;
    height: 14px;
    border-radius: 1px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all var(--trans-fast);
}

.pip.filled {
    background: var(--sf-orange);
    border-color: #FFA04D;
    box-shadow: 0 0 8px rgba(255, 122, 0, 0.6);
}

.pip.filled.cyan {
    background: var(--spacex-cyan);
    border-color: #70F7FF;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

.pip.filled.green {
    background: var(--spacex-green);
    border-color: #66FFCC;
    box-shadow: 0 0 8px rgba(0, 229, 153, 0.6);
}

/* Section Labels */
.section-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-display);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--c-primary-bright);
    text-transform: uppercase;
}

.field-hint {
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 500;
    color: var(--c-muted);
    letter-spacing: 0.5px;
}

/* SPACEX TELEMETRY HUD GRID & METRIC CARDS */
.telemetry-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.metric-card {
    background: var(--ksp-surface-card);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: all var(--trans-fast);
    position: relative;
}

/* Corner Crosshair Target Brackets */
.metric-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    width: 6px;
    height: 6px;
    border-top: 1.5px solid rgba(255, 255, 255, 0.25);
    border-left: 1.5px solid rgba(255, 255, 255, 0.25);
    pointer-events: none;
    transition: all var(--trans-fast);
}

.metric-card::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 6px;
    height: 6px;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.25);
    border-right: 1.5px solid rgba(255, 255, 255, 0.25);
    pointer-events: none;
    transition: all var(--trans-fast);
}

.metric-card:hover {
    border-color: rgba(0, 240, 255, 0.35);
    background: rgba(18, 26, 42, 0.95);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.metric-card:hover::before,
.metric-card:hover::after {
    border-color: var(--spacex-cyan);
}

.metric-label {
    font-family: var(--font-display);
    font-size: 11px;
    color: var(--c-muted);
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 17px;
    font-weight: 700;
    color: var(--c-primary-bright);
    letter-spacing: -0.2px;
    font-variant-numeric: tabular-nums;
}

/* 5-Step Mission Sequence Milestones */
.sequence-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sequence-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sequence-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 11px;
    background: rgba(5, 8, 14, 0.7);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    transition: all var(--trans-fast);
}

.sequence-step.active {
    border-color: var(--sf-orange);
    background: rgba(255, 122, 0, 0.1);
    box-shadow: 0 0 10px rgba(255, 122, 0, 0.18);
}

.sequence-step.completed {
    border-color: rgba(0, 229, 153, 0.35);
    opacity: 0.85;
}

.step-num {
    width: 20px;
    height: 20px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: #FFFFFF;
}

.sequence-step.active .step-num {
    background: var(--sf-orange);
    color: #FFFFFF;
    box-shadow: 0 0 8px var(--ksp-orange-glow);
}

.sequence-step.completed .step-num {
    background: var(--spacex-green);
    color: #000000;
}

.step-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.step-name {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    color: #FFFFFF;
    letter-spacing: 0.4px;
}

.step-note {
    font-size: 10px;
    color: var(--c-muted);
}

/* ==========================================================================
   TACTILE ACTION BUTTONS (CHAMFERED SPACEX × STARFIELD CONTROLS)
   ========================================================================== */
.action-buttons-stack {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: auto;
}

/* Primary Button with Starfield 45° Chamfered Edges */
.btn-primary-action {
    width: 100%;
    padding: 9px 16px;
    background: linear-gradient(135deg, #FF7A00 0%, #D95D00 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
    color: #FFFFFF;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--ksp-orange-glow);
    transition: all var(--trans-fast);
}

.btn-primary-action:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #FF8E24 0%, #EA6B00 100%);
    box-shadow: 0 6px 20px rgba(255, 122, 0, 0.5);
}

.btn-primary-action:active {
    transform: translateY(1px);
}

.btn-primary-action.small {
    width: auto;
    padding: 5px 13px;
    font-size: 12px;
}

.btn-secondary-action {
    width: 100%;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ksp-border);
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
    color: var(--c-primary);
    font-family: var(--font-display);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.btn-secondary-action:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    border-color: var(--ksp-border-light);
}

/* Starfield Emergency Hazard Stripes on Abort */
.btn-abort-action {
    width: 100%;
    padding: 8px 14px;
    background: var(--hazard-stripes);
    border: 1px solid rgba(255, 255, 255, 0.3);
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
    color: #FFFFFF;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
    transition: all var(--trans-fast);
}

.btn-abort-action:hover {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.7);
    filter: brightness(1.15);
}

/* ==========================================================================
   APP 2: MISSIONI & PROGRAMMI (KEX 1.0 LEGACY)
   ========================================================================== */
.programs-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ksp-border);
}

.programs-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 14px;
    overflow-y: auto;
    padding-right: 4px;
}

.program-card-item {
    background: var(--ksp-surface-card);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    transition: all var(--trans-fast);
    position: relative;
}

.program-card-item:hover, .program-card-item.active {
    transform: translateY(-2px);
    border-color: var(--sf-orange);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 16px var(--ksp-orange-glow);
}

.program-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.prog-code-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    background: rgba(255, 122, 0, 0.15);
    border: 1px solid var(--sf-orange);
    color: var(--sf-orange);
    border-radius: var(--radius-xs);
}

.prog-card-name {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.4px;
}

.prog-card-desc {
    font-size: 11.5px;
    color: var(--c-muted);
    line-height: 1.45;
}

.program-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(4, 7, 12, 0.8);
    border-radius: 1px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--ksp-border);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--spacex-cyan), #38BDF8);
    transition: width 0.3s ease;
    box-shadow: 0 0 8px var(--spacex-cyan-glow);
}

.program-objectives-checklist {
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 230px;
    overflow-y: auto;
}

.objective-check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(5, 8, 14, 0.6);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.objective-check-item:hover {
    background: rgba(18, 26, 42, 0.8);
    border-color: var(--ksp-border-hover);
}

.objective-check-item.completed {
    border-color: rgba(0, 229, 153, 0.35);
    background: rgba(0, 229, 153, 0.05);
}

.objective-check-item.completed span {
    text-decoration: line-through;
    color: var(--c-muted);
}

.program-logbook-stream {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 160px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 10.5px;
}

.logbook-entry {
    padding: 7px 10px;
    background: rgba(5, 8, 14, 0.65);
    border-left: 2px solid var(--sf-orange);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    color: var(--c-primary);
}

/* Programs Search & Filter Controls */
.programs-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.prog-search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(4, 7, 12, 0.75);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    padding: 3px 10px;
}

.prog-filter-selects {
    display: flex;
    gap: 6px;
}

.input-field-compact {
    padding: 5px 9px;
    background: rgba(4, 7, 12, 0.8);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    color: #FFFFFF;
    font-family: var(--font-display);
    font-size: 11.5px;
    font-weight: 600;
    outline: none;
    transition: all var(--trans-fast);
}

.input-field-compact:focus {
    border-color: var(--sf-orange);
    box-shadow: 0 0 8px var(--ksp-orange-glow);
}

.prog-count-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.35);
    color: var(--spacex-cyan);
    border-radius: var(--radius-xs);
    letter-spacing: 0.5px;
}

/* Program Inspector Details */
.prog-header-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.prog-body-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.4);
    color: var(--sf-yellow);
    border-radius: var(--radius-xs);
    letter-spacing: 0.5px;
}

.prog-priority-badge {
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prog-priority-badge.priority-critical {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--sf-red);
    color: var(--sf-red);
}

.prog-priority-badge.priority-high {
    background: rgba(255, 122, 0, 0.2);
    border: 1px solid var(--sf-orange);
    color: var(--sf-orange);
}

.prog-priority-badge.priority-medium {
    background: rgba(0, 240, 255, 0.2);
    border: 1px solid var(--spacex-cyan);
    color: var(--spacex-cyan);
}

.prog-priority-badge.priority-low {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--c-muted);
}

.prog-meta-category {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    color: var(--spacex-cyan-soft);
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.prog-action-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--ksp-border);
}

.btn-prog-action {
    padding: 4px 9px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    color: var(--c-primary);
    font-family: var(--font-display);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.btn-prog-action:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #FFFFFF;
    border-color: var(--ksp-border-light);
}

.btn-prog-action.danger {
    color: var(--sf-red);
    border-color: rgba(239, 68, 68, 0.35);
}

.btn-prog-action.danger:hover {
    background: var(--sf-red);
    color: #FFFFFF;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.prog-quick-status-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
}

.quick-status-label {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    color: var(--c-muted);
}

.prog-desc-card {
    padding: 9px 12px;
    background: rgba(4, 7, 12, 0.65);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    font-size: 12px;
    line-height: 1.45;
    color: var(--starfield-titanium);
}

.prog-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    font-size: 11.5px;
    margin-top: 6px;
}

.field-hint-action {
    background: transparent;
    border: none;
    color: var(--spacex-cyan);
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    transition: all var(--trans-fast);
}

.field-hint-action:hover {
    color: #FFFFFF;
    text-shadow: 0 0 8px var(--spacex-cyan);
}

.prog-assigned-vessels-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 120px;
    overflow-y: auto;
}

.prog-inline-obj-creator {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    background: rgba(6, 9, 15, 0.85);
    border: 1px solid var(--sf-orange);
    border-radius: var(--radius-xs);
    margin-top: 8px;
    box-shadow: 0 4px 14px rgba(255, 122, 0, 0.2);
}

/* Interactive Program Configuration Modal (Large Architect) */
.modal-window.large {
    width: 760px;
    max-width: 95vw;
    max-height: 88vh;
    overflow-y: auto;
}

.program-form-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.program-form-section {
    background: rgba(4, 7, 12, 0.65);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    padding: 12px 14px;
}

.prog-section-title {
    font-family: var(--font-display);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--sf-orange);
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chip-picker-row {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.chip-picker-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    font-size: 16px;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.chip-picker-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--ksp-border-light);
}

.chip-picker-btn.active {
    background: rgba(255, 122, 0, 0.2);
    border-color: var(--sf-orange);
    box-shadow: 0 0 10px var(--ksp-orange-glow);
}

.color-picker-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.color-swatch-btn {
    width: 26px;
    height: 26px;
    border-radius: 2px;
    background: var(--c);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.color-swatch-btn:hover {
    transform: scale(1.1);
}

.color-swatch-btn.active {
    border-color: #FFFFFF;
    box-shadow: 0 0 10px var(--c);
}

.prog-vessels-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 6px;
    max-height: 130px;
    overflow-y: auto;
}

.prog-template-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.btn-sm-preset {
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    color: var(--c-primary);
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.btn-sm-preset:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

.btn-sm-preset.danger {
    color: var(--sf-red);
}

.btn-sm-preset.danger:hover {
    background: var(--sf-red);
    color: #FFFFFF;
}

.prog-form-milestones-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

/* ==========================================================================
   APP 3: SERVER OPS & INTERACTIVE REMOTE CONSOLE (SPACEX LAUNCH DESK)
   ========================================================================== */
.server-ops-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ksp-border);
}

.server-refresh-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px;
    background: rgba(0, 229, 153, 0.1);
    border: 1px solid rgba(0, 229, 153, 0.4);
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    color: var(--c-nominal);
}

.live-pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--c-nominal);
    border-radius: 50%;
    animation: livePulse 1.4s infinite;
}

/* 3 Main Services Cards Rack */
.server-services-rack {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.service-status-card {
    background: var(--ksp-surface-card);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all var(--trans-fast);
}

.service-status-card:hover {
    border-color: var(--spacex-cyan);
    transform: translateY(-1px);
}

.service-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.service-title-cluster {
    display: flex;
    flex-direction: column;
}

.service-name {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.5px;
}

.service-meta {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--c-muted);
}

.service-state-badge {
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-xs);
}

.service-state-badge.active {
    background: rgba(0, 229, 153, 0.15);
    border: 1px solid var(--c-nominal);
    color: var(--c-nominal);
}

.service-state-badge.inactive {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--c-error);
    color: var(--c-error);
}

.service-desc {
    font-size: 11px;
    color: var(--c-muted);
    line-height: 1.4;
    flex: 1;
}

.service-controls-row {
    display: flex;
    gap: 6px;
}

.btn-svc-action {
    flex: 1;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ksp-border);
    color: var(--c-primary);
    font-family: var(--font-display);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: all var(--trans-fast);
    text-align: center;
}

.btn-svc-action:hover {
    background: var(--sf-orange);
    color: #FFFFFF;
    border-color: var(--sf-orange);
    box-shadow: 0 2px 8px var(--ksp-orange-glow);
}

.btn-svc-action.stop:hover {
    background: var(--sf-red);
    border-color: var(--sf-red);
    box-shadow: 0 2px 8px var(--ksp-red-glow);
}

/* SpaceX OLED Interactive Remote Linux Terminal */
.server-terminal-container {
    background: #020306;
    border: 1px solid var(--ksp-border-bright);
    border-radius: var(--radius-xs);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 315px);
    min-height: 310px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.75);
    overflow: hidden;
}

.terminal-topbar {
    background: #090D17;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.terminal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: #FFFFFF;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.terminal-action-pills {
    display: flex;
    gap: 4px;
    overflow-x: auto;
}

.term-quick-btn {
    padding: 2px 7px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--spacex-cyan);
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 600;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all var(--trans-fast);
    white-space: nowrap;
}

.term-quick-btn:hover {
    background: var(--spacex-cyan);
    color: #000000;
    border-color: var(--spacex-cyan);
    box-shadow: 0 0 8px var(--spacex-cyan);
}

.term-quick-btn.danger {
    color: var(--sf-red);
}

.term-quick-btn.danger:hover {
    background: var(--sf-red);
    color: #FFFFFF;
}

.terminal-screen-viewport {
    flex: 1;
    padding: 12px 14px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.5;
    color: #E2E8F0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.terminal-line.cmd-prompt {
    color: #FFFFFF;
    font-weight: 700;
}

.terminal-line.system {
    color: var(--spacex-cyan);
}

.terminal-line.error {
    color: var(--sf-red);
}

.terminal-input-bar {
    background: #060910;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.terminal-prompt {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--sf-orange);
    font-weight: 700;
}

.terminal-input-field {
    flex: 1;
    background: transparent;
    border: none;
    color: #FFFFFF;
    font-family: var(--font-mono);
    font-size: 11.5px;
    outline: none;
}

.terminal-submit-btn {
    padding: 4px 12px;
    background: var(--sf-orange);
    border: none;
    color: #FFFFFF;
    font-family: var(--font-display);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: all var(--trans-fast);
}

.terminal-submit-btn:hover {
    box-shadow: 0 0 10px var(--ksp-orange-glow);
}

/* Hardware Gauges & Connected LMP Pilots */
.hardware-gauges-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.lmp-players-rack {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 140px;
    overflow-y: auto;
}

.player-badge-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    background: rgba(5, 8, 14, 0.6);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 10.5px;
}

.empty-state-card {
    padding: 10px;
    background: rgba(5, 8, 14, 0.5);
    border-radius: var(--radius-xs);
    border: 1px dashed var(--ksp-border);
    text-align: center;
}

/* ==========================================================================
   APP 4 & 5: ASTRODYNAMICS & MOD BRIDGE
   ========================================================================== */
.lab-segmented-bar {
    display: flex;
    gap: 4px;
    background: rgba(4, 7, 12, 0.7);
    padding: 3px;
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    margin-bottom: 12px;
}

.lab-segment-btn {
    flex: 1;
    padding: 7px 14px;
    background: transparent;
    border: none;
    color: var(--c-muted);
    font-family: var(--font-display);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: all var(--trans-fast);
    text-align: center;
}

.lab-segment-btn.active {
    background: rgba(0, 240, 255, 0.16);
    border: 1px solid var(--spacex-cyan);
    color: #FFFFFF;
    font-weight: 700;
    box-shadow: 0 0 12px var(--spacex-cyan-glow);
}

.lab-visual-stage {
    flex: 1;
    background: var(--ksp-surface-card);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-sm);
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.deck-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ksp-border);
}

.viewport-title {
    font-family: var(--font-display);
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #FFFFFF;
    text-transform: uppercase;
}

.bridge-terminal-box {
    flex: 1;
    background: #020306;
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 12px;
}

.terminal-header {
    background: #090E1A;
    padding: 7px 12px;
    border-bottom: 1px solid var(--ksp-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-logs-body {
    flex: 1;
    padding: 10px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-family: var(--font-mono);
    font-size: 10.5px;
}

.log-entry { display: flex; gap: 8px; color: var(--c-primary); }
.log-entry.nominal { color: var(--spacex-green); }
.log-entry.warning { color: var(--sf-yellow); }
.log-entry.error { color: var(--sf-red); }
.log-time { color: var(--c-muted); }

.command-uplink-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
    margin-top: 8px;
}

.btn-uplink-ctrl {
    padding: 7px 9px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    color: #FFFFFF;
    font-family: var(--font-display);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.6px;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.btn-uplink-ctrl:hover {
    background: var(--spacex-cyan);
    color: #000000;
    border-color: var(--spacex-cyan);
    box-shadow: 0 0 10px var(--spacex-cyan-glow);
}

/* ==========================================================================
   FORMS, INPUTS & CONTROLS
   ========================================================================== */
.calculator-form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.field-label {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--c-muted);
    text-transform: uppercase;
}

.input-field {
    width: 100%;
    padding: 7px 11px;
    background: rgba(4, 7, 12, 0.8);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    color: #FFFFFF;
    font-family: var(--font-mono);
    font-size: 12px;
    outline: none;
    transition: all var(--trans-fast);
}

.input-field:focus {
    border-color: var(--sf-orange);
    box-shadow: 0 0 10px var(--ksp-orange-glow);
    background: rgba(8, 13, 24, 0.95);
}

/* ==========================================================================
   SYSTEM BOTTOM BAR
   ========================================================================== */
.system-bottombar {
    height: var(--bottom-bar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    background: rgba(5, 8, 14, 0.96);
    border-top: 1px solid var(--ksp-border);
    font-size: 10.5px;
    color: var(--c-muted);
    z-index: 100;
}

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

.prompt-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.keycap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    color: #FFFFFF;
}

.bottombar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.4px;
}

/* ==========================================================================
   MODALS (SPACEX × STARFIELD AVIONICS POPUPS)
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 3, 5, 0.8);
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all var(--trans-smooth);
}

.modal-backdrop.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-window {
    width: 480px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(10, 15, 26, 0.96);
    border: 1px solid var(--ksp-border-bright);
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 240, 255, 0.15);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: modalPop 0.22s var(--trans-smooth);
    position: relative;
}

@keyframes modalPop {
    from { transform: scale(0.96) translateY(8px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ksp-border);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.btn-modal-close {
    background: transparent;
    border: none;
    color: var(--c-muted);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.btn-modal-close:hover { color: #FFFFFF; }

/* Status Badges */
.status-badge {
    padding: 2px 7px;
    border-radius: var(--radius-xs);
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.nominal {
    background: rgba(0, 229, 153, 0.15);
    border: 1px solid var(--c-nominal);
    color: var(--c-nominal);
}

.status-badge.warning {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid var(--c-warning);
    color: var(--c-warning);
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--c-error);
    color: var(--c-error);
}

/* ==========================================================================
   VIRTUAL OS LOGIN OVERLAY (CONSTELLATION FLIGHT CLEARANCE)
   ========================================================================== */
.login-screen-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 35%, rgba(12, 18, 30, 0.96) 0%, rgba(2, 3, 5, 0.99) 100%);
    backdrop-filter: blur(28px);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-screen-backdrop.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-card-window {
    width: 450px;
    max-width: 92vw;
    background: rgba(10, 15, 26, 0.95);
    border: 1px solid var(--ksp-border-bright);
    border-radius: var(--radius-sm);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 240, 255, 0.15);
    padding: 30px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: loginCardPop 0.28s var(--trans-smooth);
    position: relative;
}

/* Corner Crosshair Target Brackets on Login Window */
.login-card-window::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    width: 12px;
    height: 12px;
    border-top: 2px solid var(--spacex-cyan);
    border-left: 2px solid var(--spacex-cyan);
    pointer-events: none;
}

.login-card-window::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 12px;
    height: 12px;
    border-bottom: 2px solid var(--spacex-cyan);
    border-right: 2px solid var(--spacex-cyan);
    pointer-events: none;
}

@keyframes loginCardPop {
    from { transform: scale(0.96) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}

.constellation-ribbon-pill.large {
    width: 52px;
    height: 7px;
    margin-bottom: 4px;
}

.login-system-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #FFFFFF;
    text-transform: uppercase;
}

.login-system-subtitle {
    font-size: 10.5px;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--sf-orange);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.login-terminal-banner {
    background: rgba(4, 7, 12, 0.85);
    border: 1px solid rgba(255, 122, 0, 0.35);
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-family: var(--font-mono);
    font-size: 10px;
}

.terminal-prefix {
    color: var(--c-muted);
}

.terminal-status {
    color: var(--sf-yellow);
    font-weight: 700;
}

.login-form-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--c-muted);
}

.remember-checkbox-label {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    user-select: none;
}

.remember-checkbox-label input[type="checkbox"] {
    accent-color: var(--sf-orange);
    cursor: pointer;
}

.btn-text-link {
    background: transparent;
    border: none;
    color: var(--spacex-cyan);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.login-submit-btn {
    width: 100%;
    height: 40px;
    font-size: 13px;
    margin-top: 4px;
}

.login-footer-meta {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--c-muted);
    border-top: 1px solid var(--ksp-border);
    padding-top: 10px;
    letter-spacing: 0.5px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 36px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    padding: 9px 16px;
    background: rgba(10, 15, 26, 0.96);
    border: 1px solid var(--ksp-border-bright);
    border-radius: var(--radius-xs);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    color: #FFFFFF;
    font-family: var(--font-display);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.5px;
    pointer-events: auto;
    border-left: 3px solid var(--sf-orange);
    animation: toastIn 0.22s var(--trans-smooth);
}

@keyframes toastIn {
    from { transform: translateY(8px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.field-validation-error {
    color: var(--sf-red);
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-body);
}

/* ==========================================================================
   RESPONSIVE DESIGN (AEROSPACE WORKSTATION TO LAPTOP)
   ========================================================================== */
@media (max-width: 1200px) {
    :root {
        --stage-ratio: 58%;
        --inspector-ratio: 42%;
    }
}

@media (max-width: 900px) {
    .os-workspace-body {
        flex-direction: column;
    }
    .stage-primary {
        width: 100%;
        height: 60%;
        border-right: none;
        border-bottom: 1px solid var(--ksp-border);
    }
    .inspector-secondary {
        width: 100%;
        height: 40%;
        border-left: none;
    }
    .server-services-rack {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   CELESTIAL BODIES MANAGEMENT MODAL & HUD COMPONENTS
   ========================================================================== */
.modal-window-large {
    width: 760px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
}

.bodies-modal-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--ksp-border);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.bodies-tab-btn {
    padding: 7px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-xs);
    color: var(--c-muted);
    font-family: var(--font-display);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.bodies-tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
}

.bodies-tab-btn.active {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--ksp-cyan-soft);
    color: var(--ksp-cyan-soft);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.bodies-modal-panel {
    display: none;
    animation: fadeIn 0.2s ease;
}

.bodies-modal-panel.active {
    display: block;
}

.bodies-catalog-scrollable {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
    overflow-y: auto;
    max-height: 420px;
}

.body-catalog-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(8, 12, 22, 0.7);
    border: 1px solid var(--ksp-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    gap: 12px;
    transition: all var(--trans-fast);
}

.body-catalog-item-card:hover {
    background: rgba(14, 20, 34, 0.9);
    border-color: var(--ksp-border-light);
}

.body-catalog-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.body-catalog-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 8px currentColor;
}

.body-badge-custom {
    background: rgba(229, 131, 46, 0.2);
    border: 1px solid var(--ksp-orange);
    color: var(--ksp-orange);
    font-size: 9px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.body-badge-stock {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid var(--ksp-cyan-soft);
    color: var(--ksp-cyan-soft);
    font-size: 9px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-delete-custom-body {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid var(--c-error);
    color: var(--c-error);
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.btn-delete-custom-body:hover {
    background: var(--c-error);
    color: #FFFFFF;
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
}

