:root {
    --bg-color: #050a10;
    --panel-bg: rgba(12, 24, 40, 0.6);
    --panel-border: rgba(255, 255, 255, 0.08);

    --accent-color: #55ada9;
    --accent-glow: rgba(85, 173, 169, 0.4);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;

    --success-color: #4ade80;
    --warning-color: #facc15;
    --danger-color: #f87171;

    --font-mono: 'Courier New', Courier, monospace;
    --font-main: 'Outfit', sans-serif;

    --sidebar-width: 260px;
    --header-height: 70px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    height: 100vh;
    overflow: hidden;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(85, 173, 169, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.05) 0%, transparent 20%);
}

/* Glassmorphism Background */
.dashboard-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr 300px;
    grid-template-rows: 1fr;
    grid-template-areas:
        "sidebar main widgets";
    height: 100vh;
    width: 100%;
}

/* HIDDEN ON DESKTOP (Mobile Only) */
.mobile-menu-toggle,
.sidebar-overlay,
.sidebar-header-mobile {
    display: none;
}

/* HEADER */
.header {
    grid-area: header;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    border-bottom: 1px solid var(--panel-border);
    backdrop-filter: blur(10px);
    background: rgba(5, 10, 16, 0.8);
    z-index: 100;
}

.system-id {
    font-family: var(--font-mono);
    color: var(--accent-color);
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-profile-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid var(--panel-border);
    font-size: 0.9rem;
    cursor: pointer;
}

.user-profile-mini img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

/* SIDEBAR */
.sidebar {
    grid-area: sidebar;
    border-right: 1px solid var(--panel-border);
    background: rgba(12, 24, 40, 0.3);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.nav-group {
    padding: 0 20px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-group.mt-auto {
    margin-top: auto;
}

.nav-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    padding-left: 10px;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px 15px;
    text-align: left;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.nav-item i {
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
    transition: color 0.2s;
}

/* Nav Item Hover/Active */
.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(85, 173, 169, 0.1);
    /* Default accent bg */
    color: var(--text-primary);
    font-weight: 500;
}

.nav-item.active i {
    color: var(--accent-color);
}

/* Dynamic Colors for Ecosystem Items */
.nav-item[style*="--item-color"]:hover,
.nav-item.active[style*="--item-color"] {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.03) 0%,
            rgba(255, 255, 255, 0.0) 100%);
}

.nav-item.active[style*="--item-color"] {
    color: var(--item-color);
}

.nav-item.active[style*="--item-color"] i {
    color: var(--item-color);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: currentColor;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px currentColor;
}


/* MAIN CONTENT */
.main-content {
    grid-area: main;
    padding: 30px;
    overflow-y: auto;
    position: relative;
}

/* Sections */
.content-section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* OVERVIEW - EVOLUTION */
.evolution-container {
    min-height: 250px;
    /* Reduced from fixed 400px */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 20px;
    /* Reduced from 40px */
    padding: 20px 0;
    /* Add padding instead of fixed height */
}

.evolution-core {
    width: 100px;
    /* Slightly smaller for tighter feel */
    height: 100px;
    position: relative;
    z-index: 2;
}

.core-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 20px var(--accent-color));
    animation: pulseCore 3s infinite ease-in-out;
}

@keyframes pulseCore {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px var(--accent-color));
    }

    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 40px var(--accent-color));
    }
}

.orbit-lines {
    display: none;
    /* REMOVED as per user request */
}

.orbit-lines::before {
    display: none;
}

