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

:root {
    --header-height: 60px;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: #f5f5f5;
    color: #222;
    min-height: 100vh;
}

header {
    background: #1a1a2e;
    color: #fff;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.header-right {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.header-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid rgba(233, 69, 96, 0.7);
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
}

.header-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    margin: 5px auto;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.header-brand .logo {
    width: 36px;
    height: 36px;
    background: #e94560;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.header-brand .app-name {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.header-auth {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

.header-board-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-board-label {
    opacity: 0.8;
}

.header-board-select {
    color: #fff;
    background: #111126;
    border: 1px solid rgba(233, 69, 96, 0.6);
    border-radius: 4px;
    padding: 0.3rem 0.55rem;
    font-size: 0.9rem;
    min-width: 180px;
}

.header-board-select:focus {
    outline: none;
    border-color: #e94560;
    box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.2);
}

.header-auth .username {
    opacity: 0.8;
}

.header-auth a,
.logout-button {
    color: #e94560;
    background: transparent;
    text-decoration: none;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border: 1px solid #e94560;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
    font-size: 0.9rem;
    cursor: pointer;
}

.header-auth a:hover,
.logout-button:hover {
    background: #e94560;
    color: #fff;
}

.logout-form {
    display: inline;
}

main {
    max-width: 1200px;
    margin: calc(var(--header-height) + 2rem) auto 2rem;
    padding: 0 1.5rem;
}

@media (max-width: 860px) {
    header {
        height: var(--header-height);
        padding: 0.6rem 1rem;
    }

    .header-brand .app-name {
        font-size: 1.1rem;
    }

    .header-right {
        position: relative;
    }

    .header-menu-toggle {
        display: block;
    }

    .header-auth {
        display: flex;
        position: absolute;
        right: 0;
        top: calc(100% + 0.5rem);
        min-width: 230px;
        background: #111126;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 8px;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
        padding: 0.75rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.7rem;
        z-index: 25;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-8px) scale(0.98);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    }

    .header-right.is-open .header-auth {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }

    .header-right.is-open .header-menu-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .header-right.is-open .header-menu-toggle span:nth-child(2) {
        opacity: 0;
    }

    .header-right.is-open .header-menu-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .header-board-switch {
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
    }

    .header-board-label,
    .header-auth .username {
        font-size: 0.85rem;
    }

    .header-board-select {
        min-width: 100%;
        max-width: 100%;
    }

    .header-auth a,
    .logout-button {
        width: 100%;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .header-menu-toggle span,
    .header-auth {
        transition: none;
    }
}
