﻿:root
{
    --bb-header-color: #e0e0e0;
    /* --bb-header-bg: #702cf8;原来原色 */
    --bb-header-bg: #329930;
}

.layout
{
    --bb-layout-header-background: var(--bb-header-bg);
    --bb-layout-sidebar-banner-background: var(--bb-header-bg);
    --bb-layout-header-color: var(--bb-header-color);
    --bb-layout-title-color: var(--bb-header-color);
    --bb-layout-sidebar-width: 240px;
    --bb-layout-sidebar-collapsed-width: 60px;
}

    .layout:not(.has-footer)
    {
        --bb-layout-footer-height: 0px;
    }

.layout-header
{
    border-bottom: 1px solid var(--bs-border-color);
}

    .layout-header .widget
    {
        margin-right: 2rem;
    }

.layout-banner
{
    border-bottom: 1px solid var(--bs-border-color);
}

    .layout-banner .layout-logo
    {
        border: 1px solid var(--bb-header-color);
    }

.layout-side
{
    border-right: 1px solid var(--bs-border-color);
}
/* 处理菜单文字溢出 */
.menu .nav-link
{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.layout-footer
{
    border-top: 1px solid var(--bs-border-color);
}

.dropdown-logout
{
    --bb-logout-text-color: var(--bb-header-color);
}

.logout-avatar
{
    border-radius: 50%;
}

.dropdown-user img
{
    border-radius: 50%;
}

.layout-drawer
{
    padding: 6px;
    cursor: pointer;
}

.widget
{
    --bb-widget-toggle-color: var(--bb-header-color);
}

    .widget .dropdown-menu
    {
        --bs-dropdown-min-width: 16rem;
    }

    .widget .dropdown-body h3
    {
        color: #666666;
        font-size: 14px;
        margin-bottom: 10px;
    }

    .widget .dropdown-body h4
    {
        color: #444444;
        font-size: 15px;
        margin: 0;
    }

    .widget .dropdown-body small
    {
        color: #999999;
        font-size: 10px;
        position: absolute;
        top: 0;
        right: 0;
    }

    .widget .dropdown-item
    {
        padding: 0.5rem 1rem;
        min-width: 100px;
    }

        .widget .dropdown-item > div:not(.progress):last-child
        {
            width: calc(100% - 40px);
        }

        .widget .dropdown-item.active,
        .widget .dropdown-item:active
        {
            color: inherit;
        }

        .widget .dropdown-item:not(:nth-of-type(odd)):active
        {
            background-color: inherit;
        }

    .widget .progress
    {
        height: 7px;
    }

.table-cell img
{
    width: 46px;
    border-radius: var(--bs-border-radius);
}

.table-cell .progress
{
    height: 6px;
    margin-top: .5rem;
}

.user-demo-address
{
    margin-top: .25rem;
    font-size: 86%;
    color: #c0c4cc;
}

.table-users
{
    height: calc(100% - 93px);
}

.cell-label
{
    line-height: 35px;
}

.menu
{
    --bb-menu-active-color: #702cf8;
    --bb-menu-bar-bg: #702cf8;
    --bb-menu-item-hover-bg: #702cf8;
    --bb-menu-item-hover-color: #fff;
}

@supports not selector(::-webkit-scrollbar)
{
    .scroll
    {
        scrollbar-color: rgba(0,0,0,0.3) rgba(0,0,0,0);
        scrollbar-width: thin;
    }
}

.tree-menu
{
    font-family: Arial, sans-serif;
    line-height: 1.6;
    font-size: 22px;
}

    .tree-menu ul
    {
        list-style-type: none;
        padding-left: 20px;
    }

    .tree-menu li
    {
        position: relative;
        margin-bottom: 15px;
    }

    .tree-menu p
    {
        margin: 0;
        font-weight: bold;
        font-size: 20px;
    }

.toggle-menu
{
    cursor: pointer;
    user-select: none;
}

    .toggle-menu span
    {
        display: inline-block;
        transition: transform 0.3s;
    }

        .toggle-menu span.expanded
        {
            transform: rotate(180deg);
        }

.tree-menu .submenu
{
    display: none;
}

    .tree-menu .submenu.expanded  
    {
        display: block;
    }

.tree-menu a
{
    text-decoration: none;
    color: inherit; /* 使用继承的颜色，通常是黑色 */
}

    .tree-menu a:hover
    {
        text-decoration: underline; /* 鼠标悬停时只添加下划线 */
    }

.custom-toast-container
{
    z-index: 9999;
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

/* ==============================================
   Z-Index 层级管理 - 统一处理Modal和SweetAlert
   ============================================== */

/* 
   Bootstrap 5 官方 z-index 层级：
   - Modal backdrop: 1050
   - Modal: 1055  
   - Popover: 1070
   - Tooltip: 1080
   - Toast: 1090
*/

/*
   修复 BootstrapBlazor 嵌套模态框层级问题
   
   - 默认的 <Modal> (ContactsModal) z-index: 1055
   - 默认的 <Modal> 背景板 z-index: 1050
*/

/* 针对 DialogService 弹出的第三个模态框
   (第1个是 ContactsModal, 第2个是 AddressModal (即使隐藏), 第3个是Table的弹窗)
*/
/* 1. 确保所有模态框的基础 z-index 都是 1055 */
.modal
{
    z-index: var(--bs-modal-zindex, 1055);
}

    /* 2. 专门提高子模态框（即 内部含有 .modal-dialog-table 的那个 .modal）
      使其 z-index (1075) 高于基础模态框 (1055)
*/
    .modal:has(.modal-dialog-table)
    {
        /* 1055 + 20 = 1075 */
        z-index: calc(var(--bs-modal-zindex, 1055) + 20) !important;
    }

/* 3. 专门提高“第二个”背景板的层级 
      (这是当子模态框打开时创建的那个背景板)
*/
.modal-backdrop:nth-of-type(2)
{
    /* z-index (1074) 必须高于父模态框 (1055)，
       但低于子模态框 (1075) 
     */
    z-index: calc(var(--bs-modal-zindex, 1055) + 19) !important;
}
/* SweetAlert2 - 确保始终在最顶层 */
.swal2-container
{
    z-index: 2000 !important;
}

.swal2-backdrop-show
{
    z-index: 1999 !important; 
}
.swal2-popup
{
    z-index: 2001 !important;
}

.swal2-backdrop
{
    z-index: 1999 !important;
}

/* 如果使用了 SweetAlert 的 toast 模式 */
.swal2-toast
{
    z-index: 2002 !important;
}

/* 备用方案：如果calc不工作，使用固定值 */
@supports not (z-index: calc(1055 + 100))
{
    .swal2-container
    {
        z-index: 1200 !important;
    }

    .swal2-backdrop-show
    {
        z-index: 1199 !important;
    }
}
