/**
 * 动环监控系统 - 样式覆盖
 * 尽可能复用 fila 的样式，只在必要时覆盖
 */

/* ==================== 本地字体 ==================== */
@font-face {
    font-family: "HarmonyOS Sans SC";
    src: url("../fonts/HarmonyOS_Sans_SC.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Inter";
    src: url("../fonts/Inter-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "JetBrains Mono";
    src: url("../fonts/JetBrainsMono-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ==================== Bootstrap 变量品牌色覆盖（浅色模式） ==================== */
:root {
    --bs-link-color: var(--color-brand);
    --bs-link-hover-color: var(--color-brand-strong);
    --bs-pagination-active-bg: var(--color-brand);
    --bs-pagination-active-border-color: var(--color-brand);
    --bs-pagination-color: var(--color-brand);
    --bs-pagination-hover-color: var(--color-brand-strong);
    --bs-nav-pills-link-active-bg: var(--color-brand);
    --bs-nav-link-color: var(--color-brand);
    --bs-nav-link-hover-color: var(--color-brand-strong);
    --bs-list-group-active-bg: var(--color-brand);
    --bs-list-group-active-border-color: var(--color-brand);
    --bs-list-group-action-active-bg: var(--color-brand-soft);
    --bs-dropdown-link-active-bg: var(--color-brand);
    --bs-dropdown-link-hover-bg: var(--color-brand-soft);
    --bs-progress-bar-bg: var(--color-brand);
    --bs-focus-ring-color: var(--color-focus-ring);
    --bs-form-check-input-checked-bg-color: var(--color-brand);
    --bs-form-check-input-checked-border-color: var(--color-brand);
    --bs-form-check-input-focus-border: var(--color-brand-light);
    --bs-accordion-btn-active-icon-color: var(--color-brand);
    --bs-accordion-active-bg: var(--color-brand-soft);
    --bs-accordion-btn-focus-border-color: var(--color-brand-light);
}

/* ==================== 中文字体设置 ==================== */
body {
    font-family: var(--p-font-sans);
}

html {
    font-size: 16px;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.form-control, .form-select, .btn {
    font-family: var(--p-font-sans);
}

code,
pre,
.font-mono {
    font-family: var(--p-font-mono);
}

/* Logo 文字位置修复 - 保持与原模板一致 */
.logo-text {
    position: absolute;
    top: 50%;
    left: 49px;
    transform: translateY(-50%);
    font-size: 24px;
    white-space: nowrap;
}

.dashboard-stat-icon {
    width: 4.6875rem;
    height: 4.6875rem;
    line-height: 6.5625rem;
}

.dashboard-chart {
    min-height: 16rem;
}

.dashboard-chart-trend {
    margin-top: 1.25rem;
    margin-bottom: -1rem;
}

.dashboard-chart-status {
    min-height: 14rem;
}

/* ==================== 按钮系统 ==================== */
/*
 * 按钮规范：
 *   - 不再使用全局 margin；间距由父级 flex gap 控制
 *   - 圆角统一使用 design-tokens 的 --radius-sm
 *   - 所有状态色走 --color-* semantic token，便于全局换肤
 */

/* 基础按钮样式 */
.btn {
    font-weight: var(--p-fw-medium);
    letter-spacing: 0.025em;
    transition: transform var(--motion-fast), box-shadow var(--motion-base), background-color var(--motion-base), border-color var(--motion-base);
    border-radius: var(--radius-lg);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* 按压反馈：点下去有 1px 沉确认感 */
.btn:active:not(:disabled) { transform: translateY(1px); }

/* 小按钮与 sm 输入框等高（34px 控件体系） */
.btn-sm {
    min-height: 34px;
}

/* 按钮组优化 */
.btn-group .btn {
    margin: 0;
}

.card-header .d-flex,
.card-body .d-flex,
.dash-panel-head .d-flex {
    gap: var(--p-space-2);
}

.card-header .d-flex > *,
.card-body .d-flex > *,
.dash-panel-head .d-flex > * {
    margin: 0;
}

/* 小号按钮 */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

/* 大号按钮 */
.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--radius-sm);
}

/* 主按钮 - Primary */
.btn-primary {
    background-color: var(--c-brand);
    border-color: var(--c-brand);
    color: #ffffff;
    box-shadow: 0 1px 2px color-mix(in srgb, var(--c-brand) 18%, transparent);
}

.btn-primary:hover {
    background-color: var(--c-brand-light);
    border-color: var(--c-brand-light);
    color: #ffffff;
    box-shadow: 0 2px 4px color-mix(in srgb, var(--c-brand) 26%, transparent);
}

.btn-primary:active,
.btn-primary:focus {
    background-color: var(--c-brand-dark);
    border-color: var(--c-brand-dark);
    color: #ffffff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-brand) 28%, transparent);
}

.btn-primary:disabled {
    background-color: var(--p-brand-300);
    border-color: var(--p-brand-300);
    color: #ffffff;
}

/* 成功按钮 - Success */
.btn-success {
    background-color: var(--c-success);
    border-color: var(--c-success);
    color: #ffffff;
    box-shadow: 0 1px 2px color-mix(in srgb, var(--c-success) 18%, transparent);
}

.btn-success:hover {
    background-color: var(--p-success-800);
    border-color: var(--p-success-800);
    color: #ffffff;
    box-shadow: 0 2px 4px color-mix(in srgb, var(--c-success) 26%, transparent);
}

.btn-success:active,
.btn-success:focus {
    background-color: var(--p-success-800);
    border-color: var(--p-success-800);
    color: #ffffff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-success) 28%, transparent);
}

/* 警告按钮 - Warning */
.btn-warning {
    background-color: var(--c-warning);
    border-color: var(--c-warning);
    color: #ffffff;
    box-shadow: 0 1px 2px color-mix(in srgb, var(--c-warning) 18%, transparent);
}

.btn-warning:hover {
    background-color: var(--p-warning-800);
    border-color: var(--p-warning-800);
    color: #ffffff;
    box-shadow: 0 2px 4px color-mix(in srgb, var(--c-warning) 26%, transparent);
}

.btn-warning:active,
.btn-warning:focus {
    background-color: var(--p-warning-800);
    border-color: var(--p-warning-800);
    color: #ffffff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-warning) 28%, transparent);
}

/* 危险按钮 - Danger */
.btn-danger {
    background-color: var(--c-danger);
    border-color: var(--c-danger);
    color: #ffffff;
    box-shadow: 0 1px 2px color-mix(in srgb, var(--c-danger) 18%, transparent);
}

.btn-danger:hover {
    background-color: var(--p-danger-800);
    border-color: var(--p-danger-800);
    color: #ffffff;
    box-shadow: 0 2px 4px color-mix(in srgb, var(--c-danger) 26%, transparent);
}

.btn-danger:active,
.btn-danger:focus {
    background-color: var(--p-danger-800);
    border-color: var(--p-danger-800);
    color: #ffffff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-danger) 28%, transparent);
}

/* 信息按钮 - Info */
.btn-info {
    background-color: var(--c-info);
    border-color: var(--c-info);
    color: #ffffff;
    box-shadow: 0 1px 2px color-mix(in srgb, var(--c-info) 18%, transparent);
}

.btn-info:hover {
    background-color: var(--p-brand-700);
    border-color: var(--p-brand-700);
    color: #ffffff;
    box-shadow: 0 2px 4px color-mix(in srgb, var(--c-info) 26%, transparent);
}

.btn-info:active,
.btn-info:focus {
    background-color: var(--p-brand-800);
    border-color: var(--p-brand-800);
    color: #ffffff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-info) 28%, transparent);
}

/* 次要按钮 - Secondary */
.btn-secondary {
    background-color: var(--p-slate-500);
    border-color: var(--p-slate-500);
    color: #ffffff;
    box-shadow: 0 1px 2px color-mix(in srgb, var(--p-slate-500) 18%, transparent);
}

.btn-secondary:hover {
    background-color: var(--p-slate-600);
    border-color: var(--p-slate-600);
    color: #ffffff;
    box-shadow: 0 2px 4px color-mix(in srgb, var(--p-slate-500) 26%, transparent);
}

.btn-secondary:active,
.btn-secondary:focus {
    background-color: var(--p-slate-700);
    border-color: var(--p-slate-700);
    color: #ffffff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--p-slate-500) 28%, transparent);
}

.right-header-content .header-right-item .notifications.dropdown .btn-secondary .material-symbols-outlined {
    color: var(--p-slate-600) !important;
}
.right-header-content .header-right-item .notifications.dropdown .dropdown-menu,
.right-header-content .header-right-item .notifications.noti.dropdown .dropdown-menu {
    z-index: 3000 !important;
}

/* ==================== Console 筛选器统一布局 ==================== */
.console-filter-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.console-filter-item {
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.console-filter-item-sm {
    width: 140px;
}

.console-filter-item-lg {
    min-width: 220px;
    flex: 1;
}

.console-filter-actions {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.console-filter-row .form-control,
.console-filter-row .form-select,
.console-filter-row .choices {
    min-height: 34px;
}

.console-filter-row .choices__inner {
    min-height: 34px;
    height: 34px;
}

.console-filter-item .choices {
    width: 100%;
    min-width: 0;
}

@media (max-width: 576px) {
    .console-filter-row {
        width: 100%;
    }

    .console-filter-item,
    .console-filter-item-sm,
    .console-filter-item-lg {
        width: 100%;
        min-width: 0;
        flex: 0 0 100%;
    }

    .console-filter-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* 轮廓按钮 - Outline Primary */
.btn-outline-primary {
    background-color: transparent;
    border-color: var(--c-brand);
    color: var(--c-brand);
}

.btn-outline-primary:hover {
    background-color: var(--c-brand);
    border-color: var(--c-brand);
    color: #ffffff;
}

.btn-outline-primary:active,
.btn-outline-primary:focus {
    background-color: var(--c-brand-light);
    border-color: var(--c-brand-light);
    color: #ffffff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-brand) 28%, transparent);
}

.btn-outline-primary.active {
    background-color: var(--c-brand);
    border-color: var(--c-brand);
    color: #ffffff;
}

/* 轮廓按钮 - Outline Success */
.btn-outline-success {
    background-color: transparent;
    border-color: var(--c-success);
    color: var(--c-success);
}

.btn-outline-success:hover {
    background-color: var(--c-success);
    border-color: var(--c-success);
    color: #ffffff;
}

.btn-outline-success:active,
.btn-outline-success:focus {
    background-color: var(--p-success-600);
    border-color: var(--p-success-600);
    color: #ffffff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-success) 25%, transparent);
}

/* 轮廓按钮 - Outline Warning */
.btn-outline-warning {
    background-color: transparent;
    border-color: var(--c-warning);
    color: var(--c-warning);
}

.btn-outline-warning:hover {
    background-color: var(--c-warning);
    border-color: var(--c-warning);
    color: #ffffff;
}

.btn-outline-warning:active,
.btn-outline-warning:focus {
    background-color: var(--p-warning-600);
    border-color: var(--p-warning-600);
    color: #ffffff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-warning) 25%, transparent);
}

/* 轮廓按钮 - Outline Danger */
.btn-outline-danger {
    background-color: transparent;
    border-color: var(--c-danger);
    color: var(--c-danger);
}

.btn-outline-danger:hover {
    background-color: var(--c-danger);
    border-color: var(--c-danger);
    color: #ffffff;
}

.btn-outline-danger:active,
.btn-outline-danger:focus {
    background-color: var(--p-danger-600);
    border-color: var(--p-danger-600);
    color: #ffffff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-danger) 25%, transparent);
}

/* 轮廓按钮 - Outline Info */
.btn-outline-info {
    background-color: transparent;
    border-color: var(--c-info);
    color: var(--c-info);
}

.btn-outline-info:hover {
    background-color: var(--c-info);
    border-color: var(--c-info);
    color: #ffffff;
}

.btn-outline-info:active,
.btn-outline-info:focus {
    background-color: var(--p-info-700);
    border-color: var(--p-info-700);
    color: #ffffff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-info) 25%, transparent);
}

/* 轮廓按钮 - Outline Secondary */
.btn-outline-secondary {
    background-color: transparent;
    border-color: var(--p-slate-400);
    color: var(--p-slate-500);
}

.btn-outline-secondary:hover {
    background-color: var(--color-surface-hover);
    border-color: var(--c-brand);
    color: var(--color-text-strong);
}

.btn-outline-secondary:active,
.btn-outline-secondary:focus {
    background-color: var(--color-surface-alt);
    border-color: var(--c-brand);
    color: var(--color-text-strong);
    box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.btn-outline-secondary.active {
    background-color: var(--c-brand);
    border-color: var(--c-brand);
    color: #ffffff;
}

/* ==================== 表单统一规范 ==================== */
.monitor-form .label,
.monitor-form label.label {
    font-size: var(--p-fs-md);
    margin-bottom: 6px;
    color: var(--p-slate-700);
    font-weight: 600;
}

.monitor-form .form-floating,
.monitor-form .form-control,
.monitor-form .form-select {
    margin-bottom: 0;
}

.monitor-form .form-floating > .form-control,
.monitor-form .form-floating > .form-select,
.monitor-form .form-control,
.monitor-form .form-select {
    min-height: 48px;
    height: 48px;
    border-radius: 8px;
    border-color: var(--p-slate-300);
}

.monitor-form .form-floating > label {
    padding: 0.8rem 0.9rem;
    color: var(--p-slate-500);
    font-size: var(--p-fs-md);
}

.monitor-form .form-control:focus,
.monitor-form .form-select:focus {
    border-color: var(--c-brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-brand) 16%, transparent);
}

.monitor-form .mb-20 {
    margin-bottom: 16px !important;
}

.monitor-form .text-danger {
    font-weight: 700;
}

.monitor-form-inline {
    width: 150px;
}

.monitor-form-inline-sm {
    width: 120px;
}

.monitor-select-multiple {
    min-height: 152px !important;
    height: 152px !important;
    padding-top: 12px;
}

.monitor-form .form-check-input {
    width: 18px;
    height: 18px;
}

.monitor-form .form-check-label {
    color: var(--p-slate-700);
}

@media (max-width: 992px) {
    .monitor-form-inline,
    .monitor-form-inline-sm {
        width: 100%;
    }
}

/* 链接按钮 */
.btn-link {
    color: var(--c-brand);
    text-decoration: none;
}

.btn-link:hover {
    color: var(--c-brand-light);
    text-decoration: none;
}

/* 图标按钮 */
.btn .material-symbols-outlined {
    font-size: var(--p-fs-lg);
    vertical-align: middle;
    margin-right: 4px;
    margin-top: -2px;
}

.btn-sm .material-symbols-outlined {
    font-size: 16px;
    margin-right: 3px;
}

.btn:not(.btn-outline-primary):not(.btn-outline-secondary):not(.btn-outline-success):not(.btn-outline-warning):not(.btn-outline-danger):not(.btn-outline-info) .material-symbols-outlined {
    color: inherit;
}
/* ECharts tooltip — 主题适配 */
.echarts-tooltip {
    background: rgba(255,255,255,0.97) !important;
    border: 1px solid rgba(59, 130, 246,0.3) !important;
    color: #1e293b !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    border-radius: 6px !important;
}
/* ==================== 滚动条样式 ==================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.25); }
@media only screen and (max-width: 991px) {
    .dashboard-stat-icon {
        width: 3.875rem;
        height: 3.875rem;
        line-height: 5.375rem;
    }

    .dashboard-stat-icon .material-symbols-outlined.fs-40 {
        font-size: 1.8rem !important;
    }

    .dashboard-chart {
        min-height: 13rem;
    }

    .right-header-content .header-right-item {
        margin-right: 0.85rem !important;
    }

    .right-header-content .header-right-item:last-child {
        margin-right: 0 !important;
    }
}

@media only screen and (max-width: 767px) {
    html {
        font-size: 15px;
    }

    .dashboard-stat-icon {
        width: 3.5rem;
        height: 3.5rem;
        line-height: 4.75rem;
    }

    .main-content-container .card h2.fs-26 {
        font-size: 1.35rem !important;
    }

    .main-content-container .card h3 {
        font-size: 1rem !important;
    }

    .default-table-area .table th,
    .default-table-area .table td {
        padding-top: 0.55rem;
        padding-bottom: 0.55rem;
        font-size: 0.8125rem;
    }

    .right-header-content {
        width: 100%;
    }

    .right-header-content > ul {
        flex-wrap: wrap;
        row-gap: 0.5rem;
        justify-content: flex-end !important;
    }

    .right-header-content .header-right-item .badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.45rem;
    }

    .dashboard-chart {
        min-height: 11.5rem;
    }
}
/* ==================== Badge徽章样式 ==================== */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

.badge.bg-success {
    background-color: var(--c-success) !important;
    color: #ffffff;
}

.badge.bg-warning {
    background-color: var(--c-warning) !important;
    color: #ffffff;
}

.badge.bg-danger {
    background-color: var(--c-danger) !important;
    color: #ffffff;
}

.badge.bg-info {
    background-color: var(--c-info) !important;
    color: #ffffff;
}

.badge.bg-primary {
    background-color: var(--c-brand) !important;
    color: #ffffff;
}

.badge.bg-secondary {
    background-color: var(--p-slate-500) !important;
    color: #ffffff;
}

/* 浅色背景徽章 */
.badge.bg-success.bg-opacity-10 {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: var(--c-success) !important;
}

.badge.bg-warning.bg-opacity-10 {
    background-color: rgba(245, 158, 11, 0.1) !important;
    color: var(--c-warning) !important;
}

.badge.bg-danger.bg-opacity-10 {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: var(--c-danger) !important;
}

.badge.bg-info.bg-opacity-10 {
    background-color: rgba(6, 182, 212, 0.1) !important;
    color: var(--c-info) !important;
}

.badge.bg-primary.bg-opacity-10 {
    background-color: color-mix(in srgb, var(--color-brand-strong) 0.1, transparent) !important;
    color: var(--c-brand) !important;
}

.badge.bg-secondary.bg-opacity-10 {
    background-color: rgba(100, 116, 139, 0.1) !important;
    color: var(--p-slate-500) !important;
}
/* ==================== 统计卡片样式 ==================== */
.card.bg-primary {
    background-color: var(--c-brand) !important;
    border: none;
}

.card.bg-success {
    background-color: var(--c-success) !important;
    border: none;
}

.card.bg-warning {
    background-color: var(--c-warning) !important;
    border: none;
}

.card.bg-danger {
    background-color: var(--c-danger) !important;
    border: none;
}

.card.bg-info {
    background-color: var(--c-info) !important;
    border: none;
}

.card.bg-primary .card-body,
.card.bg-success .card-body,
.card.bg-warning .card-body,
.card.bg-danger .card-body,
.card.bg-info .card-body {
    color: #ffffff;
}

.card.bg-primary small,
.card.bg-success small,
.card.bg-warning small,
.card.bg-danger small,
.card.bg-info small {
    color: rgba(255, 255, 255, 0.8);
}

.card.bg-warning .card-body {
    color: #ffffff;
}
/* ==================== 分页样式 ==================== */
.d-flex[id$="Pagination"] {
    align-items: center;
    gap: 0.5rem;
}

.pagination .page-link {
    color: var(--c-brand);
    border-color: var(--p-slate-200);
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.pagination .page-link:hover {
    background-color: var(--p-slate-100);
    border-color: var(--p-slate-200);
    color: var(--c-brand-light);
}

.pagination .page-item.active .page-link {
    background-color: var(--c-brand);
    border-color: var(--c-brand);
    color: #ffffff;
}

.pagination .page-item.disabled .page-link {
    color: var(--p-slate-400);
    background-color: var(--p-slate-50);
}
/* ==================== 进度条样式 ==================== */
.progress {
    background-color: var(--p-slate-200);
    border-radius: 4px;
}

.progress-bar {
    border-radius: 4px;
}

.progress-bar.bg-success {
    background-color: var(--c-success) !important;
}

.progress-bar.bg-warning {
    background-color: var(--c-warning) !important;
}

.progress-bar.bg-danger {
    background-color: var(--c-danger) !important;
}
/* ==================== 表单开关样式 ==================== */
.form-check-input {
    width: 2.5rem;
    height: 1.25rem;
    border-radius: 1rem;
}

.form-check-input:checked {
    background-color: var(--c-brand);
    border-color: var(--c-brand);
}

.form-check-input:focus {
    border-color: var(--c-brand);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--c-brand) 28%, transparent);
}
/* ==================== 告警卡片动画 ==================== */
@keyframes alertPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.alert-card.critical {
    animation: alertPulse 2s ease-in-out infinite;
}

/* ==================== 模态框样式 ==================== */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    border-bottom-color: var(--p-slate-200);
    padding: 1rem 1.5rem;
}

.modal-footer {
    border-top-color: var(--p-slate-200);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.625rem;
}

.modal-footer .btn {
    min-width: 88px;
}
/* ==================== 工具提示样式 ==================== */
.tooltip-inner {
    background-color: var(--p-slate-900);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}
/* ==================== 空状态样式 ==================== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--p-slate-500);
}

.empty-state .material-symbols-outlined {
    font-size: 64px;
    color: var(--p-slate-400);
    margin-bottom: 1rem;
}
/* ==================== 复选框和单选框行内布局 ==================== */
.checkbox-inline,
.radio-inline {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 0;
    vertical-align: middle;
}

/* ==================== 开关切换组件 ==================== */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    vertical-align: middle;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--p-slate-300);
    transition: .4s;
    border-radius: 24px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .switch-slider {
    background-color: var(--c-brand);
}

input:focus + .switch-slider {
    box-shadow: 0 0 1px var(--c-brand);
}

input:checked + .switch-slider:before {
    transform: translateX(26px);
}

/* 开关标签 */
.switch-label {
    margin-left: 8px;
    cursor: pointer;
    vertical-align: middle;
}
/* ==================== 表单布局统一 ==================== */
.form-check {
    margin-bottom: 0.5rem;
}

/* ==================== Console UI 一致性基线 ==================== */
:root {
    --monitor-control-height: 42px;
    --monitor-control-height-sm: 34px;
    --monitor-control-radius: 8px;
}

/* Content area — reserve space for card shadows */
.main-content-container {
    padding-bottom: 60px;
}

/* Prevent the padding-bottom from applying to buttons (selector grouping bug) */
.card-header .btn,
.card-body .btn {
    padding-bottom: var(--bs-btn-padding-y, 0.375rem);
}

.modal .btn,
.monitor-form .btn,
.main-content-container .btn {
    margin: 0;
}

/* 统一 header/body 内联容器行为，避免 gap+margin 双重叠加 */
.card-header .d-flex,
.card-body .d-flex,
.modal .d-flex {
    align-items: center;
    flex-wrap: wrap;
    column-gap: 0.5rem;
    row-gap: 0.5rem;
}

.card-header .d-flex > *,
.card-body .d-flex > *,
.modal .d-flex > * {
    margin: 0 !important;
}

/* 控件高度统一 */
.main-content-container .form-control,
.main-content-container .form-select,
.main-content-container .btn,
.main-content-container .input-group-text {
    border-radius: var(--monitor-control-radius);
}

.main-content-container .form-control,
.main-content-container .form-select {
    min-height: var(--monitor-control-height);
    height: var(--monitor-control-height);
    line-height: 1.2;
    margin-bottom: 0;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.main-content-container textarea.form-control {
    min-height: 96px;
    height: auto;
}

.main-content-container .btn {
    min-height: var(--monitor-control-height);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.main-content-container .btn-sm,
.main-content-container .form-control-sm,
.main-content-container .form-select-sm,
.main-content-container .input-group-sm > .form-control,
.main-content-container .input-group-sm > .form-select,
.main-content-container .input-group-sm > .input-group-text,
.main-content-container .input-group-sm > .btn {
    min-height: var(--monitor-control-height-sm);
    height: var(--monitor-control-height-sm);
    line-height: 1.2;
}

/* 表单栅格下行距 */
.main-content-container .row.g-2,
.main-content-container .row.g-3,
.main-content-container .row.g-4 {
    --bs-gutter-y: 0.75rem;
}

/* 输入区域内按钮防止被压缩 */
.main-content-container .d-grid > .btn,
.main-content-container .btn {
    white-space: nowrap;
}

/* Select2 与原生控件高度对齐 */
.select2-container--default .select2-selection--single {
    height: var(--monitor-control-height) !important;
    line-height: calc(var(--monitor-control-height) - 2px) !important;
    border-radius: var(--monitor-control-radius);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: calc(var(--monitor-control-height) - 2px) !important;
    padding-left: 0.75rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: var(--monitor-control-height) !important;
}
/* 移动端收敛：小屏按钮和输入铺满避免拥挤 */
@media (max-width: 768px) {
    .main-content-container .card-header .btn,
    .main-content-container .card-header .form-control,
    .main-content-container .card-header .form-select {
        width: 100%;
    }

    .main-content-container .card-header .d-flex > .btn,
    .main-content-container .card-header .d-flex > .form-control,
    .main-content-container .card-header .d-flex > .form-select {
        flex: 1 1 100%;
        min-width: 0;
    }
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

.form-group {
    margin-bottom: 1rem;
}

/* 复选框/单选框垂直居中 */
input[type="checkbox"],
input[type="radio"] {
    vertical-align: middle;
}

/* 选择框统一高度(与 console-forms.css 的 38px 保持一致) */
.form-select {
    height: 38px;
}

/* 全站输入控件高度对齐（select/input） */
.main-content-container .form-control,
.main-content-container .form-select {
    height: 38px;
    min-height: 38px;
    line-height: 1.5;
    padding-top: 0.375rem !important;
    padding-bottom: 0.375rem !important;
}

.main-content-container .form-control-sm,
.main-content-container .form-select-sm,
.main-content-container .input-group-sm > .form-control,
.main-content-container .input-group-sm > .form-select {
    height: calc(1.8125rem + 2px) !important;
    min-height: calc(1.8125rem + 2px) !important;
    line-height: 1.5 !important;
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
}

.main-content-container textarea.form-control,
.main-content-container textarea.form-control-sm {
    height: auto !important;
    min-height: 96px !important;
}
/* Tenant Switch Dropdown */
.tenant-switch-dropdown .dropdown-menu {
    border: 1px solid var(--p-slate-200);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tenant-switch-dropdown .dropdown-item {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: var(--p-fs-md);
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.tenant-switch-dropdown .dropdown-item:hover {
    background-color: var(--p-slate-100);
}

.tenant-switch-dropdown .dropdown-item.active {
    background-color: var(--color-brand-soft);
    color: var(--c-brand-light);
}

html.dark .tenant-switch-dropdown .dropdown-menu {
    background: var(--color-surface);
    border-color: var(--color-border-default);
}

html.dark .tenant-switch-dropdown .dropdown-item:hover {
    background-color: var(--color-surface-hover);
}

html.dark .tenant-switch-dropdown .dropdown-item.active {
    background-color: color-mix(in srgb, var(--color-brand) 18%, var(--color-surface));
}

/* Toast Notification */
.monitor-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.monitor-toast {
    min-width: 280px;
    max-width: 400px;
    padding: 14px 20px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.3s ease;
    font-size: var(--p-fs-md);
}

.monitor-toast.toast-success {
    background: var(--c-success);
    color: #fff;
}

.monitor-toast.toast-error {
    background: var(--c-danger);
    color: #fff;
}

.monitor-toast.toast-warning {
    background: var(--c-warning);
    color: #fff;
}

.monitor-toast.toast-info {
    background: var(--c-brand);
    color: #fff;
}

.monitor-toast .toast-icon {
    font-size: var(--p-fs-xl);
    line-height: 1;
}

.monitor-toast .toast-message {
    flex: 1;
    font-weight: 500;
}

.monitor-toast .toast-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: inherit;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s;
}

.monitor-toast .toast-close:hover {
    background: rgba(255,255,255,0.3);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* Preloader - Clean Modern Style */
/* ==================== Preloader ==================== */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--color-surface) !important;
    overflow: hidden;
}

#preloader .preloader {
    transform: translate(-50%, -50%);
    position: absolute;
    left: 50%;
    top: 50%;
    background: none !important;
}
#preloader .preloader .loader,
#preloader .preloader .loader div {
    border-top-color: var(--c-brand) !important;
    border-bottom-color: var(--c-brand) !important;
    border-left-color: transparent !important;
    border-right-color: transparent !important;
}
#preloader .preloader .waviy span {
    color: var(--color-text-muted);
    font-size: 20px;
    font-weight: 600;
    display: inline-block;
    letter-spacing: 2px;
}

.preloader {
    background: none !important;
}

#preloader .preloader .waviy span:nth-child(1) { animation: waviy 1.2s ease-in-out infinite 0s; }
#preloader .preloader .waviy span:nth-child(2) { animation: waviy 1.2s ease-in-out infinite 0.08s; }
#preloader .preloader .waviy span:nth-child(3) { animation: waviy 1.2s ease-in-out infinite 0.16s; }
#preloader .preloader .waviy span:nth-child(4) { animation: waviy 1.2s ease-in-out infinite 0.24s; }
#preloader .preloader .waviy span:nth-child(5) { animation: waviy 1.2s ease-in-out infinite 0.32s; }
#preloader .preloader .waviy span:nth-child(6) { animation: waviy 1.2s ease-in-out infinite 0.40s; }
#preloader .preloader .waviy span:nth-child(7) { animation: waviy 1.2s ease-in-out infinite 0.48s; }

@keyframes waviy {
    0%, 45%, 100% { transform: translateY(0); opacity: 1; }
    22% { transform: translateY(-8px); opacity: 0.7; }
}

/* Preloader with logo */
.preloader-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.preloader-logo img {
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Confirm Dialog */
.monitor-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.monitor-confirm-overlay.show {
    opacity: 1;
}

.monitor-confirm-dialog {
    background: var(--c-surface);
    border-radius: var(--r-lg);
    padding: 24px;
    min-width: 320px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.monitor-confirm-overlay.show .monitor-confirm-dialog {
    transform: scale(1);
}

.monitor-confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.monitor-confirm-icon .material-symbols-outlined {
    font-size: 32px;
}

.monitor-confirm-icon.confirm-icon-warning {
    background: var(--color-warning-soft);
    color: var(--c-warning);
}

.monitor-confirm-icon.confirm-icon-danger {
    background: var(--color-danger-soft);
    color: var(--c-danger);
}

.monitor-confirm-icon.confirm-icon-info {
    background: var(--color-brand-soft);
    color: var(--c-brand);
}

.monitor-confirm-icon.confirm-icon-success {
    background: var(--color-success-soft);
    color: var(--c-success);
}

.monitor-confirm-title {
    font-size: var(--p-fs-lg);
    font-weight: 600;
    color: var(--color-text-strong);
    margin-bottom: 8px;
}

.monitor-confirm-message {
    font-size: var(--p-fs-md);
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
    white-space: pre-line;
}

.monitor-confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.monitor-confirm-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: var(--p-fs-md);
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    min-width: 80px;
}

.monitor-confirm-btn.monitor-confirm-cancel {
    background: var(--p-slate-100);
    color: var(--p-slate-500);
}

.monitor-confirm-btn.monitor-confirm-cancel:hover {
    background: var(--p-slate-200);
}

.monitor-confirm-btn.monitor-confirm-ok.btn-primary {
    background: var(--c-brand);
    color: #fff;
}

.monitor-confirm-btn.monitor-confirm-ok.btn-primary:hover {
    background: var(--c-brand-dark);
}

.monitor-confirm-btn.monitor-confirm-ok.btn-danger {
    background: var(--c-danger);
    color: #fff;
}

.monitor-confirm-btn.monitor-confirm-ok.btn-danger:hover {
    background: var(--p-danger-700);
}
/* ================================================================
   CONSOLE DESIGN SYSTEM
   Unified tokens + component styles for the entire console UI.
   Overrides legacy style.css where needed.
   ================================================================ */

/* ---- Design Tokens ----
 * 与 design-tokens.css 保持一致：工业蓝/青色系
 * --c-brand 系列是全局 chrome（侧边栏/顶栏/菜单激活态）使用
 */
:root {
    /* Brand — 与 design-tokens --color-brand 同源 */
    --c-brand: var(--color-brand);
    --c-brand-light: var(--color-brand-light);
    --c-brand-dark: var(--color-brand-strong);
    /* 侧栏底色：极淡品牌染色，导航区与内容白卡拉开层次 */
    --sidebar-bg: color-mix(in srgb, var(--color-surface) 96%, var(--color-brand));
    --c-cyan: var(--color-accent);

    /* Surfaces */
    --c-surface: var(--color-surface);
    --c-surface-alt: var(--color-surface-alt);
    --c-surface-hover: var(--color-surface-hover);
    --c-bg: var(--color-surface-alt);

    /* Text */
    --c-text: var(--color-text-default);
    --c-text-secondary: var(--color-text-muted);
    --c-text-muted: var(--color-text-muted);
    --c-text-faint: var(--color-text-faint);

    /* Borders */
    --c-border: var(--color-border-default);
    --c-border-light: var(--color-border-subtle);
    --c-border-focus: var(--color-focus-ring);

    /* Status */
    --c-success: var(--color-success);
    --c-success-bg: var(--color-success-soft);
    --c-warning: var(--color-warning);
    --c-warning-bg: var(--color-warning-soft);
    --c-danger: var(--color-danger);
    --c-danger-bg: var(--color-danger-soft);
    --c-info: var(--color-info);
    --c-info-bg: var(--color-info-soft);

    /* Geometry — 统一指向 design-tokens 圆角体系（旧 --r-* 保留为别名） */
    --r-sm: var(--radius-lg);
    --r-md: var(--radius-lg);
    --r-lg: var(--radius-2xl);
    --r-pill: var(--radius-pill);

    /* Shadows — 统一指向 design-tokens 阴影体系 */
    --sh-xs: var(--shadow-xs);
    --sh-sm: var(--shadow-sm);
    --sh-md: var(--shadow-md);
    --sh-lg: var(--shadow-xl);

    /* Motion */
    --t-fast: var(--motion-fast);
    --t-normal: var(--motion-base);
    --t-slow: var(--motion-slow);

    /* Layout */
    --sidebar-w: 220px;
    --sidebar-w-collapsed: 56px;
    --header-h: 52px;
    --footer-h: 50px;
}
/* ---- Legacy style.css overrides ----
 * Sidebar / Header chrome
 * 设计方向：克制的高级感，不喧宾夺主（chrome 是容器，不是主角）
 */
.sidebar-area {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: var(--sidebar-w) !important;
    height: 100vh !important; /* 兜底：旧浏览器 */
    height: 100dvh !important; /* 动态视口：移动端避免底部被浏览器工具栏截断 */
    overflow: hidden !important;
    background: var(--c-surface) !important;
    border-right: 1px solid var(--c-border) !important;
    box-shadow: 2px 0 24px color-mix(in srgb, var(--color-brand-strong) .04, transparent) !important;
    display: flex !important;
    flex-direction: column !important;
    z-index: 1032;
}

.sidebar-area > * { position: relative; z-index: 1; }

.sidebar-area .logo {
    display: none !important;
}


/* 折叠态导航浮出标签（替代原生 title：慢且不可控） */
.nav-tip {
    position: fixed;
    z-index: 2000;
    transform: translateY(-50%);
    padding: 5px 10px;
    border-radius: var(--r-sm);
    background: var(--c-text-strong, var(--color-text-strong));
    color: var(--c-surface, var(--color-surface));
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
    animation: navTipIn 0.12s ease;
}
@keyframes navTipIn {
    from { opacity: 0; transform: translateY(-50%) translateX(-4px); }
    to { opacity: 1; transform: translateY(-50%) translateX(0); }
}

/* ==================== 桌面端侧栏折叠（56px 图标轨道） ====================
   custom.js 的 toggleSidebar 会切 body[sidebar-data-theme]，
   此前全站没有对应规则，折叠按钮形同虚设。 */
body[sidebar-data-theme="sidebar-hide"] .sidebar-area {
    width: var(--sidebar-w-collapsed) !important;
}
body[sidebar-data-theme="sidebar-hide"] .main-content {
    padding-left: calc(var(--sidebar-w-collapsed) + 12px) !important;
}
/* 文字类一律隐藏，只留图标 */
body[sidebar-data-theme="sidebar-hide"] .logo-text,
body[sidebar-data-theme="sidebar-hide"] .sidebar-profile-info,
body[sidebar-data-theme="sidebar-hide"] .sidebar-profile-menu-btn,
body[sidebar-data-theme="sidebar-hide"] .menu-link .title,
body[sidebar-data-theme="sidebar-hide"] .sidebar-section-title,
body[sidebar-data-theme="sidebar-hide"] .menu-toggle::after {
    display: none !important;
}
body[sidebar-data-theme="sidebar-hide"] .sidebar-logo-area {
    justify-content: center;
    padding: 14px 0;
    /* .sidebar-area > * 默认 z-index:1，菜单在后绘制会盖住 absolute 的展开按钮；
       折叠态把 logo 区（按钮的宿主）提到菜单之上 */
    z-index: 6;
}
/* 折叠态保留品牌标记（仅图标），文字已在通用规则隐藏 */
body[sidebar-data-theme="sidebar-hide"] .sidebar-logo-link { display: flex !important; }
body[sidebar-data-theme="sidebar-hide"] .sidebar-logo-link .logo-text { display: none !important; }
body[sidebar-data-theme="sidebar-hide"] .sidebar-logo-area .sidebar-collapse-btn { display: none !important; }
/* 展开按钮移到底部资料行上方：顶部只留品牌标记，操作收在底层 */
body[sidebar-data-theme="sidebar-hide"] .sidebar-expand-btn {
    display: flex !important;
    position: fixed;
    left: 8px; /* (56 - 40) / 2，轨道水平居中 */
    bottom: calc(12px + 50px + 10px); /* profile margin-bottom + 行高 + 间距 */
    z-index: 5;
}
body[sidebar-data-theme="sidebar-hide"] .sidebar-profile {
    justify-content: center;
    gap: 0;
    margin: 0 8px 12px;
    padding: 8px 0;
}
body[sidebar-data-theme="sidebar-hide"] .layout-menu { padding: 8px 6px 20px !important; }
body[sidebar-data-theme="sidebar-hide"] .menu-vertical .menu-item .menu-link {
    justify-content: center;
    padding: 10px 0 !important;
    margin: 0 2px;
    gap: 0;
    border-radius: var(--r-md);
}
/* 折叠态子菜单：fixed 浮层挂在轨道右侧（top 由 JS 对齐触发项） */
body[sidebar-data-theme="sidebar-hide"] .layout-menu .menu-item > .menu-sub {
    position: fixed;
    left: calc(var(--sidebar-w-collapsed) + 6px);
    min-width: 190px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    box-shadow: var(--sh-lg);
    padding: 4px;
    z-index: 1050;
}
body[sidebar-data-theme="sidebar-hide"] .layout-menu .menu-item > .menu-sub .menu-link {
    justify-content: flex-start;
    padding: 9px 12px !important;
    gap: 8px;
}

/* Override main-content padding to match our sidebar width */
.main-content {
    padding-left: calc(var(--sidebar-w) + 12px) !important;
    padding-right: 12px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
@media (max-width: 1199.98px) {
    .main-content {
        padding-left: 12px !important;
    }
}

.layout-menu {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    padding: 8px 12px 20px !important;
    /* 原生滚动（不再用 SimpleBar），触摸跟手；overscroll 阻止滚动穿透到页面 */
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--c-border) transparent;
}
.layout-menu::-webkit-scrollbar { width: 6px; }
.layout-menu::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 4px; }
.layout-menu::-webkit-scrollbar-track { background: transparent; }

.menu-vertical .menu-item {
    margin-bottom: 2px !important;
}

.menu-vertical .menu-item .menu-link {
    border-radius: var(--r-sm) !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--c-text-secondary) !important;
    text-decoration: none !important;
    transition: all var(--t-normal) !important;
    gap: 10px;
    position: relative;
}

.menu-vertical .menu-item .menu-link .material-symbols-outlined,
.menu-vertical .menu-item .menu-link .menu-icon {
    font-size: 20px !important;
    color: var(--c-text-muted) !important;
    transition: color var(--t-fast) !important;
}

.menu-vertical .menu-item .menu-link:hover {
    background: color-mix(in srgb, var(--color-brand-strong) .08, transparent) !important;
    color: var(--c-brand) !important;
    border-radius: var(--r-sm) !important;
}

.menu-vertical .menu-item .menu-link:hover .material-symbols-outlined,
.menu-vertical .menu-item .menu-link:hover .menu-icon {
    color: var(--c-brand) !important;
}

/* 激活态：品牌色软底 + 左侧 2px 指示条 */
.menu-vertical .menu-item .menu-link.active {
    background: var(--color-brand-soft) !important;
    color: var(--c-brand-dark) !important;
    font-weight: 600 !important;
    box-shadow: inset 2px 0 0 var(--c-brand) !important;
}

.menu-vertical .menu-item .menu-link.active .material-symbols-outlined,
.menu-vertical .menu-item .menu-link.active .menu-icon {
    color: var(--c-brand) !important;
}
.menu-vertical .menu-item .menu-link .count.new {
    min-width: 20px;
    width: auto;
    height: 20px;
    line-height: 20px;
    padding: 0 6px;
    border-radius: var(--r-pill);
    background: var(--c-danger) !important;
    color: #fff !important;
    font-weight: 700;
    font-size: var(--p-fs-xs);
}

.menu-vertical .menu-item .menu-link.disabled {
    opacity: .4;
    pointer-events: none;
}

/* ---- Top Primary Nav ---- */
.console-primary-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    border-radius: var(--r-md);
    background: var(--c-surface-hover);
    border: 1px solid var(--c-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.console-primary-nav::-webkit-scrollbar { display: none; }

.console-primary-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 16px;
    border-radius: var(--r-sm);
    color: var(--c-text-secondary);
    font-size: var(--p-fs-md);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--t-normal);
}

.console-primary-link .material-symbols-outlined {
    font-size: 20px;
    transition: transform var(--t-normal);
}

.console-primary-link:hover {
    color: var(--c-brand);
    background: var(--c-surface);
}

.console-primary-link:hover .material-symbols-outlined {
    transform: scale(1.12);
}

.console-primary-link.active {
    color: #fff;
    background: var(--c-brand);
    box-shadow: none;
}

.console-primary-link.active .material-symbols-outlined {
    color: #fff;
}

/* ---- Sidebar Context Header ---- */
.console-sidebar-context {
    padding: 16px 14px 12px;
    margin-bottom: 6px;
    border-radius: var(--r-md);
    background: color-mix(in srgb, var(--color-brand-strong) 5%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-brand-strong) 8%, transparent);
}

.console-sidebar-context-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--c-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.console-sidebar-context-title::before {
    content: "";
    width: 4px;
    height: 18px;
    border-radius: 4px;
    background: var(--c-brand);
}

.console-sidebar-context-desc {
    margin-top: 6px;
    margin-left: 12px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--c-text-muted);
}

