/* ================================================================
   五竹信息内部管理系统 — UI 设计系统 v2
   taste-skill: admin B2B, variance=4, motion=3, density=6
   ================================================================ */

/* ---------- CSS 变量（亮色 / 暗色） ---------- */
:root {
    /* 主色调 — 靛蓝, 专业沉稳 */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-lighter: #eff6ff;
    --primary-dark: #1e40af;
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);

    /* 语义色 */
    --success: #059669;
    --success-light: #d1fae5;
    --success-hover: #047857;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --warning-hover: #b45309;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --danger-hover: #b91c1c;
    --info: #0284c7;
    --info-light: #e0f2fe;

    /* 中性色（亮色模式） */
    --bg: #f0f4f8;
    --bg-card: #ffffff;
    --bg-nav: #ffffff;
    --bg-input: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md:
        0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg:
        0 10px 25px -3px rgba(0, 0, 0, 0.08),
        0 4px 10px -2px rgba(0, 0, 0, 0.04);
    --overlay: rgba(15, 23, 42, 0.5);

    /* 圆角（统一系统） */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* 字体 */
    --font:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
    --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", monospace;

    /* 间距 */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* 过渡 */
    --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);

    /* 侧边栏专用变量 */
    --sidebar-width: 220px;
    --sidebar-bg: #ffffff;
    --sidebar-item-hover: #f1f5f9;
    --sidebar-item-active: #dbeafe;
    --sidebar-item-active-text: #2563eb;
    --sidebar-border: #e2e8f0;
    --sidebar-text: #475569;
    --sidebar-text-secondary: #94a3b8;
    --sidebar-group-header: #64748b;
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
    :root {
        --primary: #3b82f6;
        --primary-hover: #60a5fa;
        --primary-light: #1e3a5f;
        --primary-lighter: #172554;
        --primary-dark: #2563eb;

        --bg: #0f172a;
        --bg-card: #1e293b;
        --bg-nav: #1e293b;
        --bg-input: #1e293b;
        --border: #334155;
        --border-light: #1e293b;
        --text: #f1f5f9;
        --text-secondary: #94a3b8;
        --text-muted: #64748b;
        --text-inverse: #0f172a;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
        --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
        --shadow-md:
            0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
        --shadow-lg:
            0 10px 25px -3px rgba(0, 0, 0, 0.4),
            0 4px 10px -2px rgba(0, 0, 0, 0.2);
        --overlay: rgba(0, 0, 0, 0.6);

        --sidebar-bg: #1e293b;
        --sidebar-item-hover: #334155;
        --sidebar-item-active: #1e3a5f;
        --sidebar-item-active-text: #60a5fa;
        --sidebar-border: #334155;
        --sidebar-text: #94a3b8;
        --sidebar-text-secondary: #64748b;
        --sidebar-group-header: #94a3b8;
    }

    .login-card .welcome-avatar,
    .nav-card:hover {
        background: var(--bg-card);
    }

    .login-card .logo-icon {
        filter: brightness(1.2);
    }

    table thead th {
        background: var(--bg);
    }

    .upload-dropzone {
        border-color: var(--border);
        background: var(--bg);
    }

    .upload-dropzone:hover {
        background: var(--bg-card);
    }
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s;
}
a:hover {
    color: var(--primary-dark);
}

/* ================================================================
   侧边栏（替代原顶部导航栏）
   ================================================================ */

/* ================================================================
   表单卡片（标准卡片容器，替代零散 inline 样式）
   ================================================================ */
.form-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 28px;
}

/* ================================================================
   表单验证反馈
   ================================================================ */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
.form-group.has-error .form-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
    display: block;
}
.form-error {
    display: none;
}

/* ================================================================
   空状态（表格内）
   ================================================================ */
td.empty,
td.empty-state {
    text-align: center;
    padding: 40px 20px !important;
    color: var(--text-muted) !important;
    font-size: 14px;
}

/* ================================================================
   背景画布色变量修复
   ================================================================ */
:root {
    --bg-canvas: var(--bg);
}

/* ---------- 标准卡片（用于详情信息等） ---------- */
.info-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 16px;
}

/* ---------- 表单区域标题（如费用明细标题、电子发票标题） ---------- */
.section-title {
    margin: 24px 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-subtitle {
    font-weight: 400;
    font-size: 13px;
    color: var(--text-muted);
}
.add-item-btn {
    margin-top: 8px;
}

/* ---------- 搜索栏内紧凑输入框 ---------- */
.query-input {
    width: 120px;
}
.query-select {
    width: 100px;
}
@media (max-width: 768px) {
    .query-input,
    .query-select {
        width: 100%;
    }
}

/* ---------- 日期过滤输入基本样式 ---------- */
input[type="date"],
input[type="month"] {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text);
    font-size: 13px;
}

/* ================================================================
   链接按钮样式（用于操作列中一致性更好的链接式按钮）
   ================================================================ */
.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 14px;
    font-family: var(--font);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.12s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-link:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
    text-decoration: none;
}

/* ---------- 仪表盘标题 ---------- */
.section-title-dash {
    font-size: 16px;
    font-weight: 600;
    margin: 32px 0 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---------- 待办事项列表 ---------- */
.pending-card {
    padding: 16px 20px;
}
.pending-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}
.pending-item-last {
    border-bottom: none;
}
.pending-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.pending-text {
    flex: 1;
    font-size: 14px;
    color: var(--text);
}

/* ---------- 骨架屏 ---------- */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--border-light) 25%,
        var(--bg) 50%,
        var(--border-light) 75%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
@keyframes skeletonShimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
.skeleton-line {
    height: 14px;
    margin-bottom: 10px;
    width: 100%;
}
.skeleton-line:last-child {
    width: 60%;
}

/* ---------- 侧边栏：直接使用 #navbar 作为容器 ---------- */
#navbar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* ---------- 品牌区域 ---------- */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px 16px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-brand .brand-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
    display: block;
}

