/* ============ 侧栏顶部品牌区 + 底部版本卡片：横向两列 Grid ============ */
/* 规则：Logo 始终在左，标题始终在右；维语 RTL 只作用于标题内部文字方向。
   .sidebar-brand / .sidebar-footer-brand 物理布局恒为 LTR，
   不使用 flex-direction:column、row-reverse、absolute 或负 margin。 */

/* ===== 顶部品牌区 ===== */
.sidebar-brand {
    display: grid !important;
    grid-template-columns: 56px minmax(0, 1fr) !important;
    align-items: center !important;
    column-gap: 12px !important;
    width: 100%;
    height: auto !important;
    min-height: 80px !important;
    padding: 14px 16px !important;
    box-sizing: border-box;
    direction: ltr !important;            /* 物理布局恒为 LTR，保证 Logo 在左 */
    text-align: left;
}
/* 维语版仍保持 Logo 在左、标题在右，仅标题内部 RTL */
html[dir="rtl"] .sidebar-brand {
    direction: ltr !important;
}

.sidebar-brand-logo {
    grid-column: 1;
    grid-row: 1;
    width: 56px;
    height: 56px;
    min-width: 56px;
    max-width: 56px;
    max-height: 56px;
    flex: 0 0 auto;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #d8a136, #b9821f);
    display: flex;
    align-items: center;
    justify-content: center;
}
.sidebar-brand-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.sidebar-brand-logo.logo-missing::after {
    content: "I";
    font-size: 24px;
    font-weight: 900;
    color: #fff;
}

.sidebar-brand-title {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    line-height: 1.38;
    gap: 2px;
}
/* 中文：标题内部 LTR 左对齐 */
html[dir="ltr"] .sidebar-brand-title {
    direction: ltr;
    text-align: left;
    align-items: flex-start;
}
/* 维语：仅标题内部 RTL 右对齐，不影响 Logo 位置 */
html[dir="rtl"] .sidebar-brand-title {
    direction: rtl;
    text-align: right;
    align-items: flex-end;
}

.sidebar-brand-title-line {
    display: block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
    color: #E8E8E8;
    line-height: 1.38;
}
html[dir="ltr"] .sidebar-brand-title-line {
    font-size: 16px;
}
html[dir="rtl"] .sidebar-brand-title-line {
    font-size: 14px;
    font-family: 'UyghurWebFont', Arial, 'Microsoft YaHei', sans-serif !important;
}

/* ===== 底部版本卡片 ===== */
.sidebar-footer-brand {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    align-items: center !important;
    column-gap: 12px !important;
    width: auto;                         /* 不用100%，避免与.sidebar-version-card的margin叠加溢出 */
    height: auto !important;
    min-height: 76px !important;
    padding: 12px 14px !important;
    box-sizing: border-box;
    direction: ltr !important;            /* 物理布局恒为 LTR */
    text-align: left;
}
html[dir="rtl"] .sidebar-footer-brand {
    direction: ltr !important;
}

.sidebar-footer-logo {
    grid-column: 1;
    grid-row: 1;
    width: 42px;
    height: 42px;
    min-width: 42px;
    max-width: 42px;
    max-height: 42px;
    flex: 0 0 auto;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(198, 146, 46, .15);
    display: flex;
    align-items: center;
    justify-content: center;
}
.sidebar-footer-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.sidebar-footer-logo.logo-missing::after {
    content: "I";
    font-size: 16px;
    font-weight: 900;
    color: #c6922e;
}

.sidebar-footer-info {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    gap: 3px;
}
html[dir="ltr"] .sidebar-footer-info,
html[dir="ltr"] .sidebar-footer-title {
    direction: ltr;
    text-align: left;
    align-items: flex-start;
}
html[dir="rtl"] .sidebar-footer-info,
html[dir="rtl"] .sidebar-footer-title {
    direction: rtl;
    text-align: right;
    align-items: flex-end;
}

.sidebar-footer-title {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.32;
}
.sidebar-footer-title-line {
    display: block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    color: #E8E8E8;
    line-height: 1.32;
}
html[dir="ltr"] .sidebar-footer-title-line {
    font-size: 12px;
}
html[dir="rtl"] .sidebar-footer-title-line {
    font-size: 11px;
    font-family: 'UyghurWebFont', Arial, 'Microsoft YaHei', sans-serif !important;
}

.sidebar-footer-version {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 600;
    direction: ltr;
    unicode-bidi: isolate;
}

/* ============ 侧栏菜单项：Grid 两列布局，中文 LTR / 维语 RTL ============ */
/* 中文版：图标在左(col1)，菜单名在右(col2)，文字左对齐 */
html[dir="ltr"] .menu-item {
    display: grid !important;
    grid-template-columns: 24px minmax(0, 1fr) !important;
    align-items: center !important;
    column-gap: 12px !important;
    direction: ltr;
}
html[dir="ltr"] .menu-item i {
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
}
html[dir="ltr"] .menu-item span {
    grid-column: 2;
    grid-row: 1;
    direction: ltr;
    text-align: left;
    min-width: 0;
}

/* 维语版：菜单名在左(col1)，图标在右(col2)，文字右对齐 */
/* 容器强制 direction:ltr 防止 Grid 列自动反转 */
html[dir="rtl"] .menu-item {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 24px !important;
    align-items: center !important;
    column-gap: 12px !important;
    direction: ltr !important;
    width: 100%;
    min-width: 0;
}
html[dir="rtl"] .menu-item i {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
}
html[dir="rtl"] .menu-item span {
    grid-column: 1;
    grid-row: 1;
    direction: rtl;
    text-align: right;
    min-width: 0;
    justify-self: stretch;
}

/* 维语分组标题右对齐 */
html[dir="rtl"] .menu-group-title {
    direction: rtl;
    text-align: right;
}

/* 中文分组标题左对齐（保持现有） */
html[dir="ltr"] .menu-group-title {
    direction: ltr;
    text-align: left;
}

/* 侧栏全局防溢出 */
.app-sidebar,
.app-sidebar * {
    box-sizing: border-box;
}
.app-sidebar {
    overflow: hidden;
}

/* ============ 顶栏统一 ============ */
.topbar-title-block .top-home-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex: 0 0 auto;
    min-width: max-content;
    max-width: none;
}
.topbar-title-block {
    min-width: 0;
    overflow: hidden;
}
.topbar-title-block .topbar-main-title {
    min-width: 0;
    overflow: hidden;
}
.topbar-sub-title {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
}
.topbar-user .user-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar-logout-btn {
    background: none;
    border: 1px solid #e5e7eb;
    color: #6B7280;
    font-size: 16px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    flex-shrink: 0;
}
.topbar-logout-btn:hover {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}
.topbar-actions {
    gap: 16px;
    flex-shrink: 0;
}
.topbar-actions > * {
    flex-shrink: 0;
}
.topbar-actions .topbar-user {
    flex-shrink: 0;
}
.topbar-notification {
    flex-shrink: 0;
}
.topbar-store {
    flex-shrink: 0;
}
.lang-switch {
    flex-shrink: 0;
}
/* 防止横向滚动 */
.app-main {
    overflow-x: hidden;
}
.app-topbar {
    overflow-x: hidden;
    min-width: 0;
}
.app-content {
    overflow-x: hidden;
}
.title-divider {
    flex-shrink: 0;
}

