/**
 * /hub/assets/css/hub-layout.css
 * ============================================================================
 * СТИЛИ КАРКАСА (LAYOUT SKELETON)
 * ============================================================================
 * Этот файл отвечает ТОЛЬКО за глобальную оболочку:
 * 1. Дизайн-токены (:root) и подключение брендовых шрифтов VZEX
 * 2. Верхняя шапка (.panel-header-*) и зона бренда (.vzex-brand-*)
 * 3. Выпадающие меню шапки (.header-catalog-*, .panel-profile-*)
 * 4. Сетка страницы (.sui-layout, .sui-sidebar, .sui-workspace, .sui-main)
 * 5. Верхний динамический баннер уведомлений (.sui-topbar-alert)
 * 6. Правая выезжающая шторка уведомлений (.sui-drawer)
 */

/**
 * /hub/assets/css/hub-layout.css
 * ============================================================================
 * СТИЛИ КАРКАСА (LAYOUT SKELETON)
 * ============================================================================
 */

@font-face {
    font-family: 'Library3am';
    src: url('/assets/fonts/Library3am-5V3Z.otf') format('opentype');
    font-weight: bold;
    font-display: swap;
}
@font-face {
    font-family: 'PoiretOne';
    src: url('/assets/fonts/PoiretOne-aD0x.ttf') format('truetype');
    font-weight: normal;
    font-display: swap;
}

:root {
    --panel-header-height: 72px;
    
    --sui-global_background: #181d20;
    --sui-global_control-background: #181d20;
    --sui-card-bg: #1e2428;
    --sui-card-hover: #252c31;
    --panel-layout-shared_border-color: #2d3236;
    --panel-layout-shared_item-background__default: transparent;
    --panel-layout-shared_item-background__hover: #2d3236;
    --panel-layout-shared_item-background__active: #3b4248;
    --panel-layout-shared_item-color__default: #ffffff;
    --panel-layout-shared_item-color__secondary: #7f888d;
    --sui-select_border__base: #3b4248;
    --sui-select_border__hover: #c2c6c9;
    --sui-shadow_color: rgba(0, 0, 0, 0.6);
    --panel-header-height: 60px;
    --panel-sider-width: 270px;
    --vzex-accent-red: #eb4247;
    --sui-blue-link: #65b7f3;

    /* Токены скруглений (по умолчанию включены) */
    --sui-radius-sm: 4px;
    --sui-radius-md: 6px;
    --sui-radius-lg: 8px;
    --sui-radius-chat: 20px;
    --sui-radius-pill: 30px;
    --sui-radius-avatar: 50%;
}

/* Режим отключенных скруглений (переключается в профиле и хранится в Cookie) */
body.sui-sharp-corners {
    --sui-radius-sm: 0px;
    --sui-radius-md: 0px;
    --sui-radius-lg: 0px;
    --sui-radius-chat: 0px;
    --sui-radius-pill: 0px;
    --sui-radius-avatar: 0px;
}

body.sui-sharp-corners *,
body.sui-sharp-corners *::before,
body.sui-sharp-corners *::after {
    border-radius: 0 !important;
}

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

body.sui-body {
    margin: 0;
    padding: 0;
    background-color: var(--sui-global_background);
    color: var(--panel-layout-shared_item-color__default);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================================
   1. ШАПКА (PANEL HEADER)
   ============================================================================ */
.panel-header-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--panel-header-height);
    background-color: var(--sui-global_background);
    border-bottom: 1px solid var(--panel-layout-shared_border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 0 0;
    font-family: 'Manrope', 'Inter', sans-serif;
    user-select: none;
}

/* В .panel-header-container замени z-index: 100; на z-index: 1000; */

.panel-hamburger-btn,
.sui-sidebar-mobile-tabs {
    display: none;
}

.panel-header-left {
    display: flex;
    align-items: center;
    height: 100%;
}

/* Зона бренда: фиксированная ширина 270px до разделительной линии */
.vzex-brand-zone {
    width: var(--panel-sider-width);
    min-width: var(--panel-sider-width);
    max-width: var(--panel-sider-width);
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 16px 0 20px;
    text-decoration: none;
    white-space: nowrap;
    border-right: 1px solid var(--panel-layout-shared_border-color);
    line-height: 1;
}

.vzex-brand-logo {
    font-family: 'Library3am', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 1.2px;
    line-height: 1;
}

.vzex-brand-sep {
    margin: 0 10px;
    font-size: 22px;
    font-weight: 300;
    color: var(--panel-layout-shared_item-color__secondary);
    line-height: 1;
}

.vzex-brand-center {
    font-family: 'PoiretOne', sans-serif;
    font-size: 21px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 1.5px;
    line-height: 1;
}

.vzex-brand-colon {
    margin-left: 6px;
    font-size: 23px;
    color: var(--vzex-accent-red);
    font-weight: 700;
    line-height: 1;
}

