/* ====== 亮色橙色主题 - 焱晨工单系统 V2 ====== */

/* ── CSS 变量 ── */
:root {
    /* 背景体系 — 浅灰到白 */
    --bg-root:          #f0f2f6;
    --bg-surface:       #f6f7fa;
    --bg-card:          #ffffff;
    --bg-card-hover:    #fff7ed;
    --bg-input:         #ffffff;
    --bg-table-header:  #f6f7fa;
    --bg-table-row-hover:#fff7ed;
    --bg-toolbar:       #ffffff;

    /* 边框 */
    --border-color:     #eaecef;
    --border-light:     #d1d5db;
    --border-focus:     rgba(249, 115, 22, 0.35);

    /* 文字 */
    --text-primary:     #1a1d26;
    --text-secondary:   #383c44;
    --text-muted:       #6e727c;
    --text-dark-card:   #1a1d26;
    --text-light-card:  #383c44;

    /* 品牌色 — 橙色为主，蓝绿红紫保留为辅助 */
    --accent-orange:     #F97316;
    --accent-orange-dim: #EA580C;
    --accent-orange-light:#fff7ed;
    --accent-blue:       #3b63ed;
    --accent-blue-dim:   #2d4fc4;
    --accent-blue-light: #eef1fd;
    --accent-green:      #10b981;
    --accent-green-dim:  #059669;
    --accent-green-light:#ecfdf5;
    --accent-purple:     #7c3aed;
    --accent-purple-light:#f5f3ff;
    --accent-red:        #ef4444;
    --accent-red-dim:    #dc2626;
    --accent-red-light:  #fef2f2;
    --accent-cyan:       #06b6d4;

    /* 导航 */
    --nav-bg:           #ffffff;
    --nav-border:       #eaecef;
    --nav-text:         #5f6570;
    --gradient-brand:   linear-gradient(135deg, #F97316, #EA580C);

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* 阴影 */
    --shadow-xs:   0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm:   0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-card: 0 2px 12px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md:   0 4px 16px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-nav:  0 1px 4px rgba(0,0,0,0.06);
    --shadow-glow: 0 0 0 3px rgba(249,115,22,0.12);
}

/* ====== 全局 ====== */
body {
    background-color: var(--bg-root);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* 列表页：锁定视口高度，禁止整页滚动 */
body:has(.content-area.has-sticky-pagination) {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* 内容区（base.html 的 container-fluid） */
.content-area {
    flex: 1;
    min-height: 0;
    padding-top: 16px !important;
}

/* 非列表页：内容区可滚动 */
body:not(:has(.content-area.has-sticky-pagination)) .content-area {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* 列表页：内容区不滚动，由 list-page-body 接管 */
.content-area.has-sticky-pagination {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 列表页可滚动区域：占满剩余高度，内部滚动 */
.list-page-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* 工具栏、批量操作栏不压缩 */
.list-page-body > .list-toolbar,
.list-page-body > .batch-action-bar {
    flex-shrink: 0;
}

/* 表格容器在 list-page-body 内撑满剩余高度 */
.list-page-body > .list-table-card {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 表格内部滚动区域 */
.list-page-body > .list-table-card > div:first-child {
    flex: 1;
    overflow: auto;
    min-height: 0;
}

/* 分页栏：固定底部，自然填充容器宽度（与上方搜索栏/表格同宽） */
.list-pagination {
    flex-shrink: 0;
    padding: 14px 0;
    background: var(--bg-root);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    z-index: 20;
}

/* 分页栏左侧 */
.list-pagination .page-size-select {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}
.list-pagination .page-size-select select {
    padding: 4px 8px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: var(--bg-card);
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
}
.list-pagination .page-size-select select:focus {
    border-color: var(--accent-orange);
    outline: none;
    box-shadow: var(--shadow-glow);
}

/* 分页栏右侧页码按钮 */
.list-pagination .page-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}
.list-pagination .page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.list-pagination .page-btn:hover:not(:disabled):not(.active) {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}
.list-pagination .page-btn.active {
    background: var(--accent-orange);
    color: #fff;
    border-color: var(--accent-orange);
}
.list-pagination .page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ====== 顶部导航栏 — 白色玻璃态 ====== */
.navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--nav-border);
    box-shadow: var(--shadow-nav);
    min-height: 56px;
    flex-shrink: 0;
    /* 顶栏自身需要建立 stacking context, 否则子级下拉菜单无法盖住下方的 content-area */
    position: relative;
    z-index: 1050;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 1.15rem;
    padding-top: 0;
    padding-bottom: 0;
}

.nav-brand-text {
    color: var(--text-primary);
    font-weight: 700;
}

.navbar-brand:hover {
    color: var(--accent-orange) !important;
}

/* Logo */
.nav-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    user-select: none;
    transition: transform 0.3s;
}

.nav-logo:hover {
    transform: scale(1.05);
}

#nav-menu {
    gap: 4px;
}

#nav-menu .nav-link {
    color: var(--nav-text) !important;
    font-weight: 500;
    padding: 0.4rem 0.8rem !important;
    border-radius: var(--radius-sm);
    position: relative;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

#nav-menu .nav-link:hover {
    color: var(--accent-orange) !important;
    background-color: var(--accent-orange-light);
}

