/* ============ 睿企通 · PC 管理端样式 ============ */
:root {
  --navy: #0f2743;
  --navy-2: #163455;
  --blue: #1f6feb;
  --blue-soft: #e8f0fe;
  --green: #0f9d58;
  --orange: #d97706;
  --red: #d92d20;
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e4e8f0;
  --text: #1f2937;
  --muted: #6b7280;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
}

.hidden { display: none !important; }

button, input, select, textarea {
  font-family: inherit;
  font-size: 14px;
}

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(90deg, rgba(6, 18, 30, .78) 0%, rgba(6, 18, 30, .45) 46%, rgba(6, 18, 30, .72) 100%),
    url('./assets/login-bg-tech.jpg') center / cover no-repeat,
    radial-gradient(1200px 600px at 20% 0%, #1d4d7e 0%, #0f2743 45%, #081a2c 100%);
}

.login-card {
  width: 360px;
  background: rgba(255, 255, 255, .96);
  border-radius: 14px;
  padding: 30px 32px 28px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .34);
  backdrop-filter: blur(6px);
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: .5px;
  text-align: center;
}

.login-card p.sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.login-card label {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  color: #374151;
}

.login-card input {
  width: 100%;
  height: 40px;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.login-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }

.login-card button {
  width: 100%;
  height: 42px;
  margin-top: 8px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
}

.login-card button:hover { background: #1a5fd0; }

.login-err {
  min-height: 18px;
  margin-top: 10px;
  color: var(--red);
  font-size: 13px;
}

/* ---------- 主框架 ---------- */
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 208px;
  flex: 0 0 208px;
  background: linear-gradient(180deg, var(--navy) 0%, #0b1f33 100%);
  color: #cfe0f2;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .5px;
}

.brand .logo i {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: 13px;
  color: #fff;
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: block;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .35);
}

.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: block;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, .25);
}

.brand .sub {
  margin-top: 6px;
  font-size: 12px;
  color: #7f9ab6;
  letter-spacing: .4px;
}

.nav {
  padding: 12px 10px;
  flex: 1;
  overflow-y: auto;
}

.nav a {
  display: block;
  padding: 10px 14px;
  margin-bottom: 4px;
  border-radius: 8px;
  color: #c2d6ea;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: .15s;
}

.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.nav a.active {
  background: linear-gradient(90deg, #1f6feb, #2a83ff);
  color: #fff;
  box-shadow: 0 4px 12px rgba(31, 111, 235, .35);
}

.nav-group { margin-bottom: 6px; }

.nav-group-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #8fa9c4;
  font-size: 12.5px;
  letter-spacing: .6px;
  cursor: pointer;
  text-align: left;
}

.nav-group-head:hover { background: rgba(255, 255, 255, .05); color: #d9e8f7; }
.nav-group-head i { font-style: normal; font-size: 13px; opacity: .75; }

.nav-sub {
  margin-left: 4px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, .08);
}
.nav-group:not(.open) .nav-sub { display: none; }

.nav-sub a {
  padding: 8px 12px;
  font-size: 13.5px;
}

.nav-empty {
  padding: 18px 12px;
  color: #8fa9c4;
  font-size: 13px;
  line-height: 1.7;
}