/* Кнопки выбора модуля — расположены правее разделительной линии */
.header-tabs-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding-left: 12px;
    gap: 4px;
    height: 100%;
}

.panel-header-brand-button {
    padding: 3px;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.panel-header-brand-button--content {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 14px;
    border-radius: var(--sui-radius-md);
    color: #c2c6c9;
    background-color: var(--panel-layout-shared_item-background__default);
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.12s ease-out, color 0.12s ease-out;
}

.panel-header-brand-button:hover .panel-header-brand-button--content {
    background-color: var(--panel-layout-shared_item-background__hover);
    color: #ffffff;
}

.panel-header-brand-button.is-active .panel-header-brand-button--content {
    background-color: var(--panel-layout-shared_item-background__active);
    color: #ffffff;
}

/* Правая часть шапки */
.panel-header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    height: 100%;
}

.header-catalog-wrapper {
    position: relative;
}

.header-catalog-trigger {
    padding: 3px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.header-catalog-trigger-content {
    display: flex;
    align-items: center;
    height: 40px;
    padding: 0 12px 0 16px;
    border-radius: var(--sui-radius-md);
    border: 1px solid var(--sui-select_border__base);
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.12s ease-out;
}

.header-catalog-trigger:hover .header-catalog-trigger-content {
    border-color: var(--sui-select_border__hover);
}

.header-catalog-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 3px;
    width: 280px;
    background-color: var(--sui-global_control-background);
    border: 1px solid var(--panel-layout-shared_border-color);
    border-radius: var(--sui-radius-md);
    padding: 8px 0;
    box-shadow: 0 8px 16px var(--sui-shadow_color);
    z-index: 1050;
    display: none;
}

.header-catalog-dropdown.is-open {
    display: block;
}

.panel-header-icon-btn {
    padding: 3px;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
}

.panel-header-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: var(--sui-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background-color: transparent;
    transition: background-color 0.12s ease-out;
    position: relative;
}

.panel-header-icon-btn:hover .panel-header-icon-wrapper {
    background-color: var(--panel-layout-shared_item-background__hover);
}

.panel-header-icon-btn.is-active .panel-header-icon-wrapper {
    background-color: var(--panel-layout-shared_item-background__active);
}

.unread-badge-dot {
    display: none;
    position: absolute;
    top: 9px;
    right: 9px;
    width: 7px;
    height: 7px;
    border-radius: var(--sui-radius-avatar);
    background-color: var(--vzex-accent-red);
    box-shadow: 0 0 0 2px var(--sui-global_background);
}

.panel-header-icon-btn.has-unread .unread-badge-dot {
    display: block;
}

/* Профиль и выпадающее меню */
.panel-profile-button {
    padding: 3px;
    cursor: pointer;
    position: relative;
}

.panel-profile-button-wrapper {
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 10px;
    border-radius: var(--sui-radius-md);
    transition: background-color 0.12s ease-out;
}

.panel-profile-button:hover .panel-profile-button-wrapper {
    background-color: var(--panel-layout-shared_item-background__hover);
}

.panel-profile-button.is-active .panel-profile-button-wrapper {
    background-color: var(--panel-layout-shared_item-background__active);
}

.panel-profile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.panel-profile-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
    overflow: hidden;
}

.panel-profile-avatar-img,
.panel-profile-icon img {
    width: 28px;
    height: 28px;
    max-width: 28px;
    max-height: 28px;
    border-radius: var(--sui-radius-sm);
    object-fit: cover;
    display: block;
}

.panel-profile-label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-left: 8px;
}

.panel-profile-email {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    line-height: 18px;
}

.panel-profile-account {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--panel-layout-shared_item-color__secondary);
    font-size: 12px;
    line-height: 16px;
}

.panel-profile-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 3px;
    width: 256px;
    background-color: var(--sui-global_control-background);
    border: 1px solid var(--panel-layout-shared_border-color);
    border-radius: var(--sui-radius-md);
    padding: 8px 0;
    box-shadow: 0 8px 16px var(--sui-shadow_color);
    z-index: 1050;
    display: none;
}

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

.dropdown-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    color: #ffffff;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.dropdown-menu-item:hover {
    background-color: var(--panel-layout-shared_item-background__hover);
}

.dropdown-menu-divider {
    height: 1px;
    margin: 4px 0;
    background-color: var(--panel-layout-shared_border-color);
}

.dropdown-account-header {
    padding: 6px 16px;
    font-size: 12px;
    color: var(--panel-layout-shared_item-color__secondary);
}

.panel-colsel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
}

.panel-colsel-header:hover {
    background-color: var(--panel-layout-shared_item-background__hover);
}

.panel-colsel-value {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #c2c6c9;
}