#nav-menu .nav-link.active {
    color: var(--accent-orange) !important;
    background-color: var(--accent-orange-light);
    font-weight: 600;
}

#nav-menu .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    border-radius: 2px;
    background: var(--accent-orange);
}

@media (max-width: 991px) {
    #nav-menu .nav-link.active::after {
        display: none;
    }
    #nav-menu .nav-link.active {
        border-left: 3px solid var(--accent-orange);
        border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    }
}

/* 移动端汉堡菜单 */
.navbar-toggler {
    border-color: var(--border-color);
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(90,90,110,0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ====== 导航栏用户信息 ====== */
#nav-user-area {
    padding-left: 12px;
}

.nav-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: var(--accent-orange-light);
    color: var(--accent-orange);
    font-size: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid rgba(249, 115, 22, 0.25);
}

.nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-username-text {
    font-size: 0.875rem;
    white-space: nowrap;
    color: var(--text-primary);
}

.btn-logout {
    font-size: 0.8rem;
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.btn-logout:hover {
    background: var(--accent-red-light);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* ====== 设置按钮下拉菜单 ====== */
.nav-settings-dropdown {
    position: static;
}

.nav-settings-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    cursor: pointer;
}

.nav-settings-btn:hover,
.nav-settings-btn[aria-expanded="true"] {
    background: var(--accent-orange-light);
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}

.nav-settings-btn svg {
    transition: transform 0.3s ease;
}

.nav-settings-btn:hover svg {
    transform: rotate(60deg);
}

.nav-settings-dropdown .dropdown-menu {
    min-width: 180px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 6px;
    margin-top: 6px;
    /* 必须高于 .navbar 的 z-index, 否则下拉菜单会被顶栏压在下面 */
    z-index: 1060;
}

.nav-settings-dropdown .dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    transition: all 0.15s;
    cursor: pointer;
}

.nav-settings-dropdown .dropdown-item:hover,
.nav-settings-dropdown .dropdown-item:focus {
    background: var(--accent-orange-light);
    color: var(--accent-orange);
}

.nav-settings-dropdown .dropdown-item.text-danger:hover,
.nav-settings-dropdown .dropdown-item.text-danger:focus {
    background: var(--accent-red-light);
    color: var(--accent-red) !important;
}

.nav-settings-dropdown .dropdown-divider {
    margin: 4px 0;
}

/* 权限切换下拉按钮（绿色调，与角色橙色区分） */
.nav-perm-badge-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.25em 0.7em;
    border-radius: 999px;
    background: var(--accent-green, #28a745);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    white-space: nowrap;
    transition: all 0.2s;
}

.nav-perm-badge-btn:hover:not(:disabled) {
    filter: brightness(1.1);
}

.nav-perm-badge-btn:disabled {
    opacity: 0.9;
    cursor: default;
}

.nav-perm-dropdown .dropdown-menu {
    min-width: 160px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 6px;
    margin-top: 6px;
    z-index: 1060;
}