.sidebar-brand .brand-text {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* ---------- 导航 ---------- */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 12px;
    scrollbar-width: thin;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--sidebar-border);
    border-radius: 2px;
}

/* ---------- 导航分组 ---------- */
.nav-group {
    margin-bottom: 2px;
}

.nav-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
    transition: background 0.12s;
}

.nav-group-header:hover {
    background: var(--sidebar-item-hover);
}

.nav-group-header .g-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-group-header .g-icon svg {
    width: 16px;
    height: 16px;
    color: var(--sidebar-text);
}

.nav-group-header .g-label {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    color: var(--sidebar-group-header);
    letter-spacing: 0.5px;
}

.nav-group-header .g-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.nav-group-header .g-chevron svg {
    width: 14px;
    height: 14px;
    color: var(--sidebar-text-secondary);
}

.nav-group.open .g-chevron {
    transform: rotate(180deg);
}

.nav-group-content {
    display: none;
    padding: 2px 0 2px 8px;
}

.nav-group.open .nav-group-content {
    display: block;
}

/* ---------- 导航项 ---------- */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.12s;
    cursor: pointer;
    white-space: nowrap;
}

.nav-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--sidebar-text-secondary);
    transition: color 0.12s;
}

.nav-item span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item:hover {
    background: var(--sidebar-item-hover);
    color: var(--text);
}

.nav-item:hover svg {
    color: var(--sidebar-text);
}

.nav-item.active {
    background: var(--sidebar-item-active);
    color: var(--sidebar-item-active-text);
    font-weight: 600;
}

.nav-item.active svg {
    color: var(--sidebar-item-active-text);
}

/* ---------- 侧边栏底部（用户信息） ---------- */
.sidebar-footer {
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
    position: relative;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.12s;
}

.sidebar-user:hover {
    background: var(--sidebar-item-hover);
}

.sidebar-user .user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user .user-info {
    flex: 1;
    overflow: hidden;
}

.sidebar-user .user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-role {
    font-size: 11px;
    color: var(--sidebar-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .dropdown-arrow {
    width: 14px;
    height: 14px;
    color: var(--sidebar-text-secondary);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.sidebar-footer .dropdown-arrow.open {
    transform: rotate(180deg);
}

/* 底部用户下拉菜单 */
.sidebar-dropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 12px;
    right: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 4px;
    z-index: 210;
}

.sidebar-dropdown.show {
    display: block;
}

.sidebar-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--text);
    font-size: 14px;
    text-decoration: none;
    transition: background 0.12s;
}

.sidebar-dropdown a:hover {
    background: var(--bg);
}

.sidebar-dropdown a:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
}

/* ---------- 移动端菜单按钮 ---------- */
.sidebar-menu-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 250;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    color: var(--text);
    transition: background 0.12s;
}

.sidebar-menu-toggle:hover {
    background: var(--bg);
}

.sidebar-menu-toggle svg {
    width: 20px;
    height: 20px;
}

/* ---------- 移动端遮罩 ---------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay);
    z-index: 190;
    animation: overlayFadeIn 0.2s ease-out;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ---------- 移动端侧边栏展开 ---------- */
body.sidebar-open .sidebar-overlay {
    display: block;
}

/* ---------- 内容区域 ---------- */
#content {
    margin-left: var(--sidebar-width);
    padding: 28px 24px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 表格区域自动撑满剩余高度，内部滚动 */
#content > .table-wrapper {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

#content > .container {
    margin-left: 0;
    padding: 0;
}

/* ---------- 页面标题 ---------- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header h1 .page-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 24px;
}
h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}
h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* ---------- 工具栏 ---------- */
.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar-label {
    font-weight: 500;
    white-space: nowrap;
}

.toolbar input,
.search-bar input {
    flex: 1;
    min-width: 200px;
    max-width: 380px;
    padding: 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg-card);
    transition: all 0.2s;
    font-family: var(--font);
}
.toolbar input:focus,
.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
    outline: none;
}
.toolbar input::placeholder,
.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}
.search-bar input {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}
.search-bar select {
    padding: 9px 32px 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    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 fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    min-width: 110px;
    transition: border-color 0.2s;
}
.search-bar select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
    outline: none;
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 20px;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font);
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1.4;
}
.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.3);
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.btn-success:hover {
    background: #047857;
    border-color: #047857;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.btn-warning {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
}
.btn-warning:hover {
    background: #b45309;
    border-color: #b45309;
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.btn-outline:hover {
    background: var(--bg);
    border-color: var(--text-muted);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-ghost:hover {
    background: var(--bg);
    color: var(--text);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 4px;
}
.btn-sm:active {
    transform: none;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ================================================================
   列对齐系统 — 数据对齐约定：
   居左：文本类（姓名、名称、事由、说明）
   居中：标识类（编号、日期、状态、角色、类型）
   居右：数值类（金额、数量、百分比）
   ================================================================ */
.text-left {
    text-align: left !important;
}
.text-center {
    text-align: center !important;
}
.text-right {
    text-align: right !important;
}

/* 金额列：右对齐 + 等宽数字方便比较 */
.col-amount,
td.col-amount,
th.col-amount {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
td.col-amount {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: -0.3px;
}

/* 标识列：居中 */
.col-id,
td.col-id,
th.col-id,
.col-date,
td.col-date,
th.col-date,
.col-status,
td.col-status,
th.col-status,
.col-type,
td.col-type,
th.col-type {
    text-align: center;
}

/* 操作列：居左，按钮间保持间距 */
.col-action,
td.col-action,
th.col-action {
    text-align: left;
}
td.col-action {
    white-space: nowrap;
}
td.col-action .btn + .btn,
td.col-action .btn + button,
td.actions .btn + .btn,
td.actions .btn + button {
    margin-left: 6px;
}

/* ---------- 表格 ---------- */
.table-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    background: var(--bg);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
    border-top: 1px solid var(--border);
    border-bottom: 2px solid var(--border);
    border-right: 1px solid var(--border-light);
    white-space: nowrap;
    position: sticky;
    top: -1px;
    z-index: 3;
}
thead {
    position: relative;
    z-index: 3;
}
thead th:last-child {
    border-right: none;
}

tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    vertical-align: middle;
}

tfoot td {
    padding: 10px 14px;
    border-top: 2px solid var(--border);
    border-right: 1px solid var(--border-light);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    vertical-align: middle;
    background: var(--bg);
    position: sticky;
    bottom: 0;
    z-index: 3;
}
tfoot td:last-child {
    border-right: none;
}

tbody td {
    border-right: 1px solid var(--border-light);
}
tbody td:last-child {
    border-right: none;
}
tbody tr {
    transition: background 0.12s;
}
tbody tr:hover {
    background: var(--sidebar-item-hover);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 48px 20px !important;
    color: var(--text-muted) !important;
    font-size: 14px;
}
.empty-state .empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* ---------- 操作列 ---------- */
.action-cell,
td.actions {
    white-space: nowrap;
    display: flex;
    gap: 6px;
    align-items: center;
}
.action-cell .btn,
td.actions .btn {
    margin: 0;
}

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.pagination button {
    padding: 6px 14px;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    transition: all 0.15s;
    font-family: var(--font);
}
.pagination button:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-lighter);
}
.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.pagination span,
.pagination .page-info {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 0 8px;
    white-space: nowrap;
}

