/* ORBIT OS v5.0 // PROJECT FUSION (Corporate Edition) */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Corporate Professional Palette */
    --fusion-bg: #f8fafc;
    /* Slightly cooled white for better contrast */
    --fusion-surface: #ffffff;
    --fusion-sidebar: #1e293b;
    --fusion-border: #e2e8f0;

    /* Semantic Text Colors (Light Mode) */
    --text-main: #0f172a;
    /* Slate 900 - Sharp Black */
    --text-muted: #64748b;
    /* Slate 500 */
    --text-inverse: #ffffff;

    /* Brand Colors */
    --brand-primary: #2563eb;
    --brand-secondary: #0f172a;
    --brand-accent: #f59e0b;
    --brand-success: #10b981;
    --brand-danger: #ef4444;

    /* Typography */
    --font-heading: 'Inter', sans-serif;
    --font-display: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --gap-xs: 4px;
    --gap-sm: 8px;
    --gap-md: 12px;
    --gap-lg: 20px;

    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius-md: 6px;
    --radius-lg: 12px;
}

/* === DARK THEME (Corporate Pitch Black) === */
body.dark-theme {
    /* Corporate Dark Palette */
    --fusion-bg: #020617;
    /* Slate 950 - Deep Space */
    --fusion-surface: #0f172a;
    /* Slate 900 */
    --fusion-sidebar: #000000;
    --fusion-border: #1e293b;
    /* Slate 800 */

    /* Semantic Text Colors (Dark Mode) */
    --text-main: #f8fafc;
    /* Slate 50 - Sharp White */
    --text-muted: #94a3b8;
    /* Slate 400 */
    --text-inverse: #0f172a;

    /* Variable Overrides */
    color: var(--text-main);
}

body.dark-theme .fusion-header,
body.dark-theme .fusion-sidebar,
body.dark-theme .fusion-card,
body.dark-theme .sidebar-section,
body.dark-theme .metric-card,
body.dark-theme .terminal-feed,
body.dark-theme .fusion-panel,
body.dark-theme .mobile-bottom-nav,
body.dark-theme .modal-content,
body.dark-theme .action-card {
    background: var(--fusion-surface);
    border-color: var(--fusion-border);
    color: var(--text-main);
}

body.dark-theme .fusion-logo {
    color: white;
}

body.dark-theme .nav-item {
    color: var(--text-muted);
}

body.dark-theme .nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--brand-primary);
}

body.dark-theme .orbit-section-refresh {
    background: rgba(255, 255, 255, 0.05);
    border-color: #334155;
    color: #94a3b8;
}

body.dark-theme .orbit-section-refresh:hover {
    background: rgba(0, 243, 255, 0.1);
    color: #e2e8f0;
    border-color: rgba(0, 243, 255, 0.3);
}

body.dark-theme .orbit-section-refresh--soft {
    border-color: rgba(16, 185, 129, 0.4);
}

body.dark-theme .orbit-section-refresh--soft:hover {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.55);
}

body.dark-theme .metric-value,
body.dark-theme .card-title,
body.dark-theme .feed-value,
body.dark-theme .section-title,
body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme h5 {
    color: var(--text-main);
}

body.dark-theme .fusion-input,
body.dark-theme select,
body.dark-theme textarea {
    background: #1e293b;
    border-color: #334155;
    color: white;
}

/* Glow Effects for Dark Mode */
body.dark-theme .metric-card:hover,
body.dark-theme .fusion-card:hover {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.2);
    border-color: rgba(37, 99, 235, 0.4);
}

body.dark-theme .fusion-btn {
    background: #1e293b;
    border-color: #334155;
    color: white;
}

body.dark-theme .fusion-btn:hover {
    background: #334155;
}

body.dark-theme .fusion-btn.primary-btn {
    background: var(--brand-primary);
    color: white;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--fusion-bg);
    color: var(--text-main);
    font-family: var(--font-display);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.5;
}

/* === HEADER === */
.fusion-header {
    padding: 0 var(--gap-md);
    height: 70px;
    background: var(--fusion-surface);
    border-bottom: 1px solid var(--fusion-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.fusion-logo {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.fusion-logo i {
    color: var(--brand-primary);
    font-size: 24px;
}

.fusion-stats {
    display: flex;
    gap: var(--gap-lg);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.stat-label {
    color: #64748b;
    /* Slate 500 */
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-secondary);
    font-family: var(--font-mono);
}

/* === MAIN GRID === */
.fusion-grid {
    display: grid;
    grid-template-columns: 240px 1fr 300px;
    /* Sidebar | Main | Panel */
    gap: var(--gap-md);
    padding: var(--gap-md);
    max-width: 1920px;
    margin: 0 auto;
    min-height: calc(100vh - 70px);
}

/* === SIDEBAR === */
.fusion-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--gap-sm);
    position: sticky;
    top: 94px;
    /* Header + Gap */
    height: fit-content;
}

.sidebar-section {
    background: var(--fusion-surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--fusion-border);
}

.section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    /* Slate 400 */
    margin-bottom: 12px;
    font-weight: 700;
    padding-left: 12px;
}