/* ============ 维语RTL顶栏：交换两个完整分组 ============ */
/* 维语版通过flex order交换 header-navigation 和 header-actions 的物理位置
   不使用row-reverse，避免二次反转。
   不在app-topbar上设direction:rtl，因为rtl会反转order方向。
   页面说明语仅在首页(system_home.html)显示，业务页base.html不含header-description。
   物理顺序：header-actions(左) | header-navigation(右)
   阅读顺序(从右向左)：回到主页 → 面包屑 → 维汉切换 → 店铺 → 铃铛 → 头像 → 用户信息 → 退出 */
/* 确保维语版顶栏始终水平排列，覆盖max-width:992px媒体查询的column布局 */
body.ug .app-topbar {
    flex-direction: row !important;
}
body.ug .header-navigation {
    order: 2;        /* 导航组放到右侧 */
    direction: rtl !important;  /* 覆盖topbar-title-block的direction:ltr !important */
}
body.ug .header-actions {
    order: 1;        /* 操作组放到左侧 */
    direction: rtl;
}
/* header-actions 内部从右向左：维汉切换 → 店铺 → 铃铛 → 头像 → 用户信息 → 退出
   direction:rtl 已让DOM顺序自然映射为从右到左阅读顺序，不需要row-reverse */
/* header-navigation 内部：回到主页在最右，面包屑在其左
   维语RTL下 direction:rtl 已让回到主页显示在最右 */
body.ug .version-number,
body.ug .notification-badge {
    direction: ltr;
    unicode-bidi: isolate;
}

