/* ══════════════════════════════════════════════════════════════
   贵州创枢达科技服务有限公司 - 企业管理系统
   CSS 样式表
   ══════════════════════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #1a73e8;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --red: #ef4444;
    --green: #10b981;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --sidebar-width: 240px;
    --topbar-height: 56px;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
table { border-collapse: collapse; width: 100%; }

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #f1f5f9;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transition: transform 0.3s ease;
    overflow-y: auto;
    /* 让 sidebar 和 main 视觉分离：右侧阴影 */
    box-shadow: 2px 0 12px rgba(0,0,0,.10);
}
.sidebar.collapsed { transform: translateX(-100%); }
/* 桌面端 sidebar 永远显示，不依赖 collapsed 类 */
@media (min-width: 769px) {
    .sidebar.collapsed { transform: translateX(0) !important; }
    .sidebar.mobile-hidden { transform: translateX(0) !important; }
    /* 桌面端阴影更柔和，避免压迫感 */
    .sidebar { box-shadow: 2px 0 16px rgba(0,0,0,.06); }
    /* 桌面端 main 内容左右留出更多呼吸空间 */
    .content-area { padding: 24px 28px; }
    /* 桌面端强制 sidebar 可见 + 关闭 toggle 按钮 */
    .toggle-sidebar { display: none !important; }
    .mobile-tabbar { display: none !important; }
}
.sidebar-header {
    padding: 20px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.logo-icon { font-size: 28px; }
.logo-text h2 { font-size: 18px; font-weight: 700; line-height: 1.2; }
.logo-text small { font-size: 11px; color: #94a3b8; }

.nav-menu { padding: 12px 0; flex: 1; }
.nav-divider {
    padding: 8px 16px 4px;
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    margin: 2px 8px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.15s;
    cursor: pointer;
    gap: 8px;
}
.nav-item:hover { background: var(--sidebar-hover); }
.nav-item.active { background: var(--sidebar-active); color: #fff; font-weight: 500; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
    padding: 12px 16px;
    font-size: 11px;
    color: #64748b;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

/* ── Main Content ── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    background: var(--bg);
}
.main-content.expanded { margin-left: 0; }
/* 桌面端防御：哪怕 JS 没清掉 .expanded，也强制让出 sidebar 宽度 */
@media (min-width: 769px) {
    .main-content.expanded { margin-left: var(--sidebar-width) !important; }
}

/* ── Top Bar ── */
.top-bar {
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.toggle-sidebar {
    background: none;
    font-size: 20px;
    padding: 6px;
    border-radius: 6px;
    color: var(--text-secondary);
}
.toggle-sidebar:hover { background: var(--bg); }

.search-box {
    flex: 1;
    max-width: 400px;
    position: relative;
}
.search-box input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg);
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}
.search-box input:focus { border-color: var(--primary); background: #fff; }
.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--text-muted);
}
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    z-index: 200;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 4px;
}
.search-result-item {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.search-result-item:hover { background: var(--primary-light); }
.search-result-item:last-child { border-bottom: none; }
.result-type {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg);
    color: var(--text-secondary);
}

.top-bar-right { margin-left: auto; display: flex; align-items: center; }
.current-time { font-size: 13px; color: var(--text-secondary); }

/* ── Content Area ── */
.content-area { padding: 24px; }

/* ── Page Header ── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.page-title { font-size: 22px; font-weight: 700; color: var(--text); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 2px 6px; font-size: 11px; }
.btn-group { display: flex; gap: 6px; }

/* ── Stats Cards ── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-card-value { font-size: 28px; font-weight: 700; }
.stat-card-value.income { color: var(--red); }
.stat-card-value.expense { color: var(--green); }
.stat-card-value.balance { color: var(--primary); }

/* ── Charts Row ── */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
.chart-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}
.chart-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; color: var(--text); }
.chart-container { position: relative; height: 280px; }
.chart-container canvas { width: 100% !important; height: 100% !important; }