.nav-perm-dropdown .dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.nav-perm-dropdown .dropdown-item:hover,
.nav-perm-dropdown .dropdown-item:focus {
    background: var(--accent-green-light, #e8f5e9);
    color: var(--accent-green, #28a745);
}

.nav-perm-dropdown .dropdown-item.active {
    background: var(--accent-green, #28a745);
    color: #fff;
}

.nav-perm-dropdown .dropdown-item:disabled {
    opacity: 0.7;
    cursor: default;
}

/* ====== 容器 ====== */
body > .container {
    color: var(--text-primary);
    max-width: 1480px;
    padding-left: 40px;
    padding-right: 40px;
}

/* ====== 列表页固定布局（仅对启用了 has-sticky-pagination 的页面生效） ====== */
body:has(.content-area.has-sticky-pagination) > .container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: 0;
}

body:has(.content-area.has-sticky-pagination) > .container > .list-page-title,
body:has(.content-area.has-sticky-pagination) > .container > .list-toolbar {
    flex-shrink: 0;
}

body:has(.content-area.has-sticky-pagination) > .container > .batch-action-bar {
    flex-shrink: 0;
}

body:has(.content-area.has-sticky-pagination) > .container > .list-table-card {
    flex: 1;
    min-height: 120px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body:has(.content-area.has-sticky-pagination) > .container > .list-table-card > div:first-child {
    flex: 1;
    overflow: auto;
    min-height: 0;
}

/* 列表内部滚动条样式 */
.list-table-card > div:first-child::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.list-table-card > div:first-child::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}
.list-table-card > div:first-child::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
.list-table-card > div:first-child::-webkit-scrollbar-track {
    background: transparent;
}

body:has(.content-area.has-sticky-pagination) > .container > .list-pagination {
    flex-shrink: 0;
}

body:has(.content-area.has-sticky-pagination) > .container > .list-table-card:last-child {
    margin-bottom: 8px;
}

/* ====== 卡片 ====== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    color: var(--text-dark-card);
    overflow: hidden;
}

.card .table {
    margin-bottom: 0;
}

.card-header {
    background: var(--bg-table-header);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark-card);
    font-weight: 600;
}

.card-header img[src],
.card-header > span img,
.card-header > span i.bi,
.card-header i.bi {
    margin-right: 6px !important;
    vertical-align: middle;
}

.card-body {
    color: var(--text-dark-card);
}

/* ====== 详情页卡片内字段布局优化 ====== */
.card-body .row.g-2 {
    --detail-gap-y: 0.75rem;
    row-gap: var(--detail-gap-y);
}

/* 每个字段单元格 */
.card-body .row.g-2 > [class*="col-"] {
    padding-top: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid transparent;
    border-radius: var(--radius-xs);
    transition: background 0.15s, border-color 0.15s;
}

.card-body .row.g-2 > [class*="col-"]:hover {
    background: var(--accent-orange-light);
    border-bottom-color: var(--border-color);
}

/* 字段标签：更清晰的层次 */
.card-body .row.g-2 > [class*="col-"] > label.text-muted.small {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
    line-height: 1.3;
}

/* 字段值：更突出 */
.card-body .row.g-2 > [class*="col-"] > div:not(.badge) {
    font-size: 0.9rem;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.5;
}

/* 字段值容器内的 badge 垂直对齐 */
.card-body .row.g-2 > [class*="col-"] > div > .badge {
    vertical-align: middle;
}

/* 多行文本字段（如任务描述）占整行 */
.card-body .row.g-2 > [class*="col-"]:has([style*="white-space:pre-wrap"]) {
    flex: 0 0 100%;
    max-width: 100%;
}

/* ====== 详情页按钮 ====== */

/* 返回列表：品牌渐变 */
.btn-brand-gradient {
    background: var(--gradient-brand);
    color: #fff;
    border: none;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: opacity 0.2s, box-shadow 0.2s;
}
.btn-brand-gradient:hover {
    opacity: 0.88;
    color: #fff;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.35);
}

/* 取消：红底白字 */
.btn-danger-solid {
    background: var(--accent-red);
    color: #fff;
    border: none;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: opacity 0.2s, box-shadow 0.2s;
}
.btn-danger-solid:hover {
    opacity: 0.85;
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

/* 操作：绿色底 */
.btn-action-green {
    background: var(--accent-green);
    color: #fff;
    border: none;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: opacity 0.2s, box-shadow 0.2s;
}
.btn-action-green:hover {
    opacity: 0.88;
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

/* ====== 页面标题 ====== */
.list-page-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

/* ====== 工具栏 ====== */
.list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-toolbar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    box-shadow: var(--shadow-card);
}

/* 搜索框 */
.list-search {
    position: relative;
    flex: 0 0 260px;
    max-width: 260px;
}

.list-search input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 34px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--bg-input);
    color: var(--text-dark-card);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.list-search input:focus {
    outline: none;
    border-color: var(--accent-orange);
    box-shadow: var(--shadow-glow);
}

.list-search input::placeholder {
    color: var(--text-muted);
}

.list-search::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
}

.list-search::after {
    content: '';
    position: absolute;
    left: 24px;
    top: 55%;
    width: 7px;
    height: 2px;
    background: var(--text-muted);
    transform: rotate(45deg);
}

/* 工具栏下拉/日期 */
.list-toolbar select,
.list-toolbar input[type="date"] {
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--bg-input);
    color: var(--text-dark-card);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.list-toolbar select {
    min-width: 120px;
}

.list-toolbar select:focus,
.list-toolbar input[type="date"]:focus {
    outline: none;
    border-color: var(--accent-orange);
    box-shadow: var(--shadow-glow);
}

.list-toolbar .date-separator {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.list-toolbar-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.list-toolbar-actions .btn {
    height: 36px;
    padding: 0 16px;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.list-toolbar hr {
    border-color: var(--border-color);
}

/* ====== 列可见性切换 ====== */
.col-toggle-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.col-toggle-btn {
    height: 36px;
    padding: 0 16px;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--accent-orange);
    color: #fff;
    font-weight: 500;
    transition: background 0.2s;
}

.col-toggle-btn:hover {
    background: var(--accent-orange-dim);
}

.col-toggle-panel {
    position: absolute;
    right: 0;
    top: 44px;
    z-index: 100;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 200px;
    max-width: 280px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    padding: 12px;
}

.col-toggle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.col-toggle-reset {
    border: none;
    background: none;
    color: var(--accent-orange);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
}
.col-toggle-reset:hover { color: var(--accent-orange-dim); }

.col-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.col-toggle-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}

.col-toggle-item:hover {
    background: var(--bg-table-row-hover);
}

.col-toggle-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-orange);
    cursor: pointer;
}