/* ============ 1366px宽度保护 ============ */
@media (max-width: 1366px) {
    .app-topbar {
        padding: 10px 16px;
    }
    .app-content {
        padding: 20px 20px;
    }
    .topbar-actions {
        gap: 10px;
    }
    .topbar-sub-title {
        max-width: 120px;
    }
    .topbar-user .user-name {
        max-width: 60px;
    }
    .topbar-store span {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .top-home-btn {
        padding: 0 10px;
        font-size: 13px;
    }
    .topbar-main-title {
        font-size: 14px;
    }
    .breadcrumb-parent {
        font-size: 14px !important;
    }
    .breadcrumb-current {
        font-size: 16px !important;
    }
}

/* ============ 维语主页横向Logo：物理方向LTR，不翻转，不改变图片 ============ */
/* 容器尺寸由 .ihbal-system-logo-slot 的 aspect-ratio 5/2 统一控制，
   中文/维语使用同一张图片，维语不改变图片或容器大小 */
html[dir="rtl"] .ihbal-system-logo-slot,
body.ug .ihbal-system-logo-slot {
    direction: ltr;
    /* 防止 RTL 布局翻转图片位置，容器自身保持 LTR */
}
html[dir="rtl"] .ihbal-system-horizontal-logo,
body.ug .ihbal-system-horizontal-logo {
    transform: none;
}

/* ============================================================
   20260815 统一修复：顶部空隙 / 顶部栏高度 / 维语侧栏品牌溢出
   说明：app-layout.css 中存在多处历史重复的 .app-topbar 高度
   设置（56/58/60/64px 互相覆盖）。本区块为最终生效规则，
   覆盖前面所有冲突的 !important，统一三端（中文/维语/移动）。
   ============================================================ */

/* ===== 1. 消除页面顶部空隙 ===== */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    height: 100%;
}
.app-shell {
    margin: 0 !important;
    padding: 0 !important;
    height: 100vh;
    overflow: hidden;
}
.app-main {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* ===== 2. 统一顶部栏高度（72px，垂直居中，压缩 padding） ===== */
.app-topbar,
.topbar,
.header-bar,
body.ug .app-topbar,
body.ug .topbar,
body.ug .header-bar {
    height: 72px !important;
    min-height: 72px !important;
    max-height: 72px !important;
    padding: 0 24px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    overflow: visible !important;
}

/* 顶部栏内部所有元素垂直居中，防止错位 */
.app-topbar > *,
.app-topbar .header-navigation,
.app-topbar .header-actions,
.app-topbar .topbar-title-block,
.app-topbar .topbar-actions {
    display: flex !important;
    align-items: center !important;
    min-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* 顶部栏 Logo 容器约束（不撑高顶部栏） */
.app-topbar .header-navigation .top-home-btn {
    height: 40px !important;
    padding: 0 14px !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
}

/* 顶部栏头像/按钮统一高度 */
.app-topbar .user-avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    flex: 0 0 auto !important;
}

.app-topbar .topbar-logout-btn {
    width: 40px !important;
    height: 40px !important;
    flex: 0 0 auto !important;
}

/* ===== 3. 修复维语侧栏品牌区标题溢出覆盖菜单 ===== */
/* 品牌区使用 grid，Logo 固定 52px，标题列允许收缩 */
.sidebar-brand {
    display: grid !important;
    grid-template-columns: 52px minmax(0, 1fr) !important;
    align-items: center !important;
    column-gap: 10px !important;
    width: 100% !important;
    height: auto !important;
    min-height: 72px !important;
    padding: 12px 14px !important;
    box-sizing: border-box !important;
    direction: ltr !important;
    text-align: left;
    /* 品牌区下方独立边界，菜单从下方正常开始 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
}
html[dir="rtl"] .sidebar-brand {
    direction: ltr !important;
}

/* Logo 固定 52×52，不收缩 */
.sidebar-brand-logo {
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    max-height: 52px !important;
    flex: 0 0 auto !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
}
.sidebar-brand-logo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

/* 标题列允许收缩，防止溢出 */
.sidebar-brand-title {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    min-width: 0 !important;
    line-height: 1.3 !important;
    gap: 2px !important;
    overflow: hidden !important;
}

/* 标题行：中文 LTR 左对齐，维语 RTL 右对齐 */
.sidebar-brand-title-line {
    display: block !important;
    width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-weight: 700 !important;
    color: #E8E8E8 !important;
    line-height: 1.3 !important;
}
html[dir="ltr"] .sidebar-brand-title-line {
    font-size: 15px !important;
    direction: ltr !important;
    text-align: left !important;
}
html[dir="rtl"] .sidebar-brand-title-line {
    font-size: 13px !important;
    direction: rtl !important;
    text-align: right !important;
    font-family: 'UyghurWebFont', Arial, 'Microsoft YaHei', sans-serif !important;
}

/* 侧栏菜单从品牌区下方正常开始 */
.sidebar-nav {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    min-height: 0 !important;
}

/* 侧栏底部版本卡片不覆盖菜单 */
.sidebar-footer-brand {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

/* ===== 4. 侧栏防横向滚动 ===== */
.app-sidebar {
    overflow-x: hidden !important;
    overflow-y: hidden !important;
}
.app-sidebar .sidebar-nav {
    overflow-x: hidden !important;
}

/* ============================================================
   20260816 统一基础布局：变量 / 顶部贴零 / 栏高72 / 操作顺序
   优先级覆盖：app-layout.css 中 ~10 处互相覆盖的 height/padding，
   以及 system_home.html <style> 标签中的移动端 flex-wrap。
   ============================================================ */

/* ===== 0. 统一 CSS 变量 ===== */
:root {
    --app-header-height: 72px;
    --app-header-gold: #d6a438;
    --app-header-gold-dark: #b8860B;
    --app-header-bg: #ffffff;
    --app-header-border: #E5E7EB;
}

/* ===== 1. 根级顶部贴零：消除 META/TITLE/LINK 错放在 body 形成的 line-height 空隙 ===== */
html,
body {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    line-height: 0 !important;   /* 防止 body 中不可见 head 子元素产生 line-height 空隙 */
    overflow: hidden;            /* 桌面端：外层不滚动，内部滚动 */
    background: transparent !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
}
/* 恢复可见元素的正常行高（body 直接子元素 > header/main/footer） */
body > * {
    line-height: normal;
}
/* 把错放在 body 的 head 元素彻底 display:none，不产生任何 line-height 占位 */
body > meta,
body > title,
body > link,
body > style,
body > script,
body > noscript {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    width: 0 !important;
    line-height: 0 !important;
}

/* ===== 2. 桌面端系统最外层容器：从 top:0 left:0 开始，100vw × 100vh ===== */
.app-shell,
.layout-wrapper,
.dashboard-layout,
.main-wrapper,
.app-container,
body > .home-header + main,
body > main.main-content {
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 100vh !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    overflow: hidden;
}

/* ===== 3. 顶部栏统一高度 72px（base页.app-topbar + 首页.home-header） ===== */
.app-topbar,
.topbar,
.header-bar,
.home-header {
    height: var(--app-header-height) !important;
    min-height: var(--app-header-height) !important;
    max-height: var(--app-header-height) !important;
    /* 上下 padding 合计 ≤ 16px（用户要求≤8px每侧） */
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    width: 100% !important;
    max-width: none !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;       /* 关键：禁止换行，防止子元素换行使栏高翻倍 */
    align-content: stretch !important;
    align-items: stretch !important;        /* 关键：顶栏高度 72px 贴死后，子级 flex item 必须先撑满高度（自身再用 align-self:center 垂直居中） */
    justify-content: space-between !important;
    gap: 12px !important;
    overflow: hidden !important;
    z-index: 900 !important;
    background: var(--app-header-bg) !important;
    border-bottom: 1px solid var(--app-header-border) !important;
    backdrop-filter: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
    border-radius: 0 !important;
}

/* 维语 topbar：继续在 app-main 中占满 width=100%，位置不再额外偏移 */
body.ug .app-topbar,
body.ug .topbar,
body.ug .header-bar {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    position: sticky !important;
    top: 0 !important;
    /* 维语顶部栏内部：direction=ltr 保证 DOM 顺序与视觉一致（不二次反转）
       但文字方向仍由子元素自己指定。这里 direction 保持默认继承。*/
}

/* ===== 3.1 首页 home-header 强制使用统一高度 ===== */
.home-header {
    overflow: hidden !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    padding-left: 32px !important;
    padding-right: 32px !important;
}

/* 首页 header-right 也禁止换行 */
.header-right {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
    min-width: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow: visible !important;
}

/* ===== 3.2 首页 Logo 插槽：严格 150 × 60，不反向撑高顶部栏 ===== */
.ihbal-system-logo-slot {
    flex: 0 0 150px !important;
    width: 150px !important;
    max-width: 150px !important;
    height: 60px !important;
    max-height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    align-self: center !important;
    aspect-ratio: 5 / 2 !important;
}
.ihbal-system-logo-slot img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

/* ===== 3.3 首页说明语（brand-tagline）：优先隐藏 ===== */
.brand-tagline {
    display: block !important;
    max-width: 360px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.2 !important;
    flex-shrink: 1 !important;
}
@media (max-width: 1366px) {
    .brand-tagline { max-width: 220px; }
}
@media (max-width: 1180px) {
    .brand-tagline { display: none !important; }
}

/* ===== 3.4 顶栏内部标题 / 面包屑区域：可压缩，不覆盖操作区 ===== */
.app-topbar .header-navigation,
.app-topbar .page-title-area,
.app-topbar .topbar-title-block,
.home-header > :first-child {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
    height: 100% !important;
    max-height: 100% !important;
}
.topbar-main-title,
.breadcrumb-parent,
.breadcrumb-current {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-width: 0 !important;
    max-width: 100% !important;
    line-height: 1.25 !important;
}
.breadcrumb-sep { flex-shrink: 0 !important; }
.topbar-sub-title {
    display: none !important;       /* 顶栏统一后删除副标题行，保留空间给面包屑 */
}

/* 回到主页按钮：保持 40px 高（覆盖 app-layout.css 中 `.topbar-actions a { height:32px }` 等特异性更高的压缩规则） */
.top-home-btn,
.topbar-title-block .top-home-btn,
.topbar-actions .top-home-btn,
.header-actions .top-home-btn,
.app-topbar .header-navigation .top-home-btn {
    flex: 0 0 auto !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 14px !important;
    margin: 0 !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
    font-size: 13px !important;
    align-self: center !important;
}

/* ===== 3.5 顶栏操作区：统一结构 =====
   父顶栏（.app-topbar / .home-header 等）使用 align-items:stretch，
   保证所有子元素先撑满 --app-header-height=72px，
   再由子级自身 align-items:center 使内部控件垂直居中。 */
.app-topbar,
.home-header,
.header-bar,
.topbar {
    align-items: stretch !important;
}

/* 顶栏左侧品牌 / 面包屑：垂直居中，不单独撑大高度 */
.app-topbar > :first-child,
.home-header > :first-child,
.page-title-area,
.topbar-title-block,
.home-brand-wrapper {
    align-self: center !important;
    min-width: 0 !important;
}

.header-actions,
.topbar-actions,
.home-header .header-right {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    align-self: stretch !important; /* flex item：顶栏 = 72px 时，操作区必须拉满高度 */
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    flex-wrap: nowrap !important;
    overflow: visible !important;
}

/* 中文 LTR：保留默认 DOM 顺序 = 视觉从左到右
   语言切换 → 店铺 → 通知 → 账号 → 退出
*/

/* ===== 4. 统一语言切换器：.app-language-switcher + .app-language-button + .is-active ===== */
/* 兼容旧类名 .lang-switch，同时支持新类名；外层总高 40px，与按钮一致 */
.lang-switch,
.app-language-switcher {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    flex: 0 0 auto !important;
    gap: 4px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid var(--app-header-border) !important;
    background: #fff !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    direction: ltr !important; /* 语言按钮内部：两个按钮保持相邻 LTR 顺序，不参与 RTL 二次反转 */
}

/* form 容器：inline-flex，去掉浏览器默认 margin/padding */
.lang-switch form,
.app-language-switcher form {
    display: inline-flex !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    height: 100% !important;
    align-items: center !important;
}

/* 语言按钮统一 40px */
.lang-switch button,
.app-language-switcher .app-language-button,
.lang-switch input[type=submit] {
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    min-width: 58px !important;
    padding: 0 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    border-radius: 10px !important;
    margin: 0 !important;
    border: 0 !important;
    position: static !important;
    top: auto !important;
    transform: none !important;
    cursor: pointer !important;
    font-weight: 700 !important;
    font-size: 12.5px !important;
    flex: 0 0 auto !important;
    background: transparent !important;
    color: #6b7280 !important;
    transition: none !important;
    white-space: nowrap !important;
}

/* 当前语言：金色背景 + 白字 */
.lang-switch button.active,
.lang-switch button.is-active,
.app-language-switcher .app-language-button.is-active,
.lang-switch .active {
    background: linear-gradient(135deg, #d6a438, #b98218) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(201,151,43,0.22) !important;
}
/* hover 保持温和 */
.lang-switch button:hover {
    background: #fef8ec !important;
    color: #a06e00 !important;
    box-shadow: none !important;
}

/* ===== 5. 店铺 / 通知 / 账号 / 退出按钮：统一 40px 高 ===== */
.store-chip,
.topbar-store {
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 0 14px !important;
    margin: 0 !important;
    border-radius: 999px !important;
    background: #fff !important;
    border: 1px solid var(--app-header-border) !important;
    box-sizing: border-box !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    color: #111827 !important;
    flex: 0 0 auto !important;
    max-width: 220px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    flex-wrap: nowrap !important;
    line-height: 1 !important;
}
.store-chip i, .topbar-store i { flex-shrink: 0 !important; color: var(--app-header-gold); }

/* 1366px 以下缩短店铺：只保留图标 + 前8字 */
@media (max-width: 1366px) {
    .store-chip, .topbar-store { max-width: 150px !important; }
}

/* 通知铃铛：40×40 点击区
   —— 覆盖 app-layout.css 中 `.topbar-actions a { height:32px }` 等错误压缩，
   必须在本 selector 中显式包含父级 .topbar-actions 才能夺回 specificity */
.topbar-notification,
.topbar-actions .topbar-notification,
.header-actions .topbar-notification {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: #111827 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    position: relative !important;
    box-sizing: border-box !important;
    flex: 0 0 40px !important;
    align-self: center !important;
    text-decoration: none !important;
    line-height: 1 !important;
}
.notification-badge {
    position: absolute !important;
    top: 3px !important;
    right: 3px !important;
    min-width: 18px !important;
    height: 18px !important;
    border-radius: 9px !important;
    background: #dc2626 !important;
    color: #fff !important;
    font-size: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 5px !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

/* 账号 + 用户 chip：整体 ≤ 40px */
.user-chip,
.topbar-user {
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 0 10px 0 6px !important;
    margin: 0 !important;
    border-radius: 999px !important;
    background: #fff !important;
    border: 1px solid var(--app-header-border) !important;
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
    line-height: 1 !important;
    overflow: hidden !important;
    flex-wrap: nowrap !important;
}
/* 账号头像 28→28，不使用 40px 以免撑高 */
.user-chip .user-avatar,
.topbar-user .user-avatar {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    border-radius: 999px !important;
    background: var(--app-header-gold) !important;
    color: #fff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}
/* 账号文字信息：100% 不换行 + 最大宽度限制，第二行可在缩放下隐藏 */
.user-chip .user-info,
.topbar-user .user-info {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    line-height: 1.1 !important;
    min-width: 0 !important;
    max-width: 140px !important;
    gap: 1px !important;
    overflow: hidden !important;
    flex: 0 0 auto !important;
    text-align: left !important;
    direction: ltr !important;  /* 手机号、账号保持 LTR，维语方向不打乱数字顺序 */
}
.user-chip .user-info strong,
.topbar-user .user-info .user-name {
    font-size: 12px !important;
    font-weight: 800 !important;
    color: #111827 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-width: 0 !important;
    line-height: 1.1 !important;
    direction: ltr !important;
    unicode-bidi: isolate !important;
}
.user-chip .user-info small,
.topbar-user .user-info .user-role {
    font-size: 10px !important;
    color: #6b7280 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-width: 0 !important;
    line-height: 1.1 !important;
}
@media (max-width: 1366px) {
    .user-chip .user-info, .topbar-user .user-info { max-width: 110px !important; }
}
/* 150% 缩放或 1024px：隐藏账号角色行 */
@media (max-width: 1100px) {
    .user-chip .user-info small,
    .topbar-user .user-info .user-role { display: none !important; }
    .user-chip, .topbar-user { padding: 0 8px !important; }
}

/* 退出按钮：40×40 */
.logout-btn,
.topbar-logout-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 999px !important;
    border: 1px solid var(--app-header-border) !important;
    background: #fff !important;
    color: #111827 !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
    line-height: 1 !important;
    font-size: 14px !important;
    position: static !important;
}
.topbar-logout-btn:hover,
.logout-btn:hover {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #dc2626 !important;
}

/* 退出 / 语言 提交 form：强制 40×40 点击区（同按钮高度），不再跟随父容器 height=100% 错位 */
.home-header .header-right > form,
.header-actions > form {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    flex: 0 0 40px !important;
    align-self: center !important;
}

/* 语言切换器内的两个 form：宽度自适应，按按钮内容 + gap 正常走（不继承上方 40×40） */
.app-language-switcher > form,
.lang-switch > form {
    width: auto !important;
    min-width: auto !important;
    max-width: none !important;
    flex: 0 0 auto !important;
    height: 100% !important;
    min-height: 40px !important;
    max-height: 40px !important;
    align-self: auto !important;
}

/* ===== 6. 维语 RTL：防止二次反转 =====
   html dir=rtl 使 body 默认阅读方向右到左。
   header-actions / header-right 本身使用正常 DOM 顺序：
     语言切换(中文/维语相邻) → 店铺 → 通知 → 账号 → 退出
   因为 dir=rtl，flex 子项视觉从右向左排列，所以退出将在最左侧。
   用户要求维语版操作顺序与中文版"同一组功能稳定位置 + 语言按钮相邻"。
   解决：给语言切换容器设置 direction=ltr（已在上方 lang-switch 中完成）
        给 header-actions / header-right 设置 direction=ltr，让功能按 DOM 顺序从左到右
        视觉最右边 = DOM 最后元素 = 退出（符合用户要求：页面最右端必须是退出按钮）
*/
html[dir="rtl"] .header-actions,
html[dir="rtl"] .topbar-actions,
html[dir="rtl"] .home-header .header-right {
    direction: ltr !important;
    justify-content: flex-end !important;
}

/* 维语店铺名称、用户姓名等保持 LTR 数字顺序（在 store-chip/user-info 内部已完成） */

/* ===== 7. 内容区 & 侧栏 top / height 统一 72px =====
   侧栏 top=0（从页面顶部开始，不被顶部栏遮挡）
   顶部栏 sticky 位于 app-main 之内，app-main 本身 top=var(--app-header-height)
   这样侧栏和顶部栏的 top 值保持一致（side从0、content从header下方）
*/
.app-sidebar,
.sidebar {
    top: 0 !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    box-sizing: border-box !important;
}
.app-content,
.app-main,
.main-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}
/* 顶部栏为 sticky + top:0，位于 app-main 第一子节点 → app-main 不需要 padding-top */
.app-main,
body > main.main-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
    height: calc(100vh) !important;
    min-height: calc(100vh) !important;
    max-height: 100vh !important;
    overflow: hidden;
}
/* app-content 位于顶部栏之后，所以 app-main 使用 flex 纵向布局更好。
   否则 main 高度 = 100vh，会导致内容超出视口。改为 flex 分栏：
   header: flex 0 0 72px
   section : flex 1 1 auto (可滚动)
*/
.app-main {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    overflow: hidden;
    position: relative !important;
}
.app-main > .app-topbar {
    flex: 0 0 var(--app-header-height) !important;
    width: 100% !important;
    position: sticky !important;
    top: 0 !important;
}
.app-main > .app-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    width: 100% !important;
    padding: 24px !important;
    box-sizing: border-box !important;
}
/* 维语 app-main 位置：与 sidebar 宽度保持协调 */
body.ug .app-main {
    margin-right: 0 !important;
    margin-left: 0 !important;
    width: auto !important;
}

/* ===== 8. 首页 main-content：top 正确衔接 ===== */
main.main-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
    top: 0 !important;
}
/* 首页 home-header 为 sticky（top=0），随后 main-content 正常文档流 →
   sticky 元素会脱离文档流一部分，但 main-content 的实际顶部应该从 home-header 底部开始。
   由于 sticky 不脱离文档流（保留占位），main-content 不需要 margin-top。
*/

/* ===== 9. 维语侧栏 top 值保持 0，与中文版一致 ===== */
body.ug .app-sidebar,
body.ug .sidebar {
    top: 0 !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
}

/* =============================================================
   20260816-v2 FINAL PATCH：针对 home-header 内联 style /
   模板 head 漏引 app-layout-extend.css 导致规则完全不生效的
   最高优先级修正。
   所有规则带 !important；放置在 extend.css 最末尾；
   不修改任何业务代码或模型。
   ============================================================= */

/* A. 根级 CSS 变量：在 html/:root 重复声明，避免 system_home <style> 内 :root 覆盖 */
html,
:root {
    --app-header-height: 72px !important;
    --app-header-gold: #d6a438 !important;
    --app-header-bg: #ffffff !important;
    --app-header-border: #E5E7EB !important;
}

/* B. 消除 body 顶部 21px 空隙：
      - body 默认 line-height:21px 加 head 错放标签 + 空白文本节点产生 1 行高占位
      - font-size:0 让空白 text 节点占据 0px 高度（第一道防线）
      - line-height:0 再叠加（第二道防线）
      - 子元素恢复正常字号和行高（第三道防线：继承回覆盖）
*/
html {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    overflow: hidden !important;
}
body {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    /* 最关键：font-size:0 + line-height:0 → 即使有空白文本节点 / head 错放标签，
       它们在没有自己单独设置 font-size 的情况下，高度将为 0px */
    font-size: 0 !important;
    line-height: 0 !important;
    box-sizing: border-box !important;
    background: transparent !important;
    border-radius: 0 !important;
}
/* 所有可见 body 子元素恢复为常规字体和行高（不继承 body 的 font-size:0） */
body > header,
body > main,
body > footer,
body > section,
body > nav,
body > aside,
body > div {
    font-size: 14px !important;
    line-height: normal !important;
}
/* 错放在 body 的 head 元素：绝对 0 占位 */
body > meta,
body > title,
body > link,
body > style,
body > script,
body > noscript {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    width: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
}

/* C. 外层容器：从 (0,0) 开始，铺满 100vw×100vh，无装饰 margin/圆角 */
.app-shell,
body > .app-shell,
body > .layout-wrapper,
body > .dashboard-layout,
body > .main-wrapper,
body > .app-container {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    background: transparent !important;
    transform: none !important;
    font-size: 14px !important;
    line-height: normal !important;
}

/* D. 顶部栏：统一 72px；强制 nowrap 阻止 flex-wrap:wrap 撑高；
      覆盖 system_home <style> 中 .home-header 的 flex-wrap:wrap / padding:0 32px
      以及 app-layout.css 中十余条 min-height:56/58/60/64 px 叠加。 */
.app-topbar,
.topbar,
.header-bar,
.home-header,
header.app-topbar,
header.home-header {
    height: var(--app-header-height) !important;
    min-height: var(--app-header-height) !important;
    max-height: var(--app-header-height) !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;           /* 绝对禁止换行 */
    align-content: stretch !important;
    align-items: stretch !important;        /* 高度贴死 = 72px 后，子级撑满后再自身居中 */
    justify-content: space-between !important;
    gap: 12px !important;
    overflow: hidden !important;
    z-index: 900 !important;
    background: var(--app-header-bg) !important;
    border-bottom: 1px solid var(--app-header-border) !important;
    border-radius: 0 !important;
}
/* 首页 home-header 左右 padding 更大一点（32px），其余与 base 相同 */
.home-header {
    padding-left: 32px !important;
    padding-right: 32px !important;
}
.home-header > :first-child,
.home-header > .home-brand-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
    height: 100% !important;
    max-height: 100% !important;
    flex-wrap: nowrap !important;
}
.home-header > .header-right,
.home-header > .header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex: 0 0 auto !important;
    flex-wrap: nowrap !important;
    height: 100% !important;
    max-height: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    justify-content: flex-end !important;
}