.side-foot {
  padding: 14px 20px 18px;
  font-size: 12px;
  color: #6d88a3;
  border-top: 1px solid rgba(255, 255, 255, .07);
  line-height: 1.6;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  flex: 0 0 64px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.user-chip b { color: var(--text); font-weight: 600; }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.btn-ghost {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 7px;
  cursor: pointer;
}

.btn-ghost:hover { border-color: #cbd5e1; color: var(--text); }

.view {
  padding: 20px 24px 48px;
}

/* ---------- 卡片 / KPI ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
}

.card-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.card-head .hint { color: var(--muted); font-size: 12px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.kpi::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: var(--blue);
}

.kpi.in::after { background: var(--green); }
.kpi.out::after { background: var(--orange); }
.kpi.warn::after { background: var(--red); }

.kpi .label { color: var(--muted); font-size: 13px; }

.kpi .value {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .3px;
  font-variant-numeric: tabular-nums;
}

.kpi .value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }

.kpi .foot { margin-top: 8px; font-size: 12px; color: var(--muted); }
.kpi .foot b { color: var(--text); font-weight: 600; }

/* ---------- 两栏布局 ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

/* ---------- 柱状图（纯 CSS，无外部依赖） ---------- */
.chart {
  padding: 8px 18px 20px;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  height: 200px;
  padding-top: 10px;
  border-bottom: 1px dashed #e5eaf2;
}

.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.bars-inner {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
}

.bar {
  width: 26px;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  transition: .3s;
  position: relative;
}

.bar.in { background: linear-gradient(180deg, #34d399, #0f9d58); }
.bar.out { background: linear-gradient(180deg, #fbbf24, #d97706); }

.bar-group span {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.legend {
  display: flex;
  gap: 16px;
  padding: 12px 18px 0;
  font-size: 12px;
  color: var(--muted);
}

.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: 1px;
}

.legend .in { background: #0f9d58; }
.legend .out { background: #d97706; }

/* ---------- 账龄 ---------- */
.aging { padding: 4px 18px 18px; }

.aging-row { margin-bottom: 12px; }

.aging-row .line {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}

.aging-row .line b { color: var(--text); font-variant-numeric: tabular-nums; }

.aging-track {
  height: 8px;
  background: #eef2f7;
  border-radius: 5px;
  overflow: hidden;
}

.aging-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #93c5fd, #1f6feb);
}

.aging-fill.warm { background: linear-gradient(90deg, #fdba74, #d97706); }
.aging-fill.hot { background: linear-gradient(90deg, #fca5a5, #d92d20); }

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

.toolbar input[type="text"],
.toolbar select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  outline: none;
  color: var(--text);
}

.toolbar input[type="text"] { width: 240px; }
.toolbar select { max-width: 190px; }
.toolbar input[type="text"]:focus,
.toolbar select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }

.toolbar .spacer { flex: 1; }

.btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover { border-color: #cbd5e1; }

.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 600;
}

.btn-primary:hover { background: #1a5fd0; }

.btn-sm {
  height: 26px;
  padding: 0 9px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-danger { color: var(--red); border-color: #fecdca; background: #fff5f4; }
.btn-danger:hover { background: #ffe4e1; }

/* ---------- 表格 ---------- */
.table-wrap { overflow: auto; max-height: calc(100vh - 250px); }

table.data thead th {
  position: sticky;
  top: 0;
  z-index: 6;
}

table.data th.actions { z-index: 7; }

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

table.data th {
  text-align: left;
  padding: 11px 12px;
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-size: 12.5px;
}

table.data td {
  padding: 11px 12px;
  border-bottom: 1px solid #f1f4f9;
  color: var(--text);
  vertical-align: middle;
}

table.data tr:hover td { background: #fafcff; }

table.data td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.data td.actions { white-space: nowrap; text-align: right; }

table.data th.actions,
table.data td.actions {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  box-shadow: -8px 0 10px -8px rgba(15, 39, 67, .28);
}

table.data th.actions { background: #f8fafc; }
table.data tr:hover td.actions { background: #fafcff; }
table td.nowrap { white-space: nowrap; }

table.data tbody tr.clickable { cursor: pointer; }

.empty {
  padding: 42px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  color: var(--muted);
  font-size: 12.5px;
}

.pager button {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
}

.pager button:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.tag.in { background: #e7f6ee; color: #0f9d58; }
.tag.out { background: #fdf0e3; color: #c2680a; }
.tag.blue { background: #e8f0fe; color: #1f6feb; }
.tag.gray { background: #f1f3f6; color: #6b7280; }
.tag.red { background: #fdecea; color: #d92d20; }
.tag.green { background: #e7f6ee; color: #0f9d58; }
.tag.amber { background: #fef4e6; color: #b45309; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  z-index: 60;
  overflow-y: auto;
}

.modal {
  width: 680px;
  max-width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .25);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 { margin: 0; font-size: 16px; }

.modal-head button {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  font-size: 20px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 18px 20px 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

.modal-body .field.full { grid-column: 1 / -1; }

.field label {
  display: block;
  margin-bottom: 5px;
  font-size: 12.5px;
  color: #475569;
}

.field label em {
  color: var(--red);
  font-style: normal;
  margin-left: 2px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
  background: #fff;
}

.field textarea {
  height: 68px;
  padding: 8px 10px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.field .hintline { margin-top: 4px; font-size: 11.5px; color: #94a3b8; }

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
}

/* ---------- 右侧详情抽屉 ---------- */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 760px;
  max-width: 92vw;
  height: 100vh;
  background: #fff;
  box-shadow: -12px 0 40px rgba(15, 23, 42, .18);
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.drawer-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-head .t1 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.drawer-head .t2 {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.drawer-head button {
  border: 0;
  background: #f4f6fa;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  color: var(--muted);
  flex: 0 0 auto;
}

.drawer-body { padding: 16px 22px 40px; overflow-y: auto; flex: 1; }

.mini-kpi {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.mini-kpi .box {
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 9px;
  padding: 10px 12px;
}

.mini-kpi .box .l { font-size: 12px; color: var(--muted); }
.mini-kpi .box .v { margin-top: 4px; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
}

.section-title .ops { display: flex; gap: 8px; }

table.mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

table.mini th {
  text-align: left;
  padding: 8px 8px;
  background: #f8fafc;
  color: #64748b;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.mini td {
  padding: 8px;
  border-bottom: 1px solid #f1f4f9;
}

table.mini td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 合同附件列表 */
.file-table td:first-child { max-width: 390px; }
.file-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.file-name > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-ext {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 22px;
  padding: 0 5px;
  border-radius: 5px;
  background: #eef4ff;
  color: #2563eb;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
}
.file-ext.pdf { background: #fff1f0; color: #d92d20; }
.file-ext.jpg, .file-ext.jpeg, .file-ext.png, .file-ext.webp, .file-ext.bmp, .file-ext.tif, .file-ext.tiff {
  background: #ecfdf3;
  color: #0f9d58;
}
.file-ext.doc, .file-ext.docx { background: #eef2ff; color: #3b5bdb; }
.file-ext.xls, .file-ext.xlsx { background: #f0fdf4; color: #15803d; }
.file-ext.zip { background: #f8fafc; color: #64748b; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: 24px;
  transform: translateX(-50%) translateY(-20px);
  background: #0f172a;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  z-index: 90;
  max-width: 80vw;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #b42318; }

.loading {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

/* ---------- 经营概览 ---------- */
.dash-head {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px;
  margin-bottom: 16px;
  border-radius: 14px;
  background:
    radial-gradient(700px 220px at 88% -20%, rgba(56, 132, 255, .34), transparent 70%),
    linear-gradient(120deg, #0f2743 0%, #163455 58%, #1b3f6b 100%);
  color: #fff;
  box-shadow: 0 10px 30px rgba(15, 39, 67, .18);
}

.dash-head::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -90px;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(255, 255, 255, .03), 0 0 0 52px rgba(255, 255, 255, .02);
  pointer-events: none;
}

.dash-kicker {
  display: block;
  font-size: 10px;
  letter-spacing: .18em;
  color: #8fc0ff;
  margin-bottom: 6px;
}

.dash-title h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: .04em;
}

.dash-title p {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, .68);
  font-size: 13px;
}

.dash-head-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(96px, 1fr));
  gap: 1px;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.dash-head-stats > div {
  padding: 10px 14px;
  background: rgba(9, 26, 46, .24);
}

.dash-head-stats span {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, .62);
  white-space: nowrap;
}

.dash-head-stats b {
  display: block;
  margin-top: 4px;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dash-head-stats small { font-size: 11px; font-weight: 500; color: rgba(255,255,255,.58); margin-left: 3px; }

.dash-main {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.dash-alerts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.dash-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
}

.dash-trend .chart { padding-top: 2px; }
.dash-trend .bars { height: 232px; }

.kpi-progress {
  height: 5px;
  margin-top: 10px;
  background: #eef2f7;
  border-radius: 4px;
  overflow: hidden;
}

.kpi-progress i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--blue);
}

.kpi.in .kpi-progress i { background: linear-gradient(90deg, #34d399, #0f9d58); }
.kpi.out .kpi-progress i { background: linear-gradient(90deg, #fbbf24, #d97706); }
.kpi.warn .kpi-progress i { background: linear-gradient(90deg, #fca5a5, #d92d20); }

.kpi-progress-label {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.badge-count {
  min-width: 24px;
  height: 20px;
  padding: 0 7px;
  border-radius: 10px;
  background: #fef3f2;
  color: #d92d20;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.badge-count.blue { background: var(--blue-soft); color: var(--blue); }

.card-link {
  color: var(--blue);
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

.card-link:hover { text-decoration: underline; }

.cash-gap {
  margin: 2px 18px 18px;
  padding: 12px 14px;
  border-radius: 9px;
  background: #f1f7ff;
  border: 1px solid #dbeafe;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cash-gap span { font-size: 11px; color: var(--muted); }
.cash-gap b { font-size: 18px; font-variant-numeric: tabular-nums; color: var(--blue); }
.cash-gap em { font-style: normal; font-size: 11px; color: var(--muted); }
.cash-gap.negative { background: #fff8f1; border-color: #fde7d6; }
.cash-gap.negative b { color: var(--orange); }

.field input[readonly] {
  background: #f8fafc;
  color: #475569;
  cursor: default;
}

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .dash-main, .dash-alerts, .dash-bottom { grid-template-columns: 1fr; }
  .dash-head { flex-direction: column; align-items: stretch; }
  .dash-head-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .dash-head-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .sidebar { display: none; }
  .modal { width: 100%; }
  .modal-body { grid-template-columns: 1fr; }
  .drawer { width: 100%; }
}

/* 报表中心 */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line, #e2e8f0);
  background: #fff;
  color: var(--text, #1e293b);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}
.chip:hover { border-color: #cbd5e1; }
.chip.on { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.input {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: inherit;
}
.input:focus { outline: none; border-color: #1f6feb; box-shadow: 0 0 0 3px rgba(31,111,235,.12); }
.muted { color: var(--muted, #64748b); }
table.data td.neg { color: #b42318; font-weight: 600; }
table.data tfoot td {
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  font-weight: 600;
  padding: 10px 12px;
  font-size: 13px;
}
table.data tfoot td.num { text-align: right; font-variant-numeric: tabular-nums; }
.btn-mini { padding: 3px 10px; font-size: 12px; height: 26px; }
table.data tr.row { cursor: pointer; }

.company-pick {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 4px 8px;
}
.company-pick select {
  border: none;
  background: transparent;
  font-size: 13px;
  color: #0f172a;
  font-weight: 600;
  max-width: 180px;
  outline: none;
  cursor: pointer;
}

/* 数据备份页 */
.backup-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 18px 16px;
}
.backup-meta > div {
  background: #f8fafc;
  border: 1px solid #e8eef5;
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 0;
}
.backup-meta span { display: block; font-size: 12px; color: #64748b; margin-bottom: 5px; }
.backup-meta b { display: block; font-size: 13px; color: #0f172a; word-break: break-all; font-weight: 600; }
.backup-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 18px 18px;
}
.backup-actions .hint { color: #64748b; font-size: 12px; }

/* ---------- 考勤记工 / 工资 ---------- */
.work-panel {
  background: #fff;
  border: 1px solid #e8eef5;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.work-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.work-panel-head .title { font-weight: 600; font-size: 14px; }
.work-grid {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px 14px;
  align-items: start;
}
.work-grid > label { color: #475569; font-size: 13px; padding-top: 8px; }
.unit-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.unit-btn {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  color: #1e293b;
}
.unit-btn.on { background: #1f6feb; color: #fff; border-color: #1f6feb; }
.work-panel input[type="number"],
.work-panel input[type="date"],
.work-panel select,
.work-panel input[type="text"] {
  height: 34px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 0 10px;
  font-size: 13px;
  color: #1e293b;
  background: #fff;
}
.work-panel input[type="number"] { width: 110px; }
.work-panel .hint { color: #64748b; font-size: 12px; }
.work-panel .save-row { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.amount-preview { font-weight: 600; color: #0f9d58; font-size: 14px; }
.payout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.payout-grid .field { display: flex; flex-direction: column; gap: 6px; }
.payout-grid label { font-size: 12.5px; color: #475569; }
.payout-grid input, .payout-grid select, .payout-grid textarea {
  height: 34px; border: 1px solid #e2e8f0; border-radius: 7px; padding: 0 10px; font-size: 13px;
}
.payout-grid .full { grid-column: 1 / -1; }
.payout-grid textarea { height: 64px; padding: 8px 10px; }
@media (max-width: 760px) {
  .payout-grid { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: 1fr; }
  .work-grid > label { padding-top: 0; }
}

/* 列宽拖动 */
table.data th.resizable,
table.mini th.resizable { position: sticky; top: 0; z-index: 6; }
.col-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
  z-index: 4;
  background: transparent;
}
.col-resizer:hover,
body.col-resizing .col-resizer { background: rgba(37, 99, 235, .28); }
body.col-resizing { cursor: col-resize !important; user-select: none; }

/* 账号权限 */
.modal-wide { width: min(760px, calc(100vw - 32px)); }
.perm-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1.3fr) 58px 58px 58px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 10px;
}
.perm-head {
  background: #f8fafc;
  padding: 8px 10px;
  font-size: 12px;
  color: #475569;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
}
.perm-head:first-child { text-align: left; }
.perm-name {
  padding: 8px 10px;
  font-size: 13px;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
}
.perm-check {
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #f1f5f9;
}
.perm-check input { width: 16px; height: 16px; cursor: pointer; }
.perm-check input:disabled { cursor: not-allowed; opacity: .65; }

/* ---------- 菜单与表格视觉优化 ---------- */
.sidebar {
  width: 218px;
  flex-basis: 218px;
  background:
    radial-gradient(420px 240px at 18% 0%, rgba(56, 189, 248, .14), transparent 62%),
    linear-gradient(180deg, #102b48 0%, #081a2c 100%);
  box-shadow: 10px 0 28px rgba(4, 15, 28, .16);
}

.brand { padding: 20px 18px 16px; }
.brand .logo { letter-spacing: .3px; }
.brand-logo { width: 32px; height: 32px; border-radius: 9px; }
.brand .sub { color: #87a8c6; letter-spacing: .2px; }

.nav { padding: 14px 12px 18px; }

.nav-group { margin-bottom: 5px; }

.nav-group-head {
  padding: 9px 10px;
  border-radius: 8px;
  color: #8eaac5;
  font-size: 12.5px;
  letter-spacing: .3px;
  transition: .18s ease;
}
.nav-group-head span::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 9px;
  border-radius: 50%;
  vertical-align: 2px;
  background: #4b6d8a;
  box-shadow: 0 0 0 3px rgba(75, 109, 138, .12);
}
.nav-group.open .nav-group-head { color: #e7f2ff; }
.nav-group.open .nav-group-head span::before {
  background: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .14), 0 0 10px rgba(56, 189, 248, .45);
}
.nav-group-head:hover { background: rgba(56, 189, 248, .07); color: #dbeeff; }
.nav-group-head i {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .07);
  background: rgba(255, 255, 255, .045);
  color: #7896b3;
  font-size: 11px;
  line-height: 1;
}
.nav-group.open .nav-group-head i {
  color: #a9d8f7;
  border-color: rgba(56, 189, 248, .18);
  background: rgba(56, 189, 248, .1);
}

.nav-sub {
  margin-left: 6px;
  padding-left: 10px;
  border-left: 1px solid rgba(96, 165, 250, .16);
}
.nav-sub a {
  margin-bottom: 3px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #b9cee2;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}
.nav-sub a:hover {
  background: rgba(56, 189, 248, .085);
  border-color: rgba(96, 165, 250, .14);
  color: #eef8ff;
  transform: translateX(2px);
}
.nav-sub a.active {
  background: linear-gradient(90deg, #1f6feb 0%, #2f8bfa 100%);
  border-color: rgba(147, 197, 253, .32);
  color: #fff;
  font-weight: 600;
  transform: none;
  box-shadow: 0 6px 16px rgba(31, 111, 235, .3), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.nav-sub a.active:hover { transform: none; }

.side-foot {
  color: #6f8ca8;
  background: rgba(2, 12, 24, .2);
}

.topbar {
  border-bottom-color: #e5edf7;
  box-shadow: 0 1px 0 rgba(228, 236, 247, .7), 0 6px 18px rgba(15, 39, 67, .04);
}
.topbar h1 { color: #17324f; letter-spacing: .2px; }

.toolbar {
  padding: 10px 12px;
  border: 1px solid #e5edf7;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  box-shadow: 0 1px 3px rgba(15, 39, 67, .045);
}

.toolbar input[type="text"],
.toolbar select {
  border-color: #dde7f3;
  border-radius: 8px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.toolbar input[type="text"]:hover,
.toolbar select:hover { border-color: #c9d9ec; }

.btn {
  border-color: #dbe5f1;
  border-radius: 8px;
  background: #fff;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, color .15s ease;
}
.btn:hover { border-color: #bfd4ea; background: #f9fcff; }
.btn-primary {
  background: linear-gradient(135deg, #1f6feb 0%, #2f86ff 100%);
  border-color: #1f6feb;
  box-shadow: 0 3px 9px rgba(31, 111, 235, .22);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1b63d4 0%, #247beb 100%);
  box-shadow: 0 4px 12px rgba(31, 111, 235, .28);
}
.btn-danger { background: #fff7f6; }
.btn-danger:hover { background: #ffecea; }

.table-wrap {
  position: relative;
  border-radius: 11px 11px 0 0;
  background: #fff;
  scrollbar-width: thin;
  scrollbar-color: #c4d5e8 #f4f8fc;
}
.table-wrap::-webkit-scrollbar { width: 9px; height: 9px; }
.table-wrap::-webkit-scrollbar-track { background: #f4f8fc; }
.table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid #f4f8fc;
  border-radius: 999px;
  background: #c4d5e8;
}
.table-wrap::-webkit-scrollbar-thumb:hover { background: #a9c1dc; }

.table-wrap table thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: linear-gradient(180deg, #fbfdff 0%, #eef5ff 100%);
  color: #334155;
  font-weight: 700;
  border-bottom: 1px solid #d9e5f5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95);
}
.table-wrap.scrolled table thead th {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 7px 14px -10px rgba(15, 39, 67, .42);
}
.table-wrap table thead th.actions { z-index: 7; background: #eef5ff; }

.drawer-body table thead th,
.modal-body table thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: #f2f7fe;
  color: #334155;
  border-bottom: 1px solid #d9e5f5;
}

table.data tbody tr:nth-child(even) td { background: #fbfdff; }
table.data tbody tr:nth-child(even) td.actions { background: #fbfdff; }
table.data tbody tr:hover td,
table.data tbody tr:hover td.actions { background: #f1f7ff; }
table.data td { border-bottom-color: #f0f4fa; }
table.data tbody td:first-child { color: #17395c; font-weight: 500; }

table.mini th {
  background: #f4f8fd;
  color: #47617b;
  border-bottom: 1px solid #e4edf8;
}

.pager {
  border-top: 1px solid #eef3fa;
  background: #fff;
  border-radius: 0 0 12px 12px;
}
.pager button {
  border-color: #dbe5f1;
  border-radius: 7px;
  transition: .15s ease;
}
.pager button:hover:not(:disabled) {
  border-color: #b9d2ef;
  background: #f3f9ff;
  color: #1f6feb;
}


/* ---------- 官网内容管理 ---------- */
.site-admin-note {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #dbe7f6;
  background: #f7fbff;
  color: #4b6078;
  font-size: 12.5px;
  line-height: 1.7;
  border-radius: 9px;
}
.site-admin-card { margin-bottom: 14px; }
.site-admin-card .card-head { align-items: baseline; gap: 12px; flex-wrap: wrap; }
.site-admin-card .card-head h2 { margin: 0; }
.site-admin-body { padding: 14px 16px 18px; }
.site-admin-body .payout-grid { gap: 12px 16px; }
.site-admin-body .field label { font-size: 12px; color: #52657c; }
.site-admin-body .field input,
.site-admin-body .field textarea {
  width: 100%;
  border: 1px solid #d5e0ee;
  border-radius: 7px;
  background: #fff;
  color: #1c2e42;
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.6;
  font-family: inherit;
}
.site-admin-body .field textarea { resize: vertical; min-height: 60px; }
.site-admin-body .field input:focus,
.site-admin-body .field textarea:focus { outline: 2px solid #cfe4ff; border-color: #8ab8ef; }
.site-admin-body .field.full { grid-column: 1 / -1; }
.hintline { margin-top: 4px; color: #8a9bad; font-size: 11px; line-height: 1.5; }
.section-title {
  margin: 18px 0 8px;
  padding-top: 12px;
  border-top: 1px dashed #dce7f4;
  color: #2b4a6c;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
}
.site-array-row {
  padding: 12px 12px 10px;
  border: 1px solid #e4edf7;
  background: #fcfdff;
  border-radius: 8px;
  margin-bottom: 8px;
}
.site-array-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  color: #6f8298;
  font-size: 11px;
}
.site-array-head > span {
  min-width: 22px;
  padding: 2px 5px;
  border-radius: 4px;
  background: #eaf3ff;
  color: #2f6ea5;
  text-align: center;
  font-family: "Bahnschrift", "DIN Alternate", sans-serif;
  letter-spacing: .08em;
}
.site-image-line { display: flex; gap: 8px; align-items: center; }
.site-image-line input { flex: 1; min-width: 0; }
.site-image-line .site-upload-btn { white-space: nowrap; }
.site-admin-foot { display: flex; gap: 10px; padding: 4px 0 18px; }
@media (max-width: 760px) {
  .site-image-line { flex-wrap: wrap; }
  .site-image-line .site-upload-btn { width: 100%; justify-content: center; }
}

/* 所有表格表头统一居中，优先级高于 th 上的内联右对齐 */
table th {
  text-align: center !important;
}