.ap-app {
    min-height: 100vh;
    padding: 24px;
    overflow-x: clip;
    background: var(--ap-page);
}

.ap-root .ap-shell {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    gap: 16px;
    max-width: 1500px;
    min-height: calc(100vh - 48px);
    margin: 0 auto;
    padding: 16px;
    background: var(--ap-shell);
    border-radius: var(--ap-radius-xl);
    box-shadow: var(--ap-shadow);
}

.ap-root .ap-sidebar {
    position: sticky;
    top: 40px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-self: start;
    height: calc(100vh - 80px);
    min-height: 440px;
    padding: 8px 0 0;
}

.ap-root .ap-sidebar .ap-brand {
    flex: 0 0 auto;
    margin-inline-start: 12px;
}

.ap-root .ap-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 14px;
    font-size: 19px;
    font-weight: 800;
    color: var(--ap-text);
}

.ap-root .ap-brand__mark {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: var(--ap-grad);
    color: var(--ap-on);
    font-size: 20px;
}

.ap-root .ap-brand__logo {
    display: block;
    max-width: 180px;
    max-height: 42px;
}

.ap-root .ap-brand--light {
    color: var(--ap-on);
}

.ap-root .ap-nav {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 22px;
    min-height: 0;
    padding-inline-start: 12px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--ap-line-strong) transparent;
}

.ap-root .ap-nav__section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ap-root .ap-nav__title {
    padding: 0 14px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ap-subtle);
    letter-spacing: 0;
}

.ap-root .ap-nav__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--ap-radius-sm);
    color: var(--ap-nav);
    font-size: 15px;
    font-weight: 500;
    transition: color 0.15s ease, background 0.15s ease;
}

.ap-root .ap-nav__item .ap-icon {
    font-size: 21px;
}

.ap-root .ap-nav__item:hover {
    color: var(--ap-text);
    background: var(--ap-surface);
}

.ap-root .ap-nav__item.is-active {
    color: var(--ap-text);
    font-weight: 700;
}

.ap-root .ap-nav__item.is-active .ap-icon {
    color: var(--ap-brand-text);
}

.ap-root .ap-nav__item.is-active::before {
    content: "";
    position: absolute;
    inset-inline-start: -12px;
    top: 50%;
    width: 5px;
    height: 26px;
    margin-top: -13px;
    border-radius: 0 6px 6px 0;
    background: var(--ap-brand);
}

.ap-root [dir="rtl"] .ap-nav__item.is-active::before {
    border-radius: 6px 0 0 6px;
}

.ap-root .ap-nav__label {
    flex: 1 1 auto;
}

.ap-root .ap-badge {
    min-width: 24px;
    padding: 0 7px;
    border-radius: 8px;
    background: var(--ap-solid);
    color: var(--ap-on);
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

.ap-root .ap-promo {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;
    margin-inline-start: 12px;
    padding: 18px;
    overflow: hidden;
    border-radius: var(--ap-radius);
    background:
        radial-gradient(circle at 15% 120%, var(--ap-c-300), transparent 60%),
        repeating-radial-gradient(circle at 110% -10%, transparent 0 22px, rgba(255, 255, 255, 0.06) 22px 23px),
        var(--ap-c-950);
    color: #ffffff;
}

.ap-root .ap-promo__icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    font-size: 18px;
}

.ap-root .ap-promo__title {
    margin-top: 6px;
    font-size: 15px;
    font-weight: 700;
}

.ap-root .ap-promo__text {
    font-size: 12px;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.72);
}

.ap-root .ap-promo .ap-btn {
    margin-top: 8px;
}

.ap-root .ap-main {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 16px;
}

.ap-root .ap-topbar {
    position: sticky;
    top: 16px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--ap-radius-lg);
    background: var(--ap-surface);
}

.ap-root .ap-iconbtn.ap-menu-toggle {
    display: none;
}

.ap-root .ap-search {
    position: relative;
    display: flex;
    flex: 0 1 360px;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 16px;
    border-radius: var(--ap-pill);
    background: var(--ap-card);
}

.ap-root .ap-search__icon {
    color: var(--ap-text);
    font-size: 19px;
}

.ap-root .ap-search__input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: var(--ap-text);
}

.ap-root .ap-search__input::placeholder {
    color: var(--ap-subtle);
}

.ap-root .ap-search__key {
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border-radius: 7px;
    background: var(--ap-surface);
    color: var(--ap-muted);
    font-family: inherit;
    font-size: 12px;
    line-height: 22px;
}