/* ---------- 表单 ---------- */
.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text);
}

.form-group label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font);
    background: var(--bg-card);
    transition: all 0.2s;
    color: var(--text);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
    outline: none;
}
.form-group input:read-only,
.form-group input[readonly] {
    background: var(--bg);
    color: var(--text-secondary);
    cursor: default;
}
.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input[type="month"],
.form-group input[type="date"] {
    min-width: 180px;
}

/* ---------- 表单网格布局（统一替代各种 inline grid） ---------- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 24px;
}
.form-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}
.form-grid .form-group {
    margin-bottom: 0;
}
.form-grid .full-width {
    grid-column: 1 / -1;
}
@media (max-width: 600px) {
    .form-grid,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Payment form grid (legacy) */
.payment-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 18px 24px;
}

.payment-form-grid .form-group {
    margin-bottom: 0;
}

.payment-form-grid .form-group.full-width {
    grid-column: 1 / -1;
}

.payment-form-grid .form-group textarea {
    min-height: 80px;
}

@media (max-width: 600px) {
    .payment-form-grid {
        grid-template-columns: 1fr;
    }
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

/* ---------- 卡片 ---------- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 20px;
    transition: box-shadow 0.2s;
}
.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}
.card-header h3 {
    margin: 0;
}

/* ---------- 快捷导航卡片 ---------- */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}

.nav-card {
    background: var(--bg-card);
    padding: 24px 16px;
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    border: 1.5px solid transparent;
}
.nav-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.nav-card .nav-card-icon {
    font-size: 28px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
}
.nav-card .nav-card-icon svg {
    width: 28px;
    height: 28px;
}
.nav-card .nav-card-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

/* ---------- 统计卡片（首页） ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

/* 统计页专用 - 固定双栏，卡片更宽 */
.stats-grid-wide {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: box-shadow 0.2s;
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.stat-card .stat-icon svg {
    width: 20px;
    height: 20px;
}
.welcome-meta span svg {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
}
.stat-card .stat-icon.blue {
    background: var(--primary-light);
    color: var(--primary);
}
.stat-card .stat-icon.green {
    background: var(--success-light);
    color: var(--success);
}
.stat-card .stat-icon.amber {
    background: var(--warning-light);
    color: var(--warning);
}
.stat-card .stat-icon.red {
    background: var(--danger-light);
    color: var(--danger);
}
.stat-card .stat-icon.primary {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-card .stat-info {
    flex: 1;
    min-width: 0;
}
.stat-card .stat-info .stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}
.stat-card .stat-info .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ---------- 欢迎区域 ---------- */
.welcome-card {
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    padding: 28px 32px;
    color: #fff;
    margin-bottom: 28px;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.25);
}
.welcome-card h2 {
    color: #fff;
    font-size: 20px;
    margin-bottom: 8px;
}
.welcome-card p {
    opacity: 0.9;
    font-size: 14px;
    line-height: 1.6;
}
.welcome-card .welcome-meta {
    display: flex;
    gap: 24px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.welcome-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.welcome-card .welcome-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.welcome-card .welcome-meta span {
    font-size: 13px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---------- 对话框 ---------- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: modalFadeIn 0.15s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 520px;
    max-width: 94%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.2s ease-out;
}

/* Payment modal - wider for payment schedule with 6 columns */
.modal-payment .modal-content {
    width: 780px;
}

@media (max-width: 820px) {
    .modal-payment .modal-content {
        width: 94%;
    }
}

@keyframes modalSlideIn {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2,
.modal-content h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    float: right;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.15s;
    line-height: 1;
}
.modal-close:hover {
    color: var(--text);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}
.modal-header h2,
.modal-header h3 {
    margin: 0;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ---------- 状态标签 ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    gap: 4px;
}
.badge-blue {
    background: var(--primary-light);
    color: var(--primary);
}
.badge-green {
    background: var(--success-light);
    color: var(--success);
}
.badge-red {
    background: var(--danger-light);
    color: var(--danger);
}
.badge-amber {
    background: var(--warning-light);
    color: var(--warning);
}

/* ---------- 提示消息 ---------- */
.message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: msgSlideIn 0.2s ease-out;
}

@keyframes msgSlideIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger);
}
.message-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success);
}
.message-info {
    background: var(--info-light);
    color: var(--info);
    border: 1px solid var(--info);
}
.message-warning {
    background: var(--warning-light);
    color: var(--warning);
    border: 1px solid var(--warning);
}

/* ---------- 登录页 ---------- */
.login-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

.login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(165deg, #dbeafe 0%, #e2e8f0 50%, #f0f4ff 100%);
    z-index: -2;
}