.sidebar-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.sidebar-section-head .section-title {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.orbit-section-refresh-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.orbit-section-refresh {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 6px;
    border: 1px solid var(--fusion-border);
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
    line-height: 1.2;
    white-space: nowrap;
}

.orbit-section-refresh:hover {
    background: rgba(0, 243, 255, 0.12);
    color: #e2e8f0;
    border-color: rgba(0, 243, 255, 0.35);
}

.orbit-section-refresh--soft {
    border-color: rgba(16, 185, 129, 0.35);
}

.orbit-section-refresh--soft:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.5);
}

.orbit-section-refresh i {
    font-size: 14px;
}

@media (max-width: 480px) {
    .orbit-section-refresh .orbit-section-refresh-text {
        display: none;
    }
}

.nav-item {
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    /* Slate 600 */
}

.nav-item:hover {
    background: #eff6ff;
    /* Blue 50 */
    color: var(--brand-primary);
}

.nav-item:hover .nav-icon {
    color: var(--brand-primary);
}

.nav-icon {
    font-size: 18px;
    color: #94a3b8;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === MAIN CONTENT === */
.fusion-main {
    display: flex;
    flex-direction: column;
    gap: var(--gap-md);
}

/* Metrics Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap-md);
}

.metric-card {
    background: var(--fusion-surface);
    border-radius: var(--radius-lg);
    padding: var(--gap-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--fusion-border);
    transition: transform 0.2s;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.metric-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--brand-secondary);
    letter-spacing: -0.5px;
}

.metric-change {
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

.metric-change.up {
    color: var(--brand-success);
}

.metric-change.down {
    color: var(--brand-danger);
}

/* Dashboard Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--gap-md);
}

.fusion-card {
    background: var(--fusion-surface);
    border-radius: var(--radius-lg);
    padding: var(--gap-md);
    border: 1px solid var(--fusion-border);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    cursor: pointer;
}

.fusion-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--gap-sm);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--brand-secondary);
}

.card-badge {
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    background: #f1f5f9;
    color: #64748b;
}

/* === RIGHT PANEL (Feed) === */
.fusion-panel {
    display: flex;
    flex-direction: column;
    gap: var(--gap-md);
}

.terminal-feed {
    background: var(--fusion-surface);
    border: 1px solid var(--fusion-border);
    border-radius: var(--radius-lg);
    padding: 0;
    max-height: 500px;
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}

.feed-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--fusion-border);
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.feed-item:last-child {
    border-bottom: none;
}

/* === TABLES === */
.fusion-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.fusion-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.fusion-table td {
    border-bottom: 1px solid var(--fusion-border);
}

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

/* Dark Mode Overrides for Table */
body.dark-theme .fusion-table td {
    border-color: rgba(255, 255, 255, 0.05);
}

body.dark-theme #current-accounts-container .fusion-table th {
    color: #cbd5e1 !important;
}

body.dark-theme #current-accounts-container .fusion-table td {
    color: #e2e8f0;
}

body.dark-theme .glass-panel {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.18);
}

body.dark-theme #current-accounts-container .fusion-table tr:hover td,
body.dark-theme #inventory-module-container .fusion-table tr:hover td {
    background: rgba(148, 163, 184, 0.08);
}

body.dark-theme #inventory-module-container .fusion-table th {
    color: #cbd5e1 !important;
}

body.dark-theme #inventory-module-container .fusion-table td {
    color: #e2e8f0;
}

body.dark-theme .fusion-input::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.feed-label {
    color: #64748b;
    font-weight: 500;
}

.feed-value {
    color: var(--brand-secondary);
    font-weight: 600;
    font-family: var(--font-mono);
}

/* === BUTTONS & INPUTS === */
.fusion-btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--fusion-border);
    background: white;
    color: #475569;
}

.fusion-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.fusion-btn.primary-btn {
    background: var(--brand-primary);
    color: white;
    border: none;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.fusion-btn.primary-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.fusion-btn.success-btn {
    background: var(--brand-success);
    color: white;
    border: none;
}

.fusion-btn.accent-btn {
    background: var(--brand-secondary);
    color: white;
    border: none;
}

.fusion-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--fusion-border);
    border-radius: var(--radius-md);
    background: white;
    font-family: inherit;
    font-size: 14px;
    color: var(--brand-secondary);
    transition: border-color 0.2s;
}

