/* ============ 恒泰石膏矿 · 工分管理系统 样式 ============ */
:root {
  --brand: #1d4ed8;
  --brand-dark: #173a8f;
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --bg: #eef2f7;
  --card: #ffffff;
  --plan: #2563eb;
  --actual: #d97706;
  --final: #059669;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #f59e0b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, .18);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
.hidden { display: none !important; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(37, 99, 235, .22), transparent 60%),
    radial-gradient(700px 500px at 100% 100%, rgba(217, 119, 6, .18), transparent 55%),
    linear-gradient(160deg, #0b1b33 0%, #12294a 55%, #0b1b33 100%);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 460px; background: #fff; border-radius: 22px;
  padding: 34px 30px 28px; box-shadow: var(--shadow-lg);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.logo-mark {
  width: 46px; height: 46px; border-radius: 13px; flex: none;
  background: linear-gradient(145deg, #1d4ed8, #0b3aa8);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 17px;
  box-shadow: 0 6px 16px rgba(29, 78, 216, .35);
}
.login-title { font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.login-sub { color: var(--ink-3); font-size: 12.5px; margin-top: 1px; }
.login-desc { color: var(--ink-2); font-size: 13px; margin: 18px 0 14px; }
.acct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.acct-chip {
  border: 1.5px solid var(--line); border-radius: 11px; padding: 10px 12px; text-align: left;
  background: #fbfdff; transition: .15s;
}
.acct-chip b { display: block; font-size: 13.5px; }
.acct-chip span { color: var(--ink-3); font-size: 11.5px; }
.acct-chip.on { border-color: var(--brand); background: #eff6ff; box-shadow: 0 0 0 3px rgba(29, 78, 216, .1); }
.pin-row { display: flex; align-items: center; gap: 12px; margin: 20px 0 12px; }
.pin-dots { display: flex; gap: 10px; }
.pin-dot { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff; transition: .12s; }
.pin-dot.on { background: var(--brand); border-color: var(--brand); }
.pin-label { color: var(--ink-3); font-size: 12.5px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button {
  height: 50px; border-radius: 12px; background: #f1f5fb; font-size: 19px; font-weight: 600;
  border: 1px solid transparent; transition: .1s;
}
.keypad button:active { background: #dbeafe; transform: scale(.98); }
.keypad button.fn { font-size: 13px; color: var(--ink-2); background: #fff; border-color: var(--line); }
.login-btn {
  width: 100%; height: 48px; border-radius: 12px; margin-top: 14px;
  background: linear-gradient(145deg, #2563eb, #1d4ed8); color: #fff; font-weight: 700; font-size: 15.5px;
  box-shadow: 0 8px 20px rgba(29, 78, 216, .28);
}
.login-btn:disabled { opacity: .45; box-shadow: none; }
.login-err { color: var(--danger); font-size: 12.5px; min-height: 18px; margin-top: 8px; text-align: center; }
.login-foot { text-align: center; color: var(--ink-3); font-size: 11.5px; margin-top: 16px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; min-height: 56px;
  background: linear-gradient(120deg, #0c1f3d 0%, #123161 55%, #0c1f3d 100%);
  color: #fff; padding: 10px 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 2px 14px rgba(8, 22, 46, .28);
}
.tb-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 auto; }
.tb-txt { min-width: 0; }
.topbar .logo-mark { width: 36px; height: 36px; border-radius: 10px; font-size: 12px; letter-spacing: 0; }
.tb-title { font-size: 15.5px; font-weight: 700; letter-spacing: .3px; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-sub { font-size: 11px; color: #9db4d8; letter-spacing: .4px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-spacer { flex: 1; }
.month-pick {
  display: flex; align-items: center; gap: 2px; background: rgba(255, 255, 255, .1);
  border-radius: 10px; padding: 3px; border: 1px solid rgba(255, 255, 255, .12);
}
.month-pick button { color: #dbeafe; width: 28px; height: 28px; border-radius: 7px; font-size: 15px; }
.month-pick button:hover { background: rgba(255, 255, 255, .14); }
.month-pick .m-label { padding: 0 8px; font-weight: 600; font-size: 13.5px; min-width: 96px; text-align: center; }
.user-chip { display: flex; align-items: center; gap: 9px; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .16); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, .16); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.user-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.user-role { font-size: 10.5px; color: #9db4d8; }
.icon-btn { color: #cbd5e1; padding: 7px 9px; border-radius: 8px; font-size: 12.5px; }
.icon-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* ---------- 选项卡 ---------- */
.tabs {
  position: sticky; top: 56px; z-index: 35;
  display: flex; gap: 4px; padding: 0 14px; background: #fff;
  border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; padding: 13px 18px 12px; white-space: nowrap; color: var(--ink-3);
  font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; border-bottom: 3px solid transparent;
}
.tab .ti { font-size: 16px; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); }
.tab .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.view { padding: 16px 18px 90px; max-width: 1500px; margin: 0 auto; }

/* ---------- 通用 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(226, 232, 240, .8); }
.card-h { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-t { font-size: 15px; font-weight: 700; }
.card-b { padding: 16px 18px; }
.card-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 15px; border-radius: 10px; font-weight: 600; font-size: 13.5px;
  background: #fff; border: 1px solid var(--line-2); color: var(--ink-2); transition: .13s;
  white-space: nowrap;
}
.btn:hover { border-color: #94a3b8; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(29, 78, 216, .22); }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: #f1f5f9; }
.btn.danger { color: var(--danger); border-color: #fecaca; background: #fff5f5; }
.btn.green { background: var(--final); border-color: var(--final); color: #fff; }
.btn.amber { background: var(--actual); border-color: var(--actual); color: #fff; }
.btn.sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px;
  border-radius: 20px; font-size: 11.5px; font-weight: 600; background: #f1f5f9; color: var(--ink-2);
}
.badge.plan { background: #dbeafe; color: #1e40af; }
.badge.actual { background: #fef3c7; color: #92400e; }
.badge.final { background: #d1fae5; color: #065f46; }
.badge.gray { background: #f1f5f9; color: var(--ink-3); }
.badge.red { background: #fee2e2; color: #991b1b; }
.badge.green { background: #dcfce7; color: #166534; }
.tag {
  display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; background: #eef2ff; color: #3730a3;
}
.seg { display: inline-flex; background: #eef2f7; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .14); }
.seg button:disabled { opacity: .38; cursor: not-allowed; }
.seg.version button.on.plan { color: var(--plan); }
.seg.version button.on.actual { color: var(--actual); }
.seg.version button.on.final { color: var(--final); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px;
  border-radius: 10px; background: #fff; border: 1.5px solid var(--line); font-size: 13.5px;
  font-weight: 500; color: var(--ink-2); transition: .12s;
}
.chip:hover { border-color: #94a3b8; }
.chip.on { border-color: var(--brand); background: #eff6ff; color: var(--brand-dark); font-weight: 700; box-shadow: 0 0 0 3px rgba(29, 78, 216, .09); }
.chip.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.chip .n { font-size: 11px; color: var(--ink-3); }
.input, .select {
  height: 38px; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 0 11px;
  background: #fff; outline: none; transition: .13s; min-width: 0;
}
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29, 78, 216, .1); }
.select { padding-right: 28px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%2364748b' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.grid th, table.grid td { padding: 8px 9px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.grid th { background: #f8fafc; font-weight: 700; color: var(--ink-2); font-size: 12.5px; position: sticky; top: 0; z-index: 2; }
table.grid tbody tr:hover td { background: #f8fbff; }
table.grid td.r, table.grid th.r { text-align: right; }
table.grid td.c, table.grid th.c { text-align: center; }
.empty { padding: 46px 20px; text-align: center; color: var(--ink-3); }
.empty .ico { font-size: 40px; opacity: .4; display: block; margin-bottom: 8px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: #fff; border-radius: 12px; padding: 13px 15px; border: 1px solid var(--line); }
.kpi .k { font-size: 11.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .3px; }
.kpi .v { font-size: 22px; font-weight: 800; letter-spacing: -.5px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.kpi .u { font-size: 11.5px; font-weight: 600; color: var(--ink-3); margin-left: 3px; }
.kpi.a .v { color: var(--actual); }
.kpi.b .v { color: var(--plan); }
.kpi.g .v { color: var(--final); }
.kpi.r .v { color: var(--danger); }

/* ---------- 填报 ---------- */
.entry-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; width: 100%; max-width: 100%; min-width: 0; }
.date-nav { display: flex; align-items: center; gap: 6px; }
.date-nav .dtext { font-size: 17px; font-weight: 800; min-width: 128px; text-align: center; letter-spacing: .2px; }
.date-nav .dsub { font-size: 11px; color: var(--ink-3); font-weight: 500; display: block; margin-top: -3px; }
.entry-list { display: flex; flex-direction: column; gap: 10px; }
.item-card {
  background: #fff; border-radius: 12px; border: 1px solid var(--line);
  padding: 13px 15px; display: grid; grid-template-columns: 1fr auto; gap: 6px 14px;
  position: relative; transition: .13s;
}
.item-card:hover { box-shadow: var(--shadow); border-color: var(--line-2); }
.item-card .ic-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.item-card .ic-name { font-weight: 700; font-size: 14.5px; }
.item-card .ic-spec { color: var(--ink-3); font-size: 12.5px; }
.item-card .ic-calc { color: var(--ink-2); font-size: 12.5px; margin-top: 4px; }
.item-card .ic-calc b { color: var(--ink); font-size: 13.5px; }
.item-card .ic-total { text-align: right; }
.item-card .ic-total .t { font-size: 20px; font-weight: 800; color: var(--brand-dark); font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.item-card .ic-total .u { font-size: 11px; color: var(--ink-3); }
.item-card .ic-people { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pchip {
  display: inline-flex; align-items: center; gap: 5px; background: #f8fafc; border: 1px solid var(--line);
  border-radius: 20px; padding: 3px 9px 3px 4px; font-size: 12px;
}
.pchip .cf { background: #e2e8f0; color: var(--ink-2); border-radius: 10px; padding: 0 6px; font-size: 10.5px; font-weight: 700; }
.pchip .sc { color: var(--brand-dark); font-weight: 700; font-variant-numeric: tabular-nums; }
.pchip .nm { font-weight: 600; }
.item-card .ic-note { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); background: #f8fafc; border-radius: 7px; padding: 4px 9px; margin-top: 4px; }
.item-card.mode-direct { border-left: 3px solid var(--warn); }
.item-card .ic-acts { position: absolute; right: 10px; top: 10px; display: flex; gap: 4px; opacity: 0; transition: .15s; }
.item-card:hover .ic-acts { opacity: 1; }
.add-item {
  width: 100%; height: 56px; border-radius: 13px; border: 2px dashed #b9c6d8; background: #fbfdff;
  color: var(--brand); font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: .15s;
}
.add-item:hover { border-color: var(--brand); background: #eff6ff; }
.entry-summary {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(255, 255, 255, .97); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); box-shadow: 0 -4px 20px rgba(15, 23, 42, .07);
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
}
.entry-summary .inner { max-width: 1500px; margin: 0 auto; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.entry-summary .sum-label { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.entry-summary .sum-val { font-size: 24px; font-weight: 800; color: var(--brand-dark); font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.entry-summary .sum-val small { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-left: 2px; }
.saved-flag { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
.saved-flag .d { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.saved-flag.dirty .d { background: var(--warn); }
.readonly-banner {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px;
  padding: 9px 14px; font-size: 13px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(8, 20, 40, .5); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
  animation: fade .16s ease;
}
@media (min-width: 720px) { .modal-mask { align-items: center; padding: 24px; } }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.sheet {
  background: #fff; width: 100%; max-width: 760px; max-height: 92vh; max-height: 92dvh;
  border-radius: 20px 20px 0 0; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: up .2s cubic-bezier(.2, .9, .3, 1);
  overflow: hidden;
}
@media (min-width: 720px) { .sheet { border-radius: 18px; max-height: 88vh; } }
@keyframes up { from { transform: translateY(24px); opacity: .6 } to { transform: translateY(0); opacity: 1 } }
.sheet-h { padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.sheet-t { font-size: 16px; font-weight: 800; }
.sheet-b { padding: 16px 18px; overflow: auto; flex: 1; }
.sheet-f { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.step { margin-bottom: 18px; }
.step-h { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.step-n {
  width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff;
  font-size: 11.5px; font-weight: 700; display: grid; place-items: center; flex: none;
}
.step-t { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.step-tip { font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.chip-wrap { display: flex; gap: 7px; flex-wrap: wrap; }
.qty-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.qty-input {
  width: 130px; height: 54px; font-size: 26px; font-weight: 800; text-align: center;
  border: 2px solid var(--line-2); border-radius: 12px; font-variant-numeric: tabular-nums;
  outline: none;
}
.qty-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(29, 78, 216, .1); }
.qty-unit { font-size: 15px; font-weight: 700; color: var(--ink-2); }
.stepper { display: flex; gap: 6px; }
.stepper button { width: 42px; height: 42px; border-radius: 10px; background: #eef2f7; font-size: 20px; font-weight: 700; color: var(--ink-2); }
.stepper button:active { background: #dbeafe; }
.quick-qty { display: flex; gap: 6px; flex-wrap: wrap; }
.formula {
  margin-top: 12px; background: linear-gradient(135deg, #eff6ff, #f8fbff); border: 1px solid #dbeafe;
  border-radius: 12px; padding: 11px 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-2);
}
.formula .eq { font-weight: 800; color: var(--brand-dark); font-size: 19px; font-variant-numeric: tabular-nums; }
.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 7px; max-height: 240px; overflow: auto; padding: 2px; }
.person-btn {
  border: 1.5px solid var(--line); border-radius: 9px; padding: 7px 9px; background: #fff; text-align: left;
  display: flex; flex-direction: column; gap: 1px;
}
.person-btn b { font-size: 13px; font-weight: 600; }
.person-btn span { font-size: 10.5px; color: var(--ink-3); }
.person-btn.on { border-color: var(--brand); background: #eff6ff; box-shadow: 0 0 0 2px rgba(29, 78, 216, .1); }
.person-btn.on b { color: var(--brand-dark); }
.sel-people { display: flex; flex-direction: column; gap: 7px; }
.sel-row {
  display: flex; align-items: center; gap: 10px; background: #f8fafc; border: 1px solid var(--line);
  border-radius: 10px; padding: 7px 11px;
}
.sel-row .nm { font-weight: 700; font-size: 13.5px; min-width: 64px; }
.sel-row .post { font-size: 11.5px; color: var(--ink-3); }
.sel-row .sc { margin-left: auto; font-weight: 700; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.coef-select { height: 30px; border-radius: 8px; border: 1px solid var(--line-2); padding: 0 6px; font-size: 12.5px; background: #fff; }
.mini-label { font-size: 11.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .2px; }

/* ---------- 日结算单 ---------- */
.sheet-paper { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 20px 18px; overflow: auto; }
.sheet-title { text-align: center; font-size: 17px; font-weight: 800; letter-spacing: 1px; margin-bottom: 4px; }
.sheet-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-bottom: 12px; padding: 0 2px; }
table.settle { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.settle th, table.settle td { border: 1px solid #94a3b8; padding: 5px 7px; text-align: center; }
table.settle th { background: #e8eef7; font-weight: 700; }
table.settle td.l { text-align: left; }
table.settle tr.total td { background: #f1f5f9; font-weight: 800; }
table.settle td .cat { writing-mode: horizontal-tb; font-weight: 700; color: var(--ink-2); }
table.settle tbody tr.cat-start td { border-top: 2px solid #64748b; }
.settle-foot { display: flex; justify-content: space-between; margin-top: 12px; font-size: 12.5px; }
.sign-line { display: flex; gap: 30px; font-size: 12.5px; color: var(--ink-3); }

/* ---------- 月度汇总 ---------- */
.mtable { border-collapse: separate; border-spacing: 0; font-size: 11.5px; width: max-content; min-width: 100%; }
.mtable th, .mtable td { border-right: 1px solid #edf1f7; border-bottom: 1px solid #edf1f7; padding: 4px 4px; text-align: center; white-space: nowrap; }
.mtable thead th { background: #f4f7fb; font-weight: 700; color: var(--ink-2); position: sticky; top: 0; z-index: 3; font-size: 11px; }
.mtable .sticky-l { position: sticky; left: 0; background: #fff; z-index: 2; }
.mtable .sticky-l2 { position: sticky; left: 44px; background: #fff; z-index: 2; }
.mtable .sticky-l3 { position: sticky; left: 130px; background: #fff; z-index: 2; }
.mtable thead .sticky-l, .mtable thead .sticky-l2, .mtable thead .sticky-l3 { z-index: 5; background: #f4f7fb; }
.mtable tbody tr:hover td { background: #f8fbff; }
.mtable tbody tr:hover .sticky-l, .mtable tbody tr:hover .sticky-l2, .mtable tbody tr:hover .sticky-l3 { background: #f8fbff; }
.mtable td.d { font-variant-numeric: tabular-nums; cursor: pointer; }
.mtable td.d:hover { background: #dbeafe !important; }
.mtable tfoot td { position: sticky; bottom: 0; background: #f8fafc; font-weight: 800; z-index: 3; }
.mtable .col-total { background: #fbfdff; font-weight: 700; }
.mtable .col-money { background: #f0fdf4; font-weight: 700; color: #065f46; box-shadow: -4px 0 10px rgba(15, 23, 42, .04); }
.month-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.pool-edit { display: flex; align-items: center; gap: 7px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 5px 10px; }
.pool-edit .input { height: 30px; width: 110px; border-color: #fcd34d; }

/* ---------- 双版对照 ---------- */
.diff-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.diff-group { margin-bottom: 14px; }
.diff-day-h { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-weight: 800; font-size: 14px; }
.diff-row {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
  display: grid; grid-template-columns: 1fr; gap: 10px;
}
@media (min-width: 860px) { .diff-row { grid-template-columns: 1.2fr 1fr 1fr; align-items: start; } }
.diff-row .dr-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.diff-side { background: #f8fafc; border-radius: 9px; padding: 8px 11px; font-size: 12.5px; border-left: 3px solid var(--line-2); }
.diff-side.plan { border-left-color: var(--plan); background: #f5f8ff; }
.diff-side.actual { border-left-color: var(--actual); background: #fffbf3; }
.diff-side .v { font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.diff-side .nm { color: var(--ink-3); font-size: 11.5px; }
.diff-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.diff-decided { font-size: 11.5px; color: var(--final); font-weight: 700; }

/* ---------- 设置 ---------- */
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.field .input, .field .select { width: 100%; }
.field .hint { font-size: 11.5px; color: var(--ink-3); }
.cat-block { margin-bottom: 18px; }
.cat-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cat-h .nm { font-weight: 800; font-size: 14px; }
.rate-row { display: grid; grid-template-columns: minmax(150px, 1.1fr) 92px 78px minmax(120px, 1fr); gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
@media (max-width: 640px) { .rate-row { grid-template-columns: 1fr 1fr; } }
.rate-input { width: 92px; height: 30px; border: 1px solid var(--line-2); border-radius: 7px; padding: 0 8px; text-align: right; font-variant-numeric: tabular-nums; }
.rate-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29, 78, 216, .1); }

/* ---------- Toast ---------- */
#toast { position: fixed; left: 50%; top: 74px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(15, 23, 42, .93); color: #fff; padding: 9px 18px; border-radius: 24px;
  font-size: 13.5px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  animation: tin .2s ease; display: flex; gap: 8px; align-items: center; max-width: 80vw;
}
.toast.err { background: #b91c1c; }
.toast.ok { background: #047857; }
@keyframes tin { from { opacity: 0; transform: translateY(-8px) } to { opacity: 1; transform: none } }

/* ---------- 微信提示 ---------- */
.wx-tip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fffbeb; border-bottom: 1px solid #fde68a; color: #92400e;
  padding: 9px 16px; font-size: 12.5px; line-height: 1.5;
}
.wx-tip strong { color: #b45309; }
.wx-tip span { flex: 1; min-width: 200px; }
.wx-tip button {
  background: #fff; border: 1px solid #fcd34d; color: #92400e; border-radius: 8px;
  padding: 4px 12px; font-size: 12px; font-weight: 600;
}

/* ---------- 打印 ---------- */
@media print {
  body { background: #fff; }
  .topbar, .tabs, .entry-summary, .month-tools, .no-print { display: none !important; }
  .view { padding: 0; max-width: none; }
  .card { box-shadow: none; border: none; }
  .sheet-paper { box-shadow: none; padding: 0; border-radius: 0; }
  table.settle { font-size: 10.5px; }
  table.settle th, table.settle td { padding: 3px 4px; }
  @page { size: A4 landscape; margin: 10mm; }
}

/* ---------- 手机 ---------- */
@media (max-width: 640px) {
  .topbar { padding: 8px 10px; gap: 8px; min-height: 56px; }
  .topbar .tb-txt { display: none; }
  .tb-title { font-size: 13.5px; }
  .tb-sub { display: none; }
  .user-name, .user-role { display: none; }
  .month-pick .m-label { min-width: auto; font-size: 12px; padding: 0 5px; white-space: nowrap; }
  .month-pick button { width: 24px; }
  .user-chip { padding-left: 8px; gap: 5px; }
  .avatar { width: 28px; height: 28px; font-size: 12px; }
  .view { padding: 12px 12px 150px; }
  .tab { padding: 12px 13px; font-size: 13.5px; }
  .tab .ti { font-size: 15px; }
  .entry-toolbar { display: block; width: auto; max-width: none; }
  .entry-toolbar > * { margin-bottom: 8px; }
  .entry-toolbar > *:last-child { margin-bottom: 0; }
  .entry-toolbar .spacer { display: none; }
  .entry-toolbar .date-nav { display: flex; justify-content: space-between; }
  .entry-toolbar .seg { display: flex; width: 100%; max-width: 100%; }
  .entry-toolbar .seg button { flex: 1 1 0; min-width: 0; padding: 6px 6px; }
  .date-nav .dtext { min-width: 108px; font-size: 15px; }
  .item-card .ic-total .t { font-size: 18px; }
  .kpi .v { font-size: 19px; }
  .sheet-b { padding: 14px; }
  .person-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
  .login-card { padding: 26px 20px 22px; }
  .entry-summary { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .entry-summary .inner { gap: 8px 14px; }
  .entry-summary .sum-val { font-size: 20px; }
  .entry-summary .sum-label { font-size: 11px; }
  .entry-summary .saved-flag { margin-left: auto; }
  .entry-summary .btn.lg { width: 100%; height: 42px; margin-top: 4px; }
  .sheet-meta { flex-direction: column; gap: 2px; }
  .diff-row { padding: 11px; }
  .diff-sum { grid-template-columns: repeat(2, 1fr); }
}