@media (prefers-color-scheme: dark) {
    .login-page::before {
        background: linear-gradient(
            165deg,
            #0f172a 0%,
            #1e1b4b 50%,
            #0b1120 100%
        );
    }
}

/* 浮动光晕 */
.login-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: -1;
}

/* ===== 上方偏左 — 蓝色主调 ===== */
.login-blob-1 {
    width: 650px;
    height: 550px;
    background: rgba(37, 99, 235, 0.1);
    top: -15%;
    left: -8%;
    animation: drift1 16s ease-in-out infinite alternate;
}

/* ===== 中间偏右 — 粉色暖调 ===== */
.login-blob-2 {
    width: 500px;
    height: 600px;
    background: rgba(236, 72, 153, 0.08);
    top: 25%;
    right: -10%;
    animation: drift2 19s ease-in-out infinite alternate;
}

/* ===== 下方偏右 — 紫色过渡 ===== */
.login-blob-3 {
    width: 550px;
    height: 450px;
    background: rgba(139, 92, 246, 0.07);
    bottom: -15%;
    left: 20%;
    animation: drift3 22s ease-in-out infinite alternate;
}

@keyframes drift1 {
    0% {
        transform: translate(0, 0) scale(0.8);
        opacity: 0.3;
    }
    33% {
        transform: translate(100px, 120px) scale(1.1);
        opacity: 0.6;
    }
    66% {
        transform: translate(180px, 60px) scale(0.9);
        opacity: 0.45;
    }
    100% {
        transform: translate(60px, 160px) scale(1.05);
        opacity: 0.55;
    }
}

@keyframes drift2 {
    0% {
        transform: translate(0, 0) scale(0.75);
        opacity: 0.25;
    }
    33% {
        transform: translate(-80px, -60px) scale(1.15);
        opacity: 0.55;
    }
    66% {
        transform: translate(-160px, 40px) scale(0.85);
        opacity: 0.35;
    }
    100% {
        transform: translate(-120px, -100px) scale(1.1);
        opacity: 0.5;
    }
}

@keyframes drift3 {
    0% {
        transform: translate(0, 0) scale(0.7);
        opacity: 0.2;
    }
    50% {
        transform: translate(-120px, -100px) scale(1.1);
        opacity: 0.45;
    }
    100% {
        transform: translate(80px, -160px) scale(0.9);
        opacity: 0.3;
    }
}

@media (prefers-color-scheme: dark) {
    .login-blob-1 {
        background: rgba(59, 130, 246, 0.1);
    }
    .login-blob-2 {
        background: rgba(244, 114, 182, 0.07);
    }
    .login-blob-3 {
        background: rgba(167, 139, 250, 0.07);
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-blob {
        animation: none;
        opacity: 0.4;
    }
}

/* 登录卡片的微妙悬浮感 */
.login-card:hover {
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.login-card {
    transition:
        box-shadow 0.3s ease,
        transform 0.3s ease;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 400px;
    max-width: 100%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
}

.login-card .login-logo {
    text-align: center;
    margin-bottom: 8px;
}

.login-card .login-logo .logo-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: var(--radius);
}

.login-card h1 {
    text-align: center;
    font-size: 20px;
    margin-bottom: 4px;
    font-weight: 700;
}

.login-card .login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 28px;
}

.login-card .form-group {
    margin-bottom: 20px;
}

.login-card .btn {
    width: 100%;
    padding: 11px;
    font-size: 15px;
    font-weight: 600;
}

/* ---------- 工资单特殊样式 ---------- */
.salary-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.salary-summary-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    text-align: center;
}

.salary-summary-card .ssc-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.salary-summary-card .ssc-value {
    font-size: 24px;
    font-weight: 700;
}

.salary-summary-card .ssc-value.green {
    color: var(--success);
}
.salary-summary-card .ssc-value.red {
    color: var(--danger);
}
.salary-summary-card .ssc-value.primary {
    color: var(--primary);
}

/* ---------- 月份输入框统一 ---------- */
.input-month {
    max-width: 200px;
}

/* ---------- JSON 导入输入框 ---------- */
.json-input {
    width: 100%;
    height: 150px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 14px;
    box-sizing: border-box;
    background: var(--bg-card);
    color: var(--text);
    resize: vertical;
}
.json-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* ---------- 工资发放入口 - 汇总卡片、表格列宽 ---------- */
.summary-card {
    display: none;
    margin-bottom: 16px;
    padding: 14px 18px;
}
.summary-card #summaryText {
    font-size: 14px;
    font-weight: 500;
}
.col-num {
    min-width: 50px;
}
.col-name {
    min-width: 70px;
}
.col-amount-sm {
    min-width: 80px;
}
.col-amount {
    min-width: 90px;
}

/* ---------- 个人信息页面 ---------- */
.profile-card {
    padding: 28px 32px;
}

/* ---------- 工资发放编辑输入 ---------- */
.ded-input {
    width: 100px;
    padding: 6px 10px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
    font-family: var(--font);
    text-align: right;
    transition: all 0.2s;
}
.ded-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
    outline: none;
}

/* ---------- 合同展开详情 ---------- */
.contract-detail-row td {
    padding: 0 !important;
    background: #fafbfc;
}