.col-toggle-item span {
    flex: 1;
}

/* ====== 表格容器 ====== */
.list-table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.list-table-card .table {
    margin-bottom: 0;
    color: var(--text-primary);
}

.list-table-card thead th {
    background: var(--bg-table-header);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.list-table-card tbody td {
    font-size: 0.875rem;
    padding: 10px 12px;
    vertical-align: middle;
    text-align: center;
    color: var(--text-dark-card);
    border-bottom: 1px solid var(--border-color);
}

.list-table-card tbody tr:hover {
    background-color: var(--accent-orange-light);
}

/* ====== 操作列固定在右侧 ====== */
.list-table-card th[data-col="actions"],
.list-table-card td[data-col="actions"] {
    position: sticky;
    right: 0;
}

.list-table-card th[data-col="actions"] {
    background: var(--bg-table-header);
    z-index: 4;
}

.list-table-card td[data-col="actions"] {
    background: var(--bg-card);
    z-index: 2;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.06);
}

/* ====== 列表单元格文字截断 ====== */
.list-table-card td:not([data-col="actions"]):not([data-col="checkbox"]) {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 数据量列不截断（数字列通常很短） */
.list-table-card td[data-col="count"],
.list-table-card td[data-col="account_count"],
.list-table-card td[data-col="indicator_count"],
.list-table-card td[data-col="member_count"] {
    max-width: none;
}

.list-table-card tbody tr:hover td[data-col="actions"] {
    background: var(--accent-orange-light);
}

/* ====== 通用表格 ====== */
.table {
    color: var(--text-dark-card);
}

.table th {
    background-color: var(--bg-table-header);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-bottom-color: var(--border-color);
}

.table td {
    border-bottom-color: var(--border-color);
    color: var(--text-dark-card);
}

.table-bordered {
    border-color: var(--border-color);
}
.table-bordered th,
.table-bordered td {
    border-color: var(--border-color);
}
.table-borderless th,
.table-borderless td {
    border: none;
}
.table-hover tbody tr:hover {
    background-color: var(--bg-table-row-hover);
}
.table-light {
    --bs-table-bg: var(--bg-table-header);
    --bs-table-color: var(--text-secondary);
    --bs-table-border-color: var(--border-color);
}

/* ====== 操作链接 ====== */
.row-action {
    font-size: 0.8125rem;
    padding: 2px 8px;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    white-space: nowrap;
    transition: all 0.15s;
}

.row-action-view,
.row-action-edit,
.row-action-reset {
    color: var(--accent-orange);
}
.row-action-view:hover,
.row-action-edit:hover,
.row-action-reset:hover {
    color: var(--accent-orange-dim);
    background: var(--accent-orange-light);
}

.row-action-delete {
    color: var(--accent-red);
}
.row-action-delete:hover {
    color: var(--accent-red-dim);
    background: var(--accent-red-light);
}

.row-action:hover {
    text-decoration: none;
}

.list-table-card td.text-nowrap {
    white-space: nowrap;
}

/* ====== 分页 ====== */
.list-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    margin-top: 8px;
    margin-bottom: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-dark-card);
    box-shadow: var(--shadow-card);
}

