@charset "UTF-8";
/**
 * 佳誉 ERP 2.0 — 核心布局（顶栏、侧栏、主区、Tabs、变量）
 * 自 legacy admin_standard 拆分
 */
/**
 * 佳誉 ERP 2.0 — 管理后台布局（顶栏 / 侧栏 / 主区 / Tabs）
 * 侧边栏、表格、表单、紧凑布局统一规范，避免套娃与样式冲突
 */

/* ==================== 变量（与 design-system 紧凑规范一致） ==================== */
.admin-standard {
    --erp-container-padding-x: 20px;
    --erp-table-row-height: 40px;
    --erp-table-header-bg: #F8F9FA;
    --erp-table-header-color: #333;
    --erp-table-border: #E9ECEF;
    --erp-card-padding: 1.25rem;
    --erp-input-height-compact: 32px;
    --erp-list-font-size: 13px;
    --font-family-compact: Inter, "Microsoft YaHei", sans-serif;
}

/* ==================== 全局顶栏 ==================== */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    display: flex;
    align-items: stretch;
    z-index: 1001;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.top-header-brand {
    width: 260px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #042618 0%, #052E21 40%, #064E3B 80%, #065F46 100%);
    display: flex;
    align-items: center;
    padding: 0 24px;
    transition: width 0.25s ease;
}
.top-header-brand-text {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}
.top-header-brand-sub {
    margin-left: 8px;
    font-size: 12px;
    font-weight: 400;
    color: rgba(255,255,255,0.78);
}
body.sidebar-slim .top-header-brand {
    width: 64px;
    min-width: 64px;
    padding: 0 4px;
    justify-content: center;
    overflow: hidden;
}
body.sidebar-slim .top-header-brand-text {
    display: inline-block;
    max-width: 100%;
    font-size: 0;
    line-height: 0;
    overflow: hidden;
    color: transparent;
}
body.sidebar-slim .top-header-brand-sub { display: none; }
body.sidebar-slim .top-header-brand-text::before {
    content: '方圆';
    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;
    color: #fff;
}
.top-header-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.top-header-left { flex-shrink: 0; }
.top-header-breadcrumb {
    font-size: 15px;
    font-weight: 700;
    color: #333;
}
.top-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.top-header-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}
.top-header-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #4b5563;
    padding: 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.top-header-btn svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}