.contract-detail-panel {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.contract-detail-panel .detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

/* ---------- 工资台账专用表样式 ---------- */
.ledger-table {
    table-layout: fixed;
    min-width: 1100px;
}

/* 列头粘顶 */
.ledger-table thead th {
    position: sticky;
    top: -1px;
    z-index: 3;
}

/* 列组着色：身份列(1-2) / 收入列(3-5) / 扣减列(6-12) / 补贴列(13) / 操作列(14) */
.ledger-table thead th:nth-child(1),
.ledger-table thead th:nth-child(2) {
    background: var(--bg);
}
.ledger-table thead th:nth-child(3),
.ledger-table thead th:nth-child(4),
.ledger-table thead th:nth-child(5) {
    background: #ecfdf5;
}
.ledger-table thead th:nth-child(6),
.ledger-table thead th:nth-child(7),
.ledger-table thead th:nth-child(8),
.ledger-table thead th:nth-child(9),
.ledger-table thead th:nth-child(10),
.ledger-table thead th:nth-child(11),
.ledger-table thead th:nth-child(12) {
    background: #fef9ef;
    font-size: 12px;
}
.ledger-table thead th:nth-child(13) {
    background: #eff6ff;
}
.ledger-table thead th:nth-child(14) {
    background: var(--bg);
}

/* 工资台账表格边框修复 */
.ledger-table thead th {
    border-top: 1px solid var(--border);
    border-bottom: 2px solid var(--border);
}
.ledger-table thead th,
.ledger-table tbody td {
    border-right: 1px solid var(--border-light);
}
.ledger-table thead th:last-child,
.ledger-table tbody td:last-child {
    border-right: none;
}

/* 暗色模式覆盖 */
@media (prefers-color-scheme: dark) {
    .ledger-table thead th:nth-child(3),
    .ledger-table thead th:nth-child(4),
    .ledger-table thead th:nth-child(5) {
        background: #0c2e1a;
    }
    .ledger-table thead th:nth-child(6),
    .ledger-table thead th:nth-child(7),
    .ledger-table thead th:nth-child(8),
    .ledger-table thead th:nth-child(9),
    .ledger-table thead th:nth-child(10),
    .ledger-table thead th:nth-child(11),
    .ledger-table thead th:nth-child(12) {
        background: #2a1f0e;
    }
    .ledger-table thead th:nth-child(13) {
        background: #0c1d3a;
    }
}

/* 数字单元格 — 等宽字体右对齐 */
.ledger-table td.num {
    text-align: right;
    font-family: var(--font-mono);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px;
    padding-left: 8px;
    padding-right: 12px;
    white-space: nowrap;
}

/* 月份格式 */
.ledger-table td.cell-month {
    font-family: var(--font-mono);
    font-size: 13px;
    text-align: center;
}

/* 补贴列微强调 */
.ledger-table td.col-subsidy-cell {
    color: var(--primary);
    font-weight: 500;
}

/* 行悬浮底色 */
.ledger-table tbody tr:hover td {
    background: var(--sidebar-item-hover);
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    /* 侧边栏变为 overlay */
    #navbar {
        transform: translateX(-100%);
    }

    .sidebar-menu-toggle {
        display: flex;
    }

    body.sidebar-open #navbar {
        transform: translateX(0);
    }

    #content {
        margin-left: 0;
        padding: 16px 12px;
    }

    /* Toast 在移动端居中 */
    .api-toast {
        left: 50%;
        top: 16px;
    }
    #content > .container {
        margin-left: 0;
        padding: 0;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .page-header h1 {
        font-size: 19px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .cards {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .toolbar input,
    .search-bar input {
        max-width: 100%;
        min-width: 0;
    }

    .modal-content {
        padding: 20px;
        width: 96%;
    }

    table {
        font-size: 13px;
    }
    thead th,
    tbody td {
        padding: 7px 10px;
    }

    .action-cell,
    td.actions {
        flex-wrap: wrap;
    }

    .salary-summary-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 28px 24px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Toast 自定义 ---------- */
.api-toast {
    position: fixed;
    top: 20px;
    left: calc(50% + var(--sidebar-width) / 2);
    transform: translateX(-50%);
    z-index: 9999;
    max-width: 420px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    animation: msgSlideIn 0.2s ease-out;
}

/* ---------- 滚动条美化 ---------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ---------- 加载动画 ---------- */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

/* ---------- Toggle Switch ---------- */
.form-group .toggle-wrap,
label.toggle-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 0;
    font-weight: 400;
    width: auto;
}
.toggle-wrap input {
    display: none;
}
.toggle-track {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--text-muted);
    border-radius: 12px;
    transition: background 0.2s;
    flex-shrink: 0;
}
.toggle-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.toggle-wrap input:checked + .toggle-track {
    background: var(--primary);
}
.toggle-wrap input:checked + .toggle-track::after {
    transform: translateX(20px);
}
.toggle-label {
    font-size: 14px;
    color: var(--text-secondary);
    user-select: none;
}

/* 可点击统计卡片（请假审批等） */
.stat-card[onclick] {
    cursor: pointer;
}
.stat-card.active {
    border: 1.5px solid var(--primary);
    background: var(--primary-lighter);
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.12);
}
.stat-card.active .stat-icon {
    transform: scale(1.05);
}

.employee-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.employee-avatar-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    vertical-align: middle;
    margin-right: 4px;
}

.employee-name {
    font-weight: 500;
    color: var(--text);
}

/* 请假类型徽章 */
.leave-type-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
}

.leave-type-年假 {
    background: #dbeafe;
    color: #1e40af;
}
.leave-type-事假 {
    background: #f1f5f9;
    color: #475569;
}
.leave-type-病假 {
    background: #fce7f3;
    color: #9d174d;
}
.leave-type-婚假 {
    background: #fef3c7;
    color: #92400e;
}
.leave-type-产假\/陪产假 {
    background: #ede9fe;
    color: #6d28d9;
}
.leave-type-丧假 {
    background: #f1f5f9;
    color: #475569;
}
.leave-type-调休 {
    background: #d1fae5;
    color: #065f46;
}
.leave-type-其他 {
    background: #f1f5f9;
    color: #475569;
}

@media (prefers-color-scheme: dark) {
    .leave-type-年假 {
        background: #1e3a5f;
        color: #93c5fd;
    }
    .leave-type-事假 {
        background: #334155;
        color: #cbd5e1;
    }
    .leave-type-病假 {
        background: #4a1942;
        color: #f9a8d4;
    }
    .leave-type-婚假 {
        background: #4a3d1a;
        color: #fbbf24;
    }
    .leave-type-产假\/陪产假 {
        background: #3b1f6e;
        color: #c4b5fd;
    }
    .leave-type-丧假 {
        background: #334155;
        color: #cbd5e1;
    }
    .leave-type-调休 {
        background: #1a3d2e;
        color: #6ee7b7;
    }
    .leave-type-其他 {
        background: #334155;
        color: #cbd5e1;
    }
}