.fusion-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* === MODALS === */
.modal-overlay {
    background: rgba(15, 23, 42, 0.6);
    /* Slate 900 heavy blur */
    backdrop-filter: blur(4px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--fusion-surface);
    color: var(--text-main);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--fusion-border);
}

/* Ensure JS-generated modals have correct background too */
body.dark-theme .modal-content,
body.dark-theme #quote-modal>div,
body.dark-theme #jowat-modal>div {
    background: #0f172a !important;
    /* Force Dark Slate */
    color: #f8fafc !important;
    border-color: #334155 !important;
}

/* === SIDE DRAWER (MOBILE) === */
#side-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    height: 100vh;
    background: var(--brand-secondary);
    z-index: 2100;
    transition: left 0.3s ease-in-out;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

#side-drawer.active {
    left: 0;
}

#drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#drawer-overlay.active {
    display: block;
    opacity: 1;
}

.drawer-item {
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 15px;
    border-radius: 8px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.drawer-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.drawer-item i {
    font-size: 18px;
    color: var(--brand-primary);
}

/* Ensure hidden on desktop */
@media (min-width: 1025px) {

    #side-drawer,
    #drawer-overlay {
        display: none !important;
    }

    .mobile-header #hamburger-btn {
        display: none;
    }
}

/* === RESPONSIVE === */
/* === MOBILE BOTTOM NAVIGATION === */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: var(--fusion-surface);
    border-top: 1px solid var(--fusion-border);
    z-index: 2000;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
}

.mobile-bottom-nav .nav-item {
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    font-size: 10px;
    color: #94a3b8;
    background: transparent;
    border-radius: 0;
    margin: 0;
}

.mobile-bottom-nav .nav-item i {
    font-size: 20px;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--brand-primary);
}

.mobile-bottom-nav .nav-item.active i {
    color: var(--brand-primary);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .fusion-grid {
        grid-template-columns: 1fr;
        padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    }

    .fusion-sidebar,
    .fusion-stats,
    .fusion-panel {
        display: none;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Mobile Menu Toggle (Hidden in favor of Bottom Nav) */
    #mobile-menu-btn {
        display: none !important;
    }

    .mobile-bottom-nav {
        display: flex;
    }
}

@media (max-width: 640px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    /* Fix Modals for Mobile - Full Screen & Native Feel */
    #jowat-modal>div,
    #quote-modal>div {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        border: none !important;
        padding: 20px !important;
        padding-top: 60px !important;
        /* Safe area for back button */
    }

    /* Better close button positioning for mobile */
    #jowat-modal button[onclick*="hidden"],
    #quote-modal button[onclick*="hidden"] {
        top: 20px !important;
        left: 20px !important;
        z-index: 10;
        padding: 10px 20px !important;
        background: rgba(37, 99, 235, 0.1) !important;
        color: var(--brand-primary) !important;
        border: none !important;
    }

    /* Touch Target Optimization */
    .fusion-btn,
    .nav-item {
        min-height: 44px;
    }
}

/* === QUOTE PREVIEW IMPROVEMENTS === */
.preview-container {
    height: calc(100vh - 250px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: #f5f5f5;
}

.paper-preview-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.paper-preview-frame {
    width: 100%;
    height: 1200px;
    /* Full A4 height */
    border: none;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* === COMPACT ACTION BUTTONS === */
.action-buttons {
    display: flex;
    gap: 12px;
    padding: 20px;
    background: rgba(10, 14, 39, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    bottom: 0;
    z-index: 100;
    flex-wrap: wrap;
}

.action-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn.primary {
    background: linear-gradient(135deg, #00f3ff, #0099cc);
    color: #0a0e27;
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 243, 255, 0.3);
}

.action-btn i {
    font-size: 16px;
}

.action-btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.action-btn-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* === SIMPLIFIED DASHBOARD === */
.dashboard-simplified {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.welcome-section {
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.1), rgba(255, 215, 0, 0.1));
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
}

.welcome-section h2 {
    font-size: 28px;
    margin-bottom: 20px;
}

.quick-stats {
    display: flex;
    gap: 30px;
}

.quick-stats .stat-item {
    display: flex;
    flex-direction: column;
}

.quick-stats .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--brand-primary);
}

.quick-stats .stat-label {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.6);
}

