:root {
  --ink: #0f1f1c;
  --g900: #072b25;
  --g800: #0b3b33;
  --g700: #0e4b41;
  --g600: #15644f;
  --g500: #1c7d63;
  --g100: #e7f1ed;
  --g50: #f2f8f5;
  --gold: #b9954f;
  --gold-soft: #f7f0df;
  --gold-line: #e6d5ae;
  --bg: #f4f5f2;
  --card: #ffffff;
  --line: #e5e7e1;
  --line-2: #eef0eb;
  --text: #15211e;
  --muted: #6d7a75;
  --muted-2: #94a09b;
  --red: #b3382f;
  --red-soft: #fbeceb;
  --amber: #a8730f;
  --amber-soft: #fbf3e1;
  --blue: #2b5f86;
  --blue-soft: #eaf1f6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 32, 28, 0.05), 0 8px 24px -18px rgba(16, 32, 28, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ login */

.login-screen {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  min-height: 100vh;
}

.login-art {
  position: relative;
  overflow: hidden;
  background: radial-gradient(120% 90% at 15% 10%, #10564a 0%, #072b25 55%, #041e19 100%);
  color: #eaf3ef;
  padding: 64px 72px;
  display: flex;
  align-items: center;
}

.art-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(80% 70% at 30% 40%, #000 20%, transparent 85%);
}

.art-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(192, 160, 98, 0.22);
}
.art-ring.r1 { width: 620px; height: 620px; right: -240px; top: -160px; }
.art-ring.r2 { width: 420px; height: 420px; right: -120px; top: -60px; border-color: rgba(192, 160, 98, 0.14); }

.art-inner { position: relative; z-index: 2; max-width: 560px; }

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 56px;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(150deg, #14705b, #0a3a31);
  display: inline-grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(192, 160, 98, 0.45);
  flex: none;
}
.logo-mark i {
  width: 12px;
  height: 12px;
  background: linear-gradient(140deg, #e3c98f, #b9954f);
  transform: rotate(45deg);
  display: block;
  border-radius: 2px;
}

.brand-name { font-size: 19px; font-weight: 600; letter-spacing: 0.06em; }
.brand-en {
  font-size: 10px;
  letter-spacing: 0.24em;
  color: rgba(192, 160, 98, 0.85);
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  padding-left: 12px;
  margin-left: 2px;
}

.login-art h1 {
  font-size: 38px;
  line-height: 1.32;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.art-sub {
  margin-top: 20px;
  color: rgba(226, 240, 234, 0.62);
  letter-spacing: 0.16em;
  font-size: 13px;
}

.art-foot {
  margin-top: 64px;
  font-size: 12px;
  color: rgba(226, 240, 234, 0.34);
  letter-spacing: 0.02em;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 48px;
  background: #fbfbf9;
}

.login-card { width: 100%; max-width: 360px; }
.login-card h2 { font-size: 24px; }
.login-card > .muted { margin: 8px 0 32px; font-size: 13px; }
#setup-box > .muted { margin: 8px 0 26px; font-size: 13px; line-height: 1.7; }
.login-box-head { margin-bottom: 24px; }
.login-box-head p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.auth-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.auth-tab {
  background: none;
  border: none;
  padding: 0 0 10px;
  font-size: 15px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active { color: var(--text); border-bottom-color: var(--g600); font-weight: 600; }

.field { display: block; margin-bottom: 18px; }
.field > span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 7px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--g500);
  box-shadow: 0 0 0 3px rgba(28, 125, 99, 0.12);
}
.field input[readonly] {
  border-color: #dce8e2;
  background: var(--g50);
  color: var(--g700);
  font-weight: 600;
  cursor: default;
}

.login-error { color: var(--red); font-size: 12px; min-height: 18px; margin-top: 10px; }
.demo-accounts { margin-top: 28px; border-top: 1px solid var(--line-2); padding-top: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--g500); color: var(--g700); background: var(--g50); }

/* ------------------------------------------------------------ shell */

.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }

.sidebar {
  background: linear-gradient(180deg, #0a352d 0%, #07251f 100%);
  color: #cfe0d9;
  display: flex;
  flex-direction: column;
  padding: 22px 0 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 20px 22px;
}
.side-name { font-size: 17px; font-weight: 600; color: #fff; letter-spacing: 0.05em; }
.side-name-line { display: flex; align-items: baseline; gap: 7px; }
.side-en {
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: rgba(220, 188, 119, 0.9);
  transform: translateY(-1px);
}
.side-brand-text { min-width: 0; }
.side-sub {
  font-size: 11px;
  line-height: 1.5;
  color: rgba(219, 234, 227, 0.66);
  letter-spacing: 0.035em;
  margin-top: 2px;
}

.nav { flex: 1; padding: 4px 10px; overflow-y: auto; }
.nav-group {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.5;
  color: rgba(231, 241, 236, 0.84);
  padding: 13px 9px 7px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 9px;
  color: rgba(231, 241, 236, 0.86);
  font-size: 13.5px;
  line-height: 1.35;
  cursor: pointer;
  position: relative;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 1px;
}
.nav-item svg { width: 16px; height: 16px; opacity: 0.9; flex: none; }
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.nav-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 600;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 7px;
  bottom: 7px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, #e3c98f, #b9954f);
}
.nav-badge {
  margin-left: auto;
  background: rgba(179, 56, 47, 0.85);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.side-foot { padding: 14px 14px 0; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.side-user { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; padding: 0 4px; }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(192, 160, 98, 0.18);
  color: #e3c98f;
  display: grid;
  place-items: center;
  font-size: 13px;
  flex: none;
}
.side-user-name { font-size: 13.5px; line-height: 1.45; color: #fff; }
.side-user-role { font-size: 11.5px; line-height: 1.45; color: rgba(219, 234, 227, 0.66); }
.side-foot .btn { font-size: 12.5px; padding: 8px 12px; }

/* ------------------------------------------------------------ main */

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

.topbar {
  height: 58px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.crumb { font-size: 16px; color: var(--muted); }
.crumb b { color: var(--text); font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.env-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(205, 215, 207, 0.9);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 246, 0.9));
  color: #50605a;
  box-shadow: 0 4px 12px -11px rgba(9, 40, 33, 0.5);
}
.env-status > i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2d9073;
  box-shadow: 0 0 0 3px rgba(45, 144, 115, 0.12);
}
.env-status > b { font-size: 12px; font-weight: 600; }
.env-status > small {
  padding-left: 6px;
  border-left: 1px solid rgba(92, 110, 102, 0.18);
  color: #93a09a;
  font-size: 10.5px;
  font-weight: 500;
}
.topbar-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 3px;
  color: #7b8983;
}
.topbar-date > svg { width: 14px; height: 14px; flex: none; opacity: 0.8; }
.topbar-divider {
  width: 1px;
  height: 18px;
  margin: 0 2px;
  background: rgba(199, 208, 201, 0.72);
}
.topbar-password {
  min-height: 32px;
  padding: 5px 10px;
  color: #61716b;
  background: rgba(255, 255, 255, 0.58);
}
.topbar-password > svg { width: 13px; height: 13px; flex: none; }
.topbar-password:hover { color: var(--g700); background: #fff; }
.env-tag {
  font-size: 10.5px;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.today { font-size: 12px; color: var(--muted-2); font-variant-numeric: tabular-nums; }

.view { padding: 26px 28px 60px; max-width: 1460px; width: 100%; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.page-head h1 { font-size: 22px; }
.page-head .desc { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.page-actions { display: flex; gap: 10px; flex: none; }

/* ------------------------------------------------------------ cards */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 0;
  gap: 12px;
}
.card-head h3 { font-size: 14px; font-weight: 600; }
.card-head .hint { font-size: 11.5px; color: var(--muted-2); }
.card-body { padding: 16px 18px 18px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi-grid.customer-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 15px;
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--g500);
  opacity: 0;
}
.kpi.accent::after { opacity: 1; }
.kpi.gold::after { background: var(--gold); opacity: 1; }
.kpi-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi-value {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
.kpi-value small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.kpi-foot { font-size: 11.5px; color: var(--muted-2); margin-top: 7px; display: flex; gap: 8px; align-items: center; }
.customer-credit-kpi {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1.05fr) minmax(220px, 0.8fr);
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
}
.customer-credit-kpi-summary { min-width: 0; }
.customer-credit-kpi-meta {
  display: grid;
  gap: 2px;
  margin-top: 9px;
}
.customer-credit-kpi-meta span { display: block; }
.customer-credit-kpi-meta .customer-credit-kpi-meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
}
.customer-credit-kpi-meta .customer-credit-kpi-meta-dot { color: var(--muted-2); }
.customer-credit-project-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding-left: 22px;
  border-left: 1px solid var(--line-2);
}
.customer-credit-reserved {
  align-self: stretch;
  min-height: 74px;
  padding-left: 20px;
  border-left: 1px solid var(--line-2);
}
.customer-credit-project-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid rgba(21, 100, 79, 0.07);
  border-radius: 9px;
  background: rgba(21, 100, 79, 0.045);
  cursor: pointer;
}
.customer-credit-project-row:hover { background: rgba(21, 100, 79, 0.09); }
.customer-credit-project-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.customer-credit-project-row b {
  color: var(--g700);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.customer-credit-project-empty {
  padding: 8px;
  border-radius: 8px;
  background: var(--g50);
  color: var(--muted-2);
  font-size: 11.5px;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--g500); display: inline-block; }
.dot.gold { background: var(--gold); }
.dot.red { background: var(--red); }

.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 14px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ------------------------------------------------------------ charts */