/* ================================================================
   经营看板 — 专用样式
   ================================================================ */

/* ---------- 月份选择器 ---------- */
.month-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 10px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.month-picker-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: auto;
    letter-spacing: 0.3px;
}

.month-picker-label svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.month-picker-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.month-picker-nav button {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.12s;
}

.month-picker-nav button:hover {
    background: var(--bg);
    color: var(--text);
    border-color: var(--primary);
}

.month-picker-nav span {
    display: inline-block;
    min-width: 76px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    padding: 0 8px;
}

/* ---------- 核心指标卡 ---------- */
.biz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

@media (min-width: 1200px) {
    .biz-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 480px) {
    .biz-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}

.biz-stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition:
        box-shadow 0.2s,
        transform 0.15s;
}

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

/* 顶部色条 */
.biz-stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.biz-stat-card.color-blue::before {
    background: var(--primary);
}
.biz-stat-card.color-green::before {
    background: var(--success);
}
.biz-stat-card.color-amber::before {
    background: var(--warning);
}
.biz-stat-card.color-red::before {
    background: var(--danger);
}
.biz-stat-card.color-primary::before {
    background: var(--primary);
}

.biz-stat-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.biz-stat-row1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.biz-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px;
}

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

.biz-stat-icon svg {
    width: 16px;
    height: 16px;
}

.biz-stat-icon.color-blue {
    background: var(--primary-light);
    color: var(--primary);
}
.biz-stat-icon.color-green {
    background: var(--success-light);
    color: var(--success);
}
.biz-stat-icon.color-amber {
    background: var(--warning-light);
    color: var(--warning);
}
.biz-stat-icon.color-red {
    background: var(--danger-light);
    color: var(--danger);
}
.biz-stat-icon.color-primary {
    background: var(--primary-lighter);
    color: var(--primary);
}

.biz-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ---------- 趋势图 ---------- */
.dash-chart-card {
    margin-bottom: 20px;
    padding: 20px 20px 16px;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.chart-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.chart-header h3 svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 11px;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-secondary);
}

.legend-svg {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 0;
}

.legend-svg svg {
    display: block;
}
.legend-line.solid {
    background: var(--primary);
}
.legend-line.dashed {
    border-top: 2px dashed var(--danger);
    height: 0;
    width: 14px;
}
.legend-line.gp {
    background: var(--success);
    height: 6px;
    border-radius: 2px;
    opacity: 0.5;
}

.chart-svg-wrap {
    width: 100%;
    overflow-x: auto;
}

.chart-svg-wrap svg {
    min-width: 520px;
    display: block;
}

/* 图表数据点交互 */
.chart-dot {
    transition:
        r 0.12s,
        opacity 0.12s;
    cursor: pointer;
}

.chart-dot:hover {
    r: 5;
}

.chart-val-label {
    pointer-events: none;
    opacity: 0.8;
}

/* ---------- 看板区域标题 ---------- */
.biz-section-title {
    font-size: 15px;
    font-weight: 600;
    margin: 28px 0 14px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.biz-section-title svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

/* ---------- 月度收支明细 ---------- */
.biz-expense-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 8px;
}

@media (max-width: 800px) {
    .biz-expense-grid {
        grid-template-columns: 1fr;
    }
}

.biz-detail-card {
    padding: 16px 18px;
    margin-bottom: 0;
}

.biz-detail-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1.5px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.expense-table {
    width: 100%;
    border-collapse: collapse;
}

.expense-table td {
    padding: 6px 4px;
    font-size: 13px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
}

.expense-table tr:last-child td {
    border-bottom: none;
}

.expense-table .et-label {
    color: var(--text);
    font-weight: 500;
    width: 82px;
}

.expense-table .et-sub {
    padding-left: 14px;
    color: var(--text-secondary);
    font-size: 12px;
    position: relative;
}

.expense-table .et-sub::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
    transform: translateY(-50%);
}

.expense-table .et-bar {
    width: 60%;
    min-width: 60px;
}

.expense-table .et-bar-track {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.expense-table .et-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.expense-table .et-pct {
    text-align: right;
    width: 36px;
    color: var(--text-muted);
    font-size: 11px;
}

.expense-table .et-amount {
    text-align: right;
    font-family: var(--font-mono);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    width: 95px;
    white-space: nowrap;
}

.expense-table .et-divider td {
    border-bottom: 1px solid var(--border);
    padding: 0;
    height: 8px;
}

.expense-table .et-highlight td {
    font-weight: 600;
    padding-top: 10px;
}

.expense-table .et-highlight .et-amount {
    font-size: 14px;
}

/* 人力构成 - 色块 */
.labor-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 12px;
    border-bottom: 1px solid var(--border-light);
}

.labor-bar-row:last-child {
    border-bottom: none;
}

.labor-bar-dot {
    width: 8px;
    height: 8px;
    border-radius: 3px;
    flex-shrink: 0;
}

.labor-bar-label {
    width: 66px;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.labor-bar-track {
    flex: 1;
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    min-width: 40px;
}

.labor-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.labor-bar-pct {
    width: 34px;
    text-align: right;
    color: var(--text-muted);
    flex-shrink: 0;
}

.labor-bar-amount {
    width: 88px;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* ---------- 外采合同摘要 ---------- */
.biz-procure-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 18px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    margin-bottom: 14px;
    flex-wrap: wrap;
    font-size: 13px;
}

.biz-procure-label {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.biz-procure-stat {
    color: var(--text-secondary);
}

.biz-procure-stat strong {
    color: var(--text);
    font-weight: 600;
}

.biz-procure-paid {
    color: var(--success);
}

.biz-procure-unpaid {
    color: var(--danger);
}

/* ---------- 即将到期合同 ---------- */
.biz-expiring {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 14px 18px;
    margin-bottom: 14px;
}

.biz-expiring-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--warning);
}