.panel-colsel-chevron {
    transition: transform 0.2s ease;
}

.panel-colsel.is-expanded .panel-colsel-chevron {
    transform: rotate(180deg);
}

.panel-colsel-body {
    display: none;
    background-color: #131618;
}

.panel-colsel.is-expanded .panel-colsel-body {
    display: block;
}

.panel-colsel-option {
    padding: 8px 36px 8px 16px;
    text-align: right;
    color: #c2c6c9;
    font-size: 14px;
    cursor: pointer;
}

.panel-colsel-option:hover,
.panel-colsel-option.is-selected {
    background-color: var(--panel-layout-shared_item-background__hover);
    color: #ffffff;
}

/* ============================================================================
   2. КАРКАС СТРАНИЦЫ: ЛЕВЫЙ САЙДБАР + РАБОЧАЯ ЗОНА
   ============================================================================ */
.sui-layout {
    display: flex;
    padding-top: var(--panel-header-height);
    min-height: 100vh;
}

.sui-sidebar {
    width: var(--panel-sider-width);
    min-width: var(--panel-sider-width);
    background-color: var(--sui-global_background);
    border-right: 1px solid var(--panel-layout-shared_border-color);
    position: fixed;
    top: var(--panel-header-height);
    bottom: 0;
    left: 0;
    padding: 16px 8px;
    overflow-y: auto;
    z-index: 50;
}

.sui-sidebar-header {
    padding: 8px 12px 14px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.sui-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sui-sidebar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: var(--sui-radius-md);
    color: #c2c6c9;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.sui-sidebar-item:hover {
    background-color: var(--panel-layout-shared_item-background__hover);
    color: #ffffff;
}

.sui-sidebar-item.active {
    background-color: var(--panel-layout-shared_item-background__active);
    color: #ffffff;
    font-weight: 500;
}

.sui-sidebar-divider {
    height: 1px;
    background-color: var(--panel-layout-shared_border-color);
    margin: 10px 8px;
}

.sui-sidebar-group-title {
    padding: 6px 12px;
    font-size: 12px;
    color: var(--panel-layout-shared_item-color__secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.sui-ext-icon {
    color: var(--panel-layout-shared_item-color__secondary);
}

.sui-workspace {
    flex: 1;
    margin-left: var(--panel-sider-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sui-topbar-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    background-color: #112a45;
    border-bottom: 1px solid #164c7e;
    color: #e2e5e7;
    font-size: 13px;
}

.sui-topbar-alert.is-critical {
    background-color: rgba(235, 66, 71, 0.16);
    border-bottom-color: rgba(235, 66, 71, 0.4);
}

.sui-topbar-alert-body {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sui-topbar-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: var(--sui-radius-sm);
    font-size: 11px;
    font-weight: 700;
    background-color: #164c7e;
    color: #ffffff;
}

.sui-topbar-alert.is-critical .sui-topbar-badge {
    background-color: var(--vzex-accent-red);
}

.sui-alert-close {
    background: transparent;
    border: none;
    color: var(--panel-layout-shared_item-color__secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: var(--sui-radius-sm);
}

.sui-alert-close:hover {
    color: #ffffff;
    background-color: var(--panel-layout-shared_item-background__hover);
}

.sui-main {
    padding: 28px 36px 56px;
    flex: 1;
}

/* ============================================================================
   3. ПРАВАЯ ВЫЕЗЖАЮЩАЯ ШТОРКА (NOTIFICATION DRAWER)
   ============================================================================ */
.sui-drawer {
    position: fixed;
    top: var(--panel-header-height);
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 100vw;
    background-color: var(--sui-global_background);
    border-left: 1px solid var(--panel-layout-shared_border-color);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.55);
    z-index: 95;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.sui-drawer.open {
    transform: translateX(0);
}

.sui-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--panel-layout-shared_border-color);
}

.sui-drawer-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.sui-drawer-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sui-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--sui-radius-md);
    background: transparent;
    border: none;
    color: #9ea6ab;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}

.sui-icon-btn:hover {
    background-color: var(--panel-layout-shared_item-background__hover);
    color: #ffffff;
}

.sui-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.sui-drawer-card {
    background-color: var(--sui-card-bg);
    border: 1px solid var(--panel-layout-shared_border-color);
    border-radius: var(--sui-radius-lg);
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.sui-drawer-card:hover {
    background-color: var(--sui-card-hover);
}

.sui-drawer-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 6px;
}

.sui-drawer-card-summary {
    font-size: 13px;
    color: #9ea6ab;
    margin-bottom: 10px;
}

.sui-drawer-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--panel-layout-shared_border-color);
}

.sui-btn-light-block {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px;
    border-radius: var(--sui-radius-md);
    background-color: #2d3236;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.12s ease;
}

.sui-btn-light-block:hover {
    background-color: #3b4248;
}