.header {
    height: 64px;
    background: linear-gradient(90deg, #000000, #000000);

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 32px;

    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-sizing: border-box;
    border-bottom: 1px solid #95b8f3;
}

.header-left .logo {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.logo span {
    color: #2f8cff;
}

.nav {
    display: flex;
    gap: 28px;
}

.nav-link {
    color: #8a96a3;
    text-decoration: none;
    font-size: 14px;
    transition: 0.2s;
}

.nav-link:hover {
    color: #ffffff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
}

.notification {
    position: relative;
    cursor: pointer;
}

.bell {
    font-size: 18px;
}

.theme-switcher {
    position: relative;
    display: flex;
    align-items: center;
}

.theme-switcher__toggle {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #aab6c4;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.theme-switcher__toggle:hover,
.theme-switcher__toggle[aria-expanded="true"] {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.08);
}

.theme-switcher__toggle:focus-visible,
.theme-switcher__option:focus-visible {
    outline: 2px solid #2f8cff;
    outline-offset: 2px;
}

.theme-switcher__trigger-icon {
    display: none;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.theme-switcher[data-current-theme="midnight"] [data-theme-trigger-icon="midnight"],
.theme-switcher[data-current-theme="white"] [data-theme-trigger-icon="white"],
.theme-switcher[data-current-theme="system"] [data-theme-trigger-icon="system"] {
    display: block;
}

.theme-switcher__menu {
    position: absolute;
    top: 44px;
    right: 0;
    width: 244px;
    padding: 7px;
    border: 1px solid #1f2a36;
    border-radius: 14px;
    background: rgba(13, 17, 23, 0.98);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1100;
}

.theme-switcher__menu[hidden] {
    display: none;
}

.theme-switcher__option {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    color: #c9d1d9;
    text-align: left;
    transition: color 0.16s ease, background 0.16s ease;
}

.theme-switcher__option:hover,
.theme-switcher__option.is-active {
    color: #ffffff;
    background: rgba(47, 140, 255, 0.12);
}

.theme-switcher__option:disabled {
    cursor: wait;
    opacity: 0.62;
}

.theme-switcher__option-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    object-fit: contain;
    opacity: 0.72;
}

.theme-switcher__check {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-switcher__option.is-active .theme-switcher__option-icon {
    opacity: 1;
}

.theme-switcher__option-copy {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.theme-switcher__option-title {
    font-size: 13px;
    font-weight: 650;
    line-height: 1.25;
}

.theme-switcher__option-description {
    margin-top: 2px;
    color: #7f8a96;
    font-size: 11px;
    line-height: 1.25;
}

.theme-switcher__check {
    visibility: hidden;
    color: #2f8cff;
}

.theme-switcher__option.is-active .theme-switcher__check {
    visibility: visible;
}

.badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: red;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 50%;
}

.avatar img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #1f2a36;
}

.logo-link {
    text-decoration: none;
    display: inline-block;
}

.logo-link:hover {
    opacity: 0.85;
}


@media (max-width: 768px) {
    .header {
        position: fixed;
        width: 100%;
        height: var(--app-mobile-header-total-height);
        padding: 0 16px;
        padding:
            var(--app-safe-top)
            max(16px, var(--app-safe-right))
            0
            max(16px, var(--app-safe-left));
        justify-content: center;
        top: 0;
        left: 0;
    }

    .nav {
        display: none;
    }

    .header-right {
        position: absolute;
        right: max(12px, var(--app-safe-right));
        display: flex;
        gap: 8px;
    }

    .header-right .avatar {
        display: none;
    }

    .header-left {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .header-left .logo {
        font-size: 16px;
        line-height: 1.2;
        white-space: nowrap;
    }

    .theme-switcher__menu {
        position: fixed;
        top: calc(var(--app-mobile-header-total-height) - 4px);
        right: max(10px, var(--app-safe-right));
        width: min(244px, calc(100vw - 20px));
    }
}


.notification-dropdown {
    position: absolute;
    top: 30px;
    right: 0;

    width: 320px;
    max-width: min(320px, calc(100vw - 24px));
    background: #0d1117;
    border: 1px solid #1f2a36;
    border-radius: 10px;

    display: none;
    flex-direction: column;
    padding: 10px;
    z-index: 1000;
}

.notification-dropdown.active {
    display: flex;
}

.notification-item {
    padding: 8px;
    font-size: 13px;
    color: #c9d1d9;
    border-bottom: 1px solid #1f2a36;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background: rgba(47, 140, 255, 0.08);
}

.notification-item:hover {
    background: #161b22;
}

.notification-text {
    line-height: 1.4;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.notification-time {
    font-size: 11px;
    color: #7f8a96;
}

.notification-empty {
    padding: 10px 8px;
    color: #8a96a3;
    font-size: 13px;
}

.avatar {
    position: relative;
    cursor: pointer;
}

.avatar-dropdown {
    position: absolute;
    top: 45px;
    right: 0;

    width: 180px;
    background: #0d1117;
    border: 1px solid #1f2a36;
    border-radius: 10px;

    display: none;
    flex-direction: column;
    padding: 8px;

    z-index: 1000;
}

.avatar-dropdown a {
    padding: 10px;
    text-decoration: none;
    color: #c9d1d9;
    font-size: 14px;
    border-radius: 6px;
}

.avatar-dropdown a:hover {
    background: #161b22;
}

.login-btn {
    color: #fff;
    background: #2f8cff;
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none;
}

.avatar-dropdown .logout-btn {
    color: #cf2b2b;
}

.avatar-dropdown.active {
    display: flex;
}