.biz-expiring-title svg {
    width: 14px;
    height: 14px;
}

.expiring-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.expiring-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-light);
}

.expiring-table td {
    padding: 8px 8px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.expiring-table tr:last-child td {
    border-bottom: none;
}

.expiring-table .et-col-name {
    font-weight: 500;
    color: var(--text);
}

.expiring-table .et-col-date {
    color: var(--text-secondary);
    white-space: nowrap;
}

.expiring-table .et-col-amount {
    text-align: right;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.expiring-table .et-row-danger td {
    background: rgba(220, 38, 38, 0.05);
}

.expiring-table .et-row-danger .et-col-amount {
    color: var(--danger);
}

.expiring-table .et-row-warning td {
    background: rgba(217, 119, 6, 0.04);
}

.expiring-table .et-row-warning .et-col-amount {
    color: var(--warning);
}

/* ---------- 商机逾期提醒 ---------- */
.biz-opp-overdue {
    padding: 10px 16px;
    background: var(--warning-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.biz-opp-overdue svg {
    width: 16px;
    height: 16px;
    color: var(--warning);
    flex-shrink: 0;
}

/* ---------- 风险预警卡片 ---------- */
.biz-risk-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.risk-card {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s;
}

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

.risk-card.risk-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.risk-card.risk-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.risk-card.risk-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.risk-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.risk-icon svg {
    width: 18px;
    height: 18px;
}

.risk-danger .risk-icon svg {
    color: var(--danger);
}
.risk-warning .risk-icon svg {
    color: var(--warning);
}
.risk-info .risk-icon svg {
    color: var(--info);
}

.risk-body {
    flex: 1;
    min-width: 0;
}

.risk-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.risk-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.risk-action {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}

.risk-btn {
    padding: 4px 14px !important;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-family: var(--font);
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.12s;
}

.risk-btn:hover {
    opacity: 0.8;
    text-decoration: none;
}

.risk-danger .risk-btn {
    background: var(--danger);
    color: #fff;
}

.risk-warning .risk-btn {
    background: var(--warning);
    color: #fff;
}

.risk-info .risk-btn {
    background: var(--primary);
    color: #fff;
}

/* 暗色模式微调 */
@media (prefers-color-scheme: dark) {
    .expiring-table .et-row-danger td {
        background: rgba(220, 38, 38, 0.08);
    }
    .expiring-table .et-row-warning td {
        background: rgba(217, 119, 6, 0.06);
    }

    .risk-card.risk-danger {
        background: rgba(220, 38, 38, 0.1);
        border-color: rgba(220, 38, 38, 0.25);
    }

    .risk-card.risk-warning {
        background: rgba(217, 119, 6, 0.1);
        border-color: rgba(217, 119, 6, 0.25);
    }

    .risk-card.risk-info {
        background: rgba(2, 132, 199, 0.1);
        border-color: rgba(2, 132, 199, 0.25);
    }
}

/* ---------- 商机小卡片覆盖 ---------- */
.biz-opportunity-card {
    background: var(--warning-light);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.biz-opportunity-card svg {
    width: 16px;
    height: 16px;
    color: var(--warning);
    flex-shrink: 0;
}

.approve-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.approve-empty svg {
    margin-bottom: 12px;
    opacity: 0.4;
}

.approve-empty p {
    font-size: 14px;
    margin: 0;
}

/* ---------- 请假创建表单 - 时长预览 ---------- */
.duration-preview {
    background: var(--bg);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

/* ---------- 日期过滤器（提取自报销统计页等） ---------- */
.date-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.date-filter-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.date-filter-label input[type="date"] {
    width: 130px;
    flex-shrink: 0;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text);
    font-size: 13px;
}
.date-filter-sep {
    color: var(--text-muted);
    font-size: 13px;
    flex-shrink: 0;
}

/* ---------- 审批弹窗文字域 ---------- */
.approve-title {
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}
.approve-textarea {
    width: 100%;
    padding: 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    resize: vertical;
    background: var(--bg-card);
    color: var(--text);
    font-size: 14px;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}
.approve-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* ================================================================
   请假详情页
   ================================================================ */

.leave-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border-light);
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
}

.leave-info-section {
    background: var(--bg-card);
    padding: 0;
}

.leave-section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 16px 20px 0;
}

.leave-info-rows {
    padding: 8px 20px 16px;
}

.leave-info-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    gap: 8px;
}

.leave-info-row:last-child {
    border-bottom: none;
}

.leave-info-label {
    font-size: 13px;
    color: var(--text-muted);
    width: 72px;
    flex-shrink: 0;
}

.leave-info-value {
    font-size: 14px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.leave-detail-amount {
    font-weight: 600;
    font-size: 15px;
    color: var(--primary);
}

.leave-detail-danger {
    color: var(--danger);
}

.leave-actions-bar {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .leave-info-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================================
   报销管理模块 — 附加样式
   ================================================================ */

/* 状态徽章 */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
}
.status-draft {
    background: #f1f5f9;
    color: #475569;
}
.status-pending {
    background: #fef3c7;
    color: #92400e;
}
.status-approved {
    background: #d1fae5;
    color: #065f46;
}
.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}
.status-paid {
    background: #dbeafe;
    color: #1e40af;
}

/* 明细编辑行 */
.reimb-item {
    margin-bottom: 8px;
}
.item-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.item-row select,
.item-row input {
    padding: 8px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg-card);
    font-family: var(--font);
}
.item-row .item-category {
    width: 110px;
}
.item-row .item-date {
    width: 140px;
}
.item-row .item-amount {
    width: 120px;
}
.item-row .item-desc {
    flex: 1;
    min-width: 150px;
}