.top-header-btn svg path {
    stroke-width: 2px;
}
.top-header-btn:hover {
    background-color: #f3f4f6;
    color: #111827;
}
/* 顶栏告警（问题布报障）：宪法 Warning 色 */
.top-header-btn.btn-warning {
    color: #f59e0b;
}
.top-header-btn.btn-warning:hover {
    background-color: #fef3c7;
    color: #d97706;
}
@media (max-width: 767px) {
    .top-header-btn-calc { display: none !important; }
}
.top-header-user-capsule {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(32, 74, 60, 0.05);
    padding: 6px 14px;
    border-radius: 999px;
}
.top-header-user-capsule .top-header-username {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}
.top-header-user-capsule .top-header-role {
    font-size: 12px;
    color: #5a5a5a;
}
.top-header-logout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #4a4a4a;
    text-decoration: none;
    padding: 6px 0;
    margin-left: 4px;
    transition: color 0.2s;
}
.top-header-logout:hover { color: #dc2626; }
.top-header-logout i { flex-shrink: 0; }

/* ==================== 侧边栏 ==================== */
body.admin-layout {
    display: flex;
    overflow-x: hidden;
}
.sidebar {
    width: 260px;
    height: calc(100vh - 64px);
    top: 64px;
    background: linear-gradient(180deg, #042618 0%, #052E21 40%, #064E3B 80%, #065F46 100%);
    color: #ecfdf5;
    position: fixed;
    left: 0;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    transition: width 0.25s ease;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(16, 185, 129, 0.3); border-radius: 10px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(16, 185, 129, 0.6); }
.sidebar { scrollbar-width: thin; scrollbar-color: rgba(16, 185, 129, 0.3) transparent; }
.sidebar-header-slim-only { display: none; padding: 0; }
.sidebar-nav { padding: 20px 0; }
.sidebar-nav-list { list-style: none; }
.sidebar-nav-list > li { margin: 0; }
.nav-item {
    display: block;
    padding: 10px 16px;
    margin: 2px 8px;
    color: #a7f3d0;
    text-decoration: none;
    transition: all 0.25s ease;
    border-left: 3px solid transparent;
    border-radius: 6px;
}
.nav-item:hover { background: rgba(16, 185, 129, 0.2); color: #fff; }
.nav-item.active {
    background: rgba(16, 185, 129, 0.3);
    color: #fff !important;
    font-weight: 700;
    border-left-color: #10B981;
}
.nav-item-icon { display: inline-block; width: 20px; margin-right: 10px; text-align: center; }
.nav-item-icon.fa-solid, .nav-item-icon.fa-regular { width: auto; min-width: 20px; font-size: 1.05em; }
.nav-group-label {
    cursor: pointer;
    color: #a7f3d0;
    font-weight: 600;
    padding: 10px 16px;
    margin: 2px 8px;
    display: block;
    border-radius: 6px;
    border-left: 3px solid transparent;
}
.nav-submenu {
    list-style: none;
    padding-left: 0;
    margin: 0;
    background: rgba(0,0,0,0.2);
    display: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
/* 基础设置等子菜单项较多：固定上限会裁切底部入口，展开后允许内部纵向滚动 */
.nav-li-has-sub.active .nav-submenu {
    display: block;
    max-height: min(78vh, 720px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(16, 185, 129, 0.45) transparent;
}
.nav-li-has-sub.active .nav-submenu::-webkit-scrollbar { width: 4px; }
.nav-li-has-sub.active .nav-submenu::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.35);
    border-radius: 10px;
}
.nav-submenu li { margin: 0; }
.nav-submenu .nav-item {
    padding: 8px 16px 8px 44px;
    margin: 2px 8px 2px 16px;
    font-size: 13px;
    color: #d1fae5;
    border-radius: 6px;
    border-left: 3px solid transparent;
}
.nav-submenu .nav-item:hover { background: rgba(16, 185, 129, 0.3); color: #fff; }
.nav-submenu .nav-item.active {
    font-weight: 700;
    color: #fff !important;
    border-left-color: #10B981;
    background: rgba(6, 78, 59, 0.95);
}
.nav-li-has-sub.active > .nav-group-label {
    background: rgba(16, 185, 129, 0.2);
    color: #fff;
    border-left-color: #10B981;
}
/* 使用 \\25BC 避免源码中非 ASCII 字符在错误 charset 下变成 â–¼ 等乱码 */
.nav-li-has-sub > .nav-group-label::after {
    content: '\25BC';
    float: right;
    font-size: 10px;
    opacity: 0.6;
    transition: transform 0.25s;
}
.nav-li-has-sub.active > .nav-group-label::after { transform: rotate(180deg); }
.sidebar-toggle {
    display: block;
    width: 100%;
    padding: 10px 16px;
    margin: 8px 0 0 0;
    background: rgba(0,0,0,0.2);
    border: none;
    color: #a7f3d0;
    font-size: 12px;
    cursor: pointer;
    text-align: center;
    border-radius: 6px;
    transition: background 0.2s;
}
.sidebar-toggle:hover { background: rgba(16, 185, 129, 0.3); color: #fff; }
/* 窄栏：与顶栏品牌区同宽 64px；禁止横向溢出以免与主区重叠。品牌仅保留顶栏一处「方圆」，侧栏内不再重复 pseudo 文案 */
.sidebar.sidebar-slim {
    width: 64px;
    min-width: 64px;
    overflow-x: hidden;
    overflow-y: auto;
}
.sidebar.sidebar-slim .nav-submenu { display: none !important; }
.sidebar.sidebar-slim .sidebar-header-slim-only {
    display: none !important;
}
.sidebar.sidebar-slim .nav-group-label::after { display: none !important; }
.sidebar.sidebar-slim .nav-item,
.sidebar.sidebar-slim .nav-group-label {
    box-sizing: border-box;
    width: calc(100% - 8px);
    max-width: 56px;
    margin-left: auto;
    margin-right: auto;
    padding: 10px 4px;
    text-align: center;
    font-size: 0;
    line-height: 0;
    letter-spacing: 0;
    overflow: hidden;
}
.sidebar.sidebar-slim .nav-item .nav-item-icon,
.sidebar.sidebar-slim .nav-group-label .nav-item-icon {
    font-size: 18px;
    line-height: 1;
    margin-right: 0;
    vertical-align: middle;
}
.sidebar.sidebar-slim .nav-item-icon.fa-solid,
.sidebar.sidebar-slim .nav-item-icon.fa-regular {
    font-size: 16px;
    min-width: 1em;
}
.sidebar.sidebar-slim #sidebar-toggle {
    box-sizing: border-box;
    width: calc(100% - 8px);
    max-width: 56px;
    margin-left: auto;
    margin-right: auto;
    padding: 8px 4px;
    font-size: 0;
    line-height: 0;
    overflow: hidden;
}
.sidebar.sidebar-slim #sidebar-toggle::after { content: '\25B6'; font-size: 12px; line-height: 1.2; }
body.sidebar-slim .main-content { margin-left: 64px; }
.main-content {
    flex: 1;
    margin-left: 260px;
    padding-top: 64px;
    min-height: 100vh;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    background: #F0FDF4;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease;
}
.content-wrapper { padding: 0; }

/* ==================== Tabs Bar ==================== */
.tabs-bar {
    display: flex;
    align-items: center;
    padding: 0 10px;
    height: 40px;
    max-height: 40px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: #fff;
    border-bottom: 1px solid #d1fae5;
    flex-shrink: 0;
    overflow: hidden;
}
.tab-items {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    white-space: nowrap;
    -ms-overflow-style: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(6, 78, 59, 0.35) transparent;
    -webkit-overflow-scrolling: touch;
}
.tab-items::-webkit-scrollbar {
    height: 4px;
}
.tab-items::-webkit-scrollbar-thumb {
    background: rgba(6, 78, 59, 0.35);
    border-radius: 4px;
}
.tab-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 30px;
    margin-top: 2px;
    font-size: 13px;
    color: #374151;
    background: #e5e7eb;
    border: 1px solid #d1d5db;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    transition: all 0.2s;
    max-width: 160px;
    min-width: 80px;
    flex-shrink: 0;
}
.tab-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-item-fixed { order: -1; flex-shrink: 0; }
.tab-item:hover { background: #d1fae5; color: #064E3B; }
.tab-item-fixed:hover { background: #e5e7eb; color: #374151; }
.tab-item-fixed.active:hover { background: #064E3B; color: #fff; }
.tab-item.active {
    background: #064E3B;
    color: #fff;
    border-color: #064E3B;
    font-weight: 600;
    z-index: 1;
    margin-bottom: -1px;
    padding-bottom: 1px;
}
.tab-close {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.1);
    color: inherit;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}
.tab-close:hover { background: rgba(0,0,0,0.2); }
.tab-item.active .tab-close:hover { background: rgba(255,255,255,0.3); }
.tabs-actions { margin-left: 8px; display: flex; gap: 6px; flex-shrink: 0; }
.tabs-actions button { padding: 4px 10px; font-size: 12px; height: 28px; border-radius: 6px; border: 1px solid #d1fae5; background: #f0fdf4; cursor: pointer; }
.tabs-actions button:hover { background: #dcfce7; }
.tab-frames { flex: 1; position: relative; min-height: 0; overflow: hidden; }
.tab-panel { display: none; position: absolute; inset: 0; overflow: auto; }
.tab-panel.active { display: block; z-index: 1; }
/* min-height：避免父级 flex 链在部分浏览器下高度为 0 时 iframe 完全不可见（误以为「空白」） */
.tab-panel iframe { width: 100%; height: 100%; min-height: 240px; border: none; }
.tab-panel .tab-inner-content { min-height: 100%; padding: 0; }