.ap-root .ap-search__results {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 8px);
    z-index: 30;
    max-height: 380px;
    padding: 8px;
    overflow-y: auto;
    border-radius: var(--ap-radius);
    background: var(--ap-card);
    box-shadow: var(--ap-shadow);
}

.ap-root .ap-search__group {
    padding: 8px 10px 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--ap-subtle);
}

.ap-root .ap-search__hit {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 13px;
}

.ap-root .ap-search__hit:hover {
    background: var(--ap-surface);
}

.ap-root .ap-search__hit small {
    color: var(--ap-muted);
}

.ap-root .ap-topbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-inline-start: auto;
}

.ap-root .ap-iconbtn {
    position: relative;
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--ap-card);
    color: var(--ap-text);
    font-size: 20px;
    transition: background 0.15s ease;
}

.ap-root .ap-iconbtn:hover {
    background: var(--ap-brand-soft);
}

.ap-root .ap-iconbtn--sm {
    width: 34px;
    height: 34px;
    font-size: 16px;
}

.ap-root .ap-iconbtn__dot {
    position: absolute;
    top: 10px;
    inset-inline-end: 11px;
    width: 9px;
    height: 9px;
    border: 2px solid var(--ap-card);
    border-radius: 50%;
    background: #e0524f;
}

.ap-root .ap-iconbtn__count {
    position: absolute;
    top: -3px;
    inset-inline-end: -3px;
    min-width: 19px;
    padding: 0 5px;
    border-radius: 10px;
    background: #e0524f;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 19px;
    text-align: center;
}

.ap-root .ap-theme-sun {
    display: none;
}

.ap-root[data-theme="dark"] .ap-theme-moon {
    display: none;
}

.ap-root[data-theme="dark"] .ap-theme-sun {
    display: inline-flex;
}

.ap-root .ap-dropdown {
    position: relative;
}

.ap-root .ap-dropdown__panel {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 10px);
    z-index: 40;
    min-width: 220px;
    padding: 8px;
    border-radius: var(--ap-radius);
    background: var(--ap-card);
    box-shadow: var(--ap-shadow);
}

.ap-root .ap-menu-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
}

.ap-root .ap-menu-list a:hover {
    background: var(--ap-surface);
}

.ap-root .ap-notify {
    width: 340px;
    max-width: calc(100vw - 32px);
    padding: 0;
    overflow: hidden;
}

.ap-root .ap-notify__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--ap-line);
}

.ap-root .ap-notify__list {
    max-height: 340px;
    overflow-y: auto;
}

.ap-root .ap-notify__item {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ap-line);
}

.ap-root .ap-notify__item:hover {
    background: var(--ap-surface);
}

.ap-root .ap-notify__item.is-unread {
    background: var(--ap-brand-soft);
}

.ap-root .ap-notify__item strong {
    display: block;
    font-size: 13px;
}

.ap-root .ap-notify__item span {
    display: block;
    font-size: 12px;
    color: var(--ap-muted);
}

.ap-root .ap-notify__empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--ap-muted);
}

.ap-root .ap-notify__all {
    display: block;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    color: var(--ap-brand-text);
}

.ap-root .ap-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: start;
}