@keyframes rotateOrbit {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.evolution-stage {
    text-align: center;
    margin-top: 15px;
    /* Reduced from 30px */
    z-index: 3;
}

.evolution-stage h2 {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 4px;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.grid-dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* PANELS */
.panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(12px);
    transition: transform 0.2s, border-color 0.2s;
}

.panel:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.panel-title {
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-bottom: 15px;
    text-transform: uppercase;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
}

/* Summary Cards */
.summary-card {
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.big-number {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.trend {
    font-size: 0.85rem;
    margin-top: 5px;
    color: var(--text-secondary);
}

.trend.up {
    color: var(--success-color);
}

.trend.down {
    color: var(--danger-color);
}

/* WIDGETS RIGHT */
.widgets-area {
    grid-area: widgets;
    border-left: 1px solid var(--panel-border);
    background: rgba(5, 10, 16, 0.5);
    /* Slightly darker */
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    overflow: hidden;
}

/* Notifications Panel (Flexible Height) */
.notification-panel {
    flex: 1;
    /* Take all available space */
    min-height: 0;
    /* Allow shrinking below content size */
    overflow-y: auto;
    /* Internal scroll */
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbar for Notification Panel */
.notification-panel::-webkit-scrollbar {
    width: 4px;
}

.notification-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Ensure Network Pulse (Bottom Panel) stays visible */
.widgets-area .panel:last-child {
    flex-shrink: 0;
}

/* Notifications */
.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.notif-icon.warn {
    color: var(--warning-color);
    background: rgba(250, 204, 21, 0.1);
}

.notif-icon.info {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.notif-content h4 {
    font-size: 0.9rem;
    margin-bottom: 2px;
    font-weight: 500;
}

.notif-content p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.notif-time {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Mini Chart */
.mini-chart {
    height: 60px;
    margin: 15px 0;
    display: flex;
    align-items: center;
}

.chart-line {
    width: 100%;
    height: 40px;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--accent-color) 20%,
            transparent 100%);
    position: relative;
    clip-path: polygon(0% 100%,
            20% var(--v1),
            40% var(--v2),
            60% var(--v3),
            80% var(--v4),
            100% 60%,
            100% 100%);
    opacity: 0.5;
}

.market-val {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
}

/* Task Matrix styles preserved but updated */
.task-matrix .task-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
}

.task-tag {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    margin-left: auto;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-container {
        grid-template-columns: 200px 1fr;
        grid-template-areas:
            "header header"
            "sidebar main";
    }

    .widgets-area {
        display: none;
        /* Hide right widgets on tablets */
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
        grid-template-areas:
            "header"
            "sidebar"
            "main";
    }

    .sidebar {
        flex-direction: row;
        overflow-x: auto;
        padding: 10px;
        border-right: none;
        border-bottom: 1px solid var(--panel-border);
    }

    .nav-group {
        flex-direction: row;
        margin-bottom: 0;
        align-items: center;
    }

    .nav-label {
        display: none;
    }

    .nav-item {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* =========================================
   PROFILE DROPDOWN (Admin Fixed)
   ========================================= */
.user-profile-mini {
    position: relative;
    /* Ensure parent is relative for absolute dropdown */
    user-select: none;
}

.profile-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 220px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    display: none;
    /* Hidden by default */
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(20px);
    z-index: 9999;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.2s ease forwards;
}

.profile-dropdown.active {
    display: flex;
    /* Show when active */
}

.dropdown-item {
    padding: 15px 20px;
    color: #cbd5e1 !important;
    /* Force readable text */
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 3px solid transparent;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff !important;
    border-left-color: var(--accent-color);
    padding-left: 25px;
    /* Slide effect */
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--accent-color);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   RIGHT COLUMN: SYSTEM WIDGETS
   ========================================= */
.notification-panel {
    min-height: 300px;
}

.system-log-item {
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid var(--panel-border);
    padding: 12px;
    margin-bottom: 10px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    position: relative;
    transition: all 0.2s;
}

.system-log-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--accent-color);
}

.log-header {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.7rem;
    margin-bottom: 5px;
}

.log-content {
    color: #e2e8f0;
}

.network-pulse {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.pulse-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.pulse-circle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: spin 10s linear infinite;
}

.pulse-text {
    text-align: center;
    z-index: 2;
}

.pulse-val {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

.pulse-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* Saturn Core Widget Styles */
.saturn-unit {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.saturn-unit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #f87171, #facc15);
}

.saturn-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #ffd700;
    margin-bottom: 8px;
    letter-spacing: 1px;
}


.nav-item {
    padding: 8px 12px;
    font-size: 0.8rem;
}
}

/* =========================================
   PROFILE DROPDOWN (Admin Fixed)
   ========================================= */
.user-profile-mini {
    position: relative;
    /* Ensure parent is relative for absolute dropdown */
    user-select: none;
}

.profile-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 220px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    display: none;
    /* Hidden by default */
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(20px);
    z-index: 9999;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.2s ease forwards;
}