/* ── Recent Lists ── */
.recent-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 1200px) {
    .charts-row { grid-template-columns: 1fr; }
    .recent-row { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: repeat(3, 1fr); }
}
/* ════ 移动端布局 v2.0 — 卡片化 + 底部 Tab ════ */
@media (max-width: 768px) {
    /* 侧边栏：手机端默认隐藏（用 .mobile-hidden 而非 .collapsed，避免与桌面端语义冲突） */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 24px rgba(0,0,0,.18);
        z-index: 200;
    }
    .sidebar.mobile-hidden { transform: translateX(-100%); }
    .sidebar:not(.mobile-hidden) { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .sidebar-backdrop {
        position: fixed; inset: 0;
        background: rgba(15,23,42,.4);
        z-index: 150;
        display: none;
    }
    .sidebar-backdrop.show { display: block; }

    /* 隐藏桌面端元素 */
    .desktop-only { display: none !important; }

    /* 顶栏紧凑 */
    .top-bar {
        flex-wrap: nowrap;
        padding: 8px 12px;
        gap: 8px;
        height: 52px;
        position: sticky; top: 0; z-index: 50;
        background: var(--card-bg);
        border-bottom: 1px solid var(--border);
    }
    .top-bar .toggle-sidebar {
        padding: 6px 10px;
        font-size: 18px;
        background: transparent;
        color: var(--text);
        border-radius: 8px;
        flex-shrink: 0;
    }
    .top-bar .search-box { display: none; }
    .top-bar-right { gap: 4px; }
    .top-bar-right .user-info,
    .top-bar-right .user-badge { display: none; }
    .top-bar-right .current-time { display: none; }

    /* 主内容区：底部留出 Tab 空间 */
    .content-area {
        padding: 12px;
        padding-bottom: 76px;  /* tabbar + 安全区 */
    }

    /* 工作台 */
    .stats-row { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
    .stat-card { padding: 12px; }
    .stat-card-value { font-size: 20px; }
    .stat-card-label { font-size: 12px; }
    .recent-row { grid-template-columns: 1fr; gap: 12px; }
    .charts-row { grid-template-columns: 1fr; gap: 12px; }
    .chart-container { min-height: 240px; }

    /* 卡片化设计 */
    .card,
    .recent-card { padding: 14px; border-radius: 12px; }
    .card-header { padding: 12px 14px; flex-wrap: wrap; gap: 6px; }
    .card-title { font-size: 14px; }
    .card-actions { width: 100%; flex-wrap: wrap; }
    .card-actions .btn { padding: 6px 10px; font-size: 12px; flex: 1; }

    /* 页面标题 */
    .page-header { flex-direction: column; align-items: stretch; gap: 8px; }
    .page-header > div { display: flex; gap: 6px; }
    .page-header .btn { flex: 1; }
    .page-title { font-size: 18px; }

    /* 过滤栏：紧凑 */
    .filter-bar {
        flex-direction: column;
        gap: 8px;
        padding: 10px 12px;
    }
    .filter-bar .table-filter { width: 100%; }

    /* 表格：手机端隐藏，改用卡片 */
    .data-table-wrapper { display: none !important; }
    .table-toolbar { display: none !important; }

    /* 卡片列表 */
    .card-list { display: flex; flex-direction: column; gap: 10px; }
    .list-card {
        background: var(--card-bg);
        border-radius: 12px;
        padding: 14px;
        box-shadow: 0 1px 4px rgba(0,0,0,.06);
        cursor: pointer;
        transition: transform .15s ease, box-shadow .15s ease;
        border-left: 4px solid var(--primary);
    }
    .list-card:active { transform: scale(.98); background: #f8fafc; }
    .list-card-main {
        display: flex; justify-content: space-between; align-items: flex-start;
        margin-bottom: 8px; gap: 8px;
    }
    .list-card-title {
        font-size: 15px; font-weight: 600; color: var(--text);
        flex: 1; line-height: 1.4;
        word-break: break-word;
    }
    .list-card-status {
        flex-shrink: 0;
        font-size: 11px; padding: 2px 8px; border-radius: 10px;
        background: #e0e7ff; color: #4338ca;
    }
    .list-card-status.success { background: #d1fae5; color: #065f46; }
    .list-card-status.warning { background: #fef3c7; color: #92400e; }
    .list-card-status.danger { background: #fee2e2; color: #991b1b; }
    .list-card-meta {
        display: flex; flex-wrap: wrap; gap: 6px 12px;
        font-size: 12px; color: var(--text-secondary);
    }
    .list-card-meta-item { display: flex; align-items: center; gap: 4px; }
    .list-card-meta-icon { opacity: .6; }
    .list-card-actions {
        display: flex; gap: 6px; margin-top: 10px;
        padding-top: 10px; border-top: 1px dashed var(--border);
    }
    .list-card-actions .btn { flex: 1; padding: 6px 8px; font-size: 12px; }

    /* 空状态 */
    .empty-state {
        padding: 40px 20px; text-align: center; color: var(--text-secondary);
    }
    .empty-state-icon { font-size: 48px; opacity: .4; margin-bottom: 8px; }
    .empty-state-text { font-size: 13px; }

    /* 表单：紧凑（弹窗里的表单） */
    .form-row { flex-direction: column; gap: 6px; }
    .form-row label { font-size: 12px; }
    .form-row .form-input,
    .form-row input,
    .form-row select,
    .form-row textarea { font-size: 14px; padding: 10px 12px; width: 100%; min-height: 40px; }
    .form-actions,
    .modal-footer { flex-direction: column-reverse; gap: 8px; padding: 10px 12px; }
    .form-actions .btn,
    .modal-footer .btn { width: 100%; justify-content: center; min-height: 44px; }

    /* 弹窗：底部弹出 sheet */
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .modal-content {
        width: 100% !important;
        max-width: none !important;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
        animation: slideUp .25s ease;
    }
    @keyframes slideUp { from { transform: translateY(100%);} to { transform: translateY(0);} }
    .modal-header { padding: 14px 16px; position: sticky; top: 0; background: var(--card-bg); z-index: 1; }
    .modal-header h3 { font-size: 16px; }
    .modal-body { padding: 12px 14px; max-height: calc(92vh - 120px); overflow-y: auto; }
    .modal-close {
        width: 32px; height: 32px;
        display: flex; align-items: center; justify-content: center;
        background: #f1f5f9; border-radius: 50%; font-size: 18px;
    }

    /* 分布统计模态框 */
    .dist-modal-content {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    .dist-modal-topbar { flex-wrap: wrap; }
    .dist-modal-topbar #distDimensionTabs { width: 100%; overflow-x: auto; }
    .dist-modal { width: 100% !important; max-width: none !important; border-radius: 16px 16px 0 0; max-height: 92vh; overflow-y: auto; }
    .dist-modal-header { padding: 12px 14px; }
    .dist-modal-header h2 { font-size: 16px; }
    .chart-type-btn { font-size: 11px !important; padding: 4px 8px !important; }

    /* FAB 浮动新增按钮 */
    .mobile-fab {
        position: fixed; right: 16px; bottom: 84px;
        width: 52px; height: 52px; border-radius: 50%;
        background: var(--primary); color: #fff;
        font-size: 24px;
        box-shadow: 0 4px 12px rgba(26,115,232,.4);
        border: none;
        display: flex; align-items: center; justify-content: center;
        z-index: 60;
    }
    .mobile-fab:active { transform: scale(.95); }

    /* 底部 Tab 导航 */
    .mobile-tabbar {
        position: fixed; left: 0; right: 0; bottom: 0;
        height: 56px;
        background: var(--card-bg);
        border-top: 1px solid var(--border);
        display: flex; align-items: stretch;
        z-index: 100;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    /* 桌面端隐藏 tabbar + 汉堡按钮 */
    @media (min-width: 769px) {
        .mobile-tabbar { display: none !important; }
        .toggle-sidebar { display: none !important; }
    }
    .mobile-tab {
        flex: 1;
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 2px;
        font-size: 11px; color: var(--text-secondary);
        cursor: pointer; user-select: none;
        -webkit-tap-highlight-color: transparent;
        transition: color .15s;
    }
    .mobile-tab .tab-icon { font-size: 20px; line-height: 1; }
    .mobile-tab.active { color: var(--primary); }
    .mobile-tab:active { background: #f1f5f9; }

    /* Tab Bar (通用：账号密码 外部/内部 等场景) */
    .tab-bar .tab-btn {
        padding: 8px 16px;
        border: 1px solid var(--border);
        background: var(--card-bg);
        border-radius: 20px;
        cursor: pointer;
        font-size: 13px;
        color: var(--text-secondary);
        transition: all .15s;
    }
    .tab-bar .tab-btn.active {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }
    .tab-bar .tab-btn:hover:not(.active) {
        background: #f1f5f9;
    }

    /* 辅导跟踪照片缩略图 */
    .trk-photo-thumb {
        position: relative;
        width: 90px; height: 90px;
        border-radius: 8px;
        overflow: hidden;
        border: 1px solid var(--border);
    }
    .trk-photo-thumb img {
        width: 100%; height: 100%;
        object-fit: cover;
        cursor: pointer;
    }
    .trk-photo-del {
        position: absolute;
        top: 2px; right: 2px;
        width: 22px; height: 22px;
        background: rgba(220,38,38,.85);
        color: #fff;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        font-size: 14px;
        line-height: 1;
    }

    /* 全屏 sheet（个人中心/更多模块） */
    .mobile-sheet {
        position: fixed; left: 0; right: 0; bottom: 0;
        background: var(--card-bg);
        border-radius: 16px 16px 0 0;
        max-height: 80vh;
        z-index: 200;
        padding-bottom: env(safe-area-inset-bottom, 0);
        animation: slideUp .25s ease;
        display: flex; flex-direction: column;
    }
    .mobile-sheet-header {
        padding: 16px; border-bottom: 1px solid var(--border);
        display: flex; justify-content: space-between; align-items: center;
        font-size: 16px; font-weight: 600;
    }
    .mobile-sheet-body { padding: 8px 0; overflow-y: auto; flex: 1; }
    .mobile-sheet-item {
        display: flex; align-items: center; gap: 12px;
        padding: 14px 16px;
        font-size: 14px;
        cursor: pointer;
        border-bottom: 1px solid #f1f5f9;
    }
    .mobile-sheet-item:active { background: #f1f5f9; }
    .mobile-sheet-item-icon { font-size: 20px; }
    .mobile-sheet-item-text { flex: 1; }
    .mobile-sheet-item-arrow { color: #cbd5e1; }

    /* 通用文本与按钮 */
    h1 { font-size: 18px; }
    h2 { font-size: 16px; }
    h3 { font-size: 15px; }
    .btn { padding: 10px 16px; font-size: 13px; min-height: 40px; }
    .btn-xs { padding: 6px 10px; font-size: 12px; min-height: 32px; }
}

/* ── 小屏手机 ≤ 480px 进一步压缩 ── */
@media (max-width: 480px) {
    .top-bar { padding: 6px 10px; }
    .content-area { padding: 10px; padding-bottom: 70px; }
    .stat-card-value { font-size: 18px; }
    .list-card-title { font-size: 14px; }
    .modal-content { max-height: 95vh; }
    .modal-body { padding: 10px 12px; }
}

/* ── 触屏优化 ── */
@media (hover: none) and (pointer: coarse) {
    .nav-item { padding: 12px 18px; }
    .btn { min-height: 44px; }
}

.recent-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}
.recent-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.recent-item:last-child { border-bottom: none; }
.recent-item-left { display: flex; flex-direction: column; }
.recent-item-title { font-weight: 500; color: var(--text); }
.recent-item-subtitle { font-size: 12px; color: var(--text-secondary); }
.recent-item-right { text-align: right; }
.recent-item-amount { font-weight: 600; }
.recent-item-amount.income { color: var(--red); }
.recent-item-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}
.status-draft { background: #f1f5f9; color: #64748b; }
.status-active { background: #dcfce7; color: #16a34a; }
.status-completed { background: #dbeafe; color: #2563eb; }
.status-cancelled { background: #fee2e2; color: #dc2626; }
.status-warning { background: #ffedd5; color: #ea580c; }
.status-submitted { background: #e0e7ff; color: #4f46e5; }
.status-approved { background: #dcfce7; color: #16a34a; }
.status-rejected { background: #fee2e2; color: #dc2626; }
.status-pending { background: #fef3c7; color: #d97706; }
.status-finished { background: #ede9fe; color: #7c3aed; }

/* 验收倒计时颜色分级 */
.countdown-urgent { color: #ef4444; font-weight: 600; }    /* 已逾期/≤30天 */
.countdown-warning { color: #ea580c; font-weight: 600; }   /* 31-90天 */
.countdown-normal { color: #2563eb; font-weight: 500; }    /* 91-180天 */
.countdown-safe { color: #16a34a; font-weight: 500; }      /* >180天 */
.countdown-empty { color: #94a3b8; }                       /* 未设置 */

/* ── Table ── */
.table-container {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.table-toolbar {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}
.table-toolbar-left { display: flex; gap: 10px; align-items: center; }
.table-filter {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    outline: none;
    min-width: 160px;
}
.table-filter:focus { border-color: var(--primary); }
.table-info { font-size: 12px; color: var(--text-secondary); }

table.data-table {
    width: 100%;
    border-collapse: collapse;
}
table.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: #f8fafc;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    user-select: none;
}
table.data-table th.sortable { cursor: pointer; }
table.data-table th.sortable:hover { color: var(--primary); }
table.data-table td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
table.data-table tr:hover td { background: #f8fafc; }
table.data-table .actions { white-space: nowrap; }
.table-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 14px;
}
.table-empty-icon { font-size: 40px; margin-bottom: 12px; }

/* ── Modal ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-content {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: modalSlideIn 0.2s ease;
}
@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
    background: none;
    font-size: 20px;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 4px;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}
.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-control.required { border-left: 3px solid var(--primary); }

/* ── Toast ── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    color: #fff;
    box-shadow: var(--shadow-md);
    animation: toastIn 0.3s ease;
    min-width: 200px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ── Detail Card ── */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.detail-item { display: flex; flex-direction: column; }
.detail-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.detail-value { font-size: 14px; font-weight: 500; color: var(--text); }

/* ── Backup Page ── */
.backup-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.backup-section h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.backup-section p { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.backup-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Amount Display ── */
.amount { font-family: "SF Mono", "Consolas", monospace; font-weight: 600; }
.amount-income { color: var(--red); }
.amount-expense { color: var(--green); }
.amount-received { color:#1a73e8; font-weight:600; }

/* ── Loading Spinner ── */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ── Confirm Dialog ── */
.confirm-content {
    max-width: 400px;
    text-align: center;
    padding: 30px 20px;
}
.confirm-icon { font-size: 40px; margin-bottom: 12px; }
.confirm-text { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }

/* ── Filter Bar ── */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}
.filter-bar select, .filter-bar input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    outline: none;
}
.filter-bar select:focus { border-color: var(--primary); }

/* ── Pagination ── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 16px;
    border-top: 1px solid var(--border);
}
.pagination button {
    padding: 6px 10px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 4px;
    font-size: 13px;
    color: var(--text);
}
.pagination button:hover { background: var(--bg); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Login Page ── */
.login-body {
    background: linear-gradient(135deg, #1e3a5f 0%, #1a73e8 50%, #4facfe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    text-align: center;
}
.login-logo { font-size: 48px; margin-bottom: 12px; }
.login-card h1 { font-size: 22px; color: #1e293b; margin-bottom: 4px; }
.login-subtitle { font-size: 13px; color: #64748b; margin-bottom: 28px; }
.login-card .form-group { text-align: left; }
.login-card .form-control { padding: 10px 14px; font-size: 14px; }
.login-btn { width: 100%; padding: 12px; font-size: 15px; margin-top: 8px; justify-content: center; }
.login-error { color: #ef4444; font-size: 13px; margin-bottom: 12px; padding: 8px; background: #fef2f2; border-radius: 6px; }
.login-links { margin-top: 16px; font-size: 13px; color: #64748b; }
.login-links a { color: #1a73e8; cursor: pointer; }
.login-links a:hover { text-decoration: underline; }

/* ── Top Bar User Info ── */
.top-bar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-info { font-size: 13px; color: var(--text); }
.user-info strong { color: var(--primary); }
.user-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
.badge-master { background: #fef3c7; color: #d97706; }
.badge-sub { background: #f1f5f9; color: #64748b; }
.btn-logout { background: none; border: 1px solid var(--border); padding: 5px 12px; border-radius: 6px; font-size: 12px; color: var(--text-secondary); }
.btn-logout:hover { background: var(--bg); color: var(--danger); }

/* ── Contact List in Form ── */
.contacts-section { margin-bottom: 16px; }
.contacts-section h4 { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--text); }
.contact-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 8px;
}
.contact-row .form-control { padding: 6px 10px; font-size: 12px; }
.btn-add-contact, .btn-remove-contact {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}
.btn-add-contact { background: #e8f0fe; color: #1a73e8; border: 1px dashed #1a73e8; }
.btn-remove-contact { background: #fef2f2; color: #ef4444; border: none; }

/* ── Qualifications Section ── */
.quals-section { margin-bottom: 16px; }
.qual-row {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 8px;
}
.qual-row select, .qual-row input { font-size: 12px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; }

/* ── Charge Details Section ── */
.charge-detail-row {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 8px;
}
.charge-detail-row input { padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; width: 120px; }

/* ── Searchable Select ── */
.searchable-select {
    position: relative;
}
.searchable-select .search-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    width: 100%;
    outline: none;
}
.searchable-select .search-input:focus { border-color: var(--primary); }
.searchable-select .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 300;
    box-shadow: var(--shadow-md);
    margin-top: 2px;
}
.searchable-select .dropdown.show { display: block; }
.searchable-select .dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    border-bottom: 1px solid #f1f5f9;
}
.searchable-select .dropdown-item:hover { background: var(--primary-light); }
.searchable-select .dropdown-item .item-meta { font-size: 10px; color: var(--text-muted); }

/* ── Conditional Field ── */
.conditional-field { display: none; padding: 10px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; margin-top: 8px; }
.conditional-field.show { display: block; }

/* ── Inline Label ── */
.form-check-label { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 8px; }
.form-check-label input[type="checkbox"] { width: 16px; height: 16px; }

/* ── Permission Panel ── */
.permission-panel {
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 16px;
}
.permission-panel h4 { font-size: 14px; margin-bottom: 12px; }
.permission-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.permission-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 6px 10px;
    background: #fff;
    border-radius: 6px;
}

/* ── File Upload Area ── */
.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8fafc;
    position: relative;
}
.file-upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.file-upload-area.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.02);
}
.file-upload-icon {
    font-size: 36px;
    margin-bottom: 8px;
}
.file-upload-text {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}
.file-upload-text small {
    color: var(--text-muted);
    font-size: 12px;
}
.file-upload-exist {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ecfdf5;
    color: #065f46;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    border: 1px solid #a7f3d0;
}

/* ========== 扫描件预览弹窗 ========== */
.scan-preview-container {
    display: flex;
    flex-direction: column;
    height: 70vh;
    min-height: 400px;
    background: #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
}
.scan-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.scan-preview-filename {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 16px;
}
.scan-download-btn {
    white-space: nowrap;
    flex-shrink: 0;
}
.scan-preview-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #525659;
    overflow: auto;
}
.scan-preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}
.scan-preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
/* 不支持预览的文件 */
.scan-preview-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
}
.scan-preview-fallback-icon {
    font-size: 64px;
    margin-bottom: 16px;
}
.scan-preview-fallback-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    word-break: break-all;
}
.scan-preview-fallback-hint {
    font-size: 13px;
    color: var(--text-muted);
}
/* 弹窗尺寸：预览时需要更大 */
#modal-overlay.show .modal {
    max-width: 900px;
}
#modal-overlay.show:has(.scan-preview-container) .modal,
#modal-overlay.show:has(.scan-preview-fallback) .modal {
    max-width: 900px;
    width: 90vw;
}

/* ── 工作台分布统计弹窗 ── */
.dist-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: distModalFadeIn 0.18s ease-out;
}
@keyframes distModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.dist-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 95vw;
    max-width: 1200px;
    height: 85vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: distModalSlideIn 0.22s ease-out;
}
@keyframes distModalSlideIn {
    from { transform: translateY(-12px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
.dist-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    flex-shrink: 0;
}
.dist-modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}
.dist-modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    color: #94a3b8;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    line-height: 1;
    padding: 0;
    margin-left: 4px;
}
.dist-modal-close:hover {
    background: #f1f5f9;
    color: #ef4444;
}
.dist-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 16px 24px 24px;
}
.dist-modal-topbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    flex-shrink: 0;
}
.dist-modal-content {
    flex: 1;
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 16px;
    min-height: 0;
}
.dist-table-wrap {
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}
.dist-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.dist-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}
.dist-table tbody tr:hover {
    background: #f8fafc;
}
.dist-chart-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fafafa;
    padding: 12px;
    overflow: auto;
    min-height: 0;
}
.dist-tab {
    transition: all 0.15s ease;
}
.dist-tab:hover {
    background: #e8f0fe !important;
    color: #1a73e8 !important;
    border-color: #1a73e8 !important;
}
.dist-tab.active:hover {
    background: #1557b0 !important;
}
.chart-type-btn {
    transition: all 0.15s ease;
}
.chart-type-btn:hover {
    background: #e8f0fe !important;
    color: #1a73e8 !important;
    border-color: #1a73e8 !important;
}
@media (max-width: 900px) {
    .dist-modal-content {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }
}

/* ══════════════════════════════════════════════════════════════
   v1.8 — 手机 App 精简锁定模式 + 辅导跟踪移动卡片
   触发：Android 壳注入 UA 标记 ChuangShudaApp 且未二次解锁
   ══════════════════════════════════════════════════════════════ */
/* App 锁定模式：导航只保留 .nav-free（辅导跟踪 / 解锁入口） */
body.app-lock-mode .nav-item:not(.nav-free),
body.app-lock-mode .nav-divider { display: none !important; }
body.app-lock-mode .sidebar-footer { display: none; }
body.app-lock-mode .search-box { display: none !important; }
#nav-unlock-btn { color: #f59e0b; }

/* 解锁弹窗 */
.unlock-hint { color: var(--text-secondary); font-size: 13px; margin: 2px 0 14px; line-height: 1.7; }
#unlock-pwd { min-height: 46px; font-size: 17px; letter-spacing: 3px; text-align: center; }
.unlock-err { color: var(--danger); font-size: 12px; min-height: 18px; margin-top: 8px; }

/* 辅导跟踪 · 移动卡片（JS 仅手机端生成） */
#trk-card-list { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }
.trk-card { background: var(--card-bg); border-radius: 12px; padding: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06); border-left: 4px solid var(--primary); }
.trk-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.trk-card-name { font-size: 15px; font-weight: 600; color: var(--text); flex: 1; line-height: 1.4; word-break: break-word; }
.trk-card-tags { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.trk-tag { font-size: 11px; padding: 1px 8px; border-radius: 10px; background: #eef2ff; color: #4338ca; white-space: nowrap; }
.trk-tag.year { background: #e0f2fe; color: #0369a1; }
.trk-proj { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: #f8fafc; }
.trk-proj:last-child { margin-bottom: 0; }
.trk-proj-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; word-break: break-word; }
.trk-proj-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.trk-proj-cell { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 2px;
    background: #fff; border-radius: 6px; }
.trk-proj-cell span { font-size: 10px; color: var(--text-secondary); }
.trk-proj-cell b { font-size: 13px; color: var(--text); font-weight: 600; }
.trk-proj-cell.hl b { color: var(--primary); }
.trk-card-empty { font-size: 12px; color: var(--text-secondary); padding: 10px 2px; text-align: center; }
.trk-card-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--text-secondary); margin-top: 10px; }
.trk-unit-note { font-size: 10px; color: #94a3b8; margin-top: 4px; text-align: right; }
.trk-card-actions { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.trk-card-actions .btn { flex: 1; }

/* 照片操作按钮（App 端：相册 / 拍照 + 水印提示） */
.trk-photo-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.trk-photo-btns .btn { flex: 1; justify-content: center; min-height: 40px; }
.trk-photo-tip { font-size: 11px; color: var(--text-secondary); margin-top: 5px; line-height: 1.5; }

/* ══════════════════════════════════════════════════════════════
   v1.9 — 辅导跟踪 手机端卡片列表微调
   ══════════════════════════════════════════════════════════════ */
.trk-mob-top {
    display: flex; justify-content: space-between; align-items: center;
    margin: 4px 2px 8px; font-size: 13px; color: var(--text-secondary);
}
.trk-mob-top strong { color: var(--primary); font-size: 15px; }
/* 卡片内项目金额 4 列：小屏进一步压缩 */
@media (max-width: 768px) {
    #trk-card-list .trk-proj-cell span { font-size: 9px; white-space: nowrap; }
    #trk-card-list .trk-proj-cell b { font-size: 12px; }
    #trk-card-list .trk-card-name { font-size: 14px; }
}
/* 弹窗内「拍照/相册」隐藏的原生文件输入不占位 */
.trk-followup-row input[type="file"] { font-size: 12px; }
@media (max-width: 768px) {
    .trk-followup-row input[type="file"] { padding: 6px; }
}
/* App 锁定态：隐藏桌面导出按钮容器（若残留） */
body.app-lock-mode .trk-export-btns { display: none !important; }
.trk-export-btns { display: inline-flex; gap: 6px; }

/* ════════════════════════════════════════════════════════════
   系统设置页 v2.0：7 分组 Tab
   ════════════════════════════════════════════════════════════ */
.settings-tabs {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-bottom: 16px;
}
.settings-tab-btn {
    padding: 9px 16px; border: 1px solid var(--border-color); border-radius: 8px;
    background: var(--bg-light); color: var(--text-muted);
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: all .18s ease; white-space: nowrap;
}
.settings-tab-btn:hover { color: var(--primary); border-color: var(--primary); }
.settings-tab-btn.active {
    background: var(--primary); border-color: var(--primary);
    color: #fff; box-shadow: 0 2px 8px rgba(26,115,232,.25);
}
.settings-tab-body { animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* 设置页两列字段布局 */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 600px) { .form-row-2 { grid-template-columns: 1fr; } }
/* 备份文件表格紧凑化 */
.settings-tab-body .data-table td, .settings-tab-body .data-table th { padding: 8px 10px; font-size: 13px; }

/* ════════════════════════════════════════════════════════════
   员工权限面板 v2：4 维度（模块/操作/范围/管理类）
   ════════════════════════════════════════════════════════════ */
.perm-actions-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
    background: var(--bg-light); border-radius: 8px; overflow: hidden;
}
.perm-actions-table th, .perm-actions-table td {
    padding: 7px 10px; border-bottom: 1px solid var(--border-color);
    text-align: center; white-space: nowrap;
}
.perm-actions-table th { background: var(--bg-light); font-weight: 600; color: var(--text-muted); }
.perm-actions-table tr:last-child td { border-bottom: none; }
.perm-actions-table input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.perm-actions-table input[type="checkbox"]:disabled { opacity: .35; cursor: not-allowed; }
.permission-panel h4 { margin-bottom: 4px; }
.permission-item input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* ══════════════════════════════════════════════════════════════
   手机 App 只读模式：隐藏所有新增/编辑/删除/保存/导入类写操作按钮
   （通过 body.is-app 类激活；电脑客户端与网页端不受影响）
   ══════════════════════════════════════════════════════════════ */
body.is-app .page-header button.btn-primary,
body.is-app .page-header button.btn-outline,
body.is-app .data-table td.actions button,
body.is-app .data-table td button.btn-danger,
body.is-app button[onclick*="openCustomerForm"],
body.is-app button[onclick*="openContractForm"],
body.is-app button[onclick*="openProjectForm"],
body.is-app button[onclick*="openReceivableForm"],
body.is-app button[onclick*="openFinanceForm"],
body.is-app button[onclick*="openEmployeeForm"],
body.is-app button[onclick*="openAttendanceDialog"],
body.is-app button[onclick*="openPayrollConfigDialog"],
body.is-app button[onclick*="openPayrollOverviewDialog"],
body.is-app button[onclick*="openExportDialog"],
body.is-app button[onclick*="openInternalAccountForm"],
body.is-app button[onclick*="openAccountForm"],
body.is-app button[onclick*="delete"],
body.is-app button[onclick*="Delete"],
body.is-app button[onclick*="Save"],
body.is-app button[onclick*="save"],
body.is-app button[onclick*="Import"],
body.is-app button[onclick*="Export"],
body.is-app button[onclick*="Upload"],
body.is-app button[onclick*="Toggle"],
body.is-app button[onclick*="Reset"],
body.is-app button[onclick*="addProgress"],
body.is-app button[onclick*="addPayment"],
body.is-app button[onclick*="addInvoice"],
body.is-app button[onclick*="addDaily"],
body.is-app button[onclick*="_addDaily"],
body.is-app button[onclick*="_toggleDailyAttendance"],
body.is-app button[onclick*="_calcAll"],
body.is-app button[onclick*="_calcOne"],
body.is-app button[onclick*="_showAddUserForm"],
body.is-app button[onclick*="_showEditUserForm"],
body.is-app button[onclick*="_showAddQualType"],
body.is-app button[onclick*="_editQualType"],
body.is-app button[onclick*="_deleteQualType"],
body.is-app button[onclick*="_deleteUser"],
body.is-app button[onclick*="toggleUserStatus"],
body.is-app button[onclick*="_saveNewUser"],
body.is-app button[onclick*="_saveEditUser"],
body.is-app button[onclick*="savePayrollConfig"],
body.is-app button[onclick*="_exportPayroll"],
body.is-app .btn-add-contact,
body.is-app .btn-remove-contact,
body.is-app .mobile-fab,
body.is-app .add-row,
body.is-app .delete-row,
body.is-app .card-action {
    display: none !important;
}
/* App 模式下表格行高亮和悬停禁用（更适合翻看） */
body.is-app .data-table tr:hover { background: inherit; }
/* App 模式下表单输入框设为只读（防误操作） */
body.is-app .modal-body input,
body.is-app .modal-body textarea,
body.is-app .modal-body select {
    pointer-events: none;
    background: var(--bg-light, #f8fafc);
    opacity: .85;
}

/* ══════════════════════════════════════════════════════════════
   手机 App 收支管理例外：允许新增/编辑/删除（与电脑客户端一致）
   通过 body.is-app.module-finance 类激活，仅作用于收支管理模块
   ══════════════════════════════════════════════════════════════ */
body.is-app.module-finance .page-header button.btn-primary,
body.is-app.module-finance .page-header button.btn-outline,
body.is-app.module-finance .data-table td.actions button,
body.is-app.module-finance .data-table td button.btn-danger,
body.is-app.module-finance button[onclick*="openFinanceForm"],
body.is-app.module-finance button[onclick*="deleteFinance"],
body.is-app.module-finance .mobile-fab {
    display: inline-flex !important;
}
body.is-app.module-finance .modal-body input,
body.is-app.module-finance .modal-body textarea,
body.is-app.module-finance .modal-body select {
    pointer-events: auto !important;
    opacity: 1 !important;
}

/* ══════════════════════════════════════════════════════════════
   手机 App 隐藏：组织管理 + 系统设置 两个分组
   集团分组 div.nav-divider + 紧跟的所有 .nav-item 一起隐藏
   ══════════════════════════════════════════════════════════════ */
/* 组织管理（员工/内部账号/账号管理） */
body.is-app .nav-divider.app-hide-group,
body.is-app .nav-item.app-hide-group { display: none !important; }
