/* ============================================================
   清算云 · H5 / PC 共用样式
   设计令牌：品牌紫 #5046E5 / 增长绿 #10B981 / 卡片圆角 12
   PC ≥ 960px：左侧导航；H5 < 960px：底部标签栏 + 单列卡片
   ============================================================ */

:root {
    --brand: #5046E5;
    --brand-weak: #F2F1FE;
    --brand-line: #E2DFFB;
    --accent: #10B981;
    --warn: #F59E0B;
    --danger: #E5484D;
    --ink: #0F1419;
    --ink-2: #4B5563;
    --ink-3: #6B7280;
    --ink-4: #9CA3AF;
    --line: #EDEDF1;
    --line-2: #E7E7EA;
    --bg: #F9F9FB;
    --card: #FFFFFF;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .10);
    --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--brand); text-decoration: none; }

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-4); }
.pos { color: var(--accent); }
.neg { color: var(--ink); }

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    flex: 0 0 240px;
    background: var(--card);
    border-right: 1px solid var(--line);
    padding: 20px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand { display: flex; align-items: center; gap: 9px; padding-left: 6px; }
.brand img { width: 26px; height: 26px; border-radius: 8px; object-fit: cover; }
.brand-mark {
    width: 26px; height: 26px; border-radius: 8px;
    background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}
.brand-name { font-size: 17px; font-weight: 600; letter-spacing: -.2px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
    display: flex; align-items: center; gap: 10px;
    height: 38px; padding: 0 10px; border-radius: 8px;
    color: var(--ink-3); font-size: 13.5px;
}
.nav a:hover { background: #FAFAFC; color: var(--ink); }
.nav a.active { background: var(--brand-weak); color: var(--brand); font-weight: 500; }
.nav svg { width: 17px; height: 17px; flex: 0 0 17px; }

.sidebar-foot { margin-top: auto; }
.user-card {
    display: flex; align-items: center; gap: 9px;
    padding: 8px; border-radius: 9px; background: var(--bg);
}
.avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: #E6E4FC; color: var(--brand);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 500; flex: 0 0 28px;
}
.user-meta { min-width: 0; }
.user-meta strong { display: block; font-size: 12.5px; font-weight: 500; }
.user-meta span { display: block; font-size: 10.5px; color: var(--ink-4); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-bottom: 24px; }