/* 合计金额 */
.total-section {
    text-align: right;
    font-size: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    margin-top: 12px;
}
.total-section #totalAmount {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.detail-header h3 {
    margin: 0;
    font-size: 18px;
}
.detail-table {
    width: 100%;
    border-collapse: collapse;
}
.detail-table th {
    text-align: left;
    padding: 8px 12px;
    width: 100px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    vertical-align: top;
}
.detail-table td {
    padding: 8px 12px;
    font-size: 14px;
}
.text-muted {
    color: var(--text-muted);
}

/* 次级按钮 */
.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: var(--bg);
    border-color: var(--text-muted);
}

/* ================================================================
   报销管理 — 文件上传区样式
   ================================================================ */

.upload-area {
    margin: 16px 0 24px;
}

.upload-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg);
}
.upload-dropzone:hover,
.upload-dropzone.drag-over {
    border-color: var(--primary);
    background: var(--primary-lighter);
}
.upload-icon {
    font-size: 36px;
    margin-bottom: 8px;
}
.upload-dropzone p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 0 12px;
}

.upload-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}
.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-gradient);
    border-radius: 4px;
    transition: width 0.2s;
}
.progress-text {
    font-size: 13px;
    color: var(--text-secondary);
    min-width: 36px;
    text-align: right;
}

.uploaded-files {
    margin-top: 8px;
}
.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}
.file-item .file-icon {
    font-size: 18px;
}
.file-item .file-name {
    flex: 1;
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
}
.file-item .file-name:hover {
    text-decoration: underline;
}
.file-item .file-size {
    color: var(--text-muted);
    font-size: 12px;
}

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

/* ================================================================
   报销统计页面 — 可视化统计区块
   ================================================================ */

.stats-section {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-5) var(--space-6);
    box-shadow: var(--shadow);
    margin-bottom: var(--space-5);
}

.stats-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-row {
    display: flex;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid var(--border-light);
    gap: 12px;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row-label {
    min-width: 72px;
    font-size: 13px;
    color: var(--text);
    flex-shrink: 0;
}

.stat-row-count {
    width: 48px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: right;
    flex-shrink: 0;
}

.stat-row-amount {
    width: 120px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    text-align: right;
    flex-shrink: 0;
}

.stat-bar-bg {
    flex: 1;
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    min-width: 60px;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.stat-bar-pct {
    width: 44px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
    flex-shrink: 0;
}

.stat-period {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 0.02em;
}

.stats-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.stats-empty .stats-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
}

/* ================================================================
   报销详情 — 卡片式详情布局
   ================================================================ */

/* ---------- 详情卡片 ---------- */
.detail-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 16px;
}

.detail-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.detail-card-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.detail-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 10px;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ---------- 信息网格（替换 detail-table） ---------- */
.detail-info {
    padding: 4px 20px 8px;
}

.detail-info-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    line-height: 1.6;
}

.detail-info-row:last-child {
    border-bottom: none;
}

.detail-info-label {
    width: 100px;
    flex-shrink: 0;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
}

.detail-info-value {
    flex: 1;
    color: var(--text);
    min-width: 0;
    word-break: break-word;
}

.detail-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.detail-danger {
    color: var(--danger);
}

.detail-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.detail-empty-icon {
    font-size: 36px;
    margin-bottom: 12px;
    display: block;
}

/* ---------- 金额列右对齐 ---------- */
.col-amount {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* ---------- 文件列表 ---------- */
.file-list {
    padding: 8px 20px;
}

.file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.file-row:last-child {
    border-bottom: none;
}

.file-row-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.file-row-name {
    flex: 1;
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-row-name:hover {
    text-decoration: underline;
}

.file-row-size {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ================================================================
   报销详情 — 审批流程时间轴
   ================================================================ */

.timeline-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 16px;
    padding: 0 0 20px;
}

.timeline-card .timeline {
    padding: 8px 20px 0 52px;
    position: relative;
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-line {
    position: absolute;
    left: 16px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-node {
    position: absolute;
    left: -22px;
    top: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.13);
    transition: transform 0.15s ease;
}

.timeline-item:hover .timeline-node {
    transform: scale(1.12);
}

.timeline-content {
    padding-left: 24px;
}

.timeline-action {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.timeline-operator {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.timeline-comment {
    font-size: 13px;
    color: var(--text);
    margin-top: 6px;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    line-height: 1.5;
}

.timeline-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    letter-spacing: 0.01em;
}

/* ---------- 时间轴节点颜色 ---------- */
.timeline-node.tl-create {
    background: var(--primary);
}
.timeline-node.tl-submit {
    background: var(--info);
}
.timeline-node.tl-approve {
    background: var(--success);
}
.timeline-node.tl-reject {
    background: var(--danger);
}
.timeline-node.tl-revoke {
    background: var(--warning);
}
.timeline-node.tl-pay {
    background: var(--success);
}
.timeline-node.tl-reject-pay {
    background: var(--danger);
}

/* ---------- 可搜索下拉框 ---------- */
.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select .ss-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.searchable-select input[type="text"] {
    width: 100%;
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.searchable-select input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.searchable-select .ss-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-tertiary);
    font-size: 18px;
    line-height: 1;
    display: none;
    padding: 2px;
    border-radius: 50%;
    transition:
        color 0.12s,
        background 0.12s;
}

.searchable-select .ss-clear:hover {
    color: var(--danger);
    background: var(--danger-light);
}

.searchable-select .ss-clear.visible {
    display: block;
}

.searchable-select .ss-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    display: none;
}

.searchable-select .ss-dropdown.open {
    display: block;
}

.searchable-select .ss-option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: background 0.1s;
    border-bottom: 1px solid var(--border-light);
}

.searchable-select .ss-option:last-child {
    border-bottom: none;
}

.searchable-select .ss-option:hover,
.searchable-select .ss-option.highlighted {
    background: var(--primary-lighter);
}

.searchable-select .ss-option .ss-option-sub {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-left: 4px;
}

.searchable-select .ss-option.selected {
    background: var(--primary-light);
    font-weight: 600;
}

.searchable-select .ss-no-results {
    padding: 16px 12px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}