.list-pagination .page-size-select {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.list-pagination .page-size-select select {
    height: 32px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    font-size: 0.8125rem;
    padding: 0 8px;
    background: var(--bg-input);
    color: var(--text-dark-card);
}

.list-pagination .page-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.list-pagination .page-nav .page-btn {
    min-width: 32px;
    height: 32px;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark-card);
    transition: all 0.15s;
}

.list-pagination .page-nav .page-btn:hover:not(:disabled) {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
    background: var(--accent-orange-light);
}

.list-pagination .page-nav .page-btn.active {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    color: #fff;
}

.list-pagination .page-nav .page-btn:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.5;
}

.list-table-card .list-pagination {
    border-radius: 0;
    margin: 0;
    box-shadow: none;
    border-top: 1px solid var(--border-color);
    border-left: none;
    border-right: none;
    border-bottom: none;
}

/* ====== 状态标签 ====== */
.badge-pending {
    background-color: var(--accent-orange);
    color: #fff;
}
.badge-progress {
    background-color: var(--accent-blue);
    color: #fff;
}
.badge-done {
    background-color: var(--accent-green);
    color: #fff;
}
.badge-overdue {
    background-color: var(--accent-red);
    color: #fff;
}
.badge-rejected {
    background-color: var(--text-muted);
    color: #fff;
}

/* Bootstrap badge 覆写 */
.badge {
    font-weight: 500;
}
.badge.bg-success {
    background-color: var(--accent-green) !important;
}
.badge.bg-secondary {
    background-color: #f0f1f3 !important;
    color: var(--text-secondary) !important;
}
.badge.bg-warning {
    background-color: var(--accent-orange) !important;
    color: #ffffff !important;
}
.badge.bg-dark {
    background-color: #3a3a55 !important;
    color: #ffffff !important;
}
.badge.bg-danger {
    background-color: var(--accent-red) !important;
}
.badge.bg-info {
    background-color: var(--accent-cyan) !important;
    color: #fff;
}
.badge.bg-primary {
    background-color: var(--accent-orange) !important;
}
.bg-purple {
    background-color: var(--accent-purple) !important;
    color: #fff;
}

/* ====== 按钮 ====== */
.btn-primary {
    background-color: var(--accent-orange);
    border-color: var(--accent-orange);
}
.btn-primary:hover {
    background-color: var(--accent-orange-dim);
    border-color: var(--accent-orange-dim);
}

.btn-outline-primary {
    color: var(--accent-orange);
    border-color: var(--accent-orange);
}
.btn-outline-primary:hover {
    background-color: var(--accent-orange);
    color: #fff;
}

.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-light);
}
.btn-outline-secondary:hover {
    background-color: var(--bg-root);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.btn-outline-danger {
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.3);
}
.btn-outline-danger:hover {
    background-color: var(--accent-red-light);
    color: var(--accent-red);
    border-color: var(--accent-red);
}

.btn-outline-success {
    color: var(--accent-green);
    border-color: rgba(16, 185, 129, 0.3);
}
.btn-outline-success:hover {
    background-color: var(--accent-green-light);
    color: var(--accent-green-dim);
    border-color: var(--accent-green);
}

