* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8f9fa;
}

.header {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 16px 0;
    position: relative;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.logo-text {
    line-height: 1;
}

.env-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: 1px solid transparent;
}

/* Повышенная специфичность, чтобы перекрыть другие .env-badge (например в login.css) */
.header .logo .env-badge.env-badge-dev {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.header .logo .env-badge.env-badge-stage {
    background: #fef9c3;
    border-color: #fde047;
    color: #854d0e;
}

.header .logo .env-badge.env-badge-prod {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.nav-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    flex: 1;
    max-width: 800px;
}

.nav-item {
    padding: 10px 18px;
    color: #495057;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
    text-align: center;
}

.nav-item:hover {
    color: #3b82f6;
    background: #f8f9fa;
}

.nav-item.active {
    color: white;
    background: #3b82f6;
}

.nav-menu-separator {
    width: 1px;
    height: 22px;
    background: #dee2e6;
    flex-shrink: 0;
    align-self: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #f8f9fa;
    border-radius: 8px;
}

.user-name {
    font-size: 13px;
    color: #495057;
    font-weight: 500;
}

.user-icon {
    font-size: 16px;
    color: #6c757d;
}

.btn-logout {
    padding: 8px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    text-decoration: none;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout:hover {
    background: #c82333;
    color: white;
}

.mobile-menu-toggle {
    display: none;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    cursor: pointer;
    font-size: 18px;
}

.mobile-menu-toggle:hover {
    background: #f8f9fa;
}

@media (max-width: 992px) {
    .header-content {
        flex-wrap: wrap;
        gap: 16px;
    }

    .logo {
        order: 1;
    }

    .mobile-menu-toggle {
        display: block;
        order: 1;
    }

    .user-menu {
        order: 2;
    }

    .btn-logout {
        order: 3;
    }

    .header-actions {
        order: 2;
        flex: 1;
        justify-content: flex-end;
    }

    .nav-menu {
        display: none;
        order: 4;
        width: 100%;
        flex-direction: column;
        gap: 0;
        max-width: none;
        border-top: 1px solid #e9ecef;
        padding-top: 12px;
        margin-top: 12px;
    }

    .nav-menu.show {
        display: flex;
    }

    .nav-item {
        width: 100%;
        text-align: left;
        padding: 12px 16px;
        border-radius: 0;
    }

    .nav-item.active {
        background: #f8f9fa;
        border-left: 3px solid #3b82f6;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0 16px;
    }

    .user-name {
        display: none;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 17px;
    }

    .btn-logout {
        padding: 8px 10px;
        font-size: 15px;
    }

    .user-menu {
        padding: 8px 10px;
    }
}

