* {
    box-sizing: border-box;
}

:root {
    --bg: #eef1fb;
    --bg-2: #dfe7f8;
    --panel: #ffffff;
    --text: #233a6f;
    --muted: #5d6f95;
    --line: #d5deef;
    --brand: #314f97;
    --brand-2: #4f6fba;
    --accent: #ca3c43;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #f8faff 0%, var(--bg) 48%, #e8eefb 100%);
}

a {
    color: var(--brand-2);
}

.btn {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.btn:hover {
    border-color: #9fb3c6;
    background: #f8fbfe;
}

.btn.btn-primary {
    color: #fff;
    border-color: var(--brand);
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.site-header {
    padding: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.site-header-inner {
    width: min(1120px, calc(100% - 2.2rem));
    margin: 0 auto;
    min-height: 66px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-logo {
    width: 230px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.site-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left center;
}

.site-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.18rem;
}

.site-nav a {
    text-decoration: none;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
    padding: 0.48rem 0.68rem;
    border-radius: 8px;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--brand);
    background: #eaf0ff;
}

.site-nav-actions {
    margin-left: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-pill {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.45rem 0.7rem;
    font-size: 0.85rem;
    color: var(--muted);
    background: #fff;
}

.user-menu {
    position: relative;
}

.user-menu-split {
    display: inline-flex;
    align-items: stretch;
}

.user-menu-main,
.user-menu-toggle {
    cursor: pointer;
    border-radius: 0;
}

.user-menu-main {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    border-right-width: 0;
}

.user-menu-toggle {
    min-width: 32px;
    padding: 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

.user-menu-main:hover,
.user-menu-toggle:hover {
    background: #f5f8ff;
}

.user-menu-panel {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    min-width: 150px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(35, 58, 111, 0.16);
    padding: 0.35rem;
    display: none;
    z-index: 25;
}

.user-menu-panel.is-open {
    display: block;
}

.user-menu-item {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    text-align: left;
    padding: 0.42rem 0.5rem;
    font-size: 0.84rem;
    cursor: pointer;
}

.user-menu-item:hover {
    border-color: var(--line);
    background: #f5f8ff;
}

.site-main {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 1rem;
}

.site-hero {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 2rem;
    background:
        linear-gradient(135deg, rgba(19, 122, 149, 0.08), rgba(239, 111, 60, 0.1)),
        var(--panel);
}

.hero-content h1 {
    margin-top: 0.25rem;
    font-size: clamp(1.6rem, 2.8vw, 2.45rem);
    line-height: 1.15;
}

.hero-content p {
    max-width: 70ch;
    color: var(--muted);
}

.kicker {
    margin: 0;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    font-weight: 700;
}

.hero-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.site-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
}

.card,
.site-section {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    padding: 1rem;
}

.card h2,
.site-section h1 {
    margin-top: 0;
}

.card p,
.site-section p {
    color: var(--muted);
}

.login-shell {
    min-height: calc(100vh - 100px);
    display: grid;
    place-items: center;
    padding: 1rem;
}

.login-card {
    width: min(460px, 100%);
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    padding: 1.35rem;
    box-shadow: 0 20px 40px rgba(49, 79, 151, 0.14);
}

.login-card h1 {
    margin: 0 0 0.3rem;
    color: var(--text);
    font-size: 1.6rem;
}

.login-sub {
    margin: 0 0 0.9rem;
    color: var(--muted);
}

.login-card form {
    display: grid;
    gap: 0.55rem;
}

.login-card label {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.9rem;
}

.login-card input {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.62rem 0.66rem;
    height: 40px;
    font-size: 0.95rem;
}

.error {
    color: #b42318;
    min-height: 1.2rem;
}

@media (max-width: 900px) {
    .site-header-inner {
        width: min(1120px, calc(100% - 1.1rem));
        min-height: auto;
        padding: 0.6rem 0;
        flex-wrap: wrap;
    }

    .site-nav {
        order: 3;
        margin-left: 0;
        width: 100%;
        flex-wrap: wrap;
    }

    .site-nav-actions {
        margin-left: auto;
    }
}

@media (max-width: 700px) {
    .site-logo {
        width: 190px;
        height: 34px;
    }
}