.profile-dropdown.active {
    display: flex;
    /* Show when active */
}

.dropdown-item {
    padding: 15px 20px;
    color: #cbd5e1 !important;
    /* Force readable text */
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 3px solid transparent;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff !important;
    border-left-color: var(--accent-color);
    padding-left: 25px;
    /* Slide effect */
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--accent-color);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   RIGHT COLUMN: SYSTEM WIDGETS
   ========================================= */
.notification-panel {
    min-height: 300px;
}

.system-log-item {
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid var(--panel-border);
    padding: 12px;
    margin-bottom: 10px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    position: relative;
    transition: all 0.2s;
}

.system-log-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--accent-color);
}

.log-header {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.7rem;
    margin-bottom: 5px;
}

.log-content {
    color: #e2e8f0;
}

.network-pulse {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.pulse-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.pulse-circle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: spin 10s linear infinite;
}

.pulse-text {
    text-align: center;
    z-index: 2;
}

.pulse-val {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

.pulse-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* Saturn Core Widget Styles */
.saturn-unit {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.saturn-unit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #f87171, #facc15);
}

.saturn-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #ffd700;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.saturn-text {
    font-size: 0.85rem;
    color: #e2e8f0;
    line-height: 1.4;
    font-style: italic;
}

/* --- HEADLESS LAYOUT OVERRIDES --- */
.user-profile-floating {
    position: absolute;
    top: 20px;
    left: 30px;
    /* Moved to Left */
    /* right: 30px; REMOVED */
    z-index: 1000;
    background: rgba(15, 23, 42, 0.6);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.user-profile-floating:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}

.user-profile-floating img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
}

.user-profile-floating span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Ensure dropdown appears correctly relative to floating profile */
.user-profile-floating .profile-dropdown {
    top: 55px;
    left: 0;
    /* Align to left edge */
    right: auto;
    width: 200px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--panel-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Business Insights Area */
.business-insights-container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto 10px auto;
}

.insights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.insight-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 12px;
    border-left: 3px solid var(--text-secondary);
    transition: transform 0.3s ease;
    text-align: left;
}

.insight-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.insight-card.success {
    border-left-color: var(--success-color);
}

.insight-card.warning {
    border-left-color: #facc15;
}

.insight-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.insight-value {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #fff;
}

.insight-sub {
    font-size: 0.8rem;
}

.insight-sub.success {
    color: var(--success-color);
}

.insight-sub.warning {
    color: #facc15;
}

/* Branding Headless */
.headless-branding {
    font-size: 2rem;
    letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
    margin-bottom: 10px;
    font-weight: 300;
    text-align: center;
}

/* Adjustments for Evolution Container in Headless Mode */
.evolution-container.headless-mode {
    flex-direction: column;
    gap: 10px;
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: spin 10s linear infinite;
}

.pulse-text {
    text-align: center;
    z-index: 2;
}

.pulse-val {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

.pulse-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* Saturn Core Widget Styles */
.saturn-unit {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.saturn-unit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #f87171, #facc15);
}

.saturn-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #ffd700;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.saturn-text {
    font-size: 0.85rem;
    color: #e2e8f0;
    line-height: 1.4;
    font-style: italic;
}

/* --- HEADLESS LAYOUT OVERRIDES --- */
.user-profile-floating {
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.6);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.user-profile-floating:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}

.user-profile-floating img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
}

.user-profile-floating span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Ensure dropdown appears correctly relative to floating profile */
.user-profile-floating .profile-dropdown {
    top: 55px;
    /* Adjusted relative to floating container */
    right: 0;
    width: 200px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--panel-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Business Insights Area */
.business-insights-container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto 10px auto;
}

.insights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.insight-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 12px;
    border-left: 3px solid var(--text-secondary);
    transition: transform 0.3s ease;
    text-align: left;
}

.insight-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.insight-card.success {
    border-left-color: var(--success-color);
}

.insight-card.warning {
    border-left-color: #facc15;
}

.insight-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.insight-value {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #fff;
}

.insight-sub {
    font-size: 0.8rem;
}

.insight-sub.success {
    color: var(--success-color);
}

.insight-sub.warning {
    color: #facc15;
}