.chart-wrap { padding: 6px 4px 0; }
.chart-legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.bar-out { fill: #15644f; }
.bar-in { fill: #c0a062; }
.axis { font-size: 10px; fill: #94a09b; }
.grid-line { stroke: #eef0eb; stroke-width: 1; }

.bar-row { display: grid; grid-template-columns: 92px 1fr 92px; gap: 12px; align-items: center; margin-bottom: 14px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-name { font-size: 12.5px; color: var(--text); }
.bar-name span { display: block; font-size: 10.5px; color: var(--muted-2); }
.bar-track { height: 8px; background: #f0f2ee; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #15644f, #2a8a70); }
.bar-fill.warn { background: linear-gradient(90deg, #b98222, #d5a34a); }
.bar-fill.red { background: linear-gradient(90deg, #a83a30, #c55a4f); }
.bar-val { text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text); }
.bar-val span { display: block; font-size: 10.5px; color: var(--muted-2); }

.ring-wrap { display: flex; align-items: center; gap: 18px; }
.ring-text { font-size: 12px; color: var(--muted); }
.ring-text b { display: block; font-size: 22px; color: var(--text); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ table */

.table-wrap { overflow-x: auto; }
.table-wrap table { min-width: 820px; }
.table-wrap table.wtable { min-width: 1080px; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: #fbfcfa;
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbf9; }
tbody tr.clickable { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-main { font-weight: 500; }
.cell-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }
.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--muted-2);
  font-size: 13px;
}

/* ------------------------------------------------------------ pills */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f1f3ef;
  color: #5c6864;
  white-space: nowrap;
}
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.pill.green { background: var(--g100); color: var(--g600); }
.pill.gold { background: var(--gold-soft); color: #96742f; }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.gray { background: #f1f3ef; color: #6d7a75; }
.pill.plain::before { display: none; }
.termination-date-hint {
  margin-top: 4px;
  color: #9a6817;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.45;
  white-space: nowrap;
}

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn.primary {
  background: linear-gradient(180deg, #15644f, #0e4b41);
  color: #fff;
  box-shadow: 0 1px 2px rgba(11, 59, 51, 0.3);
}
.btn.primary:hover { background: linear-gradient(180deg, #18745a, #0f5347); }
.btn.gold { background: linear-gradient(180deg, #c0a062, #a9854a); color: #241c0c; font-weight: 500; }
.btn.ghost { border-color: var(--line); color: var(--muted); background: #fff; }
.btn.ghost:hover { border-color: #cfd4cc; color: var(--text); }
.btn.danger { background: var(--red-soft); color: var(--red); border-color: #f0d3d0; }
.btn.small { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.link { color: var(--g600); cursor: pointer; font-size: 12.5px; }
.link:hover { text-decoration: underline; }
.dict-name-link { padding: 0; border: 0; background: transparent; text-align: left; font: inherit; }

/* ------------------------------------------------------------ detail */

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.detail-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-title h1 { font-size: 21px; }
.detail-sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.back { font-size: 12.5px; color: var(--muted); cursor: pointer; display: inline-flex; gap: 4px; align-items: center; margin-bottom: 10px; }
.back:hover { color: var(--g600); }

.kv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 24px; }
.kv label { display: block; font-size: 11.5px; color: var(--muted-2); margin-bottom: 3px; }
.kv div { font-size: 13.5px; font-variant-numeric: tabular-nums; }

.timeline { padding-left: 4px; }
.tl-item { display: flex; gap: 12px; position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 18px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.tl-item:last-child::before { display: none; }
.tl-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  flex: none;
  margin-top: 3px;
  display: grid;
  place-items: center;
}
.tl-dot i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted-2); }
.tl-item.done .tl-dot { border-color: var(--g500); }
.tl-item.done .tl-dot i { background: var(--g500); }
.tl-item.now .tl-dot { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.tl-item.now .tl-dot i { background: var(--gold); }
.tl-item.error .tl-dot { border-color: var(--red); background: var(--red-soft); }
.tl-item.error .tl-dot i { background: var(--red); }
.tl-item.error .tl-body b { color: var(--red); }
.tl-body b { font-size: 12.5px; font-weight: 500; display: block; }
.tl-body span { font-size: 11.5px; color: var(--muted-2); }

.workflow-summary { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.workflow-summary span { color: var(--muted); font-size: 12px; }
.workflow-summary b { color: var(--g700); font-family: Georgia, serif; font-size: 20px; }

.archive-list { display: flex; flex-direction: column; gap: 8px; }
.archive-row {
  display: flex; align-items: center; gap: 10px; min-height: 54px;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.archive-row.missing { border-style: dashed; background: #fbfaf6; }
.archive-state {
  display: grid; width: 24px; height: 24px; place-items: center; flex: 0 0 24px;
  border-radius: 50%; color: var(--g700); background: var(--g50); font-size: 12px;
}
.archive-row.missing .archive-state { color: var(--gold); background: var(--gold-soft); }
.archive-main { flex: 1; min-width: 0; }
.archive-main b { display: block; font-size: 12.5px; font-weight: 500; }
.archive-main small {
  display: block; overflow: hidden; color: var(--muted-2); font-size: 11px;
  text-overflow: ellipsis; white-space: nowrap;
}

.readiness-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.readiness-check {
  display: flex; align-items: flex-start; gap: 9px; padding: 11px;
  border: 1px solid var(--line); border-radius: 10px; background: #fbfcfa;
}
.readiness-check > span {
  display: grid; width: 22px; height: 22px; place-items: center; flex: 0 0 22px;
  border-radius: 50%; color: #fff; background: var(--g600); font-size: 12px;
}
.readiness-check.fail > span { background: var(--red); }
.readiness-check b { display: block; font-size: 12px; font-weight: 500; }
.readiness-check small { display: block; margin-top: 2px; color: var(--muted-2); font-size: 10.5px; line-height: 1.5; }
.health-list { display: flex; flex-direction: column; gap: 9px; }
.health-issue { display: flex; align-items: flex-start; gap: 10px; }
.health-issue .pill { flex: 0 0 auto; }
.health-issue b { display: block; font-size: 12px; font-weight: 500; }
.health-issue p { margin: 3px 0; color: var(--muted); font-size: 11.5px; line-height: 1.55; }
.health-issue small { color: var(--muted-2); font-size: 10.5px; line-height: 1.5; }
.readiness-empty { padding: 12px; border-radius: 9px; color: var(--g700); background: var(--g50); font-size: 12px; }
.health-actions {
  display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line);
}
.health-actions span { color: var(--muted-2); font-size: 10.5px; }

.notice {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  background: var(--g50);
  border: 1px solid #dfece7;
  color: var(--g700);
}
.notice.warn { background: var(--amber-soft); border-color: #f0e1c1; color: #8a6412; }
.notice.danger { background: var(--red-soft); border-color: #f2d6d3; color: var(--red); }

/* ------------------------------------------------------------ modal */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(9, 24, 20, 0.42);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 24px;
  animation: fade 0.15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px -20px rgba(9, 24, 20, 0.45);
  animation: pop 0.18s ease;
}
@keyframes pop { from { transform: translateY(8px) scale(0.99); opacity: 0; } to { transform: none; opacity: 1; } }
.modal.wide { max-width: 720px; }
.modal-head { padding: 20px 22px 0; }
.modal-head h3 { font-size: 17px; }
.modal-head p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot {
  padding: 14px 22px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line-2);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-note { font-size: 11.5px; color: var(--muted-2); margin-top: -8px; margin-bottom: 14px; }
.check-list { border: 1px solid var(--line); border-radius: 10px; max-height: 190px; overflow-y: auto; }
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-2);
  font-size: 12.5px;
  cursor: pointer;
}
.check-row:last-child { border-bottom: none; }
.check-row:hover { background: #fafbf9; }
.check-row input { accent-color: var(--g600); }
.check-row .grow { flex: 1; }
.check-row .amt { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ toast */

.toast-root { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #0e2a24;
  color: #e9f3ef;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.5);
  animation: slidein 0.2s ease;
  max-width: 380px;
}
.toast.err { background: #4a1d19; color: #f8e4e2; }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------ misc */

.todo-list { display: flex; flex-direction: column; }
.todo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line-2);
  cursor: pointer;
}
.todo:last-child { border-bottom: none; }
.todo:hover .todo-title { color: var(--g600); }
.todo-ico {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--g50);
  color: var(--g600);
  display: grid;
  place-items: center;
  font-size: 12px;
  flex: none;
}
.todo-ico.gold { background: var(--gold-soft); color: #96742f; }
.todo-title { font-size: 12.5px; font-weight: 500; transition: color 0.15s; }
.todo-sub { font-size: 11px; color: var(--muted-2); }
.todo .go { margin-left: auto; font-size: 11.5px; color: var(--muted-2); }

.alert-item {
  display: flex;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line-2);
}
.alert-item:last-child { border-bottom: none; }
.alert-ico {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 11px;
  flex: none;
  font-weight: 600;
}
.alert-ico.lv-红色 { background: var(--red-soft); color: var(--red); }
.alert-ico.lv-黄色 { background: var(--amber-soft); color: var(--amber); }
.alert-title { font-size: 12.5px; font-weight: 500; }
.alert-detail { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.5; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab {
  padding: 9px 14px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--g700); border-bottom-color: var(--g600); font-weight: 500; }

.filters { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.filters input, .filters select {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12.5px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
.filters input { width: 220px; }
.filters input:focus, .filters select:focus { outline: none; border-color: var(--g500); }

.progress-line { height: 5px; background: #eff1ec; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.progress-line i { display: block; height: 100%; background: var(--g500); border-radius: 999px; }
.progress-line i.warn { background: #c08b2a; }
.progress-line i.red { background: var(--red); }

.money-in { color: var(--g600); font-variant-numeric: tabular-nums; }
.money-out { color: var(--red); font-variant-numeric: tabular-nums; }
.tag {
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 5px;
  background: #f3f5f1;
  color: var(--muted);
  white-space: nowrap;
}

.split { display: grid; grid-template-columns: 1fr 340px; gap: 14px; align-items: start; }
.divider { height: 1px; background: var(--line-2); margin: 16px 0; }

/* ------------------------------------------------------- customer portal */

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none !important;
}

.customer-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 30px;
  min-height: 244px;
  padding: 32px 36px;
  margin-bottom: 16px;
  border-radius: 18px;
  background:
    radial-gradient(80% 130% at 100% 0%, rgba(192, 160, 98, 0.23), transparent 55%),
    radial-gradient(100% 130% at 0% 100%, #104d40 0%, #072d26 62%, #06241e 100%);
  color: #f4f8f5;
  box-shadow: 0 18px 38px -32px rgba(7, 43, 37, 0.85);
}

.hero-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.43;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(90deg, #000, transparent 78%);
}

.hero-copy,
.hero-side { position: relative; z-index: 1; }
.hero-copy { align-self: center; max-width: 650px; }
.hero-eyebrow {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  color: rgba(225, 199, 143, 0.78);
  margin-bottom: 12px;
}
.hero-copy h1 { font-size: 29px; line-height: 1.25; letter-spacing: 0.01em; }
.hero-copy > p {
  max-width: 590px;
  margin-top: 10px;
  color: rgba(231, 242, 237, 0.64);
  font-size: 13px;
  line-height: 1.75;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 25px; }
.hero-actions .btn {
  min-height: 36px;
  border-radius: 9px;
  font-size: 12.5px;
}
.hero-primary {
  color: #173026;
  background: linear-gradient(135deg, #e2cc97, #bea05f);
  border: 1px solid rgba(226, 204, 151, 0.8);
  box-shadow: 0 7px 18px -10px rgba(0, 0, 0, 0.45);
}
.hero-secondary {
  color: rgba(244, 248, 245, 0.88);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.hero-secondary:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.22); }

.hero-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding-left: 28px;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
}
.hero-orbit { display: flex; align-items: center; gap: 16px; }
.hero-orbit svg { width: 88px; height: 88px; flex: none; }
.hero-orbit svg circle:first-child { stroke: rgba(255, 255, 255, 0.1); }
.hero-orbit svg circle:last-child { stroke: #d9bf83; }
.hero-orbit b { display: block; font-size: 25px; font-weight: 500; font-variant-numeric: tabular-nums; }
.hero-orbit span { display: block; margin-top: 3px; font-size: 10.5px; color: rgba(231, 242, 237, 0.48); }
.hero-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 17px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}
.hero-meta span { color: rgba(231, 242, 237, 0.5); font-size: 11.5px; }
.hero-meta span i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d9bf83;
  margin-right: 7px;
}
.hero-meta b { font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; }

.customer-alert {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 16px;
  padding: 13px 16px;
  border: 1px solid #f0cfcb;
  border-radius: 12px;
  background: linear-gradient(90deg, #fbebe9, #fdf7f6);
  color: #7e2d27;
  cursor: pointer;
}
.customer-alert .alert-symbol {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 8px;
  background: #b3382f;
  color: #fff;
  font-weight: 700;
}
.customer-alert div { flex: 1; }
.customer-alert b { font-size: 12.5px; }
.customer-alert p { color: #9a5e58; font-size: 11px; margin-top: 2px; }
.customer-alert > span:last-child { font-size: 11.5px; font-weight: 500; }

.customer-due-alert {
  position: relative;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 17px;
  overflow: hidden;
  margin-bottom: 18px;
  padding: 17px 19px 17px 21px;
  border: 2px solid #dfa36d;
  border-radius: 14px;
  background: linear-gradient(100deg, #ffebd4, #fff7e9 62%, #fffdf8);
  color: #653617;
  cursor: pointer;
  box-shadow: 0 12px 25px -18px rgba(158, 91, 27, 0.78);
  transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s;
}
.customer-due-alert::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #b95d22;
}
.customer-due-alert:hover {
  border-color: #cd7d3c;
  box-shadow: 0 15px 30px -19px rgba(158, 91, 27, 0.9);
  transform: translateY(-1px);
}
.customer-due-alert > div:nth-child(2) { min-width: 0; }
.due-alert-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.due-alert-title > b { color: #8c3f0f; font-size: 16px; line-height: 1.4; }
.due-alert-kicker {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #b95d22;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.02em;
}
.customer-due-alert p { margin-top: 5px; color: #785139; font-size: 13px; line-height: 1.65; }
.customer-due-alert > span:last-child,
.customer-due-alert > button:last-child { color: #9a450f; white-space: nowrap; font-size: 13px; font-weight: 600; }
.customer-due-alert .btn.primary {
  border-color: #a9511b;
  background: #b95d22;
  color: #fff;
}
.due-calendar {
  width: 58px;
  height: 58px;
  display: grid;
  place-content: center;
  flex: none;
  border-radius: 14px;
  background: #b95d22;
  color: #fff;
  text-align: center;
  box-shadow: 0 7px 15px -8px rgba(127, 57, 17, 0.6);
}
.due-calendar b { display: block; font-size: 23px; line-height: 1; font-variant-numeric: tabular-nums; }
.due-calendar span { display: block; margin-top: 3px; font-size: 10px; opacity: 0.88; }
.contract-due-alert { margin-top: -4px; }

.customer-dashboard-grid { grid-template-columns: 1.25fr 1fr; }
.customer-dashboard-grid.single-column { grid-template-columns: 1fr; }
.customer-tasks { padding: 8px 18px 10px; }
.customer-task {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
}
.customer-task:last-child { border-bottom: 0; }
.task-mark {
  width: 7px;
  height: 29px;
  flex: none;
  border-radius: 999px;
  background: var(--g500);
}
.customer-task.warn .task-mark { background: var(--gold); }
.customer-task.danger .task-mark { background: var(--red); }
.task-main { flex: 1; min-width: 0; }
.task-main b { display: block; font-size: 12.5px; font-weight: 600; }
.task-main span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10.7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-go { color: var(--g600); font-size: 10.8px; white-space: nowrap; }
.customer-empty { text-align: center; padding: 39px 18px 42px; color: var(--muted); }
.customer-empty .empty-check {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--g50);
  color: var(--g600);
  font-size: 17px;
}
.customer-empty b { font-size: 12.5px; color: var(--text); }
.customer-empty p { font-size: 10.8px; margin-top: 4px; }

.credit-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line-2);
}
.credit-summary div { padding: 3px 0; }
.credit-summary span { display: block; font-size: 10.5px; color: var(--muted-2); }
.credit-summary b { display: block; margin-top: 3px; font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.credit-list { margin-top: 14px; }
.credit-row { margin-bottom: 15px; }
.credit-row:last-child { margin-bottom: 0; }
.credit-row-head,
.credit-row-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.credit-row-head { margin-bottom: 7px; }
.credit-row-head span { font-size: 11.5px; }
.credit-row-head b { font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.credit-row-head b small { font-weight: 400; color: var(--muted-2); }
.credit-row .bar-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #15644f, #2a8a70);
}
.credit-row .bar-track i.warn { background: linear-gradient(90deg, #b98222, #d5a34a); }
.credit-row .bar-track i.red { background: linear-gradient(90deg, #a83a30, #c55a4f); }
.credit-row-foot { margin-top: 5px; color: var(--muted-2); font-size: 9.8px; }
.customer-footnote {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 2px;
  color: var(--muted-2);
  font-size: 10.5px;
}
.customer-footnote button { margin-left: auto; }

/* customer contracts */

.contract-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-2);
}
.contract-tabs { display: flex; gap: 3px; }
.contract-tab {
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 7px 11px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11.5px;
}
.contract-tab span {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 5px;
  padding: 0 4px;
  border-radius: 99px;
  background: #f0f2ee;
  font-size: 9.5px;
}
.contract-tab.active { background: var(--g50); color: var(--g700); font-weight: 600; }
.contract-tab.active span { background: var(--g100); }
.contract-search {
  display: flex;
  align-items: center;
  gap: 7px;
  width: min(310px, 100%);
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--muted-2);
}
.contract-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 11.5px;
}
.contract-name-line { display: flex; align-items: flex-start; gap: 9px; min-width: 210px; }
.type-badge {
  display: inline-block;
  flex: none;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 9px;
  line-height: 1.6;
  white-space: nowrap;
}
.type-badge.loan { color: var(--g700); background: var(--g100); }
.type-badge.prepay { color: #82601f; background: var(--gold-soft); }
.type-badge.upstream { color: var(--blue); background: var(--blue-soft); }
.type-badge.downstream { color: var(--g700); background: var(--g100); }
.type-badge.funder { color: #82601f; background: var(--gold-soft); }
.subject-note { max-width: 260px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.subject-doc-button { gap: 8px; padding: 6px 9px 6px 11px; }
.subject-doc-button b {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--g100);
  color: var(--g700);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.subject-doc-button:hover b { background: #d8e9e1; }
.subject-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 15px;
}
.subject-action-card {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  flex-direction: column;
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(150deg, #fff, #f8faf7);
  box-shadow: var(--shadow);
}
.subject-action-card > div > span { color: var(--muted); font-size: 12.5px; }
.subject-action-card > div > b {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 28px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.subject-action-card small { margin-left: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }
.subject-action-card p { margin-top: 3px; color: var(--muted-2); font-size: 11.5px; }
.subject-action-card > .btn { align-self: flex-start; margin-top: 11px; }
.subject-action-card.upstream { border-top: 3px solid var(--blue); }
.subject-action-card.downstream { border-top: 3px solid var(--g500); }
.subject-action-card.funder { border-top: 3px solid var(--gold); }
.subject-action-card.warehouse { border-top: 3px solid #77847e; }
.customer-subject-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.customer-subject-profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(150deg, #fff, #f8faf7);
  box-shadow: var(--shadow);
}
.customer-subject-profile-card > div:first-child { min-width: 0; }
.customer-subject-profile-card > div:first-child > span { color: var(--muted); font-size: 12px; }
.customer-subject-profile-card > div:first-child > b {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
}
.customer-subject-profile-card p {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 11.5px;
}
.customer-subject-profile-actions {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
}
.customer-subject-profile-card.upstream { border-top: 3px solid var(--blue); }
.customer-subject-profile-card.downstream { border-top: 3px solid var(--g500); }
.customer-subject-profile-card.funder { border-top: 3px solid var(--gold); }
@media (max-width: 1180px) {
  .customer-subject-profile-grid { grid-template-columns: 1fr; }
}
.subject-ending-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
  padding: 11px 14px;
  border: 1px solid #eed6aa;
  border-radius: 10px;
  background: var(--amber-soft);
  color: #73521a;
}
.subject-ending-alert > span {
  padding: 2px 7px;
  border-radius: 999px;
  background: #b17a1c;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.subject-ending-alert > b { flex: 1; font-size: 12.5px; font-weight: 500; }
.subject-ending-alert .link { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.project-subject-board { margin-bottom: 14px; }
.project-subject-board .card-head { align-items: center; }
.project-subject-board .card-head > div { min-width: 0; }
.project-subject-board .card-head .hint { display: block; margin-top: 3px; }
.project-subject-board .contract-search { flex: none; }
.project-subject-table { min-width: 900px; }
.project-subject-table td { vertical-align: top; }
.project-subject-name {
  max-width: 240px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
}
.project-subject-name.empty { color: var(--muted-2); font-weight: 400; }
.project-subject-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 5px;
}
.project-subject-meta .pill { padding: 2px 7px; font-size: 10.5px; }
.project-subject-meta .link { font-size: 11.5px; }
.subject-unfiled { color: var(--muted-2); font-size: 11.5px; }
.subject-ending-text { color: var(--amber); }
.subject-page-title { color: var(--text); font-size: 14px; font-weight: 600; }
.subject-project-count { color: var(--g700); font-size: 15px; font-variant-numeric: tabular-nums; }
.warehouse-directory { margin-bottom: 14px; }
.warehouse-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  padding: 0 16px 16px;
}
.warehouse-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(150deg, #fff, #f9fbf8);
}
.warehouse-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-2);
}
.warehouse-card-head > div { min-width: 0; }
.warehouse-card-head > div > span {
  display: block;
  color: var(--muted-2);
  font-size: 11px;
}
.warehouse-card-head > div > b {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.warehouse-card-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 12px;
  padding: 11px 0;
}
.warehouse-card-info > div { min-width: 0; }
.warehouse-card-info > div:first-child { grid-column: 1 / -1; }
.warehouse-card-info span { display: block; color: var(--muted-2); font-size: 10.5px; }
.warehouse-card-info b {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}
.warehouse-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 9px;
  border-top: 1px solid var(--line-2);
}
.warehouse-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 130px;
  padding: 22px;
  border: 1px dashed #d8dfd7;
  border-radius: 11px;
  background: #fbfcfa;
  color: var(--muted);
  text-align: center;
}
.warehouse-empty b { color: var(--text); font-size: 14px; }
.warehouse-empty span { margin-bottom: 5px; font-size: 12px; }
.subject-doc-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.subject-doc-summary > div {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(150deg, #fbfcfa, #f5f8f4);
}
.subject-doc-summary span { display: block; color: var(--muted); font-size: 12px; }
.subject-doc-summary b {
  display: block;
  margin-top: 3px;
  color: var(--g800);
  font-size: 23px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.subject-doc-summary small { margin-left: 3px; color: var(--muted); font-size: 12px; font-weight: 400; }
.subject-doc-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 11px 13px;
  border-left: 3px solid var(--gold);
  border-radius: 0 9px 9px 0;
  background: var(--gold-soft);
}
.subject-doc-note > span { color: #725820; font-size: 13.5px; font-weight: 600; }
.subject-doc-note p { color: #806d43; font-size: 12px; line-height: 1.55; }
.subject-doc-section + .subject-doc-section { margin-top: 18px; }
.subject-doc-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.subject-doc-section-head b { font-size: 14px; color: var(--text); }
.subject-doc-section-head span { color: var(--muted); font-size: 12px; }
.subject-doc-list { display: grid; gap: 8px; }
.subject-doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #fff;
}
.subject-doc-item:hover { border-color: #d7ddd6; background: #fbfcfa; }
.subject-doc-file { display: flex; align-items: flex-start; gap: 11px; min-width: 0; }
.subject-doc-icon {
  width: 34px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 8px;
  background: var(--g100);
  color: var(--g700);
  font-size: 13px;
  font-weight: 600;
}
.subject-doc-type {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}
.subject-doc-scope {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
}
.subject-doc-scope.subject { background: var(--g100); color: var(--g700); }
.subject-doc-scope.project { background: var(--blue-soft); color: var(--blue); }
.subject-doc-name {
  margin-top: 3px;
  overflow: hidden;
  color: var(--text);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.subject-doc-meta {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.subject-doc-empty {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 160px;
  border: 1px dashed #d9dfd7;
  border-radius: 12px;
  background: #fbfcfa;
  color: var(--muted);
  text-align: center;
}
.subject-doc-empty b { color: var(--text); font-size: 14px; }
.subject-doc-empty span { font-size: 12.5px; }

@media (max-width: 760px) {
  .subject-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subject-action-card { min-height: 122px; padding: 14px; }
  .subject-ending-alert { align-items: flex-start; flex-wrap: wrap; }
  .subject-ending-alert > b { flex-basis: calc(100% - 90px); }
  .project-subject-board .card-head { align-items: stretch; flex-direction: column; }
  .project-subject-board .contract-search { width: 100%; }
  .warehouse-grid { grid-template-columns: 1fr; padding: 0 13px 13px; }
  .subject-doc-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subject-doc-note { align-items: flex-start; flex-direction: column; gap: 3px; }
  .subject-doc-item { align-items: flex-start; flex-direction: column; }
  .subject-doc-item .btn { align-self: flex-end; }
  .subject-doc-name, .subject-doc-meta { white-space: normal; }
}

@media (max-width: 520px) {
  .subject-action-grid { grid-template-columns: 1fr; }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .warehouse-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.contract-table td { vertical-align: middle; }
.contract-table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 17px;
  border-top: 1px solid var(--line-2);
  color: var(--muted-2);
  font-size: 10px;
}

.contract-sheet { padding: 2px 2px 0; }
.contract-sheet-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(135deg, #f9faf7, #fff);
}
.contract-seal {
  width: 54px;
  height: 54px;
  display: grid;
  place-content: center;
  text-align: center;
  border: 1px solid rgba(179, 149, 79, 0.5);
  border-radius: 50%;
  color: #8c6d2f;
  font-size: 11px;
  line-height: 1.35;
}
.contract-seal span { font-size: 7px; letter-spacing: 0.08em; }
.contract-sheet-head > div:nth-child(2) > span { font-size: 8px; letter-spacing: 0.16em; color: var(--muted-2); }
.contract-sheet-head h2 { margin-top: 3px; font-size: 16px; }
.contract-sheet-head p { margin-top: 3px; color: var(--muted); font-size: 10.5px; }
.contract-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 0;
}
.contract-parties > div { padding: 13px 15px; border-radius: 10px; background: #f7f9f5; }
.contract-parties label { display: block; color: var(--muted-2); font-size: 9px; }
.contract-parties b { display: block; margin-top: 4px; font-size: 12px; }
.contract-parties span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.contract-terms {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 13px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  overflow: hidden;
}
.contract-terms div { padding: 11px 13px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.contract-terms div:nth-child(4n) { border-right: 0; }
.contract-terms span { display: block; color: var(--muted-2); font-size: 9px; }
.contract-terms b { display: block; margin-top: 3px; font-size: 11.5px; font-weight: 500; }
.contract-clause,
.contract-docs { margin-top: 14px; }
.contract-clause h4,
.contract-docs h4 { font-size: 11.5px; margin-bottom: 7px; }
.contract-clause p { color: var(--muted); font-size: 10.5px; line-height: 1.8; }
.doc-line {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  margin-bottom: 6px;
}
.doc-line:hover { border-color: #cddbd5; background: var(--g50); }
.doc-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: none;
  border-radius: 7px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 8px;
  font-weight: 700;
}
.doc-line > span:nth-child(2) { flex: 1; }
.doc-line b { display: block; font-size: 10.5px; font-weight: 500; }
.doc-line small { display: block; color: var(--muted-2); font-size: 9.5px; }
.doc-line > span:last-child { color: var(--g600); font-size: 10px; }
.contract-sheet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding-top: 11px;
  border-top: 1px dashed var(--line);
  color: var(--muted-2);
  font-size: 9px;
}

/* customer applications */

.application-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.apply-card {
  position: relative;
  overflow: hidden;
  padding: 20px 21px 18px;
  border: 1px solid #dfe8e3;
  border-radius: 15px;
  background:
    radial-gradient(95% 150% at 100% 0%, rgba(21, 100, 79, 0.09), transparent 52%),
    #fff;
  box-shadow: var(--shadow);
}
.apply-card.gold {
  border-color: #eadfc9;
  background:
    radial-gradient(95% 150% at 100% 0%, rgba(192, 160, 98, 0.16), transparent 52%),
    #fff;
}
.apply-card.disabled { background: #fbfcfa; box-shadow: none; }
.apply-card-top { display: flex; align-items: center; gap: 12px; }
.apply-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
}
.apply-icon.spot { color: #fff; background: linear-gradient(145deg, #1d8269, #0b4b3e); }
.apply-icon.prepay { color: #674c18; background: linear-gradient(145deg, #f0dfb8, #ceb171); }
.apply-card-top > div { flex: 1; }
.apply-kicker { display: block; color: var(--muted-2); font-size: 8px; letter-spacing: 0.14em; }
.apply-card h3 { margin-top: 2px; font-size: 16px; }
.apply-card > p { min-height: 42px; margin: 15px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.apply-points { display: flex; flex-wrap: wrap; gap: 6px; }
.apply-points span {
  padding: 3px 7px;
  border-radius: 5px;
  background: #f5f7f3;
  color: var(--muted);
  font-size: 9.5px;
}
.apply-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
}
.apply-card-foot span { display: block; color: var(--muted-2); font-size: 9.5px; }
.apply-card-foot b { display: block; margin-top: 2px; font-size: 14px; font-weight: 500; }

/* customer settings */

.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 14px; align-items: start; }
.settings-card { overflow: hidden; }
.settings-card.compact { padding-bottom: 6px; }
.profile-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 21px 22px;
  background:
    radial-gradient(80% 130% at 100% 0%, rgba(192, 160, 98, 0.15), transparent 55%),
    linear-gradient(120deg, #f3f8f5, #fff);
}
.profile-avatar {
  width: 49px;
  height: 49px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 14px;
  background: linear-gradient(145deg, #0f5a4a, #0a372f);
  color: #ead6a8;
  font-size: 17px;
  box-shadow: inset 0 0 0 1px rgba(192, 160, 98, 0.28);
}
.profile-copy { flex: 1; min-width: 0; }
.profile-copy > span { color: var(--muted-2); font-size: 9px; letter-spacing: 0.07em; }
.profile-copy h2 { margin-top: 1px; font-size: 17px; }
.profile-copy p { margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.account-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 99px;
  background: #eaf5ef;
  color: var(--g700);
  font-size: 9.5px;
  white-space: nowrap;
}
.account-state i { width: 5px; height: 5px; border-radius: 50%; background: var(--g500); }
.profile-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 0 22px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  overflow: hidden;
  background: var(--line-2);
}
.profile-info-grid div { padding: 11px 13px; background: #fff; }
.profile-info-grid span { display: block; color: var(--muted-2); font-size: 9.5px; }
.profile-info-grid b { display: block; margin-top: 3px; font-size: 11px; font-weight: 500; }
.settings-actions { display: flex; gap: 8px; padding: 16px 22px 18px; }
.settings-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 13px;
}
.settings-card-head h3 { font-size: 13px; }
.settings-card-head p { margin-top: 3px; color: var(--muted-2); font-size: 9.8px; }
.preference-list { border-top: 1px solid var(--line-2); }
.preference-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
}
.preference-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 8px;
  background: var(--g100);
  color: var(--g700);
  font-size: 10px;
}
.preference-icon.gold { background: var(--gold-soft); color: #88651f; }
.preference-icon.blue { background: var(--blue-soft); color: var(--blue); }
.preference-copy { flex: 1; }
.preference-copy b { display: block; font-size: 11px; font-weight: 500; }
.preference-copy small { display: block; margin-top: 2px; color: var(--muted-2); font-size: 9.3px; }
.preference-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch {
  position: relative;
  width: 34px;
  height: 19px;
  flex: none;
  border-radius: 99px;
  background: #dfe4df;
  transition: background 0.18s;
}
.switch::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.18s;
}
.preference-row input:checked + .switch { background: var(--g500); }
.preference-row input:checked + .switch::after { transform: translateX(15px); }
.settings-save { display: flex; justify-content: flex-end; padding: 13px 20px 15px; }

.service-tag {
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--gold-soft);
  color: #8d6b27;
  font-size: 9px;
}
.service-progress { margin: 0 20px 13px; padding: 12px; border-radius: 9px; background: #f7f9f5; }
.service-progress-head { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; }
.service-progress-head b { font-weight: 500; font-variant-numeric: tabular-nums; }
.service-progress p { margin-top: 7px; color: var(--muted-2); font-size: 9.2px; }
.service-links { padding-bottom: 6px; }
.service-links button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border: 0;
  border-top: 1px solid var(--line-2);
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.service-links button:hover { background: #fafbf8; }
.service-links button span { flex: 1; }
.service-links b { display: block; font-size: 10.5px; font-weight: 500; }
.service-links small { display: block; margin-top: 2px; color: var(--muted-2); font-size: 9.2px; }
.service-links em { color: var(--muted-2); font-size: 12px; font-style: normal; }
.permission-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 20px;
  padding: 10px 0;
  border-top: 1px solid var(--line-2);
  font-size: 10.5px;
}
.permission-on { color: var(--g600); font-size: 9.5px; font-weight: 500; }
.permission-off { color: var(--muted-2); font-size: 9.5px; font-weight: 500; }
.platform-info { padding: 0 20px; }
.platform-info div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-2); font-size: 10px; }
.platform-info span { color: var(--muted-2); }
.platform-info b { font-weight: 500; text-align: right; }
.platform-note { margin: 11px 20px 15px; padding: 9px 10px; border-radius: 8px; background: #f8f9f6; color: var(--muted-2); font-size: 9.2px; line-height: 1.65; }

/* --------------------------------------------------- contract templates */

.contract-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.contract-funder-list {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}
.contract-funder-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 1px 2px rgba(13, 37, 31, 0.035), 0 14px 34px -28px rgba(13, 37, 31, 0.48);
}
.contract-funder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}
.contract-funder-head h3 { font-size: 15px; }
.contract-funder-head p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.contract-funder-head .pill { flex: none; }
.contract-generic-panel {
  margin-top: 20px;
  padding: 18px;
  border: 1px dashed #cdd8d1;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}
.contract-generic-panel > .card-head { padding: 0 0 14px; }
.contract-template-card { padding: 20px; }
.contract-template-head {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line-2);
}
.contract-template-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 12px;
  background: var(--g50);
  color: var(--g700);
  font-size: 17px;
  font-weight: 700;
}
.contract-template-title { flex: 1; min-width: 0; }
.contract-template-title h3 { font-size: 15px; }
.contract-template-title p { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.contract-template-head > .pill { flex: none; }
.contract-template-file {
  display: grid;
  gap: 3px;
  margin-top: 15px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfa;
}
.contract-template-file.empty { border-style: dashed; background: #fcfdfc; }
.contract-template-file b { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.contract-template-file span { color: var(--muted-2); font-size: 11.5px; }
.contract-template-map {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
  color: var(--muted-2);
  font-size: 12px;
}
.contract-template-map b { color: var(--muted); font-weight: 500; text-align: right; }
.contract-template-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 17px;
}

@media (max-width: 900px) {
  .contract-template-grid { grid-template-columns: 1fr; }
  .contract-funder-head { flex-direction: column; }
}

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid.customer-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .customer-credit-kpi { grid-template-columns: 1fr; gap: 14px; }
  .customer-credit-reserved { display: none; }
  .customer-credit-project-list {
    grid-template-columns: minmax(0, 1fr);
    padding: 13px 0 0;
    border-top: 1px solid var(--line-2);
    border-left: 0;
  }
  .grid-2 { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .customer-hero { grid-template-columns: minmax(0, 1fr) 270px; padding: 28px 30px; }
  .settings-grid { grid-template-columns: 1fr; }
  .contract-terms { grid-template-columns: repeat(3, 1fr); }
  .contract-terms div:nth-child(4n) { border-right: 1px solid var(--line-2); }
  .contract-terms div:nth-child(3n) { border-right: 0; }
}

@media (max-width: 900px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-content: start; }
  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 8px 10px;
    overflow-x: auto;
    z-index: 30;
    scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .side-brand, .side-foot { display: none; }
  .nav { display: flex; gap: 4px; padding: 0; overflow: visible; }
  .nav-group { display: none; }
  .nav-item { white-space: nowrap; margin-bottom: 0; }
  .nav-item span { font-size: 12px; }
  .nav-item.active::before { display: none; }
  .topbar { top: 54px; padding: 0 16px; }
  .env-status, .topbar-date, .topbar-divider { display: none; }
  .view { padding: 18px 16px 48px; }
  .detail-head { flex-direction: column; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .kv-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .customer-hero { grid-template-columns: 1fr; min-height: 0; padding: 26px 22px; }
  .hero-copy h1 { font-size: 24px; }
  .hero-side {
    display: grid;
    grid-template-columns: auto 1fr;
    padding: 20px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    border-left: 0;
  }
  .hero-meta { flex-direction: column; align-items: flex-start; justify-content: center; padding-top: 0; border-top: 0; }
  .hero-orbit svg { width: 72px; height: 72px; }
  .customer-hero .kpi-grid { grid-template-columns: 1fr 1fr; }
  .application-grid { grid-template-columns: 1fr; }
  .contract-toolbar { align-items: stretch; flex-direction: column; }
  .contract-search { width: 100%; }
  .contract-tabs { overflow-x: auto; }
  .contract-tab { white-space: nowrap; }
  .contract-table-foot { align-items: flex-start; flex-direction: column; gap: 4px; }
  .contract-table { min-width: 0 !important; }
  .contract-table thead { display: none; }
  .contract-table tbody { display: block; padding: 4px 13px 9px; }
  .contract-table tbody tr.contract-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 11px 16px;
    padding: 14px 1px;
    border-bottom: 1px solid var(--line-2);
  }
  .contract-table tbody tr.contract-row:hover { background: transparent; }
  .contract-table tbody tr.contract-row td {
    display: block;
    padding: 0;
    border: 0;
    font-size: 11px;
  }
  .contract-table tbody tr.contract-row td:nth-child(1),
  .contract-table tbody tr.contract-row td:nth-child(2),
  .contract-table tbody tr.contract-row td:nth-child(7) { grid-column: 1 / -1; }
  .contract-table tbody tr.contract-row td:nth-child(3)::before,
  .contract-table tbody tr.contract-row td:nth-child(4)::before,
  .contract-table tbody tr.contract-row td:nth-child(5)::before,
  .contract-table tbody tr.contract-row td:nth-child(6)::before {
    display: block;
    margin-bottom: 3px;
    color: var(--muted-2);
    font-size: 8.5px;
  }
  .contract-table tbody tr.contract-row td:nth-child(3)::before { content: "合同金额"; }
  .contract-table tbody tr.contract-row td:nth-child(4)::before { content: "合同日期"; }
  .contract-table tbody tr.contract-row td:nth-child(5)::before { content: "到期日"; }
  .contract-table tbody tr.contract-row td:nth-child(6)::before { content: "合同状态"; }
  .contract-table tbody tr.contract-row .row-actions { justify-content: flex-start; padding-top: 3px; }
  .contract-table tbody tr.contract-row .contract-name-line { min-width: 0; }
  .contract-sheet-head { grid-template-columns: auto 1fr; }
  .contract-sheet-head > .pill { grid-column: 1 / -1; justify-self: start; }
  .contract-parties { grid-template-columns: 1fr; }
  .contract-terms { grid-template-columns: 1fr 1fr; }
  .contract-terms div:nth-child(3n) { border-right: 1px solid var(--line-2); }
  .contract-terms div:nth-child(2n) { border-right: 0; }
  .profile-banner { align-items: flex-start; flex-wrap: wrap; }
  .account-state { margin-left: 63px; }
  .customer-footnote { flex-wrap: wrap; }
  .customer-footnote button { margin-left: 0; }
  .customer-due-alert { grid-template-columns: 54px minmax(0, 1fr); align-items: start; padding: 15px 15px 15px 18px; }
  .due-calendar { width: 52px; height: 52px; }
  .due-calendar b { font-size: 21px; }
  .customer-due-alert > span:last-child,
  .customer-due-alert > button:last-child { grid-column: 2; justify-self: start; }
  .due-calendar { width: 46px; height: 46px; }
}

/* ------------------------------------------------------ readability */

body { font-size: 15px; line-height: 1.62; }
.small { font-size: 13px; line-height: 1.65; }
.art-sub { font-size: 14px; line-height: 1.7; }
.art-foot { font-size: 13px; }
.field > span { font-size: 13px; }
.field input,
.field select,
.field textarea { font-size: 15px; }
.login-error { font-size: 13px; }
.chip { font-size: 13px; }

.side-en { font-size: 10px; }
.side-sub { font-size: 12px; line-height: 1.55; }
.nav-group {
  position: relative;
  padding-left: 24px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(218, 198, 144, 0.16);
  font-size: 17px;
  font-weight: 700;
  color: #ddc78f;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.42);
}
.nav-group::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(238, 219, 167, 0.72);
  background: #c7aa63;
  transform: translateY(-58%) rotate(45deg);
  box-shadow: 0 0 8px rgba(199, 170, 99, 0.2);
}
.side-user-name { font-size: 14px; }
.side-user-role { font-size: 12px; color: rgba(225, 238, 232, 0.72); }
.side-foot .btn { font-size: 13px; }

.crumb { font-size: 16px; }
.env-tag { font-size: 11.5px; }
.today { font-size: 13px; }
.page-head h1 { font-size: 24px; }
.page-head .desc { font-size: 14px; line-height: 1.65; }
.card-head h3 { font-size: 15px; }
.card-head .hint { font-size: 12.5px; }
.kpi-label { font-size: 13px; }
.kpi-value small { font-size: 14px; }
.kpi-foot { font-size: 12.5px; line-height: 1.55; }
.chart-legend { font-size: 12.5px; }
.axis { font-size: 11px; }
.bar-name { font-size: 13.5px; }
.bar-name span,
.bar-val span { font-size: 12px; }
.bar-val { font-size: 13px; }
.ring-text { font-size: 13px; }

thead th { font-size: 13px; }
tbody td { font-size: 14px; }
.cell-sub { font-size: 12.5px; line-height: 1.5; }
.empty { font-size: 14px; }
.pill { font-size: 12.5px; padding: 3px 9px; }
.btn { font-size: 14px; }
.btn.small { font-size: 13px; padding: 6px 11px; }
.link { font-size: 13.5px; }
.detail-sub,
.back { font-size: 14px; }
.kv label { font-size: 12.5px; }
.kv div { font-size: 14px; }
.modal-head p,
.form-note { font-size: 13px; line-height: 1.6; }
.check-row,
.filters input,
.filters select { font-size: 13.5px; }
.todo-title,
.alert-title { font-size: 13.5px; }
.todo-sub,
.alert-detail,
.todo .go { font-size: 12.5px; }
.tab { font-size: 14px; }
.tag { font-size: 12px; }

.hero-eyebrow { font-size: 10.5px; }
.hero-copy > p { font-size: 14px; line-height: 1.7; }
.hero-orbit span,
.hero-meta span { font-size: 12.5px; }
.customer-alert b { font-size: 13.5px; }
.customer-alert p,
.customer-alert > span:last-child { font-size: 12.5px; }
.task-main b,
.customer-empty b { font-size: 13.5px; }
.task-main span,
.customer-empty p { font-size: 12px; }
.task-go { font-size: 12px; }
.credit-summary span,
.credit-row-foot { font-size: 12px; }
.credit-row-head span,
.credit-row-head b { font-size: 13px; }
.customer-footnote { font-size: 12px; }

.contract-tab,
.contract-search input { font-size: 13px; }
.type-badge { font-size: 11.5px; }
.contract-table-foot { font-size: 11.5px; }
.contract-sheet-head > div:nth-child(2) > span { font-size: 10px; }
.contract-sheet-head p,
.contract-sheet-foot { font-size: 11.5px; }
.contract-parties label,
.contract-terms span { font-size: 11px; }
.contract-parties b { font-size: 13.5px; }
.contract-parties span,
.contract-clause p,
.doc-line b { font-size: 12.5px; }
.contract-terms b { font-size: 13px; }
.contract-clause h4,
.contract-docs h4 { font-size: 13px; }
.doc-line small { font-size: 11.5px; }
.doc-line > span:last-child { font-size: 12px; }

.apply-kicker { font-size: 10px; }
.apply-card > p { font-size: 13.5px; line-height: 1.75; }
.apply-points span { font-size: 12px; padding: 4px 9px; }
.apply-card-foot span { font-size: 12px; }
.apply-card-foot b { font-size: 15px; }

.profile-copy > span,
.profile-info-grid span,
.account-state { font-size: 11.5px; }
.profile-copy p { font-size: 12.5px; }
.profile-info-grid b { font-size: 12.5px; }
.settings-card-head h3 { font-size: 14.5px; }
.settings-card-head p { font-size: 12px; }
.preference-copy b { font-size: 13px; }
.preference-copy small { font-size: 11.5px; line-height: 1.5; }
.service-tag,
.permission-on,
.permission-off { font-size: 11px; }
.service-progress-head,
.service-links b,
.permission-row { font-size: 12.5px; }
.service-links small { font-size: 11.5px; line-height: 1.45; }
.platform-info div { font-size: 12px; }
.platform-note { font-size: 11.5px; }

@media (max-width: 900px) {
  .nav-item span { font-size: 13.5px; }
  .contract-table tbody tr.contract-row td { font-size: 12.5px; }
  .contract-table tbody tr.contract-row td:nth-child(3)::before,
  .contract-table tbody tr.contract-row td:nth-child(4)::before,
  .contract-table tbody tr.contract-row td:nth-child(5)::before,
  .contract-table tbody tr.contract-row td:nth-child(6)::before { font-size: 11px; }
}

/* ------------------------------------------------- redemption summary */

.redemption-summary { margin-bottom: 14px; }
.redemption-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--line-2);
}
.redemption-summary-item {
  min-width: 0;
  padding: 11px 13px 12px;
  background: #fff;
}
.redemption-summary-item span {
  display: block;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.45;
}
.redemption-summary-item b {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
  white-space: nowrap;
}
.redemption-summary-item.total { background: var(--g50); }
.redemption-summary-item.total span { color: var(--g700); }
.redemption-summary-item.total b { color: var(--g700); font-size: 17px; }

@media (max-width: 620px) {
  .redemption-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* -------------------------------------------------------- ui arrows */

.ui-arrow {
  display: inline-block;
  width: 15px;
  height: 15px;
  flex: none;
  vertical-align: -0.16em;
  transition: transform 0.16s ease;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(16, 32, 28, 0.04);
  transition: color 0.16s, border-color 0.16s, background 0.16s, transform 0.16s;
}
.back:hover {
  color: var(--g700);
  border-color: #c7d9d1;
  background: var(--g50);
  transform: translateY(-1px);
}
.back .ui-arrow { color: var(--g600); }
.back:hover .ui-arrow.left { transform: translateX(-2px); }
.link,
.todo .go,
.task-go,
.customer-alert > span:last-child,
.doc-line > span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.link:hover .ui-arrow.right,
.todo:hover .go .ui-arrow.right,
.customer-task:hover .task-go .ui-arrow.right,
.doc-line:hover > span:last-child .ui-arrow.right {
  transform: translateX(2px);
}
.service-links em {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #f4f7f3;
  color: var(--g600);
}
.service-links button:hover em { background: var(--g100); }
.service-links button:hover em .ui-arrow.right { transform: translateX(2px); }

/* ------------------------------------------------- redemption receipt */

.receipt-attachment {
  position: relative;
  width: 64px;
  height: 46px;
}
.receipt-thumb {
  width: 64px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, #f8faf7, #eef4f0);
  color: var(--g700);
  cursor: pointer;
  transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s;
}
.receipt-thumb:hover {
  border-color: #b9d2c8;
  box-shadow: 0 4px 12px -8px rgba(11, 59, 51, 0.55);
  transform: translateY(-1px);
}
.receipt-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.receipt-file-badge {
  display: grid;
  place-items: center;
  width: 38px;
  height: 26px;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(11, 59, 51, 0.12);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.receipt-remove {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 0 1px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  box-shadow: 0 2px 5px rgba(92, 26, 21, 0.28);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.receipt-remove:hover { background: #932c25; transform: scale(1.05); }

/* --------------------------------------------------- project upload */

.project-upload-block {
  margin: 4px 0 8px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfcfa;
}
.project-upload-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}
.project-upload-head b { font-size: 14px; }
.project-upload-head span { color: var(--muted-2); font-size: 11.5px; text-align: right; }
.project-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.project-upload-field { margin-bottom: 0; }
.project-upload-field input[type="file"] {
  padding: 7px 9px 7px 10px;
  background: #fff;
  cursor: pointer;
}
.project-upload-field input[type="file"]::file-selector-button {
  margin-right: 9px;
  padding: 3px 8px;
  border: 0;
  border-radius: 6px;
  background: var(--g100);
  color: var(--g700);
  cursor: pointer;
}
.file-picked {
  display: block;
  min-height: 17px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .project-upload-grid { grid-template-columns: 1fr; }
  .project-upload-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .project-upload-head span { text-align: left; }
}

/* ------------------------------------------------------ document view */

.document-preview-mask {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 18, 15, 0.84);
  backdrop-filter: blur(5px);
}
.document-preview-dialog {
  width: min(1200px, 94vw);
  height: min(900px, 90vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: #101917;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}
.document-preview-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px 11px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #edf5f1;
}
.document-preview-head b { display: block; font-size: 14px; font-weight: 500; }
.document-preview-head span { display: block; margin-top: 2px; color: rgba(220, 235, 228, 0.55); font-size: 11.5px; }
.document-preview-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: none;
  padding: 0 0 2px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}
.document-preview-close:hover { background: rgba(255, 255, 255, 0.15); }
.document-preview-canvas {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%) 0 0 / 24px 24px,
    linear-gradient(-45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%) 0 12px / 24px 24px,
    #07110f;
}
.document-preview-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  object-fit: contain;
  border-radius: 5px;
  cursor: zoom-in;
  transition: width 0.18s ease;
}
.document-preview-image.zoomed {
  width: 150%;
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}
.document-preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 7px;
  background: #fff;
}
.document-preview-fallback {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  color: rgba(231, 242, 237, 0.7);
  font-size: 14px;
}

@media (max-width: 760px) {
  .document-preview-mask { padding: 8px; }
  .document-preview-dialog { width: 98vw; height: 94vh; }
  .document-preview-canvas { padding: 8px; }
}

/* ---------------------------------------------------- customer pledge */

#customer-loan-items { max-height: 290px; }
.customer-stock-row { align-items: flex-start; }
.customer-stock-row .grow { min-width: 0; }
.stock-pick-name {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stock-pick-meta,
.stock-pick-available {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.45;
}
.stock-pick-available { color: var(--g600); }
.customer-stock-row .pick-qty {
  margin-top: 1px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-family: inherit;
  font-size: 12px;
}
.customer-stock-row .pick-qty:focus {
  outline: none;
  border-color: var(--g500);
  box-shadow: 0 0 0 3px rgba(28, 125, 99, 0.1);
}

/* ------------------------------------------------------ permission tree */

.permission-tree-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 5px 0 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line-2);
}
.permission-tree-head b { font-size: 14px; }
.permission-tree-head span { color: var(--muted-2); font-size: 11.5px; text-align: right; }
.permission-tree {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.permission-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.permission-parent {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  background: var(--g50);
  color: var(--g800);
  font-weight: 600;
  cursor: pointer;
}
.permission-parent input,
.permission-leaf input { accent-color: var(--g600); }
.permission-children { padding: 8px 10px 10px; }
.permission-leaf {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
}
.permission-leaf:hover { color: var(--text); }
.permission-leaf input { margin-top: 3px; flex: none; }
.permission-summary {
  max-width: 360px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .permission-tree { grid-template-columns: 1fr; }
  .permission-tree-head { align-items: flex-start; flex-direction: column; gap: 3px; }
  .permission-tree-head span { text-align: left; }
}

/* ------------------------------------------------------- approval center */

.approval-page-head { margin-bottom: 18px; }
.approval-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.approval-summary-grid.two-stage { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.approval-summary {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 112px;
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}
.approval-summary:hover {
  transform: translateY(-2px);
  border-color: #c5d3cb;
  box-shadow: 0 11px 24px -20px rgba(16, 32, 28, 0.55);
}
.approval-summary.active {
  box-shadow: 0 0 0 2px rgba(21, 100, 79, 0.12), 0 12px 26px -20px rgba(16, 32, 28, 0.5);
}
.approval-summary.business.active { border-color: #91b4d3; box-shadow: 0 0 0 2px rgba(43, 95, 134, 0.1); }
.approval-summary.risk.active { border-color: #d6ad61; box-shadow: 0 0 0 2px rgba(168, 115, 15, 0.1); }
.approval-summary.finance.active { border-color: #a9bcb0; box-shadow: 0 0 0 2px rgba(82, 104, 94, 0.1); }
.approval-summary::after {
  content: "";
  position: absolute;
  width: 72px;
  height: 72px;
  right: -25px;
  bottom: -30px;
  border-radius: 50%;
  background: rgba(21, 100, 79, 0.06);
}
.approval-summary > span { color: var(--muted); font-size: 13px; }
.approval-summary > b {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 29px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.approval-summary small { margin-left: 4px; color: var(--muted); font-size: 13px; font-weight: 400; }
.approval-summary em {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 11.5px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.approval-summary.primary { border-color: #bcd8cb; background: linear-gradient(145deg, #edf8f1, #fff); }
.approval-summary.primary > b { color: var(--g700); }
.approval-summary.business { border-color: #cddceb; }
.approval-summary.business > b { color: var(--blue); }
.approval-summary.risk { border-color: #eed9ae; background: linear-gradient(145deg, #fffaf0, #fff); }
.approval-summary.risk > b { color: #936b1c; }
.approval-summary.finance { border-color: #d9e1d7; }
.approval-summary.finance > b { color: #4e625b; }
.approval-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.approval-tabs { display: flex; gap: 4px; overflow-x: auto; }
.approval-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.approval-tab span {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f0f2ee;
  font-size: 11px;
}
.approval-tab.active { background: var(--g50); color: var(--g700); font-weight: 600; }
.approval-tab.active span { background: var(--g100); }
.approval-toolbar > span { color: var(--muted-2); font-size: 11.5px; line-height: 1.5; text-align: right; }
.approval-list { display: grid; gap: 12px; }
.approval-card {
  padding: 16px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}
.approval-card:hover {
  transform: translateY(-1px);
  border-color: #cdd9d2;
  box-shadow: 0 10px 28px -20px rgba(16, 32, 28, 0.45);
}
.approval-card.actionable { border-color: #b9d6c9; box-shadow: 0 9px 25px -19px rgba(11, 59, 51, 0.55); }
.approval-card-top,
.approval-card-title,
.approval-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.approval-type,
.approval-current {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}
.approval-type.project { background: var(--blue-soft); color: var(--blue); }
.approval-type.loan { background: var(--g100); color: var(--g700); }
.approval-type.prepay { background: var(--gold-soft); color: #84621d; }
.approval-type.redemption { background: #f4eef8; color: #714b84; }
.approval-current.business { background: #eaf1f8; color: var(--blue); }
.approval-current.risk { background: var(--amber-soft); color: var(--amber); }
.approval-current.finance { background: #eef1ed; color: #53635d; }
.approval-current.done { background: #edf5f0; color: var(--g600); }
.approval-card-title { align-items: flex-start; margin-top: 12px; }
.approval-card-title > div { min-width: 0; }
.approval-card-title b { display: block; font-size: 16px; line-height: 1.45; }
.approval-card-title span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.approval-card-title strong { color: var(--g800); font-size: 19px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.approval-card-amounts {
  min-width: 220px;
  display: grid;
  gap: 4px;
  padding: 7px 10px;
  border-radius: 9px;
  background: #f6f9f6;
}
.approval-card-amounts > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}
.approval-card-amounts b {
  color: var(--g800);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.approval-card-amounts.single { min-width: 170px; }
.approval-card-amounts.single b { font-size: 18px; }
.approval-card-meta { display: flex; flex-wrap: wrap; gap: 5px 18px; margin-top: 7px; color: var(--muted-2); font-size: 12px; }
.approval-card-meta span:first-child::before {
  content: "项目";
  margin-right: 5px;
  color: var(--muted);
}
.approval-stage-rail {
  display: flex;
  align-items: flex-start;
  margin: 15px 0 12px;
  padding: 11px 8px;
  border-radius: 10px;
  background: #f8faf7;
}
.approval-stage-node {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  color: var(--muted-2);
}
.approval-stage-node > span {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 1px solid #dce2dc;
  border-radius: 50%;
  background: #fff;
  font-size: 11px;
  font-weight: 600;
}
.approval-stage-node b { font-size: 12px; font-weight: 500; }
.approval-stage-node.done { color: var(--g600); }
.approval-stage-node.done > span { border-color: var(--g500); background: var(--g600); color: #fff; }
.approval-stage-node.current { color: #835b13; }
.approval-stage-node.current > span { border-color: #d29a35; background: #fff7e7; color: #9a6b18; box-shadow: 0 0 0 3px rgba(210, 154, 53, 0.13); }
.approval-stage-node.rejected { color: var(--red); }
.approval-stage-node.rejected > span { border-color: #d79590; background: var(--red-soft); color: var(--red); }
.approval-stage-line { flex: 1; height: 1px; margin: 11px 8px 0; background: #dfe5df; }
.approval-card-foot { padding-top: 11px; border-top: 1px solid var(--line-2); }
.approval-card-foot > span { color: var(--muted-2); font-size: 11.5px; }
.approval-card-foot .btn { gap: 5px; }
.approval-empty {
  min-height: 230px;
  display: grid;
  place-content: center;
  gap: 5px;
  padding: 32px;
  border: 1px dashed #d9dfd8;
  border-radius: 14px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}
.approval-empty b { color: var(--text); font-size: 16px; }
.approval-empty span { font-size: 13px; }
.approval-detail-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.approval-detail-status > span { color: var(--muted); font-size: 12.5px; }
.admin-review-panel {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid #dbe4dd;
  border-radius: 12px;
  background: linear-gradient(145deg, #f7faf7, #fff);
}
.admin-review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.admin-review-head b { display: block; font-size: 14px; }
.admin-review-head span { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.admin-review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.admin-review-role {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.admin-review-role.current { border-color: #b9d5c8; background: #f7fbf8; }
.admin-review-role.done { border-color: #cee0d5; }
.admin-review-role.rejected { border-color: #ebc7c3; background: #fffafa; }
.admin-review-role.waiting { background: #fafbf9; }
.admin-review-role-head { display: flex; align-items: flex-start; gap: 8px; min-height: 40px; }
.admin-review-role-head > span {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: var(--g100);
  color: var(--g700);
  font-size: 11px;
  font-weight: 700;
}
.admin-review-role.waiting .admin-review-role-head > span { background: #eef1ed; color: var(--muted-2); }
.admin-review-role.rejected .admin-review-role-head > span { background: var(--red-soft); color: var(--red); }
.admin-review-role-head b { display: block; font-size: 12.5px; }
.admin-review-role-head small { display: block; margin-top: 2px; color: var(--muted-2); font-size: 10.5px; line-height: 1.4; }
.admin-review-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 9px; }
.admin-review-role > .btn { width: 100%; margin-top: 9px; }
.approval-detail-section { margin-top: 18px; }
.approval-detail-section > h4 {
  margin-bottom: 9px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.approval-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.approval-detail-grid > div { min-width: 0; padding: 11px 13px; border-bottom: 1px solid var(--line-2); }
.approval-detail-grid > div:nth-child(odd) { border-right: 1px solid var(--line-2); }
.approval-detail-grid span { display: block; color: var(--muted-2); font-size: 11.5px; }
.approval-detail-grid b { display: block; margin-top: 3px; overflow-wrap: anywhere; font-size: 13.5px; font-weight: 500; line-height: 1.55; }
.approval-history { display: grid; gap: 0; }
.approval-history-item { display: flex; gap: 11px; position: relative; padding-bottom: 14px; }
.approval-history-item:last-child { padding-bottom: 0; }
.approval-history-item::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 27px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.approval-history-item:last-child::before { display: none; }
.approval-history-dot {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.approval-history-item.done .approval-history-dot { border-color: var(--g500); background: var(--g600); color: #fff; }
.approval-history-item.current .approval-history-dot { border-color: #d7a85d; background: var(--amber-soft); color: var(--amber); }
.approval-history-item.rejected .approval-history-dot { border-color: #d8a19b; background: var(--red-soft); color: var(--red); }
.approval-history-item b { font-size: 13.5px; }
.approval-history-item p { margin-top: 2px; color: var(--muted); font-size: 12px; }
.approval-history-item em {
  display: block;
  margin-top: 5px;
  padding: 7px 9px;
  border-radius: 7px;
  background: #f7f9f6;
  color: #53605b;
  font-size: 12px;
  font-style: normal;
  line-height: 1.55;
}
.approval-document-list { display: grid; gap: 8px; }
.approval-document-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: #fff;
}
.approval-document-icon {
  width: 32px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 7px;
  background: var(--g100);
  color: var(--g700);
  font-size: 12px;
  font-weight: 600;
}
.approval-document-item > div { flex: 1; min-width: 0; }
.approval-document-item b { display: block; font-size: 13px; }
.approval-document-item div span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.approval-document-empty { padding: 24px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted-2); font-size: 13px; text-align: center; }
.approval-decision-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 13px 14px;
  border-radius: 10px;
  background: #f7f9f6;
}
.approval-decision-summary span { color: var(--muted); font-size: 13px; }
.approval-decision-summary b { color: var(--g800); font-size: 17px; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .approval-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .approval-summary-grid.two-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .approval-toolbar { align-items: stretch; flex-direction: column; gap: 7px; }
  .approval-toolbar > span { text-align: left; }
  .approval-stage-rail { overflow-x: auto; }
  .approval-stage-node b { white-space: nowrap; }
}

@media (max-width: 620px) {
  .approval-summary { min-height: 99px; padding: 13px 14px; }
  .approval-summary > b { font-size: 25px; }
  .approval-card { padding: 14px 15px 13px; border-radius: 12px; }
  .approval-card-title { flex-direction: column; gap: 6px; }
  .approval-card-title strong { font-size: 18px; }
  .approval-card-amounts, .approval-card-amounts.single { min-width: 0; width: 100%; }
  .approval-card-meta { flex-direction: column; gap: 3px; }
  .approval-card-foot { align-items: stretch; flex-direction: column; gap: 9px; }
  .approval-card-foot .btn { width: 100%; min-height: 42px; }
  .approval-detail-grid { grid-template-columns: 1fr; }
  .approval-detail-grid > div:nth-child(odd) { border-right: 0; }
  .approval-document-item { align-items: flex-start; flex-wrap: wrap; }
  .approval-document-item .btn { margin-left: 42px; }
  .approval-decision-summary { align-items: flex-start; flex-direction: column; gap: 4px; }
  .admin-review-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------- visual refinement */

:root {
  --bg: #eef2ee;
  --card: #fffefd;
  --line: #dde4dd;
  --line-2: #edf1ec;
  --muted: #62716b;
  --muted-2: #8d9994;
  --shadow: 0 1px 2px rgba(13, 37, 31, 0.035), 0 12px 30px -24px rgba(13, 37, 31, 0.42);
}

html { background: #e9eeea; }
body {
  background:
    radial-gradient(ellipse at 15% -8%, rgba(192, 160, 98, 0.13), transparent 34%),
    radial-gradient(ellipse at 100% 0%, rgba(20, 91, 76, 0.08), transparent 30%),
    linear-gradient(180deg, #f7f9f6 0%, #eef2ee 46%, #e9eeea 100%);
  background-attachment: fixed;
}
::selection { background: rgba(21, 100, 79, 0.17); color: var(--g900); }

.sidebar {
  background:
    radial-gradient(75% 28% at 12% 0%, rgba(199, 170, 99, 0.16), transparent 58%),
    linear-gradient(180deg, #0b3c32 0%, #072a23 58%, #061f1b 100%);
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.035);
}
.topbar {
  background: rgba(252, 253, 251, 0.82);
  border-bottom-color: rgba(214, 223, 216, 0.88);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75), 0 12px 30px -30px rgba(9, 31, 25, 0.38);
}
.view { position: relative; }
.page-head h1 {
  color: #13241f;
  letter-spacing: 0.005em;
}
.page-head .desc { color: #697871; }

.card,
.kpi {
  border-color: rgba(217, 225, 218, 0.92);
  box-shadow:
    0 1px 2px rgba(13, 37, 31, 0.035),
    0 14px 34px -28px rgba(13, 37, 31, 0.48);
}
.card { background: linear-gradient(180deg, #fffefd, #fff); }
.kpi {
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(21, 100, 79, 0.035), transparent 52%),
    linear-gradient(180deg, #fffefd, #fcfdfb);
}
.kpi.accent {
  background:
    radial-gradient(110% 90% at 100% 0%, rgba(21, 100, 79, 0.09), transparent 55%),
    linear-gradient(180deg, #fffefd, #f8fbf8);
}
.kpi.gold {
  background:
    radial-gradient(110% 90% at 100% 0%, rgba(185, 149, 79, 0.11), transparent 55%),
    linear-gradient(180deg, #fffefd, #fdfaf3);
}

.table-wrap { border-radius: 0 0 12px 12px; }
thead th {
  background: linear-gradient(180deg, #f8faf7, #f4f7f3);
  color: #586761;
  font-weight: 600;
}
tbody tr { transition: background 0.14s, box-shadow 0.14s; }
tbody tr:hover {
  background: #f7faf7;
  box-shadow: inset 3px 0 rgba(21, 100, 79, 0.28);
}

.btn {
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(13, 37, 31, 0.04);
}
.btn.primary {
  background: linear-gradient(180deg, #176a55, #0f4d42);
  box-shadow: 0 7px 15px -10px rgba(8, 69, 55, 0.65);
}
.btn.primary:hover {
  background: linear-gradient(180deg, #1b765f, #115849);
  box-shadow: 0 9px 18px -11px rgba(8, 69, 55, 0.72);
}
.btn.ghost { background: rgba(255, 255, 255, 0.86); }
.btn.ghost:hover { background: #f8faf7; }

.field input,
.field select,
.field textarea {
  border-color: #d9e1da;
  background: linear-gradient(180deg, #fff, #fdfefd);
  box-shadow: inset 0 1px 2px rgba(13, 37, 31, 0.025);
}
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: #c7d5cc; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--g500);
  box-shadow: 0 0 0 3px rgba(28, 125, 99, 0.11), 0 6px 16px -14px rgba(21, 100, 79, 0.55);
}

.modal {
  border: 1px solid rgba(221, 228, 221, 0.9);
  box-shadow: 0 32px 80px -24px rgba(5, 27, 21, 0.5);
}
.notice { box-shadow: inset 0 1px rgba(255, 255, 255, 0.58); }

.login-art {
  background:
    radial-gradient(70% 58% at 78% 18%, rgba(192, 160, 98, 0.16), transparent 62%),
    radial-gradient(90% 70% at 8% 92%, rgba(28, 125, 99, 0.22), transparent 66%),
    linear-gradient(145deg, #0e5b4e 0%, #072f28 48%, #041d18 100%);
}
.login-art::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -260px;
  bottom: -310px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(192, 160, 98, 0.11), transparent 68%);
  pointer-events: none;
}
.art-grid { opacity: 0.82; }
.login-panel {
  background:
    radial-gradient(80% 70% at 100% 0%, rgba(192, 160, 98, 0.07), transparent 58%),
    linear-gradient(180deg, #fcfcfa, #f6f8f5);
}
.login-card {
  padding: 30px;
  border: 1px solid rgba(220, 226, 218, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 253, 0.88);
  box-shadow:
    0 2px 4px rgba(13, 37, 31, 0.035),
    0 24px 60px -36px rgba(13, 37, 31, 0.38);
  backdrop-filter: blur(8px);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 117, 109, 0.32) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(99, 117, 109, 0.3);
  background-clip: padding-box;
}
*::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 900px) {
  .login-panel { padding: 28px 20px; }
  .login-card { max-width: 440px; padding: 24px; }
}

@media (max-width: 520px) {
  .login-card { padding: 20px 16px; border-radius: 16px; }
  .page-head h1 { letter-spacing: 0; }
}

/* ------------------------------------------------ supporting text sizing */

.small,
.cell-sub,
.card-head .hint,
.kpi-foot,
.contract-table-foot,
.task-main span,
.customer-empty p,
.credit-summary span,
.credit-row-foot,
.todo-sub,
.alert-detail,
.service-progress-head,
.service-links b,
.preference-copy b,
.profile-copy p,
.profile-info-grid b,
.settings-card-head p,
.platform-info div {
  font-size: 13.5px;
  line-height: 1.6;
}

.field > span,
.form-note,
.notice,
.type-badge,
.tag,
.service-tag,
.account-state,
.service-links small,
.preference-copy small,
.service-progress p,
.profile-copy > span,
.profile-info-grid span,
.platform-note {
  font-size: 12.5px;
  line-height: 1.65;
}

.service-progress p,
.platform-note {
  color: #74817c;
}

.contract-table-foot,
.task-main span,
.customer-empty p {
  color: #7d8a85;
}