/* ---- Sidebar Logo Area ---- */
.sidebar-logo-area {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--c-border-light);
    min-height: var(--header-h);
}

.sidebar-logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.sidebar-logo-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: var(--r-sm);
}

.sidebar-logo-link .logo-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--c-text);
    position: static !important;
    transform: none !important;
}

.sidebar-collapse-btn,
.sidebar-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--c-text-muted);
    cursor: pointer;
    transition: all var(--t-fast);
}

.sidebar-collapse-btn:hover,
.sidebar-expand-btn:hover {
    background: var(--c-info-bg);
    color: var(--c-brand);
}

.sidebar-collapse-btn .material-symbols-outlined,
.sidebar-expand-btn .material-symbols-outlined {
    font-size: var(--p-fs-xl);
}

.sidebar-expand-btn { display: none; }
/* 资料行：头像 / 姓名+角色 / 菜单按钮 一行排布。
   左右内缩与菜单图标对齐（layout-menu padding 12 + menu-link padding 12 = 24px） */
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 12px 12px;
    padding: 8px 12px;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: background var(--motion-base);
}
.sidebar-profile:hover { background: var(--c-surface-hover); }
.sidebar-profile:has(.sidebar-profile-dropdown.show) { background: var(--c-surface-hover); }

.sidebar-profile-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--r-pill);
    /* 品牌渐变 + 内环 + 微投影：替代"纯色圆 + 白字"的模板头像 */
    background: linear-gradient(135deg, var(--c-brand-light) 0%, var(--c-brand-dark) 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    flex-shrink: 0;
    user-select: none;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.24),
        0 1px 2px rgba(15, 23, 42, 0.16);
}