.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.action-card {
    background: var(--fusion-surface);
    border: 1px solid var(--fusion-border);
    border-radius: 16px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-card:hover {
    background: rgba(37, 99, 235, 0.05);
    border-color: var(--brand-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15);
}

.action-card i {
    font-size: 48px;
    color: var(--brand-primary);
    margin-bottom: 15px;
    display: block;
}

.action-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--brand-secondary);
}

.action-card p {
    font-size: 14px;
    color: #64748b;
}

/* Utility */
.hidden {
    display: none !important;
}

/* NEXUS SHORTCUTS HOVER */
.nexus-link:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* PREMIUM DASHBOARD CARDS */
/* PREMIUM DASHBOARD CARDS (Variable Based) */
.fusion-card {
    background: var(--fusion-surface);
    border: 1px solid var(--fusion-border);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.fusion-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
}

/* AI ASSISTANT PREMIUM STYLES */
.ai-assistant-compact {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

body.app-floating-ui-hidden .mobile-fab-container,
body.app-floating-ui-hidden .ai-assistant-compact,
body.app-floating-ui-hidden .speed-dial-container {
    display: none !important;
}

.ai-toggle {
    background: linear-gradient(135deg, #0072ff 0%, #00c6ff 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(0, 114, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 114, 255, 0.6);
}

.ai-panel {
    width: 350px;
    height: 500px;
    /* Fixed height for chat */
    background: rgba(10, 15, 30, 0.95);
    /* Deep Dark */
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 0;
    /* Remove padding for edge-to-edge chat */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0, 243, 255, 0.2);
    /* Cyan Border */
    overflow: hidden;
}

.ai-panel.hidden {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    pointer-events: none;
}

/* Internal Chat Styles are handled by inline JS or phase_c_modules.js */

/* === BILLIONAIRE STRATEGY PREMIUM OVERHAUL === */
:root {
    --billionaire-gold: #FFD700;
    --billionaire-gold-bright: #FFF200;
    --billionaire-gold-dim: rgba(255, 215, 0, 0.2);
    --billionaire-dark: #05070a;
    --billionaire-card-bg: rgba(10, 15, 25, 0.7);
    --billionaire-accent: #00f3ff;
}

.billionaire-section {
    padding: 30px;
    background: radial-gradient(circle at top right, #0a101f 0%, #05070a 100%);
    min-height: 100vh;
    color: #f8fafc;
    font-family: 'Inter', sans-serif;
}

/* Header Overhaul */
.billionaire-header {
    background: linear-gradient(135deg, rgba(20, 25, 40, 0.9), rgba(5, 7, 10, 0.95));
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 40px;
    border-radius: 24px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.billionaire-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.05) 0%, transparent 70%);
}

.billionaire-title {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 36px !important;
    font-weight: 800 !important;
    color: var(--billionaire-gold) !important;
    text-transform: uppercase !important;
    letter-spacing: 4px !important;
    margin-bottom: 12px !important;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3) !important;
}

/* Opportunity Cards Professional Redesign */
.opportunity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.opportunity-card {
    background: var(--billionaire-card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    padding: 30px;
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(15px);
}

.opportunity-card:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: var(--billionaire-gold);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.1);
}

.opportunity-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--billionaire-gold), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.opportunity-card:hover::after {
    opacity: 1;
}

.opp-badge {
    background: linear-gradient(95deg, var(--billionaire-gold), #b8860b);
    color: #000 !important;
    padding: 6px 16px !important;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 24px;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(184, 134, 11, 0.4);
}

.opp-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.opp-ticker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.opp-score-badge {
    background: rgba(0, 243, 255, 0.1);
    color: var(--billionaire-accent);
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid rgba(0, 243, 255, 0.2);
}

.opp-direction-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 99px;
    margin-bottom: 24px;
    width: fit-content;
}