.ap-root .ap-user__text {
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

.ap-root .ap-user__text strong {
    font-size: 14px;
}

.ap-root .ap-user__text small {
    max-width: 160px;
    overflow: hidden;
    color: var(--ap-muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ap-root .ap-avatar {
    display: inline-flex;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    background: var(--ap-c-100);
    color: var(--ap-c-900);
    font-weight: 800;
}

.ap-root .ap-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ap-root .ap-avatar--xl {
    width: 84px;
    height: 84px;
    font-size: 30px;
}

.ap-root .ap-content {
    flex: 1 1 auto;
    padding: 24px;
    border-radius: var(--ap-radius-lg);
    background: var(--ap-surface);
}

.ap-root .ap-pagehead {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.ap-root .ap-pagehead__title {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.3;
}

.ap-root .ap-pagehead__sub {
    margin-top: 4px;
    color: var(--ap-muted);
    font-size: 14px;
}

.ap-root .ap-pagehead__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ap-root .ap-overlay {
    display: none;
}

@media (max-width: 1100px) {
    .ap-app {
        padding: 0;
    }

    .ap-root .ap-shell {
        display: block;
        min-height: 100vh;
        padding: 10px;
        border-radius: 0;
        box-shadow: none;
    }

    .ap-root .ap-sidebar {
        position: fixed;
        inset-block: 0;
        inset-inline-start: 0;
        z-index: 60;
        width: 290px;
        max-width: 86vw;
        height: auto;
        min-height: 0;
        padding-block: 18px;
        padding-inline-start: 4px;
        padding-inline-end: 16px;
        background: var(--ap-shell);
        box-shadow: var(--ap-shadow);
        visibility: hidden;
        transform: translateX(100%);
        transition: transform 0.25s ease, visibility 0s linear 0.25s;
    }

    .ap-root [dir="rtl"] .ap-sidebar {
        transform: translateX(100%);
    }

    .ap-root.is-menu-open .ap-sidebar {
        visibility: visible;
        transform: translateX(0);
        transition: transform 0.25s ease;
    }

    .ap-root.is-menu-open .ap-overlay {
        position: fixed;
        inset: 0;
        z-index: 50;
        display: block;
        background: rgba(5, 15, 10, 0.5);
    }

    .ap-root .ap-iconbtn.ap-menu-toggle {
        display: inline-flex;
    }

    .ap-root .ap-topbar {
        top: 10px;
    }
}

@media (max-width: 720px) {
    .ap-root .ap-content {
        padding: 16px;
    }

    .ap-root .ap-pagehead__title {
        font-size: 24px;
    }

    .ap-root .ap-search {
        flex: 1 1 auto;
    }

    .ap-root .ap-search__key,
    .ap-root .ap-user__text {
        display: none;
    }

    .ap-root .ap-topbar {
        padding: 10px;
        gap: 8px;
    }
}

.ap-root .ap-search-toggle,
.ap-root .ap-bottombar {
    display: none;
}

@media (max-height: 760px) and (min-width: 1101px) {
    .ap-root .ap-promo {
        padding: 14px;
    }

    .ap-root .ap-promo__text {
        display: none;
    }
}

@media (max-width: 1100px) {
    .ap-root .ap-content {
        padding: 20px;
    }

    .ap-root .ap-search {
        flex: 1 1 260px;
        max-width: 420px;
    }
}

@media (max-width: 720px) {
    .ap-root .ap-shell {
        padding: 8px 8px 92px;
    }

    .ap-root .ap-main {
        gap: 10px;
    }

    .ap-root .ap-bottombar {
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        z-index: 45;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        gap: 2px;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid var(--ap-line);
        background: var(--ap-shell);
        box-shadow: 0 -10px 28px rgba(12, 32, 22, 0.1);
    }

    .ap-root .ap-bottombar__item {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        min-width: 0;
        padding: 7px 2px;
        border: 0;
        border-radius: 14px;
        background: transparent;
        color: var(--ap-nav);
        font-size: 11px;
        font-weight: 600;
        line-height: 1.4;
    }

    .ap-root .ap-bottombar__item .ap-icon {
        font-size: 22px;
    }

    .ap-root .ap-bottombar__item span:last-child {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ap-root .ap-bottombar__item.is-active {
        background: var(--ap-brand-soft);
        color: var(--ap-brand-text);
    }

    .ap-root .ap-bottombar__badge {
        position: absolute;
        top: 2px;
        inset-inline-start: calc(50% + 6px);
        min-width: 17px;
        padding: 0 4px;
        border-radius: 9px;
        background: #e0524f;
        color: #ffffff;
        font-size: 10px;
        line-height: 17px;
        text-align: center;
    }

    .ap-toasts {
        bottom: 96px;
    }

    .ap-root .ap-pagehead__actions {
        width: 100%;
    }

    .ap-root .ap-pagehead__actions .ap-btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 560px) {
    .ap-root .ap-search-toggle {
        display: inline-flex;
    }

    .ap-root .ap-topbar .ap-search {
        display: none;
    }

    .ap-root .ap-topbar.is-searching .ap-search {
        position: absolute;
        inset-inline: 10px;
        top: 10px;
        z-index: 3;
        display: flex;
        max-width: none;
    }

    .ap-root .ap-topbar.is-searching .ap-topbar__actions,
    .ap-root .ap-topbar.is-searching .ap-menu-toggle,
    .ap-root .ap-topbar.is-searching .ap-search-toggle {
        visibility: hidden;
    }

    .ap-root .ap-topbar__actions {
        gap: 6px;
    }

    .ap-root .ap-iconbtn {
        width: 40px;
        height: 40px;
    }

    .ap-root .ap-avatar {
        width: 40px;
        height: 40px;
    }

    .ap-root .ap-user .ap-icon {
        display: none;
    }
}