.btn-outline-warning {
    color: var(--accent-orange);
    border-color: rgba(249, 115, 22, 0.3);
}
.btn-outline-warning:hover {
    background-color: var(--accent-orange-light);
    color: var(--accent-orange-dim);
    border-color: var(--accent-orange);
}

.btn-outline-info {
    color: var(--accent-cyan);
    border-color: rgba(6, 182, 212, 0.3);
}
.btn-outline-info:hover {
    background-color: rgba(6, 182, 212, 0.08);
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.btn-danger {
    background-color: var(--accent-red);
    border-color: var(--accent-red);
}
.btn-danger:hover {
    background-color: var(--accent-red-dim);
}

.btn-success {
    background-color: var(--accent-green);
    border-color: var(--accent-green);
}
.btn-success:hover {
    background-color: var(--accent-green-dim);
    border-color: var(--accent-green-dim);
}

/* ====== 表单控件 ====== */
.form-control,
.form-select {
    background-color: var(--bg-input);
    border-color: var(--border-light);
    color: var(--text-dark-card);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
    background-color: #ffffff;
    border-color: var(--accent-orange);
    color: var(--text-dark-card);
    box-shadow: var(--shadow-glow);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text-dark-card);
}

.form-control-sm {
    font-size: 0.875rem;
}

/* ====== Modal ====== */
.modal-content {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-dark-card);
}

.modal-header {
    background-color: var(--bg-table-header);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark-card);
}

.modal-footer {
    background-color: var(--bg-table-header);
    border-top: 1px solid var(--border-color);
}

.modal-title {
    color: var(--text-dark-card);
}

.btn-close {
    filter: none;
}

/* ====== Alert ====== */
.alert-success {
    background-color: var(--accent-green-light);
    border-color: rgba(16, 185, 129, 0.25);
    color: var(--accent-green-dim);
}
.alert-danger {
    background-color: var(--accent-red-light);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--accent-red);
}
.alert-warning {
    background-color: var(--accent-orange-light);
    border-color: rgba(249, 115, 22, 0.25);
    color: var(--accent-orange-dim);
}
.alert-info {
    background-color: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.25);
    color: var(--accent-cyan);
}

/* ====== Toast ====== */
.toast {
    background-color: #ffffff;
    border-color: var(--border-color);
    color: var(--text-dark-card);
}

/* ====== 上传框 ====== */
.upload-box {
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-sm);
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: var(--bg-input);
    outline: none;
    color: var(--text-dark-card);
}
.upload-box:hover {
    border-color: var(--accent-orange);
    background: var(--accent-orange-light);
}
.upload-box.active {
    background: var(--accent-orange-light);
    border-color: var(--accent-orange);
    border-style: solid;
}
.upload-box-link {
    color: var(--accent-orange);
    font-size: 0.875rem;
    cursor: pointer;
    font-weight: 500;
}
.upload-box-link:hover {
    text-decoration: underline;
}
.upload-box-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ====== 缩略图 ====== */
.thumb-wrapper {
    position: relative;
    display: inline-block;
}
.thumb-wrapper img {
    cursor: pointer;
    transition: opacity 0.15s;
}
.thumb-wrapper:hover img {
    opacity: 0.75;
}
.thumb-delete {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-red);
    color: #fff;
    border: 2px solid #ffffff;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    display: none;
    z-index: 10;
    padding: 0;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.thumb-wrapper:hover .thumb-delete {
    display: flex;
}
.thumb-delete:hover {
    background: var(--accent-red-dim);
}

/* ====== 图片全屏预览 ====== */
.image-preview-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: imgFadeIn 0.15s ease;
}
.image-preview-overlay img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}
@keyframes imgFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ====== 下拉菜单 ====== */
.dropdown-menu {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-dark-card);
}
.dropdown-item {
    color: var(--text-dark-card);
}
.dropdown-item:hover {
    background-color: var(--bg-table-row-hover);
    color: var(--text-dark-card);
}