/* 在线状态点：白环（取侧栏底色） + 亮绿，运维台"会话存活"信号 */
.sidebar-profile-avatar::after {
    content: "";
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 9px;
    height: 9px;
    border-radius: var(--r-pill);
    background: #22c55e;
    box-shadow: 0 0 0 2px var(--sidebar-bg);
}

.sidebar-profile-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.sidebar-profile-name {
    font-size: var(--p-fs-sm);
    font-weight: 600;
    color: var(--c-text);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-profile-role {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    margin-top: 2px;
    padding: 0 6px;
    border-radius: var(--r-pill);
    background: color-mix(in srgb, var(--c-brand) 10%, transparent);
    color: var(--c-brand);
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.sidebar-profile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    margin-left: auto;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--c-text-faint);
    cursor: pointer;
    transition: color var(--motion-fast), background var(--motion-fast);
}
.sidebar-profile-menu-btn .material-symbols-outlined { font-size: 18px; }
.sidebar-profile-menu-btn:hover {
    color: var(--c-text);
    background: color-mix(in srgb, var(--c-text) 8%, transparent);
}
.sidebar-profile-menu-btn:hover { background: var(--c-surface-hover); color: var(--c-text); }
.sidebar-profile-menu-btn .material-symbols-outlined { font-size: 18px; }

