* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #0b0f14;
    color: #f5f7fa;
    font-family: Arial, Helvetica, sans-serif;
}

.site-main {
    width: 100%;
    flex: 1;
}

.site-header {
    width: 100%;
    background: #10151c;
    border-bottom: 1px solid #202833;
}

.header-container {
    width: 100%;
    max-width: 1450px;
    min-height: 70px;
    margin: 0 auto;
    padding: 0 22px;
    display: flex;
    align-items: center;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    color: #ffffff;
    text-decoration: none;
}

.header-logo {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: rgba(139, 92, 246, .16);
    color: #8b5cf6;
    font-size: 17px;
}

.header-brand-text {
    min-width: 130px;
    display: flex;
    flex-direction: column;
}

.header-brand-text strong {
    color: #f8fafc;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.15;
}

.header-brand-text span {
    margin-top: 2px;
    color: #7f8b9b;
    font-size: 11px;
    line-height: 1;
}

.header-nav {
    margin-left: 24px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.header-nav>a,
.header-dropdown-trigger {
    height: 40px;
    padding: 0 13px;
    display: flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    border: 0;
    border-radius: 7px;
    color: #929dab;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.header-nav>a>i,
.header-dropdown-trigger>i:first-child {
    font-size: 12px;
}

.header-nav>a:hover,
.header-dropdown-trigger:hover {
    color: #d9dee5;
    background: #171d25;
}

.header-nav>a.active,
.header-dropdown.active .header-dropdown-trigger {
    color: #8b5cf6;
    background: rgba(139, 92, 246, .08);
}

.header-admin {
    height: 40px;
    margin-left: auto;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 7px;
    border-left: 1px solid #252c35;
    color: #929dab;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.header-admin:hover {
    color: #8b5cf6;
}

.header-dropdown {
    position: relative;
}

.header-dropdown-trigger .dropdown-chevron {
    margin-left: 2px;
    font-size: 9px;
    opacity: .65;
    transition: transform .2s ease;
}

.header-dropdown:hover .dropdown-chevron,
.header-dropdown.open .dropdown-chevron {
    transform: rotate(180deg);
}

.header-dropdown-menu {
    position: absolute;
    z-index: 1000;
    top: calc(100% + 14px);
    left: 50%;
    width: 245px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transform: translateX(-50%) translateY(-5px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: #101720;
    border: 1px solid #2a3542;
    border-radius: 11px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .4);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.header-dropdown:hover .header-dropdown-menu,
.header-dropdown.open .header-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.header-dropdown-menu::before {
    content: "";
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
}

.header-dropdown-menu a {
    min-height: 58px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    border-radius: 8px;
    color: #8f9baa;
    text-decoration: none;
}

.header-dropdown-menu a:hover {
    background: #171f29;
    color: #ffffff;
}

.header-dropdown-menu a.active {
    background: rgba(139, 92, 246, .12);
    color: #ffffff;
}

.header-dropdown-menu>a>i {
    color: #9b6cff;
    font-size: 15px;
    text-align: center;
}

.header-dropdown-menu a div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.header-dropdown-menu a strong {
    color: inherit;
    font-size: 13px;
}

.header-dropdown-menu a div span {
    color: #687687;
    font-size: 10px;
}

.mobile-nav,
.mobile-menu,
.mobile-menu-backdrop {
    display: none;
}

@media (max-width: 800px) {
    body {
        padding-bottom: 72px;
    }
    .site-header {
        min-height: 82px;
    }
    .header-container {
        min-height: 82px;
        padding: 0 24px;
    }
    .header-logo {
        width: 44px;
        height: 44px;
        border-radius: 9px;
        font-size: 20px;
    }
    .header-brand {
        gap: 13px;
    }
    .header-brand-text {
        min-width: 0;
    }
    .header-brand-text strong {
        display: block;
        font-size: 18px;
    }
    .header-brand-text span {
        display: block;
        margin-top: 4px;
        font-size: 13px;
    }
    .header-nav,
    .header-admin {
        display: none;
    }
    .mobile-nav {
        position: fixed;
        z-index: 2000;
        right: 0;
        bottom: 0;
        left: 0;
        height: 72px;
        padding: 6px 10px max(6px, env(safe-area-inset-bottom));
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        background: rgba(16, 21, 28, .98);
        border-top: 1px solid #252f3a;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, .28);
        backdrop-filter: blur(16px);
    }
    .mobile-nav a,
    .mobile-nav-button {
        min-width: 0;
        padding: 5px 2px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 5px;
        background: transparent;
        border: 0;
        color: #7f8fa1;
        font-family: inherit;
        text-decoration: none;
        cursor: pointer;
    }
    .mobile-nav i {
        font-size: 20px;
    }
    .mobile-nav span {
        overflow: hidden;
        max-width: 100%;
        font-size: 11px;
        font-weight: 700;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    .mobile-nav a.active,
    .mobile-nav-button.active {
        color: #8b5cf6;
    }
    .mobile-menu-backdrop {
        position: fixed;
        z-index: 2100;
        inset: 0;
        display: block;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        background: rgba(0, 0, 0, .55);
        transition: opacity .2s ease, visibility .2s ease;
    }
    .mobile-menu-backdrop.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    .mobile-menu {
        position: fixed;
        z-index: 2200;
        right: 12px;
        bottom: 84px;
        left: 12px;
        max-height: min(520px, calc(100vh - 120px));
        padding: 12px;
        display: block;
        overflow-y: auto;
        transform: translateY(15px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        background: #101720;
        border: 1px solid #2a3542;
        border-radius: 16px;
        box-shadow: 0 20px 55px rgba(0, 0, 0, .55);
        transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
    }
    .mobile-menu.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    .mobile-menu-head {
        min-height: 45px;
        padding: 0 5px 9px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid #26313d;
    }
    .mobile-menu-head>strong {
        color: #ffffff;
        font-size: 17px;
    }
    .mobile-menu-close {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #171f29;
        border: 1px solid #2a3542;
        border-radius: 8px;
        color: #8e9aaa;
        cursor: pointer;
    }
    .mobile-menu-links {
        padding-top: 8px;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    .mobile-menu-links a {
        min-height: 65px;
        padding: 10px 12px;
        display: grid;
        grid-template-columns: 38px minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        border-radius: 10px;
        color: #a0aab7;
        text-decoration: none;
    }
    .mobile-menu-links a:active {
        background: rgba(139, 92, 246, .1);
    }
    .mobile-menu-links a>i {
        color: #9b6cff;
        font-size: 17px;
        text-align: center;
    }
    .mobile-menu-links a div {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 3px;
    }
    .mobile-menu-links a strong {
        color: #f2f4f7;
        font-size: 14px;
    }
    .mobile-menu-links a span {
        color: #718092;
        font-size: 11px;
    }
}

@media (max-width: 420px) {
    .header-container {
        padding: 0 18px;
    }
    .header-brand-text strong {
        font-size: 17px;
    }
    .header-brand-text span {
        font-size: 12px;
    }
    .mobile-nav {
        padding-left: 4px;
        padding-right: 4px;
    }
    .mobile-nav span {
        font-size: 10px;
    }
}