/* ====== 文字颜色覆写 ====== */
.text-muted {
    color: var(--text-muted) !important;
}
.text-dark {
    color: var(--text-dark-card) !important;
}
.text-secondary {
    color: var(--text-secondary) !important;
}
.text-light {
    color: var(--text-primary) !important;
}
small, .small {
    color: var(--text-muted);
}
hr {
    border-color: var(--border-color);
    opacity: 0.5;
}

/* ====== 背景覆写 ====== */
.bg-light {
    background-color: var(--bg-table-header) !important;
}
.bg-white {
    background-color: #ffffff !important;
}
.bg-dark {
    background-color: var(--bg-root) !important;
}

/* ====== 链接 ====== */
a {
    color: var(--accent-orange);
}
a:hover {
    color: var(--accent-orange-dim);
}

/* ====== 标题 ====== */
h4.list-page-title, .h4.list-page-title {
    color: var(--text-primary);
}
h4:not(.list-page-title), .h4:not(.list-page-title) {
    color: var(--text-dark-card);
}
h5, .h5 { color: var(--text-dark-card); }
h6, .h6 { color: var(--text-dark-card); }

.page-title-gradient {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ====== 输入组 ====== */
.input-group-text {
    background-color: var(--bg-table-header);
    border-color: var(--border-light);
    color: var(--text-dark-card);
}

/* ====== 列表页复选框 ====== */
.list-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-orange);
    cursor: pointer;
    vertical-align: middle;
}

/* ====== 操作列图标按钮 ====== */
.row-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 4px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin: 0 2px;
}
.row-btn-icon img {
    width: 20px;
    height: 20px;
    pointer-events: none;
}
.row-btn-icon .emoji-btn {
    font-size: 18px;
    line-height: 1;
}
.row-btn-icon:hover {
    background: var(--accent-orange-light);
    transform: scale(1.08);
}
.row-btn-icon.delete:hover {
    background: var(--accent-red-light);
}

/* ====== 批量操作浮出栏 ====== */
.batch-action-bar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    box-shadow: var(--shadow-card);
    transition: all 0.25s ease;
}
.batch-action-bar.active {
    display: flex;
}
.batch-action-bar .selected-count {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}
.batch-action-bar .btn-batch-delete {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
    font-weight: 500;
}
.batch-action-bar .btn-batch-delete:hover { opacity: 0.85; }
.batch-action-bar .btn-cancel-select {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
}
.batch-action-bar .btn-cancel-select:hover {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

/* ====== 确认弹窗 ====== */
.confirm-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: confirmFadeIn 0.15s ease;
}
.confirm-modal-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    padding: 28px 32px;
    min-width: 320px;
    max-width: 420px;
    text-align: center;
}
.confirm-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark-card);
    margin-bottom: 12px;
}
.confirm-modal-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}
.confirm-modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}
.confirm-modal-actions .btn-confirm {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s;
}
.confirm-modal-actions .btn-confirm:hover { opacity: 0.85; }
.confirm-modal-actions .btn-confirm-cancel {
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
}
.confirm-modal-actions .btn-confirm-cancel:hover {
    border-color: var(--text-secondary);
    color: var(--text-dark-card);
}
@keyframes confirmFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ====== 系统日志页面 ====== */
.log-stats-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.log-stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 160px;
    transition: transform 0.2s;
}
.log-stat-item:hover {
    transform: translateY(-2px);
}
.log-stat-modules {
    flex: 1;
    min-width: 200px;
}
.log-stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
}
.log-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark-card);
}
.log-stat-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}
.log-stat-module-bars {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.log-stat-bar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    padding: 2px 0;
}
.log-stat-bar-name {
    color: var(--text-dark-card);
}
.log-stat-bar-count {
    color: var(--text-muted);
    font-weight: 600;
}
.module-badge {
    background-color: var(--accent-orange-light);
    color: var(--accent-orange);
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
}
.action-badge {
    background-color: var(--accent-green-light);
    color: var(--accent-green-dim);
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
}
.type-badge {
    background-color: var(--accent-purple-light);
    color: var(--accent-purple);
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* ====== 详情页小屏适配 ====== */
@media (max-width: 576px) {
    .container-fluid .card-body .row > [class*="col-"] {
        min-width: 50%;
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* ====== 组织结构页面 ====== */
.org-page {
    padding: 8px 0 32px;
}

.org-header {
    margin-bottom: 20px;
}

.org-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0;
}

.org-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.org-search-box svg {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.org-search-box input {
    width: 280px;
    padding: 0.5rem 0.875rem 0.5rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.2s;
}

.org-search-box input:focus {
    outline: none;
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px var(--shadow-glow);
}

/* 统计卡片行 */
.org-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.org-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-xs);
    transition: all 0.2s;
}

.org-stat-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.org-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.org-stat-info {
    display: flex;
    flex-direction: column;
}

.org-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.org-stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* 部门卡片 */
.org-tree-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.org-dept-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.2s;
}