.sidebar-profile-dropdown {
    position: absolute; left: 12px; bottom: 100%; min-width: 150px; margin-bottom: 4px;
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-md);
    box-shadow: var(--sh-lg); padding: 4px; display: none; z-index: 9999;
}
.sidebar-profile-dropdown.show { display: block; }
.sidebar-profile-dropdown .dropdown-item {
    border-radius: var(--r-sm); padding: 8px 12px; font-size: var(--p-fs-sm);
    display: flex; align-items: center; gap: 8px; color: var(--c-text);
}
.sidebar-profile-dropdown .dropdown-item:hover { background: var(--c-surface-hover); }
.sidebar-profile-dropdown .dropdown-item.text-danger { color: var(--c-danger); }
.sidebar-profile-dropdown .dropdown-item .material-symbols-outlined { font-size: 18px; }
/* ---- Mobile ---- */
@media (max-width: 1199.98px) {
    .sidebar-area {
        left: -300px !important;
        box-shadow: var(--sh-lg);
    }

    [sidebar-mobile-open] .sidebar-area {
        left: 0 !important;
        width: var(--sidebar-w) !important;
    }

    [sidebar-mobile-open] .sidebar-area:hover {
        width: var(--sidebar-w) !important;
    }

    /* 移动端 sidebar 抽屉的 backdrop */
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 1030; /* sidebar-area 在 1032,backdrop 在其下,主内容(z-index auto)在最下 */
        background: color-mix(in srgb, var(--color-shadow-dark, #0f172a) 50%, transparent);
        opacity: 0;
        visibility: hidden;
        transition: opacity var(--motion-base, .25s) ease, visibility var(--motion-base, .25s) ease;
        cursor: pointer;
    }
    [sidebar-mobile-open] .sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }
}

