
:root {
    
    --header-bg: var(--surface-brand);
    --header-border: rgba(255, 255, 255, 0.06);
    --nav-link-color: #7D8794;
    --nav-link-active-bg: color-mix(in srgb, var(--action-primary, #00D4FF) 6%, transparent);
    
    --logo-bg: var(--action-primary);
    --logo-text: #071216;
    
    --rm-radius: 12px;
    
    --state-green: #00ff88;
    --state-yellow: #ffcc00;
    --state-red: #ff0044;
    --state-black: #666666;
}
.mission-control-header {
    background: var(--header-bg) !important;
    border-bottom: 2px solid var(--header-border) !important;
    padding: 0 24px !important;
    height: var(--rm-nav-h) !important;
    min-height: var(--rm-nav-h) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}
.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}
.rm-nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    height: var(--rm-nav-h);
}
.rm-brand-anchor {
    display: flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}
.rm-brand-anchor:hover,
.rm-brand-anchor:focus-visible {
    color: inherit;
    text-decoration: none;
}
.rm-brand-anchor:focus-visible { outline: 2px solid var(--border-active); outline-offset: 2px; border-radius: 10px; }
.rm-logo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--logo-bg) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.3s ease;
}
.rm-logo span {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 800;
    color: var(--logo-text) !important;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.rm-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.rm-brand-name {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary) !important;
    letter-spacing: 0.3px;
    line-height: 1.2;
}
.rm-brand-sub {
    font-family: var(--font-primary);
    font-size: 11px;
    font-weight: 500;
    color: var(--action-primary) !important;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-top: 1px;
    transition: color 0.3s ease;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    text-decoration: none;
    padding-right: 20px;
    border-right: 1px solid var(--header-border);
}
.brand-icon {
    color: var(--action-primary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.brand-name {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-primary);
}
.system-state {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 14px 4px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    font-family: var(--font-mono);
    font-size: 12px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}
.state-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot 2s infinite;
}
.system-state.green .state-dot {
    background: var(--state-green);
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.4);
}
.system-state.green {
    border-color: rgba(0, 255, 136, 0.2);
}
.system-state.yellow .state-dot {
    background: var(--state-yellow);
    box-shadow: 0 0 12px rgba(255, 204, 0, 0.5);
    animation-duration: 1s;
}
.system-state.yellow {
    border-color: rgba(255, 204, 0, 0.3);
    background: rgba(255, 204, 0, 0.08);
}
.system-state.red .state-dot {
    background: var(--state-red);
    box-shadow: 0 0 20px rgba(255, 0, 68, 0.6);
    animation-duration: 0.6s;
}
.system-state.red {
    border-color: rgba(255, 0, 68, 0.4);
    background: rgba(255, 0, 68, 0.12);
}
.system-state.black .state-dot {
    background: var(--state-black);
    box-shadow: none;
    animation: none;
}
.system-state.black {
    border-color: #333;
    background: rgba(255, 255, 255, 0.03);
    opacity: 0.6;
}
.state-label {
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}
.state-time {
    color: var(--text-muted);
    font-size: 11px;
    padding-left: 6px;
    border-left: 1px solid var(--header-border);
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}
.mode-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
.mode-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--nav-link-color);
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    white-space: nowrap;
}
.mode-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}
.mode-btn.active {
    background: var(--action-primary);
    color: var(--logo-text);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--action-primary) 35%, transparent);
}
.mode-btn.active:hover {
    background: var(--action-primary-hover);
    box-shadow: 0 4px 20px color-mix(in srgb, var(--action-primary) 45%, transparent);
}
.mode-icon {
    font-size: 16px;
    line-height: 1;
}
.mode-label {
    font-weight: 500;
}
.mode-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.5px;
}
.mode-btn.active .mode-badge {
    background: rgba(0, 0, 0, 0.15);
    color: var(--logo-text);
}
.mode-badge.warning {
    background: var(--state-yellow);
    color: #0a0e17;
}
.mode-btn:not(.active) .mode-badge.warning {
    background: var(--state-yellow);
    color: #0a0e17;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
}
.action-critical {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    background: var(--state-red);
    color: white;
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 0 30px rgba(255, 0, 68, 0.15);
}
.action-critical:hover {
    background: #ff1155;
    transform: scale(1.02);
    box-shadow: 0 0 40px rgba(255, 0, 68, 0.25);
}
.action-critical:active {
    transform: scale(0.97);
}
.action-icon {
    font-size: 16px;
}
.quick-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 4px;
}
.action-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--nav-link-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-decoration: none;
}
.action-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    text-decoration: none;
}
.action-btn.active {
    color: var(--action-primary);
}
.header-settings-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: transparent;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    font-size: 18px;
    flex-shrink: 0;
    text-decoration: none;
}
.header-settings-btn:hover {
    border-color: var(--border-active);
    color: var(--color-secondary);
    background: var(--action-primary-bg);
    text-decoration: none;
}
.header-settings-btn.active {
    color: var(--color-secondary);
    border-color: var(--color-secondary);
    background: var(--action-primary-bg);
}
.header-settings-btn.active:hover {
    color: var(--color-secondary-hover);
    border-color: var(--color-secondary-hover);
    background: var(--action-primary-bg);
}
.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 4px;
    cursor: pointer;
    position: relative;
}
.user-menu-chevron {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}
.user-menu:hover .user-menu-chevron {
    color: var(--text-secondary);
}
.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 200px;
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 8px 0;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all var(--transition-fast);
    z-index: 10000;
}
.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.user-dropdown-header {
    padding: 8px 16px 6px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.user-dropdown-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}
