/**
 * Навигация Phoenix: крошки, поиск, закладки, шторка фильтров.
 */

/* ── Панель над контентом ── */
.phx-page-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: var(--phx-space-3, 12px);
    padding: var(--phx-space-2, 8px) 0;
}

.phx-page-toolbar__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Крошки ── */
.phx-breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--phx-text-sm, 13px);
}

.phx-breadcrumbs__item {
    display: inline-flex;
    align-items: center;
    color: var(--phx-text-muted, #8b90a1);
}

.phx-breadcrumbs__item:not(:last-child)::after {
    content: "/";
    margin: 0 6px;
    color: var(--phx-text-muted, #8b90a1);
    opacity: 0.7;
}

.phx-breadcrumbs__link {
    color: var(--phx-accent, #3d7ab8);
    text-decoration: none;
}

.phx-breadcrumbs__link:hover,
.phx-breadcrumbs__link:focus {
    color: var(--phx-accent-hover, #356da3);
    text-decoration: underline;
}

.phx-breadcrumbs__current {
    color: var(--phx-text-primary, #2c3044);
    font-weight: var(--phx-weight-medium, 500);
}

/* ── Контекстные чипы ── */
.phx-breadcrumb-context {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.phx-breadcrumb-context__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--phx-bg-card-head, #f8f9fb);
    border: 1px solid var(--phx-border, #e2e6ee);
    font-size: var(--phx-text-xs, 11px);
    color: var(--phx-text-secondary, #6b6f82);
}

.phx-breadcrumb-context__label {
    font-weight: var(--phx-weight-medium, 500);
}

.phx-breadcrumb-context__value {
    color: var(--phx-text-primary, #2c3044);
}

.phx-bookmark-toggle.is-bookmarked {
    color: #f0ad4e;
    border-color: rgba(240, 173, 78, 0.45);
}

/* ── Глобальный поиск в шапке ── */
.phx-global-search {
    position: relative;
    flex: 1 1 180px;
    max-width: 320px;
    min-width: 140px;
    margin: 0 8px;
    z-index: 2;
}

.phx-global-search__input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 32px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.phx-global-search__input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.phx-global-search__input:focus {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(126, 200, 255, 0.55);
}

.phx-global-search__icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    pointer-events: none;
}

.phx-global-search__drop {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow: auto;
    background: var(--phx-bg-card, #fff);
    border: 1px solid var(--phx-border, #e2e6ee);
    border-radius: var(--phx-radius-md, 8px);
    box-shadow: var(--phx-shadow-card, 0 4px 16px rgba(15, 20, 25, 0.12));
}

.phx-global-search__drop.is-open {
    display: block;
}

.phx-global-search__item {
    display: block;
    padding: 8px 12px;
    color: var(--phx-text-primary, #2c3044);
    text-decoration: none;
    font-size: 13px;
    border-bottom: 1px solid var(--phx-border, #eef0f4);
}

.phx-global-search__item:last-child {
    border-bottom: none;
}

.phx-global-search__item:hover,
.phx-global-search__item:focus,
.phx-global-search__item.is-active {
    background: var(--phx-bg-control-hover, #f4f6f9);
    text-decoration: none;
    color: var(--phx-text-primary, #2c3044);
}

.phx-global-search__item small {
    display: block;
    margin-top: 2px;
    color: var(--phx-text-muted, #8b90a1);
    font-size: 11px;
}

.phx-global-search__empty {
    padding: 10px 12px;
    font-size: 12px;
    color: var(--phx-text-muted, #8b90a1);
}

/* ── Закладки в userbar ── */
.phx-bookmarks {
    position: relative;
}

body.menu-on-top .phx-userbar__bookmarks {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0 !important;
    border-radius: 10px !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    color: #fff !important;
}

body.menu-on-top .phx-userbar__bookmarks:hover,
body.menu-on-top .phx-userbar__bookmarks:focus {
    background: rgba(91, 155, 212, 0.25) !important;
    border-color: rgba(126, 200, 255, 0.45) !important;
}

.phx-bookmarks__drop {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    max-width: 320px;
    max-height: 360px;
    overflow: auto;
    background: var(--phx-bg-card, #fff);
    border: 1px solid var(--phx-border, #e2e6ee);
    border-radius: var(--phx-radius-md, 8px);
    box-shadow: 0 8px 24px rgba(15, 20, 25, 0.15);
    z-index: 1000;
}

.phx-bookmarks__drop.is-open {
    display: block;
}

.phx-bookmarks__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--phx-border, #eef0f4);
}

.phx-bookmarks__item:last-child {
    border-bottom: none;
}

.phx-bookmarks__link {
    flex: 1;
    color: var(--phx-text-primary, #2c3044);
    text-decoration: none;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.phx-bookmarks__link:hover {
    color: var(--phx-accent, #3d7ab8);
}

.phx-bookmarks__remove {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--phx-text-muted, #8b90a1);
    cursor: pointer;
    padding: 4px;
}

.phx-bookmarks__empty {
    padding: 12px;
    font-size: 12px;
    color: var(--phx-text-muted, #8b90a1);
}

/* ── Бейдж онлайн в меню ── */
.phx-menu-badge {
    display: inline-block;
    min-width: 18px;
    margin-left: 6px;
    padding: 0 5px;
    border-radius: 999px;
    background: #43a047;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    vertical-align: middle;
}

.phx-menu-badge.is-hidden {
    display: none;
}

body.menu-on-top nav.phx-topbar-nav a.is-active {
    background: rgba(91, 155, 212, 0.22) !important;
    color: #fff !important;
}

/* ── Шторка фильтров ── */
.phx-filter-drawer-host {
    margin-bottom: var(--phx-space-3, 12px);
}

.phx-filter-drawer__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 22, 0.45);
    z-index: 1040;
}

.phx-filter-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(420px, 92vw);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--phx-bg-card, #fff);
    border-left: 1px solid var(--phx-border, #e2e6ee);
    box-shadow: -4px 0 24px rgba(15, 20, 25, 0.12);
    z-index: 1045;
    transform: translateX(100%);
    transition: transform 0.22s ease;
}

.phx-filter-drawer.is-open {
    transform: translateX(0);
}

.phx-filter-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--phx-border, #e2e6ee);
}

.phx-filter-drawer__title {
    margin: 0;
    font-size: var(--phx-text-lg, 18px);
    font-weight: var(--phx-weight-bold, 700);
    color: var(--phx-text-primary, #2c3044);
}

.phx-filter-drawer__body {
    flex: 1;
    overflow: auto;
    padding: 16px;
}

.phx-filter-drawer__foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--phx-border, #e2e6ee);
    background: var(--phx-bg-card-head, #f8f9fb);
}

body.phx-filter-drawer-open {
    overflow: hidden;
}

.phx-page-toolbar-row {
    padding-top: 4px;
}

body.menu-on-top aside#left-panel .phx-global-search {
    align-self: center;
    flex: 0 1 320px;
}

@media (max-width: 979px) {
    body.menu-on-top aside#left-panel .phx-global-search {
        flex: 1 1 100%;
        order: 50;
        margin: 8px 0 0;
        max-width: none;
    }
}

@media (max-width: 979px) {
    .phx-global-search {
        order: 10;
        flex: 1 1 100%;
        max-width: none;
        margin: 8px 0 0;
    }
}