/* 桌面端不显示 backdrop */
@media (min-width: 1200px) {
    .sidebar-overlay { display: none !important; }
}

/* 移动端点击区域提升到 44px(WCAG 2.5.5 AA) */
@media (max-width: 1199.98px) {
    .sidebar-collapse-btn, .sidebar-expand-btn { width: 44px; height: 44px; }
    .sidebar-profile-menu-btn { width: 44px; height: 44px; }
}

/* 平板/移动端(<992px) nav 改 icon-only, 让 6 个分组都能点到
   覆盖原 <575.98px 的 icon-only 规则, 提前到 992px 断点 */
@media (max-width: 991.98px) {
    .console-primary-nav {
        justify-content: flex-start;
        scrollbar-width: thin;
    }
    .console-primary-nav::-webkit-scrollbar { display: block; height: 4px; }
    .console-primary-nav::-webkit-scrollbar-thumb {
        background: var(--c-border);
        border-radius: 4px;
    }
    .console-primary-nav::-webkit-scrollbar-track { background: transparent; }

    .console-primary-link {
        padding: 0 10px;
        font-size: var(--p-fs-sm);
    }
    .console-primary-link span:not(.material-symbols-outlined) {
        display: none;
    }
    .console-primary-link .material-symbols-outlined {
        font-size: var(--p-fs-lg);
    }
}