.user-dropdown-role {
    font-size: 11px;
    color: var(--text-muted);
}
.user-dropdown-divider {
    height: 1px;
    background: var(--border-soft);
    margin: 6px 12px;
}
.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    font-family: var(--font-primary);
}
.user-dropdown-item:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    text-decoration: none;
}
.user-dropdown-item i {
    font-size: 14px;
    width: 18px;
    text-align: center;
}
.user-dropdown-item.danger {
    color: var(--state-danger);
}
.user-dropdown-item.danger:hover {
    background: var(--state-danger-bg);
    color: var(--state-danger);
}
.user-avatar {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: var(--avatar-radius, 28%);
    corner-shape: var(--avatar-corner, round);
    background: linear-gradient(135deg, var(--action-primary), var(--surface-brand));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.avatar-initials {
    color: var(--logo-text);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-primary);
}
.avatar-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--header-bg);
    background: var(--state-green);
}
.avatar-status.offline {
    background: var(--text-muted);
}
.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.user-name {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-primary);
}
.user-role {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 400;
    font-family: var(--font-primary);
}
.rm-hamburger {
    display: none;
    background: none;
    border: 1px solid var(--header-border) !important;
    border-radius: 8px;
    color: var(--nav-link-color) !important;
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-size: 18px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1001;
    pointer-events: auto;
    position: relative;
}
.rm-hamburger:hover {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}
.rm-mob-nav {
    display: none;
    position: fixed;
    top: var(--rm-nav-h);
    left: 0;
    right: 0;
    background: var(--header-bg);
    border-bottom: 2px solid var(--header-border);
    z-index: 9998;
    flex-direction: column;
    padding: 12px 16px 16px;
    max-height: calc(100vh - var(--rm-nav-h));
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.rm-mob-nav.open {
    display: flex;
}
.rm-mob-link {
    padding: 12px 14px;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
.rm-mob-link:hover {
    color: var(--text-primary);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.04);
}
.rm-mob-link.active {
    color: var(--action-primary) !important;
}
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 150;
    display: none;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}
