.dashboard-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--ss-color-bg);
    padding: 0 24px 24px 0;
    height: 72px;
    box-sizing: border-box;
    z-index: 30;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
}

.logo {
    font-size: 1.25rem;
    font-weight: var(--ss-font-weight-bold);
    color: var(--ss-color-text);
}

.page-title-header {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-credits-widget {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem 0.75rem;
    background: var(--ss-color-bg-subtle);
    border-radius: 0.5rem;
    border: 1px solid var(--ss-color-border-light);
}

.header-credits-label {
    font-size: 0.75rem;
    font-weight: var(--ss-font-weight-semibold);
    color: var(--ss-color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.header-credit-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.header-credit-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: brightness(0) saturate(100%) invert(42%) sepia(15%) saturate(1234%) hue-rotate(75deg) brightness(95%) contrast(89%);
}

.header-credit-icon-screen {
    background-image: url('../img/icons/screen.svg');
}

.header-credit-icon-sage {
    background-image: url('../img/icons/sage.svg');
}

.header-credit-value {
    font-size: 0.875rem;
    font-weight: var(--ss-font-weight-semibold);
    color: var(--ss-color-text);
}

.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.user-menu-trigger:hover {
    background: var(--ss-color-bg-hover);
}

.user-greeting {
    font-size: 0.875rem;
    color: var(--ss-color-text);
}

.user-avatar {
    border-radius: 9999px;
}

.dropdown-icon {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: var(--ss-color-text-light);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    width: 12rem;
    background: var(--ss-color-bg);
    border: 1px solid var(--ss-color-border-light);
    border-radius: 0.5rem;
    box-shadow: var(--ss-shadow-dropdown);
    padding: 0.25rem 0;
    z-index: 50;
}

.user-dropdown.hidden {
    display: none;
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--ss-color-text);
    text-decoration: none;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background: var(--ss-color-bg-hover);
}

.dropdown-divider {
    height: 1px;
    background: var(--ss-color-border-light);
    margin: 0.25rem 0;
}

/* ============================================
   SUDO MODE STYLES
   ============================================ */

/* Sudo mode indicator bar */
.sudo-mode-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #0077ff;
    color: #FFFFFF;
    padding: 8px 24px;
    z-index: 35;
    font-size: 0.875rem;
}

.sudo-mode-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 1400px;
    margin: 0 auto;
}

.sudo-mode-text {
    font-weight: 400;
}

.sudo-mode-text strong {
    font-weight: 600;
}

.sudo-mode-exit {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    margin-left: 12px;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.sudo-mode-exit svg {
    width: 18px;
    height: 18px;
}

.sudo-mode-exit:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Adjust header position when sudo bar is visible */
.sudo-mode-bar + .dashboard-header {
    top: 36px;
}

/* ============================================
   COUNCIL SWITCHER MODAL
   ============================================ */

.council-switcher-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.council-switcher-modal.hidden {
    display: none;
}

.council-switcher-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.council-switcher-content {
    position: relative;
    background: var(--ss-color-bg);
    border-radius: 12px;
    box-shadow: var(--ss-shadow-card);
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.council-switcher-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--ss-color-border-light);
}

.council-switcher-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: var(--ss-font-weight-semibold);
    color: var(--ss-color-text);
}

.council-switcher-body {
    padding: 24px;
}

.council-switcher-body .e-control-wrapper {
    width: 100%;
}

.council-switcher-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--ss-color-border-light);
    text-align: center;
}

.council-switcher-home-btn {
    color: var(--ss-color-brand);
    text-decoration: underline;
    font-size: 0.875rem;
    font-weight: 500;
}

.council-switcher-home-btn:hover {
    opacity: 0.8;
}

.council-switcher-footer-divider {
    color: var(--ss-color-text-light);
    margin: 0 8px;
}

.council-switcher-close-link {
    color: var(--ss-color-form-accent);
    text-decoration: underline;
    font-size: 0.875rem;
    font-weight: 500;
}

.council-switcher-close-link:hover {
    opacity: 0.8;
}

/* Modal loading state */
.council-switcher-overlay.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
}

.council-switcher-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--ss-color-border-light);
    border-top-color: var(--ss-color-brand);
    border-radius: 50%;
    animation: council-switcher-spin 0.8s linear infinite;
}

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