@media (max-width: 767.98px) {
    .sidebar-area {
        width: var(--sidebar-w) !important;
    }

    .sidebar-logo-area {
        padding: 14px 16px;
    }
}

/* ==================== Header / Footer Chrome ==================== */
.console-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 18px;
    margin-bottom: 18px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    position: relative;
    z-index: 1030;
    transition: box-shadow var(--t-slow);
}

.console-header.sticky {
    position: sticky;
    top: 0;
    box-shadow: var(--sh-lg);
}

.console-header > .console-primary-nav {
    margin: 0 auto;
    flex: 1;
    justify-content: center;
}

.console-header-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Ensure dropdowns from header render above page content */
.console-header-right .dropdown-menu {
    z-index: 1080;
}

.console-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--c-text-secondary);
    cursor: pointer;
    position: relative;
    transition: all var(--t-fast);
    flex-shrink: 0;
    /* 移动端点击区域提升到 44px(WCAG 2.5.5 AA) */
}
@media (max-width: 1199.98px) {
    .console-icon-btn { width: 44px; height: 44px; }
}

.console-icon-btn .material-symbols-outlined { font-size: var(--p-fs-xl); }

.console-icon-btn:hover {
    background: var(--c-info-bg);
    color: var(--c-brand);
}

/* Theme toggle icon visibility */
.console-theme-dark, .console-theme-light { display: none; }
/* Notification badge */
.console-noti-count {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    padding: 0 5px;
    border-radius: var(--r-pill);
    background: var(--c-danger);
    color: #fff;
    font-size: var(--p-fs-xs);
    font-weight: 700;
    text-align: center;
}

/* Notification dropdown */
.console-noti-menu {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    box-shadow: var(--sh-lg);
    padding: 0;
    min-width: 340px;
    overflow: hidden;
    z-index: 1080;
}

.console-noti-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--c-border-light);
    font-size: var(--p-fs-md);
    font-weight: 600;
    color: var(--c-text-secondary);
}

.console-noti-link {
    font-size: var(--p-fs-sm);
    font-weight: 600;
    color: var(--c-brand);
    text-decoration: none;
}

.console-noti-link:hover { color: var(--c-brand-dark); }

.console-noti-list { max-height: 280px; overflow-y: auto; }

.console-noti-item {
    display: block;
    padding: 10px 16px;
    font-size: var(--p-fs-sm);
    color: var(--c-text-secondary);
    border-bottom: 1px solid var(--c-border-light);
    text-decoration: none;
    transition: background var(--t-fast);
}

.console-noti-item:hover {
    background: var(--c-surface-hover);
    color: inherit;
    text-decoration: none;
}

/* Tenant switch button */
.console-tenant-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    background: var(--c-surface-alt);
    color: var(--c-text-secondary);
    font-size: var(--p-fs-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
    max-width: 200px;
}

.console-tenant-btn .material-symbols-outlined:first-child {
    font-size: var(--p-fs-lg);
    color: var(--c-text-muted);
}

