@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #0f1b2d;
  --muted: #5b6878;
  --line: #e3e8ef;
  --accent: #0b6e6e;
  --accent-ink: #ffffff;
  --accent-soft: #e6f3f2;
  --warn: #9a5b00;
  --warn-soft: #fff4e0;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --good: #1d7a3e;
  --good-soft: #e7f6ec;
  --info: #2e5aac;
  --info-soft: #eaf0fb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 1px 3px rgba(15, 27, 45, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.neg { color: var(--bad); }
.hidden { display: none !important; }

/* 顶栏 */
.topbar { background: var(--ink); color: #fff; }
.topbar .inner { max-width: 1320px; margin: 0 auto; padding: 0 20px; height: 56px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand .logo { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; font-size: 13px; }
.brand small { font-weight: 500; color: #a9b4c2; }
.nav { display: flex; gap: 2px; margin-left: 8px; overflow-x: auto; }
.nav a { color: #c9d2dd; padding: 8px 12px; border-radius: 7px; font-weight: 500; white-space: nowrap; }
.nav a:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.nav a.active { background: rgba(255, 255, 255, .14); color: #fff; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 12px; color: #a9b4c2; font-size: 12px; white-space: nowrap; }
.role { background: rgba(255, 255, 255, .12); color: #fff; padding: 3px 8px; border-radius: 999px; font-weight: 600; font-size: 11px; }
.banner { background: var(--accent-soft); color: #0a4f4f; font-size: 12px; text-align: center; padding: 6px 16px; }

main { max-width: 1320px; margin: 0 auto; padding: 20px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-head .grow { flex: 1; min-width: 200px; }
.page-head p { margin: 4px 0 0; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-head .grow { flex: 1; }
.card-body { padding: 16px; }

.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 14px 16px; }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 500; }
.kpi .value { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #fafbfc; white-space: nowrap; }
tbody tr:hover { background: #fafcfd; }
tfoot td { font-weight: 700; background: #fafbfc; }
.driver-cell b { display: block; font-weight: 600; }
.driver-cell span { color: var(--muted); font-size: 12px; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.paid { background: var(--good-soft); color: var(--good); }
.pill.partial, .pill.awaiting { background: var(--warn-soft); color: var(--warn); }
.pill.unpaid, .pill.neutral { background: #eef1f5; color: #3d4a5c; }
.pill.negative, .pill.overpaid, .pill.pastdue { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }

/* 按钮与表单 */
button, .btn { font: inherit; font-weight: 600; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 7px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
button:hover, .btn:hover { background: #f3f5f8; text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover, .btn.primary:hover { background: #095c5c; }
button.ghost { border-color: transparent; background: transparent; color: var(--accent); padding: 4px 6px; }
button.ghost:hover { background: var(--accent-soft); }
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
input, select, textarea { font: inherit; border: 1px solid #cfd6df; border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--ink); min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(11, 110, 110, .25); border-color: var(--accent); }
label { display: grid; gap: 6px; font-weight: 500; font-size: 13px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form { display: grid; gap: 14px; }
textarea { min-height: 90px; resize: vertical; }

/* 审核队列 */
.queue { max-height: 720px; overflow-y: auto; }
.qitem { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.qitem:last-child { border-bottom: 0; }
.qitem .top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qitem .who { font-weight: 600; }
.qitem p { margin: 0; color: #344154; font-size: 13px; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

/* 提示条 */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); z-index: 50; max-width: calc(100vw - 32px); font-weight: 500; }
.toast.bad { background: var(--bad); }
.notice { padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.notice.good { background: var(--good-soft); color: #14532d; }
.notice.bad { background: var(--bad-soft); color: #7a1a12; }
.notice.warn { background: var(--warn-soft); color: #6b3f00; }
.notice.info { background: var(--info-soft); color: #1f3f7a; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }

dialog { border: 0; border-radius: 12px; padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(15, 27, 45, .3); }
dialog::backdrop { background: rgba(15, 27, 45, .45); }
dialog .card-head { border-bottom: 1px solid var(--line); }
dialog .foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* 导入页 */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.filelist { list-style: none; margin: 0; padding: 0; }
.filelist li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.filelist li:last-child { border-bottom: 0; }
.filelist code { font-size: 12px; }
.drop { border: 2px dashed #c4ccd6; border-radius: 10px; padding: 22px; text-align: center; color: var(--muted); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: #f0f3f6; padding: 1px 5px; border-radius: 4px; }

/* 消息页 */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; text-align: left; font-weight: 500; white-space: normal; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.bubble { background: #eef6ff; border-radius: 12px 12px 12px 2px; padding: 10px 12px; max-width: 520px; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-side { background: var(--ink); color: #dfe6ee; padding: 48px; display: flex; flex-direction: column; gap: 28px; justify-content: center; }
.login-side h1 { color: #fff; font-size: 30px; line-height: 1.2; }
.login-side ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.login-side li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; }
.login-side li b { color: #fff; display: block; }
.check { width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .12); display: grid; place-items: center; color: #7fd6d0; font-weight: 700; font-size: 12px; }
.login-main { display: grid; place-items: center; padding: 32px 20px; }
.login-box { width: min(400px, 100%); display: grid; gap: 18px; }
.acct { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; text-align: left; width: 100%; }
.acct:hover { border-color: var(--accent); background: #fbfefe; }
.acct .meta { flex: 1; display: grid; gap: 2px; }
.acct .meta span { font-weight: 500; color: var(--muted); font-size: 12px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* 说明页 */
.prose { max-width: 860px; }
.prose p, .prose li { color: #2b3748; }
.prose h2 { margin: 26px 0 8px; }
.map td:first-child { font-weight: 600; width: 34%; }
.arch { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0; }
.arch div { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; font-size: 13px; }
.arch b { display: block; margin-bottom: 4px; }

/* 工资单 */
.statement { max-width: 900px; margin: 0 auto; background: #fff; padding: 36px; border: 1px solid var(--line); border-radius: 12px; }
.st-head { display: flex; justify-content: space-between; gap: 24px; border-bottom: 2px solid var(--ink); padding-bottom: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.st-head h1 { font-size: 20px; }
.st-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.st-grid div { background: #f7f9fb; border-radius: 8px; padding: 10px 12px; }
.st-grid span:first-child { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.st-sum { margin-left: auto; width: min(360px, 100%); margin-top: 16px; }
.st-sum td { border: 0; padding: 5px 0; }
.st-sum tr.total td { border-top: 2px solid var(--ink); font-weight: 700; font-size: 16px; padding-top: 8px; }
.st-section { margin-top: 22px; }
.st-section h3 { margin-bottom: 6px; }
.load-row td { background: #f7f9fb; font-weight: 600; }
.stamp { display: inline-block; border: 2px solid var(--good); color: var(--good); padding: 4px 10px; border-radius: 6px; font-weight: 700; transform: rotate(-3deg); }

footer.foot-note { max-width: 1320px; margin: 8px auto 28px; padding: 0 20px; color: var(--muted); font-size: 12px; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  main { padding: 16px; }
  .topbar .inner { padding: 0 16px; gap: 10px; flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 6px; }
  .brand small, .topbar .right .exp { display: none; }
  .nav { order: 3; width: 100%; margin-left: 0; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid2, .field-row { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-side { padding: 32px 20px; order: 2; }
  .arch { grid-template-columns: 1fr 1fr; }
  .statement { padding: 18px; }
  .st-grid { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
}
@media print {
  body { background: #fff; }
  .topbar, .banner, .no-print, footer.foot-note, .layout > aside { display: none !important; }
  main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
  .layout { grid-template-columns: 1fr; }
  .statement { border: 0; padding: 0; }
  th { background: #fff; }
  tr { break-inside: avoid; }
}
.side-note { color: #8d9aab; }
.lead { margin: 6px 0 0; }
button.block { justify-content: center; width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.inline-label { display: inline; font-weight: 600; }
.mt { margin-top: 14px; }
.dlg-err { margin: 0 16px 12px; }
.toast.hidden { display: none; }
/* 看板表格紧凑化 */
.layout th, .layout td { padding: 9px 10px; }
.driver-cell { min-width: 170px; }
.driver-cell b { white-space: nowrap; }
.acts { display: grid; grid-template-columns: auto auto; gap: 4px; justify-content: start; }
.acts .btn, .acts button { padding: 4px 8px; font-size: 12px; border-radius: 6px; }
.layout { grid-template-columns: minmax(0, 1fr) 330px; }
@media (max-width: 1100px) { .layout { grid-template-columns: 1fr; } }
main, .topbar .inner, footer.foot-note { max-width: 1520px; }
.layout { grid-template-columns: minmax(0, 1fr) 300px; }
.layout th { font-size: 10.5px; letter-spacing: .03em; }
@media (max-width: 1100px) { .layout { grid-template-columns: 1fr; } }
.layout th, .layout td { padding: 8px 8px; }
td.stack { display: table-cell; }
td.stack .pill { display: flex; width: max-content; margin: 2px 0; }
@media (max-width: 1100px) { .layout { grid-template-columns: minmax(0, 1fr); } }
.layout > * { min-width: 0; }
.grid2 > * { min-width: 0; }
.filelist li { flex-wrap: wrap; }
.filelist code, .filelist a, td code { overflow-wrap: anywhere; word-break: break-all; }