.org-dept-card:hover {
    box-shadow: var(--shadow-card);
}

.org-dept-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
}

.org-dept-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.org-dept-title svg {
    color: var(--accent-orange);
}

.org-dept-count {
    font-size: 0.8125rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
}

.org-dept-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 角色分组 */
.org-role-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.org-role-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.org-role-label::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 12px;
    border-radius: 2px;
    background: var(--accent-orange);
}

/* 成员网格 */
.org-member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.org-member-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-primary);
    cursor: pointer;
}

.org-member-card:hover {
    border-color: var(--accent-orange);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-xs);
    text-decoration: none;
}

.org-member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-orange-light);
    color: var(--accent-orange);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 1px var(--border-color);
}

.org-member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.org-member-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.org-member-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.org-member-position {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.org-member-status {
    font-size: 0.6875rem;
    padding: 1px 8px;
    border-radius: 999px;
    font-weight: 500;
    display: inline-block;
    width: fit-content;
}

.org-member-status.active {
    background: var(--accent-green-light);
    color: var(--accent-green-dim);
}

.org-member-status.inactive {
    background: var(--accent-red-light);
    color: var(--accent-red-dim);
}

.org-member-card.inactive {
    opacity: 0.65;
}

/* 空状态 */
.org-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.org-empty-text {
    margin-top: 12px;
    font-size: 0.875rem;
}

/* 响应式 */
@media (max-width: 768px) {
    .org-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .org-search-box input {
        width: 100%;
    }

    .org-member-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== 组织结构 - 表格模式 ========== */
.org-member-count-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--accent-orange-light);
    color: var(--accent-orange);
    border: 1px solid var(--accent-orange);
}

.org-member-mini-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-orange-light);
    color: var(--accent-orange);
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 6px;
    vertical-align: middle;
}

.org-row:hover {
    background: var(--bg-card-hover) !important;
}

/* 响应式补充 */
@media (max-width: 576px) {
    .org-stats-row {
        grid-template-columns: 1fr;
    }
}

/* ========== 轻量富文本编辑器（审批不合格原因） ========== */
.rt-wrapper {
    border: 1px solid var(--bs-border-color, #ced4da);
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}
.rt-toolbar {
    display: flex;
    gap: 4px;
    padding: 4px 6px;
    background: #f5f7fa;
    border-bottom: 1px solid var(--bs-border-color, #ced4da);
}
.rt-toolbar button {
    width: 30px;
    height: 28px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #333;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}
.rt-toolbar button:hover {
    background: #e3e8ef;
    border-color: #c9d2dd;
}
.rt-editor {
    min-height: 72px;
    max-height: 220px;
    overflow-y: auto;
    padding: 8px 10px;
    font-size: 14px;
    line-height: 1.6;
    outline: none;
    white-space: pre-wrap;
    word-break: break-word;
}
.rt-editor.rt-empty::before {
    content: attr(data-placeholder);
    color: #9aa3ae;
    pointer-events: none;
}
.rt-editor b, .rt-editor strong { font-weight: 700; }
.rt-editor i, .rt-editor em { font-style: italic; }
.rt-editor u { text-decoration: underline; }
.rt-editor ul, .rt-editor ol { margin: 4px 0; padding-left: 22px; }
.rt-editor p { margin: 0 0 4px; }

/* 审批原因展示（净化后 HTML 渲染） */
.rich-reason {
    font-size: 13px;
    line-height: 1.6;
    color: #c0392b;
    max-width: 260px;
    word-break: break-word;
}
.rich-reason p { margin: 0 0 4px; }
.rich-reason ul, .rich-reason ol { margin: 2px 0; padding-left: 20px; }