.console-tenant-btn span:nth-child(2) {
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.console-tenant-caret {
    font-size: var(--p-fs-lg);
    color: var(--c-text-muted);
    flex-shrink: 0;
}

.console-tenant-btn:hover {
    border-color: var(--c-border-focus);
    background: var(--c-info-bg);
    color: var(--c-brand-dark);
}

.console-tenant-btn:hover .material-symbols-outlined:first-child {
    color: var(--c-brand);
}

/* Tenant dropdown */
.console-tenant-menu {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    box-shadow: var(--sh-lg);
    padding: 8px;
    min-width: 220px;
    z-index: 1080;
}

.console-tenant-menu-label {
    padding: 4px 8px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.console-tenant-loading {
    padding: 16px;
    text-align: center;
    color: var(--c-text-muted);
    font-size: var(--p-fs-sm);
}

.console-tenant-menu .dropdown-item {
    border-radius: var(--r-sm);
    padding: 8px 10px;
    font-size: var(--p-fs-sm);
    font-weight: 500;
    color: var(--c-text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.console-tenant-menu .dropdown-item .material-symbols-outlined:last-child {
    margin-left: auto;
}

.console-tenant-menu .dropdown-item:hover {
    background: var(--c-surface-hover);
}

.console-tenant-menu .dropdown-item.active {
    background: var(--c-info-bg);
    color: var(--c-brand-dark);
}

/* 窄屏租户下拉：限宽限高，内部滚动，避免溢出屏幕 */
@media (max-width: 991.98px) {
    .console-tenant-menu {
        max-height: min(60vh, 420px);
        overflow-y: auto;
        width: min(300px, calc(100vw - 24px));
    }
}

/* ==================== Tenant Switch Overlay ==================== */
#tenant-switch-overlay { z-index: 9999; }
/* ==================== Style Theme Dropdown ==================== */
.console-style-menu {
    min-width: 180px;
    padding: 8px 0;
}

.console-style-menu-label {
    padding: 6px 14px 10px;
    font-size: var(--p-fs-xs);
    font-weight: var(--p-fw-extrabold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.console-style-item {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 8px 14px !important;
    font-size: var(--p-fs-sm);
    color: var(--color-text-default);
    cursor: pointer;
    transition: background var(--motion-fast), color var(--motion-fast);
}

.console-style-item:hover {
    background: var(--color-surface-hover);
}

.console-style-item.active {
    background: var(--color-brand-soft);
    color: var(--color-brand);
    font-weight: var(--p-fw-bold);
}

.console-style-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: var(--radius-pill);
    flex-shrink: 0;
    box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 14%, transparent);
}
/* Footer — 固定底部，不因页面高度漂移 */
.main-content {
    min-height: 100vh;
}
.console-footer {
    position: fixed; bottom: 0; left: var(--sidebar-w); right: 0;
    height: var(--footer-h); z-index: 1050;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 var(--p-space-4);
    border-top: 1px solid var(--c-footer-border);
    background: var(--c-footer-bg);
    transition: border-color var(--motion-base), background-color var(--motion-base), left var(--motion-base);
}
.console-footer p {
    margin: 0; font-size: var(--p-fs-sm); color: var(--c-footer-text);
}

/* 移动端(<992px)隐藏 footer,把屏幕空间还给内容;不影响 desktop */
@media (max-width: 991.98px) {
    .console-footer { display: none !important; }
    .main-content-container { padding-bottom: 16px; }
}


/* ==================== Responsive Header ==================== ==================== */
@media (max-width: 1199.98px) {
    .console-header { padding: 10px 14px; gap: 10px; }
}

/* 平板/移动端(<992px) header 可折叠布局:
   默认: 汉堡 + 核心控件(主题/通知/租户) 单行, nav 折叠
   展开: nav tabs 显示在第二行 */
@media (max-width: 991.98px) {
    .console-header { flex-wrap: wrap; padding: 6px 10px; gap: 6px; }
    .console-header > #header-burger-menu { order: 1; }

    .console-header-nav-toggle {
        order: 1;
        margin-left: 2px;
    }

    .console-header-nav-toggle .material-symbols-outlined {
        transition: transform 0.25s ease;
    }

    .console-header-right {
        order: 1;
        flex: 1;
        justify-content: flex-end;
        gap: 6px;
    }

    .console-header > .console-primary-nav {
        order: 2;
        flex: none;
        width: 100%;
        margin: 4px 0 0;
        justify-content: flex-start;
    }

    .console-header:not(.nav-expanded) .console-primary-nav {
        display: none;
    }

    .console-header:not(.nav-expanded) .console-header-nav-toggle .material-symbols-outlined {
        transform: rotate(0deg);
    }

    .console-header.nav-expanded .console-header-nav-toggle .material-symbols-outlined {
        transform: rotate(180deg);
    }

    .console-noti-menu { min-width: 280px; }
}

@media (max-width: 575.98px) {
    .console-header { padding: 6px 8px; gap: 4px; }
    .console-header-right { gap: 4px; }
    .console-tenant-btn span:nth-child(2),
    .console-tenant-caret { display: none; }
    .console-tenant-btn { width: 38px; padding: 0; justify-content: center; }
    .console-primary-nav { padding: 3px 0; }
}

/* ==================== Modern Console Refresh ==================== */
body.bg-body-bg {
    min-height: 100vh;
    background: var(--color-surface-alt) !important;
    color: var(--c-text);
}
/* B 端正文色 — 加深到 slate-800 */
.main-content-container {
    color: var(--color-text-strong) !important;
}
.sidebar-area {
    background: var(--sidebar-bg) !important;
    box-shadow: 10px 0 34px rgba(15, 10, 30, 0.06) !important;
}
.sidebar-logo-link .logo-text {
    letter-spacing: 0;
}

/* Console Header — 实底 surface，边框跟随主题 */

.console-primary-nav {
    background: var(--c-surface-alt);
    border-color: var(--color-border-default);
}

.main-content-container > .card,
.main-content-container .card:not(.dash-panel) {
    /* 与 KPI 卡 / 面板 / 按钮同一档圆角（radius-lg），消除 10px 与 8px 混用 */
    border-radius: var(--radius-lg);
    border-color: var(--color-border-default) !important;
}

@media (prefers-reduced-motion: reduce) {
    .btn-primary:hover,
    .console-icon-btn:hover,
    .console-tenant-btn:hover {
        transform: none;
    }
}

/* ==================== Console Form Polish Final Layer ==================== */
/* Keep this at the end: older template rules define form heights multiple times. */
/* Note: .modal 必须与 .main-content-container 同步声明这些变量——
   modal 在 DOM 中通常在 .main-content-container 之外,
   否则浅色模式下 .modal .form-control 会因 var(--console-control-*) 未定义
   而被 !important 的无效声明覆盖成 border:none / background:transparent。 */
.main-content-container,
.modal {
    --console-control-bg: var(--color-surface);
    --console-control-bg-hover: var(--color-surface-hover);
    --console-control-border: var(--color-border-default);
    --console-control-border-hover: var(--color-brand-soft);
    --console-control-focus: var(--color-brand);
    --console-control-text: var(--color-text-default);
    --console-control-muted: var(--color-text-muted);
    --console-control-shadow: 0 0 0 4px var(--color-focus-ring);
    --console-control-height: 42px;
    --console-control-height-sm: 34px;
    --console-control-radius: var(--radius-lg);
}

.main-content-container .form-label,
.modal .form-label {
    color: var(--color-text-default);
    font-size: var(--p-fs-sm);
    font-weight: var(--p-fw-bold);
    letter-spacing: 0.01em;
    margin-bottom: 6px;
}

.main-content-container .form-control,
.main-content-container .form-select,
.modal .form-control,
.modal .form-select {
    width: 100%;
    min-height: var(--console-control-height) !important;
    height: var(--console-control-height) !important;
    padding: 0.5rem 0.78rem !important;
    border: 1px solid var(--console-control-border) !important;
    border-radius: var(--console-control-radius) !important;
    background-color: var(--console-control-bg) !important;
    color: var(--console-control-text) !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    box-shadow: none !important;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.main-content-container .form-control-sm,
.main-content-container .form-select-sm,
.main-content-container .input-group-sm > .form-control,
.main-content-container .input-group-sm > .form-select,
.modal .form-control-sm,
.modal .form-select-sm,
.modal .input-group-sm > .form-control,
.modal .input-group-sm > .form-select {
    min-height: var(--console-control-height-sm) !important;
    height: var(--console-control-height-sm) !important;
    padding: 0.35rem 0.68rem !important;
    border-radius: var(--radius-lg) !important;
    font-size: 12px !important;
}

.main-content-container textarea.form-control,
.modal textarea.form-control,
.main-content-container textarea.form-control-sm,
.modal textarea.form-control-sm {
    height: auto !important;
    min-height: 96px !important;
    resize: vertical;
}

.main-content-container .form-control:hover,
.main-content-container .form-select:hover,
.modal .form-control:hover,
.modal .form-select:hover {
    border-color: var(--console-control-border-hover) !important;
    background-color: var(--console-control-bg-hover) !important;
}

.main-content-container .form-control:focus,
.main-content-container .form-select:focus,
.modal .form-control:focus,
.modal .form-select:focus {
    border-color: var(--console-control-focus) !important;
    background-color: var(--console-control-bg-hover) !important;
    box-shadow: var(--console-control-shadow) !important;
    outline: none;
}

.main-content-container .form-control::placeholder,
.modal .form-control::placeholder {
    color: var(--color-text-muted);
}

.main-content-container .form-select,
.modal .form-select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 2.25rem !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px 10px;
}

.main-content-container input[type="datetime-local"].form-control,
.modal input[type="datetime-local"].form-control,
.main-content-container input[type="date"].form-control,
.modal input[type="date"].form-control,
.main-content-container input[type="time"].form-control,
.modal input[type="time"].form-control {
    min-width: 190px;
    font-family: "JetBrains Mono", "Noto Sans SC", monospace;
    letter-spacing: 0;
}

.console-filter-row {
    gap: 12px;
    align-items: flex-end;
}

.console-filter-item {
    gap: 5px;
}

.console-filter-item-sm {
    width: 160px;
}

.console-filter-item-lg {
    min-width: 240px;
}

.console-filter-actions {
    min-height: var(--console-control-height-sm);
    align-items: flex-end;
}
.console-filter-actions .btn-sm {
    min-height: var(--console-control-height-sm);
}

.form-check-input {
    cursor: pointer;
    border-color: var(--p-slate-300);
}

.form-check-input:focus {
    border-color: var(--console-control-focus);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-brand-strong) 0.1, transparent);
}

.form-text {
    color: var(--console-control-muted);
    line-height: 1.55;
}

/* Modal forms should feel like the console, not stock Bootstrap. */
.modal-content {
    border-radius: 12px;
}

.modal-header,
.modal-footer {
    border-color: var(--p-slate-200);
}
@media (max-width: 768px) {
    .console-filter-item,
    .console-filter-item-sm,
    .console-filter-item-lg,
    .console-filter-actions {
        width: 100%;
        min-width: 0;
        flex: 0 0 100%;
    }

    .console-filter-actions .btn {
        width: 100%;
    }
}

/* ==================== Console Data Grid ==================== */
/* 把所有 .dash-table 升级为现代企业级数据网格，
   不改 Blade 结构，纯 CSS 增强。 */

.dash-table {
    --grid-header-bg: var(--p-slate-50);
    --grid-header-fg: var(--p-slate-600);
    --grid-row-fg: var(--p-slate-800);
    --grid-border: var(--p-slate-100);
    --grid-zebra: var(--p-slate-50);
    --grid-hover: color-mix(in srgb, var(--color-brand-strong) 0.045, transparent);
    --grid-hover-border: color-mix(in srgb, var(--color-brand-strong) 0.16, transparent);
    --grid-radius: 10px;
    --grid-pad-x: 16px;
    --grid-pad-y: 14px;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-feature-settings: "tnum" 1;
}

/* ── Header ── */
.dash-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: var(--grid-pad-y) var(--grid-pad-x);
    background: var(--grid-header-bg);
    color: var(--grid-header-fg);
    font-weight: 800;
    font-size: var(--p-fs-xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    border: 0;
    border-bottom: 2px solid var(--grid-border);
    user-select: none;
}

.dash-table thead th:first-child { border-top-left-radius: var(--grid-radius); }
.dash-table thead th:last-child  { border-top-right-radius: var(--grid-radius); }

/* ── Body ── */
.dash-table tbody td {
    padding: var(--grid-pad-y) var(--grid-pad-x);
    font-size: var(--p-fs-sm);
    line-height: 1.45;
    color: var(--grid-row-fg);
    vertical-align: middle;
    border: 0;
    border-bottom: 1px solid var(--grid-border);
}

.dash-table tbody tr:nth-child(even) { background: var(--grid-zebra); }

.dash-table tbody tr {
    transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

.dash-table tbody tr:hover {
    background: var(--grid-hover);
}

/* hover 时给整行加一条极细的左引导色 */
.dash-table tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 0 var(--grid-hover-border);
}

/* 最后一行去掉底边 */
.dash-table tbody tr:last-child td { border-bottom: 0; }
.dash-table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--grid-radius); }
.dash-table tbody tr:last-child td:last-child  { border-bottom-right-radius: var(--grid-radius); }