/* E. 首页横版 Logo 插槽：严格 150×60 */
.ihbal-system-logo-slot {
    flex: 0 0 150px !important;
    width: 150px !important;
    max-width: 150px !important;
    min-width: 150px !important;
    height: 60px !important;
    max-height: 60px !important;
    min-height: 60px !important;
    aspect-ratio: 5 / 2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    align-self: center !important;
}
.ihbal-system-logo-slot .ihbal-system-horizontal-logo {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

/* F. 语言切换器（final）：总高 40px，按钮 40px，保持相邻，不参与 RTL 反转 */
.lang-switch,
.app-language-switcher {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    flex: 0 0 auto !important;
    gap: 4px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid var(--app-header-border) !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    direction: ltr !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important;
}
.lang-switch form,
.app-language-switcher form {
    display: inline-flex !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    height: 100% !important;
    align-items: center !important;
    gap: 4px !important;
}
.lang-switch button,
.app-language-switcher .app-language-button,
.lang-switch input[type=submit] {
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    min-width: 58px !important;
    padding: 0 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    border-radius: 10px !important;
    margin: 0 !important;
    border: 0 !important;
    position: static !important;
    transform: none !important;
    cursor: pointer !important;
    font-weight: 700 !important;
    font-size: 12.5px !important;
    flex: 0 0 auto !important;
    background: transparent !important;
    color: #6b7280 !important;
    white-space: nowrap !important;
}
.lang-switch button.active,
.lang-switch button.is-active,
.app-language-switcher .app-language-button.is-active,
.app-language-switcher .app-language-button.active {
    background: linear-gradient(135deg, #d6a438, #b98218) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(201,151,43,0.22) !important;
}

/* G. 侧栏 top=0、height=100vh；app-main height=100vh flex纵向；app-content可滚动 */
.app-sidebar,
.sidebar,
body.ug .app-sidebar,
body.ug .sidebar {
    top: 0 !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    box-sizing: border-box !important;
}
.app-main {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    position: relative !important;
    top: 0 !important;
}
.app-main > .app-topbar {
    flex: 0 0 var(--app-header-height) !important;
    width: 100% !important;
    position: sticky !important;
    top: 0 !important;
}
.app-main > .app-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    width: 100% !important;
    padding: 24px !important;
    box-sizing: border-box !important;
}

/* 首页 main-content：home-header 是 sticky 占位后接 main，
   不额外设 height 以免 overflow 冲突 */
body > main.main-content,
main.main-content {
    padding-top: 0 !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
    padding-bottom: 24px !important;
    margin: 0 !important;
    margin-top: 0 !important;
    top: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* H. RTL 操作区最终：direction:ltr 防止二次反转，退出位于最右端 */
html[dir="rtl"] .header-actions,
html[dir="rtl"] .topbar-actions,
html[dir="rtl"] .home-header .header-right {
    direction: ltr !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
}
body.ug .header-actions,
body.ug .topbar-actions,
body.ug .home-header .header-right {
    direction: ltr !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
}
/* 数字、手机号、店铺中文名称保持 LTR 顺序 */
.store-chip span,
.topbar-store span,
.user-chip .user-info,
.topbar-user .user-info,
.user-chip .user-name,
.topbar-user .user-name {
    direction: ltr !important;
    unicode-bidi: isolate !important;
    text-align: left !important;
}

/* I. 响应式降级顺序：说明语 → 面包屑宽度 → 角色第二行 → 店铺缩短
   关键：lang/store/user/logout 永远不 hide 不 wrap */
@media (max-width: 1366px) {
    .brand-tagline { max-width: 200px !important; }
}
@media (max-width: 1200px) {
    .brand-tagline { display: none !important; }
}
@media (max-width: 1100px) {
    .topbar-sub-title { display: none !important; }
    .user-chip .user-info small,
    .topbar-user .user-info .user-role { display: none !important; }
    .store-chip, .topbar-store { max-width: 140px !important; }
}
@media (max-width: 960px) {
    .home-header { padding-left: 16px !important; padding-right: 16px !important; }
    .ihbal-system-logo-slot { flex: 0 0 120px !important; width: 120px !important; max-width: 120px !important; min-width: 120px !important; height: 48px !important; max-height: 48px !important; min-height: 48px !important; }
    .store-chip span, .topbar-store span { display: none !important; }
    .store-chip, .topbar-store { min-width: 40px !important; width: 40px !important; max-width: 40px !important; padding: 0 !important; justify-content: center !important; }
}

/* =============================================================
   20260816-v3 FINAL SHELL LAYOUT & SYSTEM HOME CENTERING
   修复三个问题：
   (a) 维语 RTL app-main 仍保留 sidebar-width 的 margin-right / right: var(...) / calc(100vw - sidebar)
       导致主内容进入侧栏下面、顶部栏也被截断。
   (b) system_home.html 使用通用类名 <main class="main-content">，命中
       body.ug .main-content { margin-right: 250px; width: calc(100% - 250px); }
       等 base 侧栏补偿规则，导致首页整体向一侧偏移约 sidebar 宽度。
   (c) 顶部栏返回首页按钮在所有 base 页面显示，类名为 .top-home-btn。

   策略：
   1. 全部使用 flex 布局 .app-shell，direction 固定 LTR，仅在 sidebar/main 上用 order 切换左右。
      不再使用 position:fixed sidebar + app-main margin-right 手工补偿的旧混合模型。
      旧 app-layout.css 中所有 margin-left/margin-right/right/width:calc/left 被清除。
   2. 系统首页 body 增加 system-home-page 类（见 system_home.html body 类），
      并将主内容类名由 main-content 改为 system-home-main，
      再在 body.system-home-page 命名空间下强制清零所有 sidebar 残留补偿。
   不修改业务页面、不创建 migration、不修改 app-layout.css 源文件。
   ============================================================= */

/* --- 1. APP SHELL FLEX LAYOUT (桌面端 ≥1025px) --- */
@media (min-width: 1025px) {
    .app-shell {
        display: flex !important;
        flex-direction: row !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        flex-wrap: nowrap !important;
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        height: 100vh !important;
        max-height: 100vh !important;
        min-height: 100vh !important;
        overflow: hidden !important;
        direction: ltr !important;          /* 外壳布局恒LTR，中文/维语靠 order 切换 */
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        right: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    /* --- Sidebar：flex 不压缩，固定宽度 --- */
    .app-sidebar,
    body.ug .app-sidebar {
        order: 1 !important;
        flex: 0 0 var(--app-sidebar-width, 250px) !important;
        width: var(--app-sidebar-width, 250px) !important;
        max-width: var(--app-sidebar-width, 250px) !important;
        min-width: var(--app-sidebar-width, 250px) !important;
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
        position: relative !important;
        top: 0 !important;
        left: auto !important;
        right: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        transform: none !important;
        direction: ltr !important;        /* sidebar 几何 LTR，子菜单自己处理 rtl */
    }

    /* --- Main：flex 1 自动占剩余空间 --- */
    .app-main,
    body.ug .app-main {
        order: 2 !important;
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding: 0 !important;
        position: relative !important;
        top: 0 !important;
        left: auto !important;
        right: auto !important;
        box-sizing: border-box !important;
        transform: none !important;
        direction: ltr !important;     /* main 外层几何恒LTR，标题/正文自己处理 */
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        overflow: hidden !important;
    }

    /* --- Topbar：sticky 在 main 第一子节点，宽度=main 的 100% --- */
    .app-topbar,
    body.ug .app-topbar {
        order: 0 !important;
        flex: 0 0 var(--app-header-height, 72px) !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        position: sticky !important;
        top: 0 !important;
        left: auto !important;
        right: auto !important;
        margin: 0 !important;
        left: 0 !important;
        right: 0 !important;
        padding-left: 24px !important;
        padding-right: 24px !important;
        box-sizing: border-box !important;
        transform: none !important;
        z-index: 900 !important;
    }

    /* --- app-content：第二栏，可滚动但横向由 flex 限制 --- */
    .app-content,
    body.ug .app-content {
        order: 1 !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 24px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        direction: inherit !important;
    }

    /* --- 中文：sidebar 在左、main 在右（order 已满足） --- */
    /* --- 维语：main 在左、sidebar 在右 → 仅调换 order --- */
    body.ug .app-shell .app-sidebar,
    html[dir="rtl"] .app-shell .app-sidebar {
        order: 2 !important;
    }
    body.ug .app-shell .app-main,
    html[dir="rtl"] .app-shell .app-main {
        order: 1 !important;
    }

    /* --- 维语 topbar 视觉上：标题/面包屑在右，操作区在左
           实现：topbar 本身不 direction:rtl（避免 reverse order 二次反转），
           内部 .topbar-title-block 使用 order:2 direction:rtl text-align:right，
           .header-actions 使用 order:1 justify-content:flex-start direction:ltr。
           操作区内部顺序保持 语言→店铺→通知→返回→账号→退出，视觉稳定不重复反转。 --- */
    body.ug .app-topbar,
    html[dir="rtl"] .app-topbar {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: stretch !important;
        direction: ltr !important;           /* 顶栏外层 LTR 几何 */
    }
    body.ug .app-topbar .topbar-title-block,
    html[dir="rtl"] .app-topbar .topbar-title-block,
    body.ug .app-topbar .page-title-area,
    html[dir="rtl"] .app-topbar .page-title-area {
        order: 2 !important;                    /* 放右侧 */
        direction: rtl !important;
        text-align: right !important;
        justify-content: flex-end !important;
        align-items: center !important;
        padding-left: 8px !important;
        padding-right: 0 !important;
    }
    body.ug .app-topbar .topbar-title-block *,
    html[dir="rtl"] .app-topbar .topbar-title-block * {
        /* 标题面包屑等维语内容：继承 rtl，但数字/日期子项仍 LTR（已由 store-chip/user-info 各自锁定） */
    }
    body.ug .app-topbar .header-actions,
    html[dir="rtl"] .app-topbar .header-actions,
    body.ug .app-topbar .topbar-actions,
    html[dir="rtl"] .app-topbar .topbar-actions {
        order: 1 !important;                    /* 放左侧 */
        direction: ltr !important;              /* 防止第二次反转 */
        justify-content: flex-start !important;
        align-items: center !important;
    }
}

/* --- 2. 系统首页：专属命名空间 system-home-page，杜绝 sidebar 偏移污染 ---
   body.system-home-page → 主内容类名由 main-content 改为 system-home-main
   见 templates/index/system_home.html 对应修改。
   所有命中 app-layout.css 的 main-content sidebar margin 补偿规则全部清零并重写居中。 */
body.system-home-page {
    min-height: 100vh !important;
    height: auto !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}
body.system-home-page,
body.system-home-page *,
body.system-home-page *::before,
body.system-home-page *::after {
    /* 系统首页完全不参与 base 的 sidebar 偏移变量 */
}

/* 清零 system-home-page 下所有可能的 sidebar 补偿
   （app-layout.css 中 body:not(.ug) / body.ug 的 main-content 规则） */
body.system-home-page .system-home-main,
body.system-home-page main.system-home-main,
body.system-home-page .main-content {
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: calc(100% - 48px) !important;
    max-width: 1500px !important;
    min-width: 0 !important;
    display: block !important;
    box-sizing: border-box !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
}

/* 系统首页 home-header 占满整个浏览器宽度（不受居中 margin 影响），
   不再使用 main-content 的任何 sidebar margin/width 规则 */
body.system-home-page > header.home-header,
body.system-home-page header.home-header {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    position: sticky !important;
    box-sizing: border-box !important;
}

/* 系统首页 body.ug：绝不再保留维语 main-content 的 230/250px margin-right 残留 */
body.system-home-page.ug .system-home-main,
body.system-home-page.ug main.system-home-main,
body.system-home-page.ug .main-content {
    margin-right: auto !important;
    margin-left: auto !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
}
body.system-home-page:not(.ug) .system-home-main,
body.system-home-page:not(.ug) main.system-home-main,
body.system-home-page:not(.ug) .main-content {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* --- 3. 返回首页按钮最终样式：40px 高、浅金边框、金色主页图标、紧凑圆角 --- */
.top-home-btn,
.topbar-actions .top-home-btn,
.header-actions .top-home-btn,
.app-topbar .top-home-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 0 14px !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
    border: 1px solid #e9d4a4 !important;
    background: #fffaf0 !important;
    color: #a8761a !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    box-shadow: 0 1px 2px rgba(201, 151, 43, 0.08) !important;
    align-self: center !important;
}
.top-home-btn i,
.topbar-actions .top-home-btn i,
.header-actions .top-home-btn i {
    color: #c6922e !important;
    font-size: 14px !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}
.top-home-btn:hover,
.topbar-actions .top-home-btn:hover,
.header-actions .top-home-btn:hover {
    background: #fff3d4 !important;
    color: #7a4d00 !important;
    border-color: #c9972b !important;
}

/* --- 4. 侧栏品牌 Logo 容器：去掉金色渐变底（黑金圆形Logo自带），改为透明背景 ---
   注意：品牌 Logo 容器是黑金圆形 PNG，有黑底+金环，因此：
   - 不用金色渐变背景（避免叠加成“金底金色Logo”失真）
   - 不用金色边框
   - background: transparent
   仅保留 56×56 圆形 viewport 让黑金 Logo 展示完整。 --- */
.sidebar-brand-logo {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
.sidebar-brand-logo img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: transparent !important;
}
/* 底部版本卡 Logo：黑金圆形，去掉半透明金色遮罩背景 */
.sidebar-footer-logo {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
.sidebar-footer-logo img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: transparent !important;
}

/* =============================================================
   20260816-v4 TARGETED FIXES
   (a) 中文 body:not(.ug) .app-main 仍保留 margin-left:250px（旧 app-layout.css
       特异性 0,2,0 胜过 extend.css 中 .app-main 0,1,0），导致中文销售页内容偏右。
   (b) 品牌标题必须完整显示，不允许 nowrap/ellipsis/overflow:hidden 裁切。
   (c) 返回首页按钮移入 .topbar-title-block，不再出现在 .header-actions。
   (d) 销售页 .sales-workbench 基于 app-content 宽度居中。
   ============================================================= */

/* --- (a) 覆盖旧侧栏补偿：仅桌面/平板固定侧栏需要此归一化。
   之前未限定断点，覆盖了 app-layout.css 的移动端 transform，导致 390px
   仍保留 250px 侧栏。M1 的手机抽屉规则见本文件末尾。 --- */
@media (min-width: 481px) {
    body:not(.ug) .app-main,
    body:not(.ug).app-main {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: auto !important;
        max-width: none !important;
        left: auto !important;
        right: auto !important;
    }
    body:not(.ug) .app-sidebar,
    body:not(.ug).app-sidebar {
        left: auto !important;
        right: auto !important;
        position: relative !important;
        transform: none !important;
    }
    body:not(.ug) .app-topbar,
    body:not(.ug).app-topbar {
        left: auto !important;
        right: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    /* 同时覆盖 body.ug（保险） */
    body.ug .app-main {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: auto !important;
        max-width: none !important;
    }
    body.ug .app-sidebar {
        left: auto !important;
        right: auto !important;
        position: relative !important;
        transform: none !important;
    }
    body.ug .app-topbar {
        left: auto !important;
        right: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* --- (b) 品牌标题：允许换行，不截断，不省略 --- */
.sidebar-brand-title-line {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    display: block !important;
    width: 100% !important;
    line-height: 1.35 !important;
    word-break: break-word !important;
}
/* 中文主标题：完整显示"易赫宝金店管理系统" */
html[dir="ltr"] .sidebar-brand-title-line.brand-title {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #E8E8E8 !important;
    white-space: normal !important;
    overflow: visible !important;
}
/* 维语主标题：完整显示，允许自然两行 */
html[dir="rtl"] .sidebar-brand-title-line.brand-title,
html[dir="rtl"] .sidebar-brand-title-line.ug-sidebar-brand-title {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #E8E8E8 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.35 !important;
    word-break: break-word !important;
    direction: rtl !important;
    text-align: right !important;
}
/* 副标题 IHBAL 小字 */
.sidebar-brand-title-line.brand-subtitle {
    white-space: nowrap !important;
    overflow: visible !important;
}

/* 品牌区高度自适应两行文字 */
.sidebar-brand {
    min-height: 80px !important;
    height: auto !important;
}

/* --- (c) 返回首页按钮在标题区样式 --- */
.topbar-title-block .top-home-btn,
.topbar-home-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    padding: 0 12px !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
    border-radius: 10px !important;
    border: 1px solid #e9d4a4 !important;
    background: #fffaf0 !important;
    color: #a8761a !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    position: static !important;
    transform: none !important;
    align-self: center !important;
    box-shadow: 0 1px 2px rgba(201, 151, 43, 0.08) !important;
}
.topbar-title-block .top-home-btn i,
.topbar-home-link i {
    color: #c6922e !important;
    font-size: 13px !important;
    line-height: 1 !important;
}
.topbar-title-block .top-home-btn:hover,
.topbar-home-link:hover {
    background: #fff3d4 !important;
    color: #7a4d00 !important;
    border-color: #c9972b !important;
}
/* 维语标题区：返回首页在面包屑阅读顺序之前 */
html[dir="rtl"] .topbar-title-block .top-home-btn,
html[dir="rtl"] .topbar-home-link {
    direction: ltr !important;
}
html[dir="rtl"] .topbar-title-block .top-home-btn span,
html[dir="rtl"] .topbar-home-link span {
    direction: rtl !important;
    unicode-bidi: isolate !important;
}

/* --- (d) 销售页根容器居中：基于 app-content 宽度 --- */
.sales-workbench {
    width: 100% !important;
    max-width: 1500px !important;
    margin-inline: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}
/* app-content 已有 24px padding，sales-workbench 内部 16px padding 不重复 */
.app-content > #calcForm,
.app-content form#calcForm {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* =============================================================
   M1 — 手机应用外壳（仅 <=480px）
   固定侧栏仅在 481px 及以上保留；手机端使用覆盖内容的抽屉。
   ============================================================= */
.mobile-menu-toggle,
.app-topbar .mobile-menu-toggle,
.mobile-sidebar-close,
.mobile-sidebar-backdrop {
    display: none !important;
}

@media (max-width: 480px) {
    html,
    body {
        width: 100%;
        overflow-x: hidden;
    }

    body.mobile-nav-scroll-lock {
        position: fixed;
        width: 100%;
        overflow: hidden;
    }

    .app-shell,
    body.ug .app-shell {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        max-height: 100dvh !important;
        overflow: hidden !important;
    }

    .app-main,
    body:not(.ug) .app-main,
    body.ug .app-main {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    .app-sidebar,
    body.ug .app-sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        width: min(82vw, 300px) !important;
        min-width: min(82vw, 300px) !important;
        max-width: min(82vw, 300px) !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        z-index: 1100 !important;
        visibility: hidden;
        transition: transform 0.25s ease, visibility 0s linear 0.25s !important;
    }

    body:not(.ug) .app-sidebar {
        left: 0 !important;
        right: auto !important;
        transform: translateX(-100%) !important;
    }

    body.ug .app-sidebar,
    html[dir="rtl"] .app-sidebar {
        left: auto !important;
        right: 0 !important;
        transform: translateX(100%) !important;
    }

    body.mobile-open .app-sidebar,
    .app-sidebar.mobile-open {
        visibility: visible;
        transform: translateX(0) !important;
        transition-delay: 0s !important;
    }

    .mobile-sidebar-backdrop {
        display: block !important;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.48);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.25s ease, visibility 0s linear 0.25s;
        z-index: 1050;
    }

    body.mobile-open .mobile-sidebar-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition-delay: 0s;
    }

    .mobile-menu-toggle,
    .app-topbar .mobile-menu-toggle,
    .mobile-sidebar-close {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 44px !important;
        min-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        background: transparent !important;
        color: inherit !important;
        cursor: pointer;
        line-height: 1 !important;
    }

    .mobile-menu-toggle {
        order: 0;
    }

    .mobile-sidebar-close {
        position: absolute;
        top: 8px;
        z-index: 1;
    }

    body:not(.ug) .mobile-sidebar-close {
        right: 8px;
    }

    body.ug .mobile-sidebar-close,
    html[dir="rtl"] .mobile-sidebar-close {
        left: 8px;
        right: auto;
    }

    .app-topbar,
    body:not(.ug) .app-topbar,
    body.ug .app-topbar {
        display: flex !important;
        flex: 0 0 auto !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 64px !important;
        max-height: none !important;
        margin: 0 !important;
        left: 0 !important;
        right: 0 !important;
        padding: 8px 12px !important;
        gap: 8px !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .app-topbar .topbar-title-block {
        order: 1;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    .app-topbar .title-divider,
    .app-topbar .topbar-sub-title,
    .app-topbar .topbar-title-block .top-home-btn span {
        display: none !important;
    }

    .app-topbar .topbar-main-title {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-topbar .topbar-actions {
        order: 2;
        display: flex !important;
        flex: 1 1 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        gap: 4px !important;
        overflow: hidden;
    }

    .app-topbar .topbar-store span,
    .app-topbar .topbar-user .user-info {
        display: none !important;
    }

    .app-main > .app-content,
    body.ug .app-main > .app-content {
        flex: 1 1 auto !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 12px !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        box-sizing: border-box !important;
    }
}