/* Branding Headless */
.headless-branding {
    font-size: 2rem;
    letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
    margin-bottom: 10px;
    font-weight: 300;
    text-align: center;
}

/* Adjustments for Evolution Container in Headless Mode */
.evolution-container.headless-mode {
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* Main Content Padding Update for Headless */
.main-content {
    padding-top: 40px;
    /* Space for the floating profile visually */
}

/* =========================================
   FINTECH SYSTEM VIEW
   ========================================= */
.fintech-system-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--panel-border);
}

.system-block {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.system-block:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.1);
}

.sb-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--accent-color);
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.market-ai .sb-header {
    color: #3b82f6;
}

/* Blue for Market */
.shift-ai .sb-header {
    color: #facc15;
}

/* Gold for Shift */

.sb-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tech-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ti-status {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.ti-status.active {
    color: var(--success-color);
    background: rgba(74, 222, 128, 0.1);
}

.ti-status.warning {
    color: var(--warning-color);
    background: rgba(251, 146, 60, 0.1);
}

.ti-value {
    color: #fff;
    font-weight: bold;
}

.sb-footer {
    padding: 10px 15px;
    font-size: 0.7rem;
    text-align: center;
    border-top: 1px solid var(--panel-border);
    background: rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}

.sb-footer.highlight {
    color: var(--success-color);
    font-weight: bold;
}

/* Flow Animation */
.system-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 40px;
    position: relative;
    color: var(--text-secondary);
}

.flow-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    animation: flowPulse 2s infinite;
}

.flow-icon {
    background: #0f172a;
    border: 1px solid var(--accent-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--accent-color);
    z-index: 2;
    margin-top: -13px;
    /* Center over line */
}

@keyframes flowPulse {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.3;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .fintech-system-container {
        flex-direction: column;
    }

    .system-flow {
        transform: rotate(90deg);
        margin: 10px 0;
    }
}

/* --- DASHBOARD CLEANUP & POLISH (GLOBAL) --- */

/* 1. Main Content Spacing */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    /* Force vertical spacing between sections */
    padding-bottom: 50px;
    padding-top: 80px;
    /* Space for Local Island Bar */
}

/* 2. Headless Branding Area & Spacing for Profile */
.command-deck-panel {
    /* margin-top: 60px; REMOVED - Handled by global padding */
}

.evolution-container.headless-mode {
    flex-direction: column;
    gap: 20px;
    margin-top: 10px;
    margin-bottom: 30px;
    /* Push content below away */
    position: relative;
    z-index: 1;
}

.headless-branding {
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
}

/* 3. Business Insights & Quick Stats Separation */
.grid-dashboard {
    margin-top: 20px;
    z-index: 2;
    position: relative;
}

.insights-grid {
    margin-top: 20px;
    /* Space between Branding and Insights */
}

/* 4. Enhanced System View (Glassmorphism) */
.fintech-system-container {
    background: rgba(15, 23, 42, 0.4);
    /* Darker, cleaner background */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.system-block {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.system-block:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.1);
}

/* 5. Sidebar Logout Fix */
.sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Pushes content apart */
}

.sidebar-menu {
    flex-grow: 1;
    /* Takes scaleable space */
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: auto;
    /* Explicitly push to bottom */
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--danger-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
    padding: 10px;
    border-radius: 8px;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.1);
    transform: translateX(5px);
}

/* --- COMMAND DECK LAYOUT (Restored) --- */

.command-deck-panel {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.command-deck-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
}

.deck-content {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    align-items: center;
}

.deck-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-right: 40px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.deck-branding {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    text-align: center;
}

.deck-intel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.deck-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 2px;
    color: var(--text-secondary);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 15px;
}

.deck-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.deck-insights-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.deck-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--accent-color);
    padding: 20px;
    border-radius: 12px;
}

.deck-card h4 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 600;
    letter-spacing: 1px;
}

.deck-card .value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
}

.deck-card .sub {
    font-size: 0.8rem;
    color: var(--accent-color);
}

/* Responsive Deck */
@media (max-width: 1024px) {
    .deck-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .deck-visual {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 30px;
        flex-direction: row;
        justify-content: center;
    }
}

/* =========================================
   MOBILE & TABLET OPTIMIZATIONS (Consolidated)
   ========================================= */