/* ── table-sm 紧凑模式 ── */
.dash-table.table-sm thead th { padding: 10px 12px; }
.dash-table.table-sm tbody td { padding: 10px 12px; }

/* ── code / 等宽数字 ── */
.dash-table code {
    font-size: 12px;
    background: color-mix(in srgb, var(--color-brand-strong) 0.06, transparent);
    color: var(--c-brand);
    padding: 2px 6px;
    border-radius: 6px;
    font-family: "JetBrains Mono", monospace;
}

/* ── 操作列：让行内按钮组更精致 ──
   统一 a/button 混排按钮：inline-flex 保证文字水平垂直居中，
   避免不同浏览器下 <a> 与 <button> 的行高/基线差异导致错位。 */
.dash-table tbody td:last-child .btn-sm,
.dash-table tbody td:last-child .btn-xs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    border-radius: 8px;
    white-space: nowrap;
    vertical-align: middle;
}

/* 操作列按钮间距统一为 6px（覆盖页面里零散的 me-1/ms-1/gap-*，含 bootstrap !important 工具类） */
.dash-table tbody td:last-child .btn {
    margin: 0 !important;
}

.dash-table tbody td:last-child .btn + .btn {
    margin-left: 6px !important;
}

/* 图标+文字混排按钮：图标与文字基线对齐 */
.dash-table tbody td:last-child .btn .material-symbols-outlined {
    font-size: 16px;
    line-height: 1;
}

.dash-table tbody td:last-child .btn .material-symbols-outlined + * {
    margin-left: 4px;
}
/* ── 长文本单元格：省略号截断，悬停 title 看全文 ── */
.dash-table td.cell-ellipsis {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-table td.cell-ellipsis-sm {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-table td.cell-ellipsis-lg {
    max-width: 380px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── 操作列：不换行、不被长内容挤压 ── */
.dash-table td.cell-actions {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
}

/* ── 全站表格兜底：含按钮的单元格自动不换行，防止被长文本挤压变形 ── */
.dash-table tbody td:has(.btn),
.main-content-container .table:not(.dash-table) tbody td:has(.btn) {
    white-space: nowrap;
    vertical-align: middle;
}

/* 长文本兜底：无空格超长串（URL/密钥等）自动折行，防止撑破表格；
   显式使用 cell-ellipsis* 的列仍按省略号截断，互不影响。 */
.dash-table tbody td,
.main-content-container .table:not(.dash-table) tbody td {
    overflow-wrap: anywhere;
}

/* ── 空状态行 ── */
.dash-table tbody tr td[colspan] {
    text-align: center;
    color: var(--grid-header-fg);
    font-size: var(--p-fs-md);
    padding: 48px var(--grid-pad-x);
}

/* ── 首列加粗（语义锚点） ── */
.dash-table tbody td:first-child {
    font-weight: 600;
}

/* 数值/时间列右对齐（通过 .text-end 或 .num 类触发） */
.dash-table .num,
.dash-table .text-end {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ==================== 兼容非 dash-table 的普通 console 表格 ==================== */
.main-content-container .table:not(.dash-table) thead th {
    padding: 10px 14px;
    font-size: var(--p-fs-xs);
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--p-slate-600);
    border-bottom: 1px solid var(--p-slate-200);
    background: var(--p-slate-50);
}

.main-content-container .table:not(.dash-table) tbody td {
    padding: 11px 14px;
    font-size: var(--p-fs-sm);
    border-color: var(--p-slate-200);
    vertical-align: middle;
}

.main-content-container .table:not(.dash-table) tbody tr:hover {
    background: var(--grid-hover);
}

/* 非 dash-table 表格的操作列按钮同样统一 */
.main-content-container .table:not(.dash-table) tbody td:last-child .btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    border-radius: 8px;
    white-space: nowrap;
    vertical-align: middle;
}

.main-content-container .table:not(.dash-table) tbody td:last-child .btn {
    margin: 0 !important;
}

.main-content-container .table:not(.dash-table) tbody td:last-child .btn + .btn {
    margin-left: 6px !important;
}
/* ==================== 子菜单品牌色覆盖 (对抗 style.css 的 #0f79f3) ==================== */
.menu-vertical .menu-sub .menu-item .menu-link.active {
    background-color: var(--color-brand-soft) !important;
    color: var(--color-brand) !important;
}
.menu-vertical .menu-sub .menu-item .menu-link.active::before {
    background-color: var(--color-brand) !important;
}
.menu-vertical .menu-sub .menu-item .menu-link:hover {
    background-color: var(--color-brand-soft) !important;
    color: var(--color-brand) !important;
}
.menu-vertical .menu-sub .menu-item .menu-link:hover .material-symbols-outlined {
    color: var(--color-brand) !important;
}
/* ==================== Layout 全局交互/Modal 玻璃/侧边栏分组(原 layout.blade 内联) ==================== */
#headerAlertList .dropdown-item {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 360px;
}

.menu-vertical .menu-item .menu-link .count.new {
    min-width: 20px;
    width: auto;
    height: 20px;
    line-height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background-color: var(--c-danger) !important;
    color: var(--color-text-inverse) !important;
    font-weight: var(--p-fw-bold);
}

/* 全局交互规范 */
html, body { overflow-x: hidden; }
.card, .console-icon-btn, .console-tenant-btn,
[role="button"], button:not(:disabled) { cursor: pointer; }
.card { transition: box-shadow 0.25s ease, border-color 0.25s ease; }
/* 仅可交互卡（KPI 卡 / 链接卡）有 hover 描边，静态内容卡保持安静 */
.dash-metric-card:hover,
a.card:hover,
.card[role="button"]:hover {
    border-color: color-mix(in srgb, var(--color-brand) 30%, var(--color-border-default)) !important;
}
/* Modal 统一 */
.modal-content {
    background: var(--color-surface) !important;
    border-radius: var(--r-lg) !important;
    border: 1px solid var(--color-border-default) !important;
    box-shadow: var(--sh-lg) !important;
}
.modal-header,
.modal-footer {
    border-color: var(--color-border-subtle) !important;
}
.modal-title { font-weight: 700; color: var(--color-text-strong) !important; }
/* 侧边栏分组标题 */
.sidebar-section-title {
    color: var(--c-brand) !important;
    font-size: var(--p-fs-xs); font-weight: var(--p-fw-bold);
    text-transform: uppercase; letter-spacing: 0.06em; opacity: 1;
}