.opp-direction-pill.long {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.opp-direction-pill.short {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.opp-stats-box {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.opp-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.opp-stat-label {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.opp-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #f1f5f9;
}

.opp-stat-value.highlight {
    color: var(--billionaire-gold);
    font-size: 20px;
}

.opp-analysis-text {
    font-size: 13px;
    line-height: 1.6;
    color: #94a3b8;
    margin-bottom: 24px;
    font-style: italic;
}

/* Sniper Button Professional */
.sniper-btn {
    background: linear-gradient(135deg, var(--billionaire-gold) 0%, #b8860b 100%) !important;
    color: #000 !important;
    border: none !important;
    padding: 16px !important;
    border-radius: 16px !important;
    font-weight: 800 !important;
    font-size: 14px !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.sniper-btn:hover {
    transform: scale(1.03) !important;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3) !important;
    filter: brightness(1.1) !important;
}

/* Info Panel Overhaul */
.billionaire-notu-card {
    background: rgba(255, 215, 0, 0.03);
    border: 1px dashed rgba(255, 215, 0, 0.2);
    border-radius: 24px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.notu-icon {
    font-size: 48px;
    color: var(--billionaire-gold);
    opacity: 0.5;
}

/* Loading Animation Professional */
.billionaire-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px;
    gap: 20px;
    grid-column: 1 / -1;
}

.loader-eye {
    width: 80px;
    height: 80px;
    border: 4px solid var(--billionaire-gold-dim);
    border-top-color: var(--billionaire-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ORBIT — daha kompakt ana düzen (geniş ekran) */
@media (min-width: 901px) {
    .fusion-grid {
        gap: 10px;
        padding: 10px;
    }

    .fusion-main {
        gap: 10px;
    }

    .sidebar-section {
        padding: 12px;
    }

    .section-title {
        margin-bottom: 8px;
        padding-left: 8px;
    }

    .nav-item {
        padding: 7px 10px;
        font-size: 13px;
        margin-bottom: 2px;
        gap: 10px;
    }

    .metrics-grid {
        gap: 8px;
    }

    .metric-card {
        min-height: 82px;
        padding: 12px 14px;
    }

    .metric-value {
        font-size: 19px;
    }

    /* Ana sayfa — hero + hızlı işlemler (dashboard.css sonrası) */
    #main-content .dashboard-hero {
        padding: 14px 18px;
        margin-bottom: 10px;
    }

    #main-content .hero-title {
        font-size: 22px;
        margin-bottom: 4px;
    }

    #main-content .hero-subtitle {
        font-size: 13px;
        line-height: 1.35;
    }

    #main-content .hero-gradient-line {
        margin: 8px 0;
    }

    #main-content .hero-stats {
        gap: 12px;
        margin-top: 8px;
    }

    #main-content .hero-stat-value {
        font-size: 18px;
    }

    #main-content .hero-stat-label {
        font-size: 10px;
    }

    #main-content .dashboard-quick-actions {
        gap: 8px;
        margin-bottom: 10px;
    }

    #main-content .quick-action-card {
        padding: 12px 14px;
        min-height: 0;
    }

    #main-content .quick-action-card i {
        font-size: 22px;
        margin-bottom: 8px;
    }

    #main-content .quick-action-card h3 {
        font-size: 14px;
        margin: 4px 0 2px;
    }

    #main-content .quick-action-card p {
        font-size: 11px;
        margin: 0;
        line-height: 1.25;
    }

    #main-content .orbit-dash-compact-row,
    #main-content .orbit-dash-compact-row-2 {
        gap: 8px !important;
        margin-bottom: 10px !important;
    }

    #main-content .receivables-section .section-header h3 {
        font-size: 15px;
    }
}

/* Ana ekran — ek kompakt yoğunluk (masaüstü; mobil mobile.css ile) */
@media (min-width: 901px) {
    #main-content {
        gap: 8px !important;
    }

    #main-content .metrics-grid {
        gap: 6px !important;
        margin-bottom: 10px !important;
    }

    #main-content .metrics-grid .metric-card {
        min-height: 0 !important;
        height: auto !important;
        padding: 10px 12px !important;
        justify-content: flex-start !important;
    }

    #main-content .metrics-grid .metric-card .metric-label {
        margin-bottom: 3px !important;
    }

    #main-content .metrics-grid .metric-card .metric-value {
        font-size: 17px !important;
        letter-spacing: -0.3px;
    }

    #main-content .metrics-grid .metric-card .metric-change {
        margin-top: 2px !important;
        font-size: 11px !important;
    }

    #main-content .metrics-grid .metric-card .sparkline-container {
        margin-top: 4px !important;
    }

    #main-content .metrics-grid .metric-card:nth-child(5) .progress {
        margin-top: 6px !important;
    }

    #main-content .sparkline {
        height: 22px !important;
    }

    #main-content .dashboard-quick-actions {
        gap: 8px !important;
        margin-bottom: 12px !important;
    }

    #main-content .quick-action-card {
        min-height: 0 !important;
        padding: 11px 10px !important;
    }

    #main-content .quick-action-card i {
        font-size: 22px !important;
        margin-bottom: 6px !important;
    }

    #main-content .quick-action-card h3 {
        font-size: 13px !important;
    }

    #main-content .orbit-dash-compact-row,
    #main-content .orbit-dash-compact-row-2 {
        gap: 6px !important;
        margin-bottom: 8px !important;
    }

    #main-content .orbit-card-glass.orbit-dash-widget-inner {
        border-radius: 12px;
    }

    #main-content .metrics-grid .glow-card:hover {
        transform: translateY(-3px);
    }
}