@media (max-width: 768px) {

    /* 1. Layout Structure */
    .dashboard-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
        grid-template-areas:
            "header"
            "sidebar"
    }

    /* 2. Sidebar Navigation (Slide-Out Drawer) */
    /* 2. Sidebar Navigation (Slide-Out Drawer) */
    .mobile-menu-toggle {
        display: flex;
        /* Flex to center icon */
        position: fixed;
        top: 25px;
        /* Aligned with profile approx */
        left: 20px;
        /* Left Zone */
        z-index: 2000;
        background: rgba(15, 23, 42, 0.95);
        border: 1px solid var(--panel-border);
        color: var(--accent-color);
        padding: 0;
        width: 50px;
        /* Defined square size */
        height: 50px;
        border-radius: 12px;
        cursor: pointer;
        backdrop-filter: blur(10px);
        align-items: center;
        justify-content: center;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    }

    .sidebar-overlay {
        display: block;
        /* Override global display: none */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(3px);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        background: rgba(12, 24, 40, 0.98);
        border-right: 1px solid var(--accent-color);
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
        padding-top: 0;
        overflow-y: auto;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 10px 0 50px rgba(0, 0, 0, 0.5);
    }

    /* Mobile Sidebar Header */
    .sidebar-header-mobile {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 20px;
        border-bottom: 1px solid var(--panel-border);
        margin-bottom: 20px;
    }

    .sys-title {
        font-family: var(--font-mono);
        color: var(--accent-color);
        font-weight: 700;
        letter-spacing: 2px;
    }

    .close-sidebar {
        background: transparent;
        border: none;
        color: var(--text-secondary);
        font-size: 1.2rem;
        cursor: pointer;
    }

    .nav-group {
        flex-direction: column;
        /* Vertical list in drawer */
        margin-bottom: 20px;
        align-items: flex-start;
        width: 100%;
    }

    .nav-label {
        display: block;
        /* Show labels in drawer */
        margin-top: 10px;
    }

    .nav-item {
        width: 100%;
        padding: 12px 20px;
        font-size: 1rem;
        white-space: normal;
        border: none;
        background: transparent;
        border-radius: 0;
        border-right: 3px solid transparent;
        justify-content: flex-start;
        /* Align icon and text left */
    }

    .nav-item.active {
        background: linear-gradient(90deg, rgba(85, 173, 169, 0.1) 0%, transparent 100%);
        border-right-color: var(--accent-color);
    }

    .sidebar-footer {
        display: flex;
        /* Show logout in drawer */
        margin-top: auto;
        padding: 20px;
    }

    .deck-content {
        display: flex;
        /* Switch to flex column */
        flex-direction: column;
        gap: 25px;
    }

    .deck-branding {
        font-size: 1.5rem;
        /* Larger branding */
    }

    .deck-insights-row {
        grid-template-columns: 1fr;
        /* Stack cards vertically */
        gap: 15px;
    }

    /* 5. Dashboard Grid (Stats) */
    .grid-dashboard {
        grid-template-columns: 1fr;
        /* Stack stats vertically */
        gap: 15px;
    }

    /* 6. Systems Views */
    .fintech-system-container {
        flex-direction: column;
        padding: 15px;
    }

    .system-flow {
        transform: rotate(90deg);
        margin: 15px 0;
        width: 100%;
        align-items: center;
        justify-content: center;
    }

    .flow-line {
        width: 50px;
        /* Shorter line for vertical */
        height: 2px;
    }

    .flow-icon {
        margin-top: 0;
        /* Reset margin */
        position: absolute;
    }

    /* 7. Profile Floating (Right Zone) */
    .user-profile-floating {
        top: 25px;
        left: auto;
        /* Remove centering */
        right: 20px;
        /* Position to Right */
        transform: none;
        /* Remove transform */
        width: calc(100% - 90px);
        /* 100% - (Toggle 50px + Gap 20px + Margin 20px) */
        max-width: 400px;
        justify-content: space-between;
        height: 50px;
        /* Match toggle height */
        background: rgba(15, 23, 42, 0.95);
        /* Consistency */
    }

    .user-profile-floating .profile-dropdown {
        width: 100%;
        left: 0;
        top: 60px;
    }
}