.topbar {
    height: 78px; background: var(--card);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px; gap: 16px; position: sticky; top: 0; z-index: 20;
}
.topbar h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.3px; }
.topbar .sub { margin: 5px 0 0; font-size: 12px; color: var(--ink-4); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.content { padding: 22px 28px 0; display: flex; flex-direction: column; gap: 14px; }

/* ---------- 组件 ---------- */
.btn {
    height: 36px; padding: 0 15px; border-radius: 8px;
    background: var(--brand); color: #fff; font-size: 13px; font-weight: 500;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    transition: filter .15s; white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: var(--card); color: var(--ink-2); border: 1px solid var(--line-2); }
.btn.weak { background: var(--brand-weak); color: var(--brand); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn.block { width: 100%; height: 46px; font-size: 14px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.field input, .field select, .field textarea {
    height: 40px; padding: 0 12px; border: 1px solid var(--line-2);
    border-radius: 8px; background: #fff; outline: none;
}
.field textarea { height: auto; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(80, 70, 229, .12); }

.card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title { font-size: 13px; font-weight: 500; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
/* 5 张 KPI 的页面（如销售入库）：避免最后一张单独占一行 */
.kpi-grid.kpi-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1180px) { .kpi-grid.kpi-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 960px) { .kpi-grid.kpi-5 { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px; }
.kpi.primary { background: #FBFAFF; border-color: #E6E4FC; }
.kpi .label { font-size: 12px; color: var(--ink-3); }
.kpi .value { font-size: 22px; font-weight: 700; margin: 8px 0 6px; letter-spacing: -.5px; }
.kpi.primary .value { color: var(--brand); }
.kpi .delta { font-size: 11px; }

.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; }

/* 图表 */
.chart { width: 100%; height: 220px; display: block; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.bar-name { width: 92px; font-size: 12px; color: var(--ink-2); flex: 0 0 92px; }
.bar-track { flex: 1; height: 6px; background: #F1F1F4; border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 3px; }
.bar-val { width: 96px; text-align: right; font-size: 12px; flex: 0 0 96px; }

/* 表格 */
.table-wrap { overflow-x: auto; margin: -16px; padding: 0; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
thead th {
    text-align: left; font-size: 11.5px; font-weight: 500; color: var(--ink-4);
    background: #FAFAFC; padding: 12px 16px; white-space: nowrap;
}
tbody td { padding: 13px 16px; border-top: 1px solid #F4F4F7; font-size: 13px; vertical-align: middle; }
tbody tr:hover { background: #FCFCFE; }
td.amount { text-align: right; white-space: nowrap; }
th.amount { text-align: right; }
.cell-sub { font-size: 11px; color: var(--ink-4); margin-top: 3px; }

.pill {
    display: inline-flex; align-items: center; height: 22px;
    padding: 0 9px; border-radius: 100px; font-size: 11px; font-weight: 500;
    background: #EDFAF4; color: #0F9D6E;
}
.pill.warn { background: #FEF6E9; color: #B4740B; }
.pill.muted { background: #F4F4F7; color: var(--ink-3); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip {
    height: 32px; padding: 0 14px; border-radius: 100px;
    background: #fff; border: 1px solid var(--line-2);
    font-size: 12.5px; color: var(--ink-2);
    display: inline-flex; align-items: center;
}
.chip.active { background: var(--brand-weak); border-color: transparent; color: var(--brand); font-weight: 500; }

/* 套餐 */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 24px; background: #fff; display: flex; flex-direction: column; gap: 16px; }
.plan.featured { background: #FBFAFF; border-color: #CFCBF9; box-shadow: 0 12px 32px -16px rgba(80, 70, 229, .35); }
.plan .pname { font-size: 14px; font-weight: 500; color: var(--ink-3); display: flex; justify-content: space-between; align-items: center; }
.plan.featured .pname { color: var(--brand); }
.plan .price { font-size: 36px; font-weight: 700; letter-spacing: -1px; }
.plan .price small { font-size: 13px; font-weight: 400; color: var(--ink-4); margin-left: 4px; letter-spacing: 0; }
.plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.plan li { font-size: 13px; color: var(--ink-2); padding-left: 18px; position: relative; line-height: 1.5; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-size: 12px; }

/* 登录 */
.login-page {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 26px; padding: 24px;
    background: radial-gradient(120% 120% at 50% 0%, #FFFFFF 0%, #F1F0FA 60%, #EDEBF8 100%);
}
.login-card {
    width: 100%; max-width: 400px; background: #fff;
    border: 1px solid var(--line); border-radius: 16px; padding: 32px;
    box-shadow: 0 24px 60px -24px rgba(16, 24, 40, .18);
    display: flex; flex-direction: column; gap: 16px;
}
.login-card h2 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.4px; }
.login-card p.hint { margin: -8px 0 0; font-size: 13px; color: var(--ink-3); }
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.tabs button { padding: 0 0 10px; font-size: 13px; color: var(--ink-4); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--brand); border-color: var(--brand); font-weight: 500; }
.captcha-row { display: flex; gap: 10px; }
.captcha-row input { flex: 1; min-width: 0; }
.captcha-row img { height: 40px; width: 132px; border-radius: 8px; border: 1px solid var(--line-2); cursor: pointer; object-fit: contain; background: #F9F9FB; }

/* 弹层 */
.modal-mask {
    position: fixed; inset: 0; background: rgba(15, 20, 25, .45);
    display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100;
}
.modal {
    background: #fff; border-radius: 14px; width: 100%; max-width: 460px;
    padding: 24px; display: flex; flex-direction: column; gap: 14px;
    max-height: 88vh; overflow-y: auto;
}
.modal h3 { margin: 0; font-size: 17px; font-weight: 600; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

.toast {
    position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
    background: rgba(15, 20, 25, .92); color: #fff; padding: 11px 18px;
    border-radius: 10px; font-size: 13px; z-index: 200; max-width: 80vw;
}
.toast.err { background: rgba(180, 35, 40, .95); }

.empty { padding: 48px 16px; text-align: center; color: var(--ink-4); font-size: 13px; }

/* ---------- 资金账户 ---------- */
.acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 12px; }

.acct {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 15px;
    display: flex; flex-direction: column; gap: 6px;
    transition: border-color .15s, box-shadow .15s;
}
.acct:hover { border-color: var(--brand-line); box-shadow: var(--shadow); }
.acct-head { display: flex; align-items: center; justify-content: space-between; }
.acct-type {
    height: 22px; padding: 0 9px; border-radius: 100px;
    background: var(--brand-weak); color: var(--brand);
    font-size: 11px; font-weight: 500; display: inline-flex; align-items: center;
}
.acct-name { font-size: 14px; font-weight: 500; letter-spacing: -.2px; }
.acct-sub { font-size: 11.5px; color: var(--ink-4); }
.acct-balance { font-size: 24px; font-weight: 700; letter-spacing: -.6px; margin: 4px 0 2px; }
.acct-balance.neg { color: var(--danger); }
.acct-flow { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-4); }
.acct-flow b { color: var(--ink-2); font-weight: 500; }
.acct-foot { display: flex; gap: 8px; margin-top: 8px; }
.acct-foot .btn { flex: 1; }

.flow-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 0; border-top: 1px solid #F4F4F7;
}
.flow-row:first-of-type { border-top: none; }
.flow-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.flow-main strong { font-size: 13px; font-weight: 500; }
.flow-main span { font-size: 11px; }
.flow-amt { font-size: 13px; white-space: nowrap; }
.flow-amt small { display: block; font-size: 10.5px; color: var(--ink-4); font-weight: 400; }

/* ---------- 发票与税务 ---------- */
.kv {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    padding: 9px 0; border-bottom: 1px dashed #F1F1F4; font-size: 12.5px;
}
.kv:last-of-type { border-bottom: none; }
.kv span { color: var(--ink-4); flex: 0 0 auto; }
.kv b { font-weight: 500; text-align: right; word-break: break-all; }

.tip-line {
    margin-top: 10px; padding: 9px 11px; border-radius: 8px;
    background: #FBFAFF; border: 1px solid var(--brand-line);
    color: var(--ink-2); font-size: 11.5px; line-height: 1.6;
}

.link-btn {
    padding: 0 6px; font-size: 12px; color: var(--brand);
    background: none; border: none;
}
.link-btn.danger { color: var(--danger); }
.link-btn:hover { text-decoration: underline; }

.modal.wide { max-width: 620px; }

/* 移动端底部标签 */
.tabbar { display: none; }

@media (max-width: 1100px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    .plans { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
    .shell { display: block; }
    .sidebar { display: none; }
    .main { padding-bottom: 76px; }
    .topbar { height: 64px; padding: 0 16px; }
    .topbar h1 { font-size: 18px; }
    .topbar .sub { display: none; }
    .content { padding: 14px 14px 0; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .kpi { padding: 13px; }
    .kpi .value { font-size: 18px; }
    .table-wrap { margin: -16px -16px 0; }
    table { min-width: 640px; }
    .plans { gap: 12px; }
    .tabbar {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0;
        background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px);
        border-top: 1px solid var(--line); padding: 6px 0 max(6px, env(safe-area-inset-bottom));
        z-index: 50; overflow-x: auto; scrollbar-width: none;
    }
    .tabbar::-webkit-scrollbar { display: none; }
    .tabbar a {
        flex: 0 0 20%; min-width: 62px;
        display: flex; flex-direction: column; align-items: center; gap: 3px;
        font-size: 10.5px; color: var(--ink-4); padding: 4px 0;
    }
    .tabbar a.active { color: var(--brand); }
    .tabbar svg { width: 20px; height: 20px; }
    .acct-grid { grid-template-columns: 1fr; }
    .acct-balance { font-size: 21px; }
    .login-card { padding: 24px; }
}

@media (max-width: 380px) {
    .kpi .value { font-size: 16px; }
}
/* 登录页提示（后台可配） */
.login-hint {
    margin: 0; padding: 8px 10px; border-radius: 8px;
    background: #F3F2FE; color: #4B46A8;
    font-size: 12px; line-height: 1.6; text-align: center;
    word-break: break-all;
}
.login-switch {
    margin: 0; font-size: 11.5px; text-align: center; color: #9AA0A6;
}
.login-switch a { color: var(--brand); text-decoration: none; font-weight: 600; }
.login-switch a:hover { text-decoration: underline; }

/* ---------------- 对话记账 ---------------- */
.quick-card { display: flex; flex-direction: column; gap: 12px; }
.quick-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.quick-head strong { font-size: 15px; color: var(--ink); }
.quick-text {
    width: 100%; box-sizing: border-box; resize: vertical; min-height: 86px;
    padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-2);
    background: #FBFBFD; font-size: 15px; line-height: 1.7; color: var(--ink);
    font-family: inherit; outline: none;
}
.quick-text:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(80, 70, 229, .10); }
.quick-examples { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-examples .chip { cursor: pointer; border: 1px dashed var(--line-2); background: #fff; }
.quick-examples .chip:hover { border-color: var(--brand); color: var(--brand); }
.quick-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.quick-tip { flex: 1; min-width: 200px; font-size: 12px; color: var(--ink-4); line-height: 1.6; }
.quick-result { margin-top: 16px; padding: 0; overflow: hidden; }
.quick-input {
    width: 100%; box-sizing: border-box; height: 34px; padding: 0 8px;
    border: 1px solid transparent; border-radius: 7px; background: transparent;
    font-size: 13px; color: var(--ink); font-family: inherit;
}
.quick-input:hover { border-color: var(--line-2); background: #fff; }
.quick-input:focus { border-color: var(--brand); background: #fff; outline: none; }
.quick-input.num { font-variant-numeric: tabular-nums; }
.quick-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; border-top: 1px solid var(--line); background: #FCFCFE; flex-wrap: wrap;
}
.quick-total { font-size: 13px; color: var(--ink-3); }
.quick-total strong { color: var(--brand); font-size: 16px; font-variant-numeric: tabular-nums; }
.quick-foot-actions { display: flex; gap: 8px; }
.quick-empty {
    margin-top: 16px; padding: 26px 16px; text-align: center;
    color: var(--ink-4); font-size: 13px;
}

@media (max-width: 720px) {
    .quick-text { font-size: 14px; min-height: 72px; }
    .quick-tip { display: none; }
    .quick-bar { justify-content: flex-end; }
    .quick-result .table-wrap { overflow-x: auto; }
    .quick-result table { min-width: 620px; }
}

/* ============================================================
   运营模块：收银台 / 对账 / 员工 / 通知 / 报表图表 / 预算
   ============================================================ */

/* ---------- 顶栏通知铃铛 ---------- */
.bell {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-2);
    background: var(--card); color: var(--ink-2);
}
.bell:hover { border-color: var(--brand); color: var(--brand); }
.bell svg { width: 17px; height: 17px; }
.bell-badge {
    position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px;
    border-radius: 9px; background: var(--danger); color: #fff;
    font-size: 10px; line-height: 17px; text-align: center; padding: 0 4px;
    font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px #fff;
}

/* ---------- 分段控件 ---------- */
.seg { display: inline-flex; padding: 3px; background: #F2F2F6; border-radius: 9px; gap: 2px; }
.seg button {
    height: 28px; padding: 0 12px; border-radius: 7px; font-size: 12.5px;
    color: var(--ink-3); background: transparent; border: none;
}
.seg button.active { background: #fff; color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(16,24,40,.08); }

/* ---------- 收银台 ---------- */
.cashier-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 16px; align-items: start; }
/* 网格子项默认 min-width:auto，会把内部 640px 宽的表格撑出手机屏幕；允许收缩，横向滚动交给 .table-wrap */
.cashier-grid > *, .grid-2 > *, .period-grid > *, .recon-summary > *, .perm-grid > *, .kpi-grid > * { min-width: 0; }
.cashier-panel { display: flex; flex-direction: column; gap: 16px; }
.cashier-amount {
    display: flex; align-items: baseline; justify-content: center; gap: 8px;
    padding: 18px 16px 10px;
}
.cashier-amount .cur { font-size: 20px; color: var(--ink-4); font-weight: 500; }
.cashier-amount input {
    width: 100%; max-width: 260px; border: none; outline: none; background: transparent;
    font-size: 40px; font-weight: 700; letter-spacing: -1px; text-align: center;
    font-family: var(--mono); color: var(--ink); padding: 0;
}
.cashier-amount input::placeholder { color: #D6D6DE; }
.pay-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pay-row select {
    height: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-2);
    background: #fff; font-size: 13px; min-width: 104px;
}
.pay-row input {
    flex: 1; height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2);
    background: #fff; font-size: 14px; font-family: var(--mono); text-align: right;
}
.pay-row input:focus, .pay-row select:focus { border-color: var(--brand); outline: none; }
.pay-sum { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); padding: 4px 2px 0; }
.pay-sum strong { color: var(--brand); font-family: var(--mono); }
.pay-sum .short { color: var(--danger); }
.cashier-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.cashier-total-row {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 12px; border-top: 1px dashed var(--line-2);
}

/* ---------- 对账 ---------- */
.period-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.period-card {
    border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
    background: var(--card); cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.period-card:hover { border-color: var(--brand-line); box-shadow: var(--shadow); }
.period-card.active { border-color: var(--brand); background: #FBFAFF; }
.period-card.locked { background: #FAFAFB; }
.period-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.period-name { font-size: 13px; font-weight: 600; }
.period-hint { font-size: 11px; color: var(--ink-4); margin-bottom: 10px; }
.period-nums { display: flex; gap: 14px; }
.period-nums div { font-size: 11px; color: var(--ink-4); }
.period-nums strong { display: block; font-size: 15px; color: var(--ink); font-family: var(--mono); margin-top: 2px; }
.period-nums .in strong { color: var(--accent); }
.recon-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.recon-diff {
    margin-top: 12px; padding: 10px 12px; border-radius: 9px; font-size: 12.5px;
    background: #FFF8EC; color: #92600A; border: 1px solid #FBE6C2; line-height: 1.6;
}
.recon-diff.ok { background: #EFFBF5; color: #0B7A57; border-color: #C9EEDF; }

/* ---------- 员工权限 ---------- */
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; align-items: start; }
/* 每组限高可滚动，避免某一组太长把弹窗顶到屏幕外 */
.perm-group {
    border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
    max-height: 212px; overflow-y: auto;
}
/* 菜单组：页面名短，一排小胶囊更省地方 */
.perm-menu { margin-bottom: 12px; max-height: none; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.perm-chip {
    display: inline-flex; align-items: center; gap: 6px;
    font: inherit; font-size: 12px; line-height: 1.4; color: var(--ink);
    padding: 4px 10px 4px 8px; border: 1px solid var(--line); border-radius: 100px;
    background: #fff; cursor: pointer;
}
.perm-chip:hover { background: #F6F6F9; }
.perm-chip.st-own { border-color: var(--brand); background: #F3F2FF; color: var(--brand); }
.perm-chip.st-deny { border-color: #E7A5A5; background: #FDF3F3; color: #B42318; text-decoration: line-through; }
.perm-chip .perm-box { width: 13px; height: 13px; font-size: 9px; }
.perm-group > strong { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }
/* 菜单组标题右边挂「全选 / 清空」，18 个页面逐个点太费事 */
.perm-menu > strong { display: flex; align-items: center; gap: 6px; }
.perm-bulk { margin-left: auto; display: flex; gap: 4px; }
.perm-bulk button {
    font: inherit; font-size: 11px; line-height: 1.6; color: var(--ink-3);
    padding: 0 8px; border: 1px solid var(--line); border-radius: 100px;
    background: #fff; cursor: pointer; font-weight: 400;
}
.perm-bulk button:hover { color: var(--brand); border-color: var(--brand); background: #F3F2FF; }
.perm-hint { display: block; margin-top: 8px; font-size: 11px; line-height: 1.6; color: var(--ink-4); }
/* 三态权限项：未设 / 允许（✓ 品牌色）/ 收回（✕ 红色） */
.perm-item {
    display: flex; align-items: center; gap: 7px; width: 100%;
    font: inherit; font-size: 12.5px; line-height: 1.5; text-align: left; color: var(--ink);
    padding: 4px 6px; margin: 0 -6px; border: none; background: none;
    border-radius: 6px; cursor: pointer;
}
.perm-item:hover { background: #F6F6F9; }
.perm-item:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.perm-box {
    flex: none; width: 15px; height: 15px; border: 1.5px solid #D8D8DF; border-radius: 4px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; line-height: 1; color: #fff; background: #fff;
}
.perm-name { flex: 1; min-width: 0; }
.perm-tag { flex: none; font-size: 10px; color: var(--ink-4); display: none; }
.perm-item.st-own .perm-tag, .perm-item.st-deny .perm-tag { display: inline; }
.perm-item.st-own .perm-box { background: var(--brand); border-color: var(--brand); }
.perm-item.st-own .perm-tag { color: var(--brand); }
.perm-item.st-deny .perm-box { background: #D93F3F; border-color: #D93F3F; }
.perm-item.st-deny .perm-name { color: #B42318; }
.perm-item.st-deny .perm-tag { color: #B42318; }
.perm-dept {
    font-size: 11.5px; line-height: 1.7; color: var(--ink-3);
    background: #F7F7FB; border: 1px dashed var(--line); border-radius: 8px;
    padding: 8px 10px; margin-bottom: 10px;
}
.perm-dept b { color: var(--ink); }
.staff-row-actions { display: flex; gap: 4px 8px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }

/* 员工列表：桌面为对齐网格，窄屏自动堆叠成卡片 */
.staff-head-bar { padding: 16px 16px 12px; gap: 8px; flex-wrap: wrap; margin-bottom: 0; }
.staff-hint { font-size: 11px; margin-left: auto; }
.staff-list { display: flex; flex-direction: column; }
.staff-head, .staff-row {
    display: grid; align-items: center; gap: 12px;
    /* 底薪 / 参与名单已移到「工资表 → 底薪设置」，这里只剩 员工 部门 今日 操作 */
    grid-template-columns: minmax(0, 1fr) 170px 92px 176px;
}
.staff-head {
    padding: 9px 16px; background: #FAFAFC;
    font-size: 11.5px; color: var(--ink-4);
    border-top: 1px solid #F4F4F7;
}
.staff-head .num { text-align: right; }
.staff-row { padding: 12px 16px; border-top: 1px solid #F4F4F7; }
.staff-row:hover { background: #FCFCFE; }
.staff-row.is-off { opacity: .58; }
.staff-row.is-off:hover { opacity: .78; }
.staff-who { min-width: 0; }
.staff-name-line { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink); }
.staff-meta {
    font-size: 11.5px; color: var(--ink-4); margin-top: 2px; line-height: 1.5;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.staff-dept { min-width: 0; }
.staff-today { text-align: right; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.staff-today b { font-weight: 600; color: var(--ink); }
.staff-today small { display: block; font-size: 11px; color: var(--ink-4); }
.staff-ops { justify-self: end; }

/* 员工列表：底薪 + 工资表/考勤表勾选 */
.staff-base { text-align: right; white-space: nowrap; }
.staff-base-in {
    width: 88px; height: 26px; padding: 0 7px; text-align: right;
    font-size: 12.5px; font-variant-numeric: tabular-nums; font-family: inherit;
    border: 1px solid var(--line-2); border-radius: 6px; color: var(--ink); background: #fff;
}
.staff-base-in:focus { outline: none; border-color: var(--brand); }
.staff-base-txt { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.staff-tech-tag { font-size: 11px; }
.staff-flags { display: flex; gap: 6px; }
.staff-flag {
    display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 6px;
    border: 1px solid var(--line-2); border-radius: 6px; cursor: pointer; user-select: none;
    font-size: 11px; color: var(--ink-4); background: #fff;
}
.staff-flag input { margin: 0; width: 12px; height: 12px; accent-color: var(--brand); cursor: pointer; }
.staff-flag.on { color: var(--brand); border-color: var(--brand-line); background: #F4F3FF; }
.staff-flags-head { font-size: 11.5px; color: var(--ink-4); }

/* 员工提成：时段 / 旬 / 分类三层筛选 + 汇总卡 + 提成列表 */
.comm-head-bar { padding: 14px 16px 4px; gap: 10px; flex-wrap: wrap; align-items: center; }
.comm-tabs { margin: 0; }
.comm-range { font-size: 11.5px; margin-left: auto; }

.comm-filters {
    display: flex; flex-direction: column; gap: 8px;
    padding: 8px 16px 0;
}
.comm-sub-tabs, .comm-scope-tabs { gap: 6px; }
.comm-sub-tabs .chip { height: 28px; padding: 0 12px; font-size: 12px; background: #FAFAFC; }
.comm-scope-tabs .chip { height: 28px; padding: 0 11px; font-size: 12px; gap: 5px; }
.comm-scope-tabs .chip.active { background: var(--brand-weak); }
.chip-num {
    font-style: normal; font-size: 10.5px; line-height: 1;
    padding: 2px 5px; border-radius: 100px; background: #F0F0F4; color: var(--ink-4);
    font-variant-numeric: tabular-nums;
}
.chip.active .chip-num { background: #fff; color: var(--brand); }

/* 查询条：时间 / 账号类型 / 技师分类 / 工号 / 员工角色 / 排序，任意组合 */
.comm-search {
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px 12px; align-items: end;
    padding: 12px 16px;
    border-top: 1px dashed var(--line-2);
    margin-top: 10px;
    background: #FCFCFD;
}
.cs-range { grid-column: span 3; }
.cs-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cs-label { font-size: 11.5px; color: var(--ink-4); }
.cs-field select, .cs-field input {
    width: 100%; height: 32px; padding: 0 9px; font-size: 12.5px; color: var(--ink);
    border: 1px solid var(--line-2); border-radius: 7px; background: #fff;
    font-family: inherit; box-sizing: border-box;
}
.cs-field input::placeholder { color: #B9B9C4; }
.cs-field select:focus, .cs-field input:focus { outline: none; border-color: var(--brand); }
.cs-time { display: flex; align-items: center; gap: 6px; }
.cs-time input { min-width: 0; }
.cs-sep { font-style: normal; font-size: 11.5px; color: var(--ink-4); flex: 0 0 auto; }
.cs-ops { grid-column: span 4; display: flex; gap: 8px; justify-content: flex-end; }
.cs-ops .btn { height: 32px; }
.comm-warn { font-size: 11.5px; color: #B26A00; margin: 8px 16px 0; }

/* ---- 工资表 ---- */
.sal-tabs { padding: 12px 16px 0; }
.sal-head-bar { padding: 12px 16px 4px; align-items: center; flex-wrap: wrap; gap: 10px; }
.sal-month { display: flex; align-items: center; gap: 8px; }
.sal-month-cur { font-size: 15px; font-weight: 700; color: var(--ink); min-width: 72px; text-align: center; }
.sal-stats { padding: 10px 16px 0; }
.sal-paydays {
    width: 64px; height: 30px; padding: 0 8px; font-size: 14px; font-weight: 700;
    border: 1px solid var(--line-2); border-radius: 7px; color: var(--ink); background: #fff;
}
.sal-paydays:focus { outline: none; border-color: var(--brand); }
.sal-table-wrap { overflow-x: auto; padding: 12px 16px 4px; }
.sal-table { width: 100%; border-collapse: collapse; font-size: 12.5px; white-space: nowrap; }
/* 结算列：未付 / 多付 / 结清 + 台账核销说明 */
.sal-settle { min-width: 186px; }
.ok-text { color: var(--ok, #1F9D55); }
.warn-text { color: #C25A00; }
.info-text { color: #1264c0; }
.sal-table th {
    font-size: 11px; font-weight: 500; color: var(--ink-4); text-align: left;
    padding: 5px 4px; border-bottom: 1px solid var(--line); white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.sal-table td { padding: 7px 8px; border-bottom: 1px dashed var(--line-2); vertical-align: middle; }
.sal-table th.num, .sal-table td.num { text-align: right; }
.sal-table tbody.sal-grp:last-child tr:last-child td { border-bottom: 0; }
.sal-table tbody.paid td { color: var(--ink-3); }
.sal-user strong { font-size: 13px; }
.sal-user .badge { margin-left: 6px; }
.sal-in, .sal-base-in {
    width: 78px; height: 28px; padding: 0 7px; font-size: 12.5px; text-align: right;
    border: 1px solid var(--line-2); border-radius: 6px; color: var(--ink); background: #fff;
    font-family: inherit;
}
.sal-in:focus, .sal-base-in:focus { outline: none; border-color: var(--brand); }
.sal-static { font-variant-numeric: tabular-nums; }
.sal-wage, .sal-net { font-weight: 700; color: var(--ink); }
.sal-net { color: #0B8A3E; }
.sal-paycell { min-width: 104px; }
.sal-pay-state { display: flex; align-items: center; gap: 6px; margin-bottom: 1px; }
.sal-pay-methods { font-size: 10.5px; color: var(--ink-3); display: block; white-space: normal; line-height: 1.35; }
.sal-pay-line { display: block; white-space: nowrap; }
.sal-pay-line i { font-style: normal; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.sal-pay-line b { font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; }
/* 整月视图的发放记录：每一次一行（上旬 / 中旬 / 下旬 + 日期 + 方式 + 金额），三段都看得见 */
.sal-pay-round {
    display: flex; align-items: baseline; gap: 3px;
    font-size: 10px; line-height: 1.55; white-space: nowrap; color: var(--ink-3);
}
.sal-pay-round .sal-rp-phase {
    flex: 0 0 auto; font-style: normal; font-size: 9.5px; line-height: 14px; color: var(--ink-2);
    background: #F2F4FA; border-radius: 3px; padding: 0 3px;
}
.sal-pay-round .sal-rp-day,
.sal-pay-round .sal-rp-mth { flex: 0 0 auto; font-style: normal; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.sal-pay-round b { margin-left: auto; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sal-pay-times { color: var(--ink-4); font-size: 10px; }
/* 没结清的行：已付多少 / 还下欠多少，直接写在发放列里 */
.sal-pay-detail {
    font-size: 10.5px; line-height: 1.35; color: var(--ink-3);
    font-variant-numeric: tabular-nums; margin: 1px 0 0;
}
.sal-pay-detail b { font-weight: 500; }
.sal-note { font-size: 11.5px; margin: 6px 16px 14px; line-height: 1.7; }
.sal-code { font-size: 11.5px; }
.sal-days { white-space: nowrap; }
.sal-days .days-src { display: block; margin: 2px 0 0; text-align: center; }
/* 底薪/提成列：技师的小标签换行显示，列宽控制在 116 以内 */
.sal-base { max-width: 122px; }
.sal-base .sal-comm-tags { font-size: 10px; gap: 2px; justify-content: flex-end; max-width: 62px; }
.sal-base .days-src { padding: 0 3px; }
.days-src {
    display: inline-block; margin-left: 4px; padding: 0 4px; font-style: normal;
    font-size: 10px; line-height: 15px; border-radius: 4px;
    background: #F3F4F6; color: var(--ink-4); vertical-align: 1px;
}
.days-src.from-attn { background: #EDFAF4; color: #0B8A3E; }

/* ================= 考勤登记 ================= */
.attn-card { overflow: hidden; }
.attn-head-bar {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 12px 16px 6px;
}
.attn-depts { flex-wrap: wrap; }
.comm-stats.attn-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.attn-bad { color: var(--danger); }

.attn-legend {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 4px 16px 0; font-size: 11.5px; color: var(--ink-3);
}
.attn-leg { display: inline-flex; align-items: center; gap: 5px; }
.attn-leg i {
    width: 16px; height: 16px; border-radius: 4px; display: inline-block;
}
/* 图例里每一项后面跟一句「计几天 / 不算钱 / 扣三天」，比只写名字清楚 */
.attn-leg u {
    text-decoration: none; font-size: 10.5px; color: var(--ink-4);
    background: var(--bg); border-radius: 4px; padding: 0 4px;
}
.attn-leg-bad u { color: #C02626; background: #FDECEC; }
.attn-leg-empty i { background: #FFF; border: 1px dashed var(--line); }
.attn-cut {
    font-style: normal; display: block; font-size: 10px;
    color: var(--danger); margin-top: 1px;
}
.attn-leg-tip { color: var(--ink-4); }

.attn-sync-hint {
    font-size: 11.5px; color: var(--ink-4);
    padding: 6px 16px 0;
}
.attn-scroll-tip { display: none; }

.attn-table-wrap { overflow-x: auto; padding: 10px 16px 4px; }
.attn-table { border-collapse: separate; border-spacing: 0; font-size: 11.5px; white-space: nowrap; }
.attn-table th {
    font-size: 10.5px; font-weight: 500; color: var(--ink-4);
    padding: 4px 0; text-align: center; min-width: 24px;
}
.attn-table th.attn-dh b { display: block; font-size: 11px; color: var(--ink-2); font-weight: 600; }
.attn-table th.attn-dh i { display: block; font-style: normal; font-size: 9px; color: var(--ink-4); }
.attn-table th.attn-dh.we b, .attn-table th.attn-dh.we i { color: var(--ink-4); }
.attn-table td { padding: 1px; border: none; }

/* 视觉分层：隔行底色 + 每周分割线 + 汇总列分隔，31 列横着看不串行 */
.attn-table tbody tr:nth-child(even) > td { background: #F5F7FA; }
.attn-table tbody tr:nth-child(even) > .attn-name-cell { background: #EAEDF3; }
.attn-table tbody tr:hover > td { background: #EDF1FF; }
.attn-table tbody tr:hover > .attn-name-cell { background: #E3EAFF; }
.attn-table .wk-start { border-left: 1px solid #DCE0EA; }
.attn-table thead .wk-alt { background: #F4F6FA; }
.attn-table thead th.attn-dh.wk-alt.we { background: #EFF1F6; }
.attn-table .attn-sum-first { border-left: 1px solid #DCE0EA; }
.attn-table thead .attn-dh { border-bottom: 1px solid var(--line); padding-bottom: 5px; }

/* 工资表里的「考勤 / 满勤 / 手填」小标：可点，跳到考勤页定位到本人 */
.days-src-btn { border: 0; cursor: pointer; font-family: inherit; }
.days-src-btn:hover { filter: brightness(0.96); text-decoration: underline; }

/* 从工资表跳过来时高亮定位到的那个人 */
.attn-table tbody tr.attn-focus > td { background: #FFF3D6; }
.attn-table tbody tr.attn-focus > .attn-name-cell { background: #FFE5AE; }
.attn-table tbody tr.attn-focus > td:first-child { box-shadow: inset 4px 0 0 #E09B2D; }
.attn-table tbody tr.attn-focus-on > td { animation: attnFlash 0.85s ease-out 2; }
@keyframes attnFlash {
    0% { background: #FFD98A; }
    100% { background: #FFF3D6; }
}

.attn-name-cell {
    position: sticky; left: 0; z-index: 2; background: var(--card);
    text-align: left; padding: 4px 12px 4px 0 !important;
    border-right: 1px dashed var(--line); min-width: 116px;
}
.attn-name-cell strong { display: block; font-size: 12.5px; }
.attn-dept { display: block; font-size: 10.5px; color: var(--ink-4); margin-top: 1px; }
.attn-days-inline { display: none; }
.attn-table thead .attn-name-cell { font-size: 11px; color: var(--ink-4); font-weight: 500; }

.attn-cell { text-align: center; }
.attn-dot {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 6px; margin: 1px auto;
    font-size: 10.5px; line-height: 1; user-select: none;
    border: 1px dashed transparent; color: var(--ink-4);
}
.attn-cell.we .attn-dot { background: #FAFAFB; }
button.attn-dot, span.attn-dot[data-action] { cursor: pointer; }
span.attn-dot[data-action]:hover { border-color: var(--brand); }
.attn-dot.st-attend { background: #EDFAF4; color: #0B8A3E; font-weight: 600; }
.attn-dot.st-half { background: #ECF3FE; color: #1D6FD0; font-weight: 600; }
.attn-dot.st-rest { background: #F3F4F6; color: #6B7280; }
.attn-dot.st-leave { background: #FEF6E9; color: #B4740B; font-weight: 600; }
.attn-dot.st-sick { background: #FDF2F8; color: #B0306A; font-weight: 600; }
.attn-dot.st-absent { background: #FDECEC; color: #C02626; font-weight: 600; }
.attn-cell.st-attend .attn-dot { border-style: solid; border-color: transparent; }

.attn-sum { min-width: 46px; padding-left: 8px !important; }
.attn-half { font-style: normal; font-size: 10px; color: var(--ink-4); margin-left: 2px; }
.attn-op { min-width: 40px; text-align: right; }
.attn-op .link-btn { font-size: 11px; }
.attn-note { font-size: 11.5px; margin: 8px 16px 14px; line-height: 1.7; }

.attn-batch { max-width: 420px; }
.attn-batch-hint { font-size: 12px; margin: 6px 0 14px; line-height: 1.6; }
.attn-batch-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.attn-batch-fields label {
    display: flex; flex-direction: column; gap: 5px;
    font-size: 12px; color: var(--ink-3);
}
.attn-batch-fields select {
    height: 34px; padding: 0 8px; font-size: 13px; color: var(--ink);
    border: 1px solid var(--line-2); border-radius: 8px; background: #fff;
}
.attn-batch-fields select:focus { outline: none; border-color: var(--brand); }
.attn-check {
    display: flex; align-items: center; gap: 8px;
    font-size: 12.5px; color: var(--ink-2); margin-top: 12px;
}
.attn-check input { width: 15px; height: 15px; accent-color: var(--brand); }
.sal-config-table td { height: 44px; }
.sal-config-foot { display: flex; align-items: center; gap: 12px; padding: 12px 16px 16px; font-size: 12px; }
/* 底薪设置：订房单价是全店一个价，放在卡片头上，改一次对所有人生效 */
.sal-head-rate-box {
    display: inline-flex; align-items: center; gap: 6px;
    margin-left: 12px; padding: 0 10px; height: 30px;
    border: 1px solid var(--line); border-radius: 8px; background: #fff;
    font-size: 12px; white-space: nowrap;
}
.sal-head-rate {
    width: 66px; height: 24px; padding: 0 6px; text-align: right;
    border: 1px solid var(--line); border-radius: 6px; font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}
.sal-head-rate:focus { outline: none; border-color: var(--brand); }
.sal-pay-modal, .sal-payall-modal { max-width: 360px; }
.sal-pay-hint { font-size: 12px; margin: 6px 0 14px; line-height: 1.6; }
.pay-rows { display: flex; flex-direction: column; gap: 8px; }
.pay-row { display: flex; align-items: center; gap: 10px; }
.pay-name { width: 52px; font-size: 13px; color: var(--ink-2); }
.pay-amt {
    flex: 1; height: 34px; padding: 0 10px; font-size: 13.5px; text-align: right;
    border: 1px solid var(--line-2); border-radius: 8px; color: var(--ink); background: #fff;
    font-family: inherit;
}
.pay-amt:focus { outline: none; border-color: var(--brand); }
.pay-diff { font-size: 12px; margin: 10px 0 2px; color: #0B8A3E; min-height: 18px; }
.pay-diff.warn { color: #B26A00; }
.pay-radios { display: flex; gap: 16px; margin: 4px 0 6px; }
.pay-radio { display: flex; align-items: center; gap: 5px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }


.comm-stats {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px; padding: 10px 16px 0;
}
.comm-stat { background: #FAFAFC; border: 1px solid #F4F4F7; border-radius: 10px; padding: 10px 12px; }
.comm-stat span { display: block; font-size: 11.5px; color: var(--ink-4); }
.comm-stat b {
    display: block; margin-top: 4px; font-size: 17px; font-weight: 600;
    color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.2px;
}
.comm-note { font-size: 11.5px; margin: 10px 16px 14px; }
.comm-list-card { margin-top: 16px; padding: 0; overflow: hidden; }
.comm-head, .comm-row {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, .9fr) 70px 120px 96px;
}
.comm-orders {
    text-align: right; font-size: 12.5px; color: var(--ink-3);
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
.comm-amount {
    text-align: right; font-size: 14px; font-weight: 600; color: var(--ink);
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
.comm-detail-meta {
    display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center;
    font-size: 12px; color: var(--ink-3);
}
.comm-detail-total { margin-left: auto; font-size: 15px; font-weight: 600; color: var(--brand); }
.comm-table { margin: 0; padding: 0; }
.comm-table table { min-width: 520px; font-size: 12.5px; }
.comm-table th, .comm-table td { padding: 8px 10px; white-space: nowrap; }
.comm-table tfoot td { font-weight: 600; background: #FAFAFC; }

.badge {
    display: inline-block; padding: 1px 7px; border-radius: 20px;
    font-size: 10.5px; line-height: 17px; white-space: nowrap;
}
.badge.ok { background: #EAF8F1; color: #0B7A57; }
.badge.warn { background: #FFF4E2; color: #9A6300; }
.badge.danger { background: #FDECEC; color: #B4282C; }
.badge.info { background: var(--brand-weak); color: var(--brand); }
.badge.mute { background: #F3F3F6; color: var(--ink-3); }

/* ---------- 通知 ---------- */
.notice-item {
    display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line);
    cursor: pointer; align-items: flex-start;
}
.notice-item:last-child { border-bottom: none; }
.notice-item:hover { background: #FCFCFE; }
.notice-item.unread { background: #FBFAFF; }
.notice-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-top: 7px; flex: 0 0 7px; }
.notice-dot.read { background: transparent; }
.notice-body { flex: 1; min-width: 0; }
.notice-title { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.notice-text { font-size: 12px; color: var(--ink-3); line-height: 1.6; }
.notice-time { font-size: 11px; color: var(--ink-4); white-space: nowrap; }

/* ---------- 图表 ---------- */
.chart-box { width: 100%; overflow: hidden; }
.chart-box svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-3); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.budget-row { margin-bottom: 14px; }
.budget-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.budget-top .pct { font-family: var(--mono); }
.budget-track { height: 8px; border-radius: 4px; background: #F1F1F4; overflow: hidden; }
.budget-fill { height: 100%; border-radius: 4px; background: var(--brand); }
.budget-fill.warn { background: var(--warn); }
.budget-fill.over { background: var(--danger); }

/* ---------- 上传 / 语音 ---------- */
.quick-modes { display: flex; gap: 6px; }
.upload-box {
    border: 1px dashed var(--line-2); border-radius: 12px; padding: 22px 16px;
    text-align: center; color: var(--ink-3); font-size: 13px; background: #FCFCFE;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.upload-box strong { font-size: 14px; color: var(--ink); }
.upload-box .hint { font-size: 11.5px; color: var(--ink-4); }
.mic-btn {
    width: 88px; height: 88px; border-radius: 50%; background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center; margin: 6px auto;
    box-shadow: 0 8px 24px -8px rgba(80,70,229,.7);
}
.mic-btn.rec { background: var(--danger); animation: pulse 1.2s ease-in-out infinite; }
.mic-btn svg { width: 34px; height: 34px; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.mic-hint { text-align: center; font-size: 12px; color: var(--ink-4); line-height: 1.7; }

@media (max-width: 960px) {
    .cashier-grid { grid-template-columns: 1fr; }
    .period-grid { grid-template-columns: 1fr; }
    .recon-summary { grid-template-columns: repeat(2, 1fr); }
    .perm-grid { grid-template-columns: 1fr; }
    .perm-group { max-height: none; }
    .cashier-amount input { font-size: 34px; }
}

/* 打印：门店把「收支流水」直接打出来交给财务，只留内容和表头 */
@media print {
    .sidebar, .tabbar, .topbar-actions, .chips, .bell,
    .quick-card, .staff-row-actions, .link-btn { display: none !important; }
    .shell { display: block; }
    .main { margin: 0; padding: 0; }
    .topbar { padding: 0 0 12px; border-bottom: 1.5px solid #000; margin-bottom: 12px; }
    .topbar h1 { font-size: 18px; }
    .card { border: none; box-shadow: none; padding: 0; }
    .table-wrap { overflow: visible; }
    table { font-size: 11px; }
    thead th { border-bottom: 1px solid #999; }
    tr { break-inside: avoid; }
    .badge { border: 1px solid #ccc; }
}

/* ---- 品牌外观 / 部门 ---- */
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type=color] { width: 40px; height: 38px; padding: 0; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; cursor: pointer; }
.color-row input[type=text] { flex: 1; min-width: 0; }
.img-preview { max-width: 160px; max-height: 60px; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; object-fit: contain; background: #FAFAFC; }
.dept-list { margin-top: 4px; }
.dept-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 2px; border-bottom: 1px dashed var(--line);
}
.dept-row:last-of-type { border-bottom: none; }
.dept-row strong { flex: 0 0 auto; }
.dept-row .muted { flex: 1; }

/* ---------- 移动端「更多」面板 ---------- */
.more-sheet { display: none; }
@media (max-width: 960px) {
    .more-sheet {
        display: block; position: fixed; inset: 0; z-index: 60;
    }
    .more-backdrop { position: absolute; inset: 0; background: rgba(16, 24, 40, .38); }
    .more-panel {
        position: absolute; left: 0; right: 0; bottom: 0;
        background: #fff; border-radius: 18px 18px 0 0;
        padding: 16px 14px calc(14px + env(safe-area-inset-bottom));
        box-shadow: 0 -12px 32px -16px rgba(16, 24, 40, .3);
    }
    .more-title { font-size: 12px; color: var(--ink-4); margin: 0 2px 12px; }
    .more-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 4px; }
    .more-grid a {
        display: flex; flex-direction: column; align-items: center; gap: 6px;
        padding: 10px 4px; border-radius: 12px; font-size: 11.5px; color: var(--ink-2);
        text-align: center;
    }
    .more-grid a.active { background: var(--brand-weak); color: var(--brand); }
    .more-ico svg { width: 22px; height: 22px; display: block; }
}

/* ---------- 员工列表（H5 适配）---------- */
@media (max-width: 720px) {
    /* 部门筛选：一行横滑，不换行挤压内容 */
    .chips.dept-chips {
        flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
        margin: 0 -14px 2px; padding: 0 14px 6px;
    }
    .chips.dept-chips::-webkit-scrollbar { display: none; }
    .chips.dept-chips .chip { flex: 0 0 auto; height: 30px; padding: 0 12px; font-size: 12px; }

    .staff-head-bar { padding: 14px 14px 12px; }
    .staff-hint { display: none; }
    .staff-head { display: none; }
    .staff-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "who  today"
            "dept dept"
            "ops  ops";
        align-items: start; gap: 6px 10px; padding: 13px 14px;
    }
    .staff-who { grid-area: who; }
    .staff-name-line { font-size: 14.5px; }
    .staff-meta { white-space: normal; word-break: break-all; }
    .staff-dept { grid-area: dept; margin-top: 2px; }
    .staff-base { grid-area: base; text-align: left; margin-top: 4px; }
    .staff-base-in { width: 96px; height: 28px; }
    .staff-flags { grid-area: flags; justify-content: flex-end; margin-top: 4px; }
    .staff-flag { height: 28px; font-size: 11.5px; }
    .staff-today { grid-area: today; font-size: 13.5px; }
    .staff-today b { font-size: 16px; }
    .staff-ops {
        grid-area: ops; justify-self: stretch;
        margin-top: 4px; padding-top: 10px; border-top: 1px dashed #F0F0F4;
    }
    .staff-ops .staff-row-actions { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
    .staff-ops .link-btn {
        height: 32px; line-height: 32px; padding: 0 13px;
        background: #F6F6F9; border-radius: 8px; font-size: 12.5px;
    }
    .staff-ops .link-btn.danger { background: #FDF1F1; }
    .staff-list .empty { padding: 36px 14px; }

    /* 员工提成：统计卡两列，列表堆成卡片 */
    .comm-head-bar { padding: 12px 14px 2px; }
    .comm-range { display: none; }
    .comm-search {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px; padding: 12px 14px; align-items: end;
    }
    .cs-range, .cs-ops, .cs-sort { grid-column: 1 / -1; }
    .cs-time { flex: 1; }
    .cs-time input { width: 100%; min-width: 0; }
    .cs-ops { justify-content: stretch; }
    .cs-ops .btn { flex: 1; }
    .comm-warn { margin: 8px 14px 0; }

    /* 工资表：横向滚动看全列，操作按钮放大好点 */
    .sal-tabs { padding: 12px 14px 0; }
    .sal-head-bar { padding: 10px 14px 2px; }
    .sal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sal-table-wrap { padding: 10px 8px 4px; margin: 0 -2px; }
    .sal-table { font-size: 12px; }
    .sal-in, .sal-base-in { width: 68px; height: 30px; }
    .sal-paycell { min-width: 96px; }
    .sal-note { margin: 6px 14px 14px; }

    /* 考勤：格子缩小、姓名列吸附，横向滑动登记 */
    .attn-head-bar { padding: 10px 14px 4px; gap: 8px; }
    .comm-stats.attn-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .attn-legend { padding: 4px 14px 0; gap: 8px; font-size: 11px; }
    .attn-leg-tip { display: none; }
    .attn-sync-hint { padding: 6px 14px 0; }
    .attn-scroll-tip {
        display: block; font-size: 10.5px; color: var(--ink-4);
        padding: 6px 14px 0;
    }
    .attn-table-wrap { padding: 8px 10px 4px; }
    .attn-name-cell { min-width: 92px; padding-right: 8px !important; }
    .attn-name-cell strong { font-size: 12px; }
    .attn-days-inline { display: block; font-size: 10.5px; color: var(--brand); margin-top: 2px; }
    .comm-stats.attn-stats .comm-stat:last-child { grid-column: 1 / -1; }
    .attn-dot { width: 20px; height: 20px; border-radius: 5px; font-size: 10px; }
    .attn-table th { min-width: 22px; }
    .attn-note { margin: 8px 14px 12px; }
    .attn-batch-fields { grid-template-columns: 1fr 1fr; }
    .comm-filters { padding: 8px 14px 0; gap: 6px; }
    .comm-sub-tabs, .comm-scope-tabs {
        flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
        margin: 0 -14px; padding: 0 14px 2px;
    }
    .comm-sub-tabs::-webkit-scrollbar, .comm-scope-tabs::-webkit-scrollbar { display: none; }
    .comm-sub-tabs .chip, .comm-scope-tabs .chip { flex: 0 0 auto; }
    .comm-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; }
    .comm-tabs::-webkit-scrollbar { display: none; }
    .comm-tabs .chip { flex: 0 0 auto; }
    .comm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 8px 14px 0; }
    .comm-stat { padding: 9px 11px; }
    .comm-stat b { font-size: 16px; }
    .comm-note { margin: 8px 14px 12px; }
    .comm-list-card { margin-top: 12px; }
    .comm-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "who   amount"
            "dept  orders"
            "ops   ops";
        gap: 4px 10px; padding: 11px 14px 9px;
    }
    .comm-row .staff-ops { margin-top: 0; padding-top: 8px; }
    .comm-row .staff-meta { font-size: 11.5px; }
    .comm-row .staff-who { grid-area: who; }
    .comm-row .staff-dept { grid-area: dept; }
    .comm-orders { grid-area: orders; align-self: center; font-size: 12px; }
    .comm-amount { grid-area: amount; font-size: 16px; }
    .comm-row .staff-ops { grid-area: ops; }
    .comm-detail { padding: 18px 16px; }
    .comm-detail h3 { font-size: 15.5px; }
    .comm-detail-total { margin-left: 0; width: 100%; }
    .comm-table table { min-width: 460px; font-size: 12px; }
    .comm-table th, .comm-table td { padding: 7px 8px; }
}

/* ================= 工资表：部门筛选 / 挂账提示 / 打印预览 ================= */
.sal-dept-chips { padding: 10px 16px 0; flex-wrap: wrap; }
.sal-arap-line { margin: 4px 0 0; font-size: 12px; }
.sal-arap-line b { color: var(--ink-2); }
.sal-base .days-src { margin-left: 4px; }

/* 底薪/提成栏：提成单数、手改标记与「明细」入口 */
.sal-base { min-width: 92px; max-width: 100px; }
.sal-comm-tags {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 6px; margin-top: 4px; flex-wrap: wrap;
}
.sal-comm-tags .days-src { margin-left: 0; }
.days-src.manual { background: #FEF3C7; color: #B45309; }
.sal-comm-link {
    font-size: 11.5px; color: var(--brand); padding: 0;
    border-bottom: 1px dashed currentColor; line-height: 1.5;
}
.sal-comm-link:hover { opacity: .75; }

.print-mask {
    position: fixed; inset: 0; z-index: 120; overflow: auto;
    background: rgba(15, 23, 42, 0.55); padding: 24px 16px;
}
.print-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    position: sticky; top: 0; z-index: 2;
    max-width: 1160px; margin: 0 auto 12px; padding: 8px 12px;
    background: #fff; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,0.18);
    color: var(--ink-3); font-size: 12.5px;
}
.print-doc {
    background: #fff; color: #111; max-width: 1160px; margin: 0 auto;
    padding: 30px 34px 26px; border-radius: 8px; box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}
.print-title { margin: 0 0 6px; text-align: center; font-size: 20px; font-weight: 700; }
.print-meta { margin: 0 0 14px; text-align: center; font-size: 12px; color: #555; }
.print-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.print-table th, .print-table td { border: 1px solid #94A3B8; padding: 4px 6px; }
.print-table th { background: #F1F5F9; font-weight: 600; white-space: nowrap; }
.print-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.print-note { display: block; font-size: 9px; color: #555; font-style: normal; white-space: normal; max-width: 90px; }
.print-table .print-tot td { background: #F8FAFC; font-weight: 700; }
.print-settle { white-space: nowrap; font-size: 11.5px; }
.print-settle.is-owed { color: #B91C1C; font-weight: 700; }
/* 每人一格的签字位（手写领款签名），高度够写字 */
.print-sign-th, .print-sign-cell { width: 76px; min-width: 76px; }
.print-sign-cell { height: 24px; }
.print-tip { margin: 8px 0 0; font-size: 11px; color: #555; }
/* 签字栏：放在表格 tfoot 里，打印时每页都会重复出现，且不会压住正文 */
.print-table tfoot .print-sign-row td { border: 0; padding: 10px 2px 2px; background: transparent; }
.print-sign {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px;
    font-size: 12px; color: #333; padding-top: 8px; border-top: 1px solid #94A3B8;
}

/* ===== 工资表：紧凑重排（15 列也要每列都看得见） ===== */
.sal-table-wrap {
    overflow-x: auto; overflow-y: visible;
    /* 左右不留内边距：吸附列（员工 / 应发 / 结算 / 发放）按滚动口吸附，
       有左右 padding 时整列会内缩，压到相邻的备注列 */
    padding: 8px 0 4px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.sal-table-wrap::-webkit-scrollbar { height: 9px; }
.sal-table-wrap::-webkit-scrollbar-track { background: #F4F4F7; border-radius: 6px; }
.sal-table-wrap::-webkit-scrollbar-thumb { background: #D3D3DC; border-radius: 6px; }
.sal-table-wrap::-webkit-scrollbar-thumb:hover { background: #B9B9C6; }
.sal-table { width: 100%; font-size: 12px; }
/* 只有工资表（每人两行、8 个增/减项格）需要这么宽；底薪设置页 3 列不用。
   固定列宽布局：不然 100% 宽度下富余空间随机塞给底薪 / 工资列，把增项列挤扁。
   下面只给「员工 / 底薪 / 上班 / 工资 / 项 / 备注 / 应发 / 结算 / 发放」定宽，
   剩下的富余全给 4 个增项减项列（数字右对齐，留白在左，看着正好）。 */
.sal-sheet-card .sal-table { min-width: 940px; table-layout: fixed; }
.sal-sheet-card .sal-table thead th:nth-child(1) { width: 96px; }
.sal-sheet-card .sal-table thead th:nth-child(2) { width: 100px; }
.sal-sheet-card .sal-table thead th:nth-child(3) { width: 48px; }
.sal-sheet-card .sal-table thead th:nth-child(4) { width: 74px; }
.sal-sheet-card .sal-table thead th:nth-child(5) { width: 26px; }
/* 4 个增项 / 减项列：定死在 62px（列名进小字行，宽度够用），别把富余空间全吃掉，
   省下来的宽度留给备注 / 应发 / 结算 / 发放 */
.sal-sheet-card .sal-table thead th.sal-b-th { width: 62px; }
.sal-sheet-card .sal-table thead th:nth-child(10) { width: 96px; }
.sal-sheet-card .sal-table thead th:nth-child(11) { width: 86px; }
.sal-sheet-card .sal-table thead th:nth-child(12) { width: 186px; }
/* 结算列要放下「上旬 / 中旬 / 下旬」三条发放记录；发放列只剩按钮，收窄 */
.sal-sheet-card .sal-table thead th:nth-child(13) { width: 104px; }
/* 表头「增项 / 减项」跨 4 列，弱化成说明文字，不要抢主列名的视觉重量 */
.sal-sheet-card .sal-table thead th.sal-items-gap {
    font-size: 10px; font-weight: 400; color: var(--muted); letter-spacing: .5px;
    text-align: center; white-space: nowrap;
}
/* 右侧结论列（应发 / 结算 / 发放）贴在右边，中间明细横向滑动时不会看不到结论。
   偏移量用 CSS 变量（渲染后按真实列宽量出来），表格等比放大也不会错位 */
.sal-table .sal-net { position: sticky; right: calc(var(--sal-pay-w, 104px) + var(--sal-settle-w, 186px)); z-index: 1; background: #fff; width: 86px; min-width: 86px; padding-right: 6px; }
.sal-table .sal-settle { position: sticky; right: var(--sal-pay-w, 104px); z-index: 1; background: #fff; width: 186px; min-width: 186px; }
.sal-table .sal-paycell { position: sticky; right: 0; z-index: 1; background: #fff; width: 104px; min-width: 104px; padding-left: 8px; }
.sal-table .sal-net, .sal-table .sal-settle, .sal-table .sal-paycell { box-shadow: inset 1px 0 0 var(--line); }
/* 表头同样吸附：否则横向滚动 / 有内边距时，表头会和下面的数字错位 */
.sal-table thead th.sal-net, .sal-table thead th.sal-settle, .sal-table thead th.sal-paycell {
    position: sticky; top: 0; z-index: 3; background: #fff;
}
.sal-table tbody.sal-grp:hover .sal-net, .sal-table tbody.sal-grp:hover .sal-settle, .sal-table tbody.sal-grp:hover .sal-paycell { background: #FAFAFE; }
.sal-table th { position: sticky; top: 0; z-index: 2; background: #fff; }
.sal-table td { padding: 4px 3px; }
.sal-table th { padding: 5px 3px; }
.sal-table .sal-in { width: 48px; }
/* 员工列吸附在左边：横向滚动时不至于看不出这行是谁。
   宽度卡死（max-width）—— 100% 宽度下浏览器会把富余空间全塞给这一列 */
.sal-user { position: sticky; left: 0; z-index: 1; background: #fff; width: 96px; min-width: 96px; }
.sal-table tbody.sal-grp:hover .sal-user { background: #FAFAFE; }
.sal-table tbody.paid .sal-user { background: #fff; }
.sal-name-btn {
    display: inline-block; padding: 0; border: 0; background: none; cursor: pointer;
    font-size: 12.5px; font-weight: 700; color: var(--ink); text-align: left; line-height: 1.35;
    border-bottom: 1px dashed transparent;
}
.sal-name-btn:hover { color: var(--brand); border-bottom-color: var(--brand-line); }
.sal-tags { display: block; margin-top: 2px; line-height: 1.5; }
.sal-tags .badge { margin: 0 3px 0 0; font-size: 10px; padding: 0 4px; line-height: 15px; }
.sal-note-in {
    width: 56px; height: 22px; margin-top: 3px; padding: 0 5px;
    font-size: 11.5px; border: 1px solid var(--line-2); border-radius: 5px;
    color: var(--ink-2); background: #fff;
}
.sal-note-in:focus { outline: none; border-color: var(--brand); }
.sal-note-in.sal-note-ro { color: var(--ink-3); background: #FAFAFC; border-style: dashed; }
.sal-note-txt {
    margin-top: 2px; font-size: 10.5px; color: var(--ink-3); max-width: 78px;
    white-space: normal; line-height: 1.4; text-align: right;
}
/* 充值提成核减说明（系统生成只读）：工资表备注列下的小字 */
.sal-remark {
    margin-top: 4px; font-size: 10.5px; line-height: 1.4; text-align: right;
    color: #C25A00; word-break: break-all; max-width: 96px;
}
.sal-other { min-width: 0; max-width: 108px; }
/* 表格里的数字框：平时淡边框，聚焦时高亮，紧凑排版也能看清数字 */
.sal-table .sal-in {
    height: 25px; padding: 0 3px; font-size: 11.5px;
    border-color: var(--line-2); background: transparent;
}
.sal-table .sal-in:hover { background: #fff; }
.sal-table .sal-in:focus { background: #fff; }
.sal-settle .badge { white-space: nowrap; }
.sal-settle { min-width: 186px; }
.sal-settle .sal-comm-tags { white-space: normal; justify-content: flex-start; max-width: 150px; }
.sal-left-amt { font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-top: 2px; }
.sal-settle .sal-comm-tags { font-size: 9.5px; }
.sal-settle .days-src { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 工资表：每人两行（上行增项 / 下行减项），备注与结果列跨两行 ===== */
.sal-table thead th { line-height: 16px; }
/* 「项」这一列：标明这一行是加钱还是扣钱 */
.sal-table th.sal-kind, .sal-table td.sal-kind {
    width: 34px; min-width: 34px; padding: 5px 2px; text-align: center;
    font-size: 10.5px; letter-spacing: .5px;
}
.sal-table th.sal-kind { font-weight: 600; color: var(--ink-3); }
.sal-table td.sal-kind.plus { color: #0B8A3E; background: #F7FCF8; }
.sal-table td.sal-kind.minus { color: #C25A00; background: #FFF9F4; }
/* 增/减项每格：小字列名在上、数字在下（列名让这一格自己说明这是什么钱） */
.sal-b-in { display: flex; flex-direction: column; align-items: flex-end; gap: 0; }
.sal-b-lbl {
    flex: 0 0 auto; font-size: 9px; line-height: 1; color: #B4752A;
    letter-spacing: 0; white-space: nowrap;
}
.sal-plus-cell .sal-b-lbl { color: #0B8A3E; }
/* 谁都不许被压扁：列名和输入框都固定宽度，数字在右 */
.sal-b-cell { padding: 3px 2px !important; }
.sal-b-cell .sal-in {
    width: 100%; max-width: 62px; text-align: right;
    /* 不许收缩：flex 子项默认 shrink 1，行高被别的列压紧时输入框会被压成一条线 */
    flex: 0 0 21px; height: 21px; min-height: 21px;
    padding: 0 2px; font-size: 11px;
}
.sal-b-in > * { flex-shrink: 0; }
.sal-b-cell .sal-static { flex: 0 0 auto; }
.sal-b-cell .sal-comm-tags { justify-content: flex-end; margin-top: 0; font-size: 9px; }
/* 列宽上限：不然 100% 宽度下富余空间全被「底薪 / 工资」吃掉，增项减项反而挤成 52px */
.sal-table td.sal-base, .sal-table th.sal-base { max-width: 100px; }
.sal-table td.sal-wage { max-width: 74px; }
.sal-table td.sal-days { min-width: 48px; }
.sal-table td.sal-wage { min-width: 74px; }
.sal-b-cell { min-width: 46px; }

/* 同一人的两行：上行虚线收尾，下行实线收尾（人与人之间分开） */
.sal-table .sal-row-a > td { border-bottom: 1px dashed var(--line-2); }
.sal-table .sal-row-b > td { border-bottom: 1px solid var(--line); }
.sal-table tbody.sal-grp:hover td { background: #FAFAFE; }
.sal-table tbody.sal-grp:hover td.sal-kind.plus { background: #EFF9F2; }
.sal-table tbody.sal-grp:hover td.sal-kind.minus { background: #FFF3EA; }
.sal-note-cell { min-width: 84px; width: 84px; max-width: 84px; }
.sal-note-cell .sal-note-in { margin-top: 0; width: 70px; }
.sal-note-cell .sal-note-txt { margin-top: 0; max-width: 84px; }
/* 没参与考勤表的员工：上班列显示「不计」 */
.days-src.exempt { color: #8A5A00; background: #FFF7E8; }

/* ===== 满勤天数自动 / 提成·减项开关 / 三次发放 ===== */
.sal-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sal-paydays-hint { margin-top: 3px; font-size: 10.5px; color: var(--ink-4); white-space: nowrap; }
.sal-paydays-hint .link-btn { padding: 0; font-size: 10.5px; }
.sal-switch-cell { display: flex; flex-direction: column; }
.sal-switch-row { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.sal-switch {
    display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
    font-size: 12.5px; font-weight: 600; color: #0B8A3E;
}
.sal-switch input { width: 14px; height: 14px; accent-color: #0B8A3E; cursor: pointer; }
.sal-switch i { font-style: normal; }
.sal-switch.off { color: var(--ink-4); font-weight: 500; }
.sal-switch.off input { accent-color: #B9BEC9; }
/* 没勾选的组成项：数字灰掉，并且在「项」列标「不计」 */
.sal-table td.sal-off .sal-in,
.sal-table td.sal-off .sal-static,
.sal-table td.sal-off .sal-b-lbl { color: #B9BEC9; }
.sal-table td.sal-off .sal-in { background: #F7F8FA; border-color: #EDEFF3; }
.sal-table td.sal-kind.sal-off { color: #B9BEC9; }
.sal-off-tag {
    display: block; font-style: normal; font-size: 9.5px; line-height: 1.3;
    color: #B4752A; background: #FFF3E4; border-radius: 3px; margin-top: 2px;
}
/* 三次发放：第一次上旬 / 第二次中旬 / 第三次下旬（竖排，窄列也放得下） */
.sal-rounds { display: flex; flex-direction: column; gap: 2px; margin-top: 3px; }
.sal-round {
    display: flex; align-items: center; gap: 3px; padding: 0 4px;
    border: 1px solid var(--line-2); border-radius: 4px; font-size: 9.5px;
    color: var(--ink-4); background: #fff; white-space: nowrap;
}
.sal-round b { font-weight: 700; color: #A8AFBC; }
.sal-round em { font-style: normal; color: var(--ink-3); margin-left: auto; }
.sal-round.done { border-color: #CFE9D8; background: #F3FAF5; color: #0B8A3E; }
.sal-round.done b { color: #0B8A3E; }
.sal-round.done em { color: #0B8A3E; }
.sal-round.now { box-shadow: inset 0 0 0 1px #F0C98A; }
.sal-round-hint {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin: 2px 0 8px; padding: 7px 10px; border-radius: 8px;
    background: #FFF9EE; border: 1px solid #F6E3BF; font-size: 11.5px; color: #8A5A00;
}
.sal-round-hint .link-btn { padding: 0; font-size: 11.5px; }

/* 结算 / 发放两列内容多，允许换行（整表是 nowrap，不放开就会往左边溢出去压住别的列） */
.sal-table .sal-settle, .sal-table .sal-paycell { white-space: normal; }
.sal-table .sal-paycell .sal-pay-methods,
.sal-table .sal-paycell .sal-pay-detail { white-space: normal; word-break: break-word; }
.sal-table .sal-settle .sal-comm-tags { white-space: normal; }

/* 底薪设置：参与名单勾选 + 不参与工资表的行整体压暗 */
.sal-flags { display: flex; gap: 6px; flex-wrap: wrap; }
.sal-config-table .staff-flag { height: 24px; font-size: 11.5px; }
/* 订房 / 充值两列只放一个勾选：定宽布局按比例切，别让两个勾选各占 150px */
.sal-config-table { table-layout: fixed; }
.sal-config-table th:nth-child(1) { width: 24%; }
.sal-config-table th:nth-child(2) { width: 16%; }
.sal-config-table th:nth-child(3) { width: 130px; }
.sal-config-table th:nth-child(5),
.sal-config-table th:nth-child(6) { width: 110px; }
.sal-cfg-off td { background: #FCFCFD; }
.sal-cfg-off td strong, .sal-cfg-off td > .badge { opacity: .55; }

/* 窄屏：右侧三列不再吸附，否则 298px 的固定列会把中间明细全挤掉，改成整体左右滑动 */
@media (max-width: 760px) {
    .sal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sal-table .sal-net,
    .sal-table .sal-settle,
    .sal-table .sal-paycell { position: static; box-shadow: none; }
    .sal-table thead th.sal-net,
    .sal-table thead th.sal-settle,
    .sal-table thead th.sal-paycell { position: static; }
    .sal-table .sal-user { position: static; }
}
.sal-comm-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; justify-content: flex-end; }
.sal-lock { font-size: 10.5px; color: var(--ink-4); white-space: nowrap; }

/* ===== 工资发放明细弹窗 ===== */
.sal-hist-modal {
    width: min(820px, 94vw); max-width: min(820px, 94vw);
    max-height: 88vh; display: flex; flex-direction: column; padding: 20px;
}
.sal-hist-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 2px 0 10px; }
.sal-hist-stats.sal-hist-stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sal-hist-stats > div { background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.sal-hist-stats span { display: block; font-size: 11.5px; color: var(--ink-4); margin-bottom: 2px; }
.sal-hist-stats b { font-size: 14px; font-variant-numeric: tabular-nums; }
.sal-hist-wrap {
    flex: 1; min-height: 140px; max-height: 50vh; overflow: auto;
    display: flex; flex-direction: column; gap: 10px; padding-right: 2px;
}
.sal-hist-group { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex: none; }
.sal-hist-group-head {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.sal-hist-month { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.sal-hist-tag {
    font-size: 10.5px; padding: 1px 6px; border-radius: 999px;
    border: 1px solid var(--line-2); color: var(--ink-4); background: #fff;
}
.sal-hist-tag.on { color: #128a3f; border-color: #bfe6cb; background: #f1fbf4; }
.sal-hist-sum { display: flex; gap: 14px; margin-left: 4px; font-size: 11.5px; color: var(--ink-4); }
.sal-hist-sum b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.sal-hist-sub { font-style: normal; font-size: 10.5px; color: var(--ink-4); margin-left: 4px; }
.sal-hist-result { margin-left: auto; }
.sal-hist-left { font-variant-numeric: tabular-nums; font-size: 12px; }
.sal-hist-table { width: 100%; border-collapse: collapse; font-size: 12.5px; table-layout: fixed; }
.sal-hist-table th {
    background: #fff;
    font-size: 11.5px; font-weight: 500; color: var(--ink-4); text-align: left;
    padding: 6px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
.sal-hist-table td { padding: 7px 10px; border-bottom: 1px dashed var(--line-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sal-hist-table th:nth-child(1), .sal-hist-table td:nth-child(1) { width: 92px; }
.sal-hist-table th:nth-child(3), .sal-hist-table td:nth-child(3) { width: 96px; }
.sal-hist-table th:nth-child(4), .sal-hist-table td:nth-child(4) { width: 104px; }
.sal-hist-table th:nth-child(5), .sal-hist-table td:nth-child(5) { width: 112px; }
.sal-hist-table th:nth-child(6), .sal-hist-table td:nth-child(6) { width: 122px; }
.sal-hist-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.sal-hist-table tr:last-child td { border-bottom: 0; }
.sal-hist-date { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.sal-hist-note { font-size: 10.5px; line-height: 1.4; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sal-pay-chip {
    display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11.5px;
    border: 1px solid var(--line-2); background: var(--bg); color: var(--ink-2);
}
.sal-pay-chip.m-wechat { color: #128a3f; border-color: #bfe6cb; background: #f1fbf4; }
.sal-pay-chip.m-alipay { color: #1264c0; border-color: #c2dcf8; background: #f2f8ff; }
.sal-pay-chip.m-bank { color: #4a4f8a; border-color: #d3d6ee; background: #f5f6ff; }
.sal-pay-chip.m-cash { color: #8a5a12; border-color: #efe0c2; background: #fffaf1; }
.sal-pay-chip.m-card { color: #7a2f8a; border-color: #e6c9ee; background: #fdf5ff; }
.sal-hist-group-head { cursor: pointer; }
.sal-hist-group-head:hover { background: #F6F6FA; }
.sal-hist-caret {
    font-size: 10px; color: var(--ink-4); width: 12px; text-align: center;
    transition: transform .15s ease;
}
.sal-hist-group.collapsed .sal-hist-caret { transform: rotate(-90deg); }
.sal-hist-group.collapsed .sal-hist-table { display: none; }
.sal-hist-group.collapsed .sal-hist-group-head { border-bottom: 0; }

/* 明细工具条：按年筛 / 只看未结清 / 展开收起 / 导出 */
.sal-hist-tools {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 0 0 8px; border-bottom: 1px solid var(--line-2); margin-bottom: 8px;
}
.sal-hist-years { padding: 0; gap: 6px; }
.sal-hist-tools-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.sal-hist-check { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--ink-3); cursor: pointer; }
.sal-hist-check input { width: 13px; height: 13px; }
.sal-hist-tip { font-size: 11.5px; line-height: 1.7; margin: 8px 2px 0; }

/* 补发弹窗 */
.sal-topup-modal { width: min(460px, 94vw); }
.sal-topup-sum {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0 12px;
}
.sal-topup-sum > div { background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.sal-topup-sum span { display: block; font-size: 11.5px; color: var(--ink-4); margin-bottom: 2px; }
.sal-topup-sum b { font-size: 14px; font-variant-numeric: tabular-nums; }
.sal-topup-amt { display: flex; align-items: center; gap: 8px; }
.sal-topup-amt input { flex: 1; }
.sal-topup-tip { font-size: 11.5px; line-height: 1.7; margin: 4px 0 0; }
.sal-hist-loading { margin: 20px 2px; }


/* 打印：只输出预览稿。@page margin:0 让 Chrome / Edge 不再绘制默认页眉页脚 */
@page { size: A4 landscape; margin: 0; }
@media print {
    body > *:not(.print-mask) { display: none !important; }
    .print-mask { position: static; background: none; padding: 0; overflow: visible; }
    .print-bar { display: none !important; }
    .print-doc { max-width: none; border-radius: 0; box-shadow: none; padding: 22px 26px; }
    .print-table { font-size: 11px; }
}


/* ============ 操作日志页 ============ */
.audit-filter {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px;
}
.audit-filter .in { height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 12.5px; }
.audit-filter .audit-q { flex: 1 1 160px; min-width: 140px; }
.audit-sep { color: var(--ink-4); }
.audit-table-wrap { overflow-x: auto; }
.audit-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 760px; }
.audit-table th {
    font-size: 11px; font-weight: 500; color: var(--ink-4); text-align: left;
    padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.audit-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.audit-table tr:last-child td { border-bottom: 0; }
.audit-when { white-space: nowrap; line-height: 1.5; }
.audit-target { white-space: nowrap; color: var(--ink-2); }
.audit-summary { min-width: 220px; line-height: 1.55; }
.audit-ip { white-space: nowrap; font-family: var(--mono); font-size: 11px; }
.audit-detail-row td { background: var(--bg); padding: 8px 10px 12px 10px; border-bottom: 1px dashed var(--line-2); }
.audit-diff { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.audit-pair { font-size: 12px; color: var(--ink-2); }
.audit-pair b { color: var(--ink-4); font-weight: 500; margin-right: 2px; }
.audit-arr { color: var(--ink-4); font-style: normal; margin: 0 4px; }
.audit-after { color: var(--brand); }
.audit-pager { display: flex; align-items: center; gap: 10px; margin-top: 12px; }

/* ============ 工资表锁定 ============ */
.sal-lock-banner {
    margin: 10px 12px 0; padding: 9px 12px; border-radius: 8px;
    background: #FFF7E8; border: 1px solid #F5D9A8; color: #8A5A00; font-size: 12.5px;
}
.sal-lock-screen {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 60px 20px; gap: 6px;
}
.sal-lock-screen .sal-lock-ico { font-size: 40px; }
.sal-lock-screen p { margin: 2px 0; }
.sal-lock-screen .sal-month { margin-top: 16px; }

/* ============ 应收应付 · 类别管理 ============ */
.arap-cat-list {
    display: flex; flex-wrap: wrap; gap: 6px;
    min-height: 28px;
}
.arap-cat-item {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 6px 3px 10px; border-radius: 999px;
    background: var(--bg); border: 1px solid var(--line-2);
    font-size: 12.5px; color: var(--ink-2);
}
.arap-cat-del {
    border: 0; background: none; cursor: pointer;
    width: 18px; height: 18px; line-height: 16px; padding: 0;
    border-radius: 50%; font-size: 13px; color: var(--ink-4);
}
.arap-cat-del:hover { background: #FDE8E8; color: #C0392B; }

/* ============ 应收应付 · 搜索与同姓名合并 ============ */
.arap-search {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    padding: 10px 12px 0;
}
.arap-search-input {
    flex: 1 1 320px; min-width: 220px;
}
.arap-search input[type="month"] { width: 150px; }
.arap-search-meta { padding: 6px 12px 10px; font-size: 12px; }

.badge.merge { background: #EEF3FF; color: #3B5BDB; border-color: #D6E0FF; }
.arap-period {
    display: inline-block; margin-left: 6px; padding: 0 5px;
    font-size: 11px; line-height: 16px; border-radius: 4px;
    background: var(--bg); color: var(--ink-3); border: 1px solid var(--line-2);
    font-variant-numeric: tabular-nums;
}
tr.arap-grp.is-merged > td { border-bottom: 0; }
tr.arap-sub > td {
    background: var(--bg);
    border-bottom: 1px dashed var(--line-2);
    font-size: 12.5px;
}
tr.arap-sub > td:first-child { padding-left: 18px; }
tr.arap-sub:last-child > td { border-bottom: 1px solid var(--line); }

/* 页尾说明卡：和上面两张表隔开一点 */
.sal-note-card { margin-top: 16px; padding: 4px 16px; background: #FCFCFD; }
.sal-note-card .sal-note { margin: 10px 0; }

/* ===== 部门与采集：采集账号表单 ===== */
.msh-account {
    margin: 4px 0 12px; padding: 12px; border: 1px solid var(--line);
    border-radius: 10px; background: #FAFAFE;
}
.msh-acc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.msh-acc-grid {
    display: grid; gap: 8px 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.msh-field { display: flex; flex-direction: column; gap: 4px; }
.msh-field-wide { grid-column: 1 / -1; }
.msh-field > span { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.msh-field input {
    height: 32px; padding: 0 9px; font-size: 12.5px;
    border: 1px solid var(--line-2); border-radius: 7px; background: #fff; color: var(--ink);
}
.msh-field input:focus { outline: none; border-color: var(--brand); }
.msh-acc-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.msh-acc-foot .link-btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ===== 工资表：自动保存状态 ===== */
.sal-save-state {
    display: inline-flex; align-items: center; height: 26px; padding: 0 9px;
    font-size: 11.5px; color: var(--ink-3); background: #F4F4F7;
    border-radius: 999px; white-space: nowrap;
}
.sal-save-state.ok { color: #0B8A3E; background: #E8F7EE; }
.sal-save-state.pending { color: #8A5A00; background: #FFF7E8; }
.sal-save-state.err { color: #B42318; background: #FEECEB; }

/* 发放列里三五个小按钮挤在一起：字号收到 11，行距压紧，别把整组撑高 */
.sal-table .sal-paycell .staff-row-actions { margin-top: 2px; gap: 0 6px; row-gap: 0; }
.sal-table .sal-paycell .staff-row-actions .link-btn { font-size: 11px; line-height: 1.45; }
.sal-table .sal-paycell .sal-comm-tags { margin-top: 1px; }
.sal-table .sal-paycell .sal-pay-state .badge { font-size: 10px; padding: 0 5px; }

/* 表头不许折行：「结算」「发放」在窄列里会竖成两行，跟数据列看着错位 */
.sal-table thead th.sal-net,
.sal-table thead th.sal-settle,
.sal-table thead th.sal-paycell { white-space: nowrap; }
/* 结算 / 发放两列的内容挨在一起会读成一句话：实线隔开 */
.sal-table .sal-paycell { border-left: 1px solid var(--line-2); }

/* ===== 工资表：分段选择（上旬 / 中旬 / 下旬 / 全部） ===== */
.sal-head-bar .sal-segs { margin-left: 2px; }
.sal-segs .chip { height: 28px; line-height: 28px; padding: 0 12px; font-size: 12.5px; }
.sal-segs .chip.active { font-weight: 600; }
/* 分段说明条：现在算的是哪一段 + 口径一句话 */
.sal-seg-banner {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px;
    margin: 8px 16px 0; padding: 9px 12px;
    background: #FFF9EE; border: 1px solid #F3E2C0; border-radius: 10px;
}
.sal-seg-banner b { font-size: 13px; color: #8A5A00; }
.sal-seg-win { font-size: 12px; color: #8A5A00; font-variant-numeric: tabular-nums; }
.sal-seg-tip { font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }
@media (max-width: 760px) {
    .sal-seg-banner { margin: 8px 12px 0; }
}

/* ===== 营业收入（慧近营业汇总·按付款方式） ===== */
.sales-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sales-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sales-range > label { font-size: 12px; color: var(--ink-4); }
.sales-range input[type="date"],
.sales-range input[type="datetime-local"] {
    height: 32px; padding: 0 9px; border-radius: 8px;
    border: 1px solid var(--line-2); background: #fff;
    font-size: 12.5px; color: var(--ink); font-variant-numeric: tabular-nums;
}
.sales-range input[type="datetime-local"] { min-width: 196px; }

/* 统计窗口：选完任何时段都把「起 → 止」精确到秒显示出来 */
.sales-window {
    flex: 1 0 100%; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-top: 2px; padding: 7px 11px; border-radius: 8px;
    background: #F8F8FC; font-size: 12px; color: var(--ink-2);
}
.sales-window .sw-label {
    font-size: 10.5px; color: #fff; background: var(--brand);
    padding: 1px 7px; border-radius: 999px; letter-spacing: .02em;
}
.sales-window b { font-weight: 600; color: var(--ink); letter-spacing: .01em; }
.sales-window .sw-arrow { color: var(--ink-4); }
.sales-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.sales-progress {
    flex: 1 0 100%; margin-top: 4px; padding: 8px 11px;
    border-radius: 8px; background: var(--brand-weak); color: var(--brand);
    font-size: 12px; line-height: 1.6;
}
.sales-progress.err { background: #FDECEC; color: #B4282C; }

.sales-table { min-width: 900px; }
.sales-table thead th { padding: 10px 12px; font-size: 11px; }
.sales-table tbody td { padding: 10px 12px; font-size: 12.5px; }
.sales-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sales-table tr.sales-sub > td { background: #FCFCFE; font-weight: 500; }
.sales-table tr.sales-total > td { background: #F7F7FB; font-weight: 600; border-top: 1px solid var(--line-2); }
.sales-table tr.sales-mute > td { color: var(--ink-4); }
/* 储值消费：不计入收入，排在合计下方 */
.sales-table tr.sales-out > td { background: #FFFBF3; color: #8A6A21; font-weight: 500; }
.sales-table tr.sales-out > td:first-child { box-shadow: inset 3px 0 0 #E8C070; }
.sales-out-tag {
    display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px;
    background: #F6E7C6; color: #7A5A15; font-size: 10px; font-weight: 500; line-height: 16px;
}
.sales-table .sales-subhead th {
    padding: 4px 12px 8px; font-size: 10.5px; font-weight: 400;
    color: var(--ink-4); background: #FAFAFC; border-top: 1px dashed var(--line);
}
.sales-note { margin: 4px 2px 12px; font-size: 11.5px; line-height: 1.75; color: var(--ink-4); }
@media (max-width: 760px) {
    .sales-range { gap: 6px; }
    .sales-range input[type="date"],
    .sales-range input[type="datetime-local"] { flex: 1 1 150px; min-width: 0; }
}
.sales-table.narrow { min-width: 0; }
.sales-bottom { display: grid; grid-template-columns: minmax(260px, 320px) 1fr; gap: 16px; align-items: start; }
.sales-table.days { min-width: 620px; }
/* 减免明细：6 列，比三张主表窄 */
.sales-bottom .sales-table:not(.narrow) { min-width: 620px; }
@media (max-width: 980px) { .sales-bottom { grid-template-columns: 1fr; } }

/* ===== 考勤页 · 班次设置（收银/水吧/保洁/经理） ===== */
.shiftcfg-card { margin-top: 16px; }
.shiftcfg-card summary { cursor: pointer; padding: 11px 14px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.shiftcfg-card summary::-webkit-details-marker { display: none; }
.shiftcfg-card summary b { font-size: 13px; }
.shiftcfg-card summary .muted { font-size: 11.5px; }
.shiftcfg { padding: 2px 14px 14px; display: grid; gap: 10px; }
.shiftcfg-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fbfbfc; }
.shiftcfg-row > b { min-width: 32px; font-size: 13px; }
.shiftcfg-slots { display: flex; gap: 8px; flex-wrap: wrap; flex: 1 1 320px; }
.shiftcfg-slot { display: flex; align-items: center; gap: 5px; background: #fff; border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 8px; }
.shiftcfg-slot .sc-name { width: 66px; height: 28px; border: 1px solid var(--line-2); border-radius: 6px; padding: 0 6px; font-size: 12.5px; }
.shiftcfg-slot input[type="time"] { width: 96px; height: 28px; border: 1px solid var(--line-2); border-radius: 6px; padding: 0 6px; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink); background: #fff; }
.sc-cross { color: #b45309; font-size: 11px; font-weight: 600; white-space: nowrap; }
.shiftcfg-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 2px; }
.shiftcfg-foot .muted { font-size: 11.5px; flex: 1 1 320px; }

/* ================= 一键采集 ================= */
.cl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.cl-head h3 { margin: 0 0 4px; font-size: 16px; }
.cl-head p { margin: 0; max-width: 560px; }
.cl-run { margin-top: 14px; }
.cl-bar { position: relative; height: 8px; border-radius: 99px; background: var(--brand-weak); overflow: hidden; flex: 1 1 200px; }
.cl-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), #7C72F2); transition: width .4s ease; }
.cl-pct { font-size: 12px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cl-run > .cl-bar { margin-bottom: 14px; }

.cl-steps { display: flex; flex-direction: column; gap: 0; }
.cl-step { display: flex; align-items: flex-start; gap: 12px; padding: 12px 2px; border-top: 1px dashed var(--line); }
.cl-step:first-child { border-top: 0; }
.cl-ic { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; font-style: normal; margin-top: 2px; }
.cl-ic.wait { background: var(--bg); color: var(--ink-4); border: 1px solid var(--line-2); }
.cl-ic.ok { background: #E7F8F0; color: #0B8A53; }
.cl-ic.bad { background: #FDECEC; color: #C0353A; }
.cl-ic.run { background: var(--brand-weak); color: var(--brand); position: relative; }
.cl-ic.run u { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--brand); border-top-color: transparent; animation: clspin .8s linear infinite; }
.cl-ic.big { width: 40px; height: 40px; margin: 0 0 8px; }
@keyframes clspin { to { transform: rotate(360deg); } }

.cl-step-main { flex: 1 1 auto; min-width: 0; }
.cl-step-main b { font-size: 13.5px; }
.cl-step.fail .cl-step-main b { color: #C0353A; }
.cl-why { margin: 2px 0 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
.cl-detail { margin: 4px 0 0; font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.cl-detail.ok { color: #0B8A53; }
.cl-detail.fail { color: #C0353A; }
.cl-state { flex: 0 0 auto; font-size: 11.5px; color: var(--ink-4); margin-top: 4px; white-space: nowrap; }
.cl-step.run .cl-state { color: var(--brand); font-weight: 600; }
.cl-step.ok .cl-state { color: #0B8A53; }
.cl-step.fail .cl-state { color: #C0353A; font-weight: 600; }
.cl-summary { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--brand-weak); color: var(--ink); font-size: 12.5px; font-weight: 600; }

.cl-cover { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 14px; }
.cl-cov-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.cl-cov-card span { font-size: 11.5px; color: var(--ink-3); }
.cl-cov-card b { font-size: 14px; }
.cl-cov-card i { font-style: normal; font-size: 11.5px; color: var(--ink-4); }
.cl-note { margin-top: 12px; font-size: 11.5px; line-height: 1.6; }

/* 采集进行中的全屏冻结层 */
.collect-freeze { position: fixed; inset: 0; z-index: 9999; background: rgba(15, 20, 25, .45); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.cl-freeze-card { width: min(420px, 92vw); background: var(--card); border-radius: 16px; box-shadow: 0 24px 60px -12px rgba(16, 24, 40, .35); padding: 26px 24px; text-align: center; }
.cl-freeze-card b { display: block; font-size: 15px; margin-bottom: 2px; }
.cl-freeze-card .muted { margin: 0 0 14px; font-size: 12px; }
.cl-freeze-card .cl-bar { margin-bottom: 6px; }
.cl-freeze-now { margin: 10px 0 0; font-size: 12px; color: var(--ink-2); min-height: 18px; word-break: break-all; }

/* ---------------- 拍照记账：本地 / 调接口 双模式 ---------------- */
.ocr-mode { margin-bottom: 10px; }
.ocr-mode .chips { margin-bottom: 6px; }
.ocr-mode-tip { font-size: 12px; line-height: 1.6; }
.ai-call-strip {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-top: 12px; padding: 10px 14px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    font-size: 12px;
}
.ai-call-strip a { color: var(--brand); text-decoration: none; }
.ai-call-strip a:hover { text-decoration: underline; }

/* ---------- 班次选择条（营业收入 / 收退款明细 / 订房 / 入库 共用） ---------- */
.shift-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--line, #EDEDF1);
}
.shift-bar .shift-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-3, #6B7280);
}
.shift-bar input.shift-day {
    width: 148px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--line-2, #E7E7EA);
    border-radius: 8px;
    font-size: 13px;
    color: var(--ink, #0F1419);
    background: #fff;
}
.shift-rows { display: flex; flex-direction: column; gap: 8px; }
.shift-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shift-row input[type="time"],
.shift-row input[type="text"] {
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--line-2, #E7E7EA);
    border-radius: 8px;
    font-size: 13px;
    color: var(--ink, #0F1419);
    background: #fff;
}
.shift-row input[type="time"] { width: 118px; }

/* ============ 班次对账（日期 × 收银员 × 班次 收款 + 支出） ============ */
.row-sub td { background: #FAFAFC; font-weight: 600; color: var(--ink-2, #3F4753); }
.row-total td { font-weight: 700; border-top: 1.5px solid var(--line-2, #D8DCE3); background: #fff; }
.sp-table th.sp-key-col { background: #F7F7FB; }
.sp-table .sp-exp-link { border-bottom: 1px dashed #9CA3AF; color: inherit; text-decoration: none; cursor: pointer; }
.sp-table .sp-exp-link:hover { color: var(--brand, #5046E5); border-bottom-color: var(--brand, #5046E5); }
a[data-action] { cursor: pointer; }
/* 已对账：绿色小徽标，一眼能看出这一行核对过了；有「修改流水」权限时是可点的链接 */
.sp-table .sp-recon-done {
  display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
  color: #0F7B4A; background: #E6F6EE; border: 1px solid #BFE7D2; text-decoration: none; white-space: nowrap;
}
.sp-table a.sp-recon-done { cursor: pointer; }
.sp-table a.sp-recon-done:hover { background: #D5F0E2; border-color: #8FD5B3; }
@media print {
    .print-table .row-sub td { background: #F2F2F5; font-weight: 600; }
    .print-table .row-total td { border-top: 1.5px solid #000; font-weight: 700; }
    .print-table { font-size: 10.5px; white-space: nowrap; }
}

/* ---------- 资料下载：在线文档 / 表格编辑器 ---------- */
.dl-editor .dl-tools{display:flex;gap:4px;flex-wrap:wrap;align-items:center;padding:7px 8px;
  border:1px solid var(--line);border-radius:10px;background:#FAFAFC;margin:8px 0}
.dl-editor .dl-tools button{height:28px;min-width:28px;padding:0 8px;border:1px solid transparent;border-radius:6px;
  background:transparent;color:#333;font-size:12px;cursor:pointer;line-height:1}
.dl-editor .dl-tools button:hover{background:#fff;border-color:var(--line);color:var(--brand,#5046E5)}
.dl-editor .dl-tools .sep{width:1px;height:16px;background:var(--line);margin:0 4px}
.dl-paper{background:#fff;color:#111;border:1px solid var(--line);border-radius:8px;padding:32px 40px;
  min-height:50vh;max-height:60vh;overflow:auto;line-height:1.8;font-size:14px;outline:none}
.dl-paper:focus{box-shadow:inset 0 0 0 2px var(--brand-weak,#E6E4FC)}
.dl-paper h1{font-size:22px;margin:0 0 14px;font-weight:700}
.dl-paper h2{font-size:17px;margin:16px 0 8px;font-weight:700}
.dl-paper h3{font-size:15px;margin:12px 0 6px;font-weight:700}
.dl-paper p{margin:0 0 8px}
.dl-paper ul,.dl-paper ol{margin:0 0 8px;padding-left:22px}
.dl-paper table{border-collapse:collapse;width:100%;margin:10px 0;font-size:13px}
.dl-paper td,.dl-paper th{border:1px solid #9CA3AF;padding:6px 8px;min-width:60px;vertical-align:top}
.dl-paper th{background:#F2F2F2;font-weight:700}
/* 粘贴进来的常见结构：引用 / 代码 / 链接 / 图片 / 分隔线 / 表格内段落 */
.dl-paper blockquote{margin:8px 0;padding:2px 0 2px 12px;border-left:3px solid var(--line);color:#444}
.dl-paper pre{background:#F7F7FB;border:1px solid var(--line);border-radius:6px;padding:8px 10px;
  font-family:ui-monospace,Consolas,Menlo,monospace;font-size:12.5px;white-space:pre-wrap;
  overflow:auto;margin:8px 0;color:#111}
.dl-paper a{color:var(--brand,#5046E5);text-decoration:underline;word-break:break-all}
.dl-paper img{max-width:100%;height:auto}
.dl-paper hr{margin:12px 0;border:0;border-top:1px solid var(--line)}
.dl-paper ul{list-style:disc}
.dl-paper ol{list-style:decimal}
.dl-paper td p,.dl-paper th p{margin:0 0 4px}
.dl-paper td p:last-child,.dl-paper th p:last-child{margin-bottom:0}
.dl-paper td ul,.dl-paper td ol{margin:0;padding-left:18px}
.dl-grid-wrap{overflow:auto;max-height:60vh;border:1px solid var(--line);border-radius:8px;background:#fff}
.dl-grid{border-collapse:collapse;width:100%;font-size:13px;background:#fff}
.dl-grid td{border:1px solid #D8D8E0;padding:0;min-width:96px}
.dl-grid tr:first-child .dl-cell{font-weight:700;background:#F7F7FB}
.dl-grid .dl-cell{padding:7px 9px;min-height:20px;outline:none;color:#111;white-space:pre-wrap;word-break:break-all}
.dl-grid .dl-cell:focus{background:#FFF9E6;box-shadow:inset 0 0 0 2px var(--brand,#5046E5)}
.dl-lucky{width:100%;min-height:440px;border:1px solid var(--line,#E2E4EA);border-radius:8px;overflow:hidden;background:#fff}
.dl-lucky #luckysheet{width:100% !important}
.dl-sheet{border-collapse:collapse;width:100%;font-size:13px;background:#fff}
.dl-sheet td,.dl-sheet th{border:1px solid #333;padding:7px 9px;vertical-align:top;word-break:break-word;color:#111}
.dl-sheet th{background:#F2F2F2;font-weight:700;text-align:center}
.dl-sheet tr:first-child td{background:#F7F7FB;font-weight:700}

/* ---------- 在线文档：eWebEditor 风格编辑器（KindEditor 内核） ---------- */
.dl-editor .dl-head{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.dl-editor .dl-head input[type="text"]{height:34px;border:1px solid var(--line);border-radius:8px;
  padding:0 10px;font-size:14px;background:#fff}
.dl-editor .dl-head input[data-field="dlTitle"]{flex:1;min-width:220px;font-weight:600;font-size:15px}
.dl-editor .dl-head input.dl-cat{width:120px;flex:0 0 auto}
.dl-editor .dl-ke-wrap{flex:1;min-height:0;margin-top:10px}
.dl-editor .dl-foot{display:flex;justify-content:space-between;align-items:center;gap:12px;
  margin-top:8px;font-size:12px;color:var(--muted,#6B7280);flex-wrap:wrap}
.dl-editor .dl-count{color:#111;font-weight:600}

/* 工具栏：经典灰蓝渐变 + 细边框按钮，接近 eWebEditor 的操作手感 */
.dl-editor .ke-container{border:1px solid #C9D3E0;border-radius:8px;overflow:hidden;background:#fff;
  box-shadow:0 1px 2px rgba(16,24,40,.05)}
.dl-editor .ke-toolbar{background:linear-gradient(#FBFCFE,#EEF2F8);border-bottom:1px solid #C9D3E0;
  padding:4px 5px;line-height:1}
.dl-editor .ke-toolbar .ke-outline{border:1px solid transparent;border-radius:4px;padding:2px;margin:0 1px;
  transition:none}
.dl-editor .ke-toolbar .ke-outline:hover{border-color:#9FB8DC;background:#E8F1FC}
.dl-editor .ke-toolbar .ke-on{border-color:#7C9BC7;background:#D8E6F8}
.dl-editor .ke-toolbar .ke-separator{background:#CBD5E1;margin:2px 4px;height:18px}
.dl-editor .ke-edit{background:#fff}
.dl-editor .ke-statusbar{background:#F1F4F9;border-top:1px solid #C9D3E0;color:#5B6472}
.dl-editor .ke-statusbar span{color:#5B6472}
/* 编辑器里的“纸张”留白，靠近 A4 页面观感 */
.dl-editor .ke-edit-iframe{background:#fff}
@media (max-width:640px){
  .dl-editor .dl-head input.dl-cat{width:88px}
  .dl-editor .dl-foot .dl-tip{display:none}
}

/* 资料下载：文件夹导航 + 填写并打印 + 禁止复制 */
.dl-layout{display:flex;gap:16px;align-items:flex-start}
.dl-rail{flex:0 0 210px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px;position:sticky;top:14px}
.dl-rail-title{font-size:12px;color:#8A93A6;font-weight:600;margin-bottom:8px;letter-spacing:.04em}
.dl-folder{display:flex;align-items:center;gap:8px;padding:8px;border-radius:8px;cursor:pointer;color:#2A3142;font-size:14px;position:relative}
.dl-folder:hover{background:#F3F5FB}
.dl-folder.active{background:#EAE6FF;color:#3B2FCF;font-weight:600}
.dl-folder-ico{font-size:15px;line-height:1}
.dl-folder-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dl-folder .chip-num{font-size:12px;color:#8A93A6;background:#F0F2F7;border-radius:10px;padding:1px 8px;min-width:22px;text-align:center}
.dl-folder.active .chip-num{background:#fff;color:#3B2FCF}
.dl-folder-ops{display:none;gap:6px}
.dl-folder:hover .dl-folder-ops{display:flex}
.dl-folder-ops a{color:#9AA3B5;font-size:13px;padding:0 2px}
.dl-folder-ops a:hover{color:#3B2FCF}
.dl-main{flex:1;min-width:0}
@media (max-width:760px){
  .dl-layout{flex-direction:column}
  .dl-rail{position:static;width:100%;flex-basis:auto}
}
/* 禁止复制：预览 / 在线打开区域 */
.dl-no-copy{user-select:none;-webkit-user-select:none;-moz-user-select:none}
/* 填写项留空时的下划线空白（供手写） */
.dl-blank{display:inline-block;min-width:4em;border-bottom:1px solid #333;height:1.05em;vertical-align:middle;margin:0 2px}
/* 填写并打印弹窗 */
.dl-fill-row{display:flex;align-items:center;gap:12px;margin:10px 0}
.dl-fill-row label{flex:0 0 90px;color:#2A3142;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dl-fill-row input{flex:1;height:36px;border:1px solid var(--line);border-radius:8px;padding:0 10px;font-size:14px}
.dl-fill-row input:focus{outline:none;border-color:var(--brand,#5046E5);box-shadow:0 0 0 3px rgba(80,70,229,.12)}

/* ONLYOFFICE 编辑器容器 */
.dl-oo{width:100%;min-height:0;flex:1;background:#fff;border:1px solid var(--line,#E2E4EA);border-radius:8px;overflow:hidden}
.dl-oo iframe{width:100%!important;height:100%!important;border:0;display:block}
.modal.dl-editor{height:90vh;max-height:96vh;overflow:hidden;padding:14px}
.modal.dl-editor .dl-oo{flex:1 1 auto;min-height:0}
.dl-oo-loading{display:flex;align-items:center;justify-content:center;height:100%;min-height:300px;color:#8A90A2;font-size:14px}