.sidebar-overlay.show {
    display: block;
    opacity: 1;
    pointer-events: auto;
}
.app-shell {
    width: 100%;
    position: relative;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    overflow: hidden;
    z-index: 1050;
    margin-top: var(--rm-nav-h);
}
body.wc-overlay-open .mission-control-header,
body.wc-overlay-open .app-shell,
body.modal-open .mission-control-header,
body.modal-open .app-shell { z-index: auto !important; }
.reports-notification {
    display: none;
    align-items: center;
    gap: 10px;
    background: rgba(217, 59, 59, 0.08);
    border: 1px solid var(--state-danger);
    border-left: 4px solid var(--state-danger);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: var(--rm-radius);
    margin: 10px auto 0;
    cursor: pointer;
    flex-wrap: wrap;
    max-width: 1000px;
}
.reports-notification .reports-text {
    flex: 1 1 160px;
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 600;
    min-width: 0;
}
.reports-notification .reports-badge {
    display: inline;
    background: var(--state-danger);
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 700;
}
.reports-notification .reports-view {
    font-family: var(--font-primary);
    font-size: 12px;
    color: var(--action-primary) !important;
    font-weight: 700;
}
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-default);
    background: var(--surface-default);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 15px;
    flex-shrink: 0;
}
.theme-toggle-btn:hover {
    border-color: var(--border-active);
    color: var(--text-primary);
    background: var(--surface-hover);
}
.theme-toggle-btn:active {
    transform: scale(0.92);
}
.theme-toggle-btn .toggle-label-dark {
    display: inline;
}
.theme-toggle-btn .toggle-label-light {
    display: none;
}
body.settings-light .theme-toggle-btn .toggle-label-dark {
    display: none;
}
body.settings-light .theme-toggle-btn .toggle-label-light {
    display: inline;
}
body.settings-light .theme-toggle-btn {
    background: var(--surface-card);
    border-color: var(--border-default);
    color: var(--text-secondary);
}
body.settings-light .theme-toggle-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-active);
}
@media (max-width: 1200px) {
    .mode-label {
        display: none;
    }
    .mode-btn {
        padding: 8px 14px;
    }
    .user-info {
        display: none;
    }
    .user-menu-chevron {
        display: none;
    }
}
@media (max-width: 992px) {
    .mode-switcher {
        display: none !important;
    }
    .rm-hamburger {
        display: flex !important;
    }
    
    .header-settings-btn,
    .user-menu,
    .user-dropdown {
        display: none !important;
    }
    .rm-mob-nav {
        z-index: 9999 !important;
        position: fixed !important;
    }
    .mission-control-header {
        padding: 0 12px;
        gap: 10px;
        height: 64px;
        min-height: 64px;
    }
    .brand-name {
        font-size: 14px;
        letter-spacing: 1px;
    }
    .brand {
        padding-right: 12px;
        gap: 10px;
    }
    .system-state .state-label,
    .system-state .state-time {
        display: none;
    }
    .system-state {
        padding: 4px 8px;
    }
    .action-critical span:not(.action-icon) {
        display: none;
    }
    .action-critical {
        padding: 8px 12px;
    }
    .quick-actions {
        border: none;
        padding: 0;
    }
}
@media (max-width: 768px) {
    .mission-control-header {
        padding: 0 8px;
        height: 56px;
        min-height: 56px;
    }
    .brand-icon {
        width: 24px;
        height: 24px;
    }
    .brand-name {
        font-size: 12px;
        letter-spacing: 0.5px;
    }
    .brand {
        padding-right: 8px;
        gap: 8px;
    }
    .rm-hamburger {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    .user-avatar {
        width: 30px;
        height: 30px;
    }
    .avatar-initials {
        font-size: 11px;
    }
    .action-critical {
        padding: 6px 10px;
    }
    .action-critical .action-icon {
        font-size: 14px;
    }
    .state-dot {
        width: 8px;
        height: 8px;
    }
    .rm-mob-nav {
        top: 56px;
        max-height: calc(100vh - 56px);
        padding: 8px 12px 12px;
    }
    .rm-mob-link {
        font-size: 14px;
        padding: 10px 12px;
    }
    .header-settings-btn {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
    .user-dropdown {
        right: -8px;
        min-width: 180px;
    }
}
@media (max-width: 480px) {
    .brand-name {
        display: none;
    }
    .brand {
        padding-right: 6px;
        border-right: none;
    }
    .system-state {
        padding: 2px 6px;
        gap: 6px;
    }
    .system-state .state-label {
        display: none;
    }
    .system-state .state-time {
        display: none;
    }
    .quick-actions .action-btn {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    .action-critical {
        padding: 4px 8px;
    }
    .action-critical span:not(.action-icon) {
        display: none;
    }
    .user-info {
        display: none;
    }
    .user-avatar {
        width: 28px;
        height: 28px;
    }
    .avatar-initials {
        font-size: 10px;
    }
    .mission-control-header {
        gap: 6px;
        padding: 0 6px;
    }
    .header-left {
        gap: 10px;
    }
    .rm-hamburger {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
    .header-settings-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
        border-radius: 6px;
    }
    .user-dropdown {
        right: -4px;
        min-width: 160px;
    }
    .user-dropdown-item {
        font-size: 12px;
        padding: 6px 12px;
    }
}
