:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --text: #262b33;
  --muted: #8a919e;
  --line: #e7e9ee;
  --line-strong: #d8dce3;
  --brand: #dd5a13;
  --brand-strong: #c04c0b;
  --brand-soft: #fdf1e8;
  --brand-border: #f5cdb0;
  --success: #2e8b57;
  --success-soft: #e9f6ee;
  --warning: #b97708;
  --warning-soft: #fdf5e3;
  --danger: #cb4437;
  --danger-soft: #fdeceb;
  --info: #3b6db4;
  --info-soft: #ecf2fa;
  --sidebar-text: #4d5f74;
  --sidebar-heading: #24384f;
  --sidebar-active: #1d5a96;
  --sidebar-accent: #2f6fb0;
  --shadow-card: 0 1px 2px rgba(31, 35, 41, 0.04), 0 2px 8px rgba(31, 35, 41, 0.04);
  --radius: 6px;
  --control-height: 36px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC",
    Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

/* ---------- 登录页 ---------- */

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px 16px;
  background:
    linear-gradient(0deg, rgba(221, 90, 19, 0.03), rgba(221, 90, 19, 0.03)),
    var(--bg);
}

.login-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(31, 35, 41, 0.07);
  padding: 36px 36px 30px;
}

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

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

.brand-mark {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.login-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}

.login-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form .btn.primary {
  margin-top: 4px;
  height: 40px;
}

.login-help {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.login-foot {
  color: #b3b9c2;
  font-size: 12px;
}

/* ---------- 整体框架 ---------- */

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width, 204px) minmax(0, 1fr);
}

.sidebar {
  background: linear-gradient(180deg, #fbfdff 0%, #edf3fa 100%);
  color: var(--sidebar-text);
  border-right: 1px solid #dfe7f0;
  padding: 0 10px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 168px;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid #e2e9f2;
}

.sidebar-brand .brand-mark {
  width: 34px;
  height: 34px;
  font-size: 16px;
  border-radius: 7px;
}

.brand-name {
  color: var(--sidebar-heading);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.brand-sub {
  font-size: 11px;
  color: #7d8ea1;
  white-space: nowrap;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}

.nav a .nav-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  opacity: 0.85;
}

.nav a:hover {
  color: var(--sidebar-heading);
  background: rgba(47, 111, 176, 0.08);
}

.nav a.active {
  color: var(--sidebar-active);
  background: #dcebf9;
  font-weight: 600;
}

.nav a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 999px;
  background: var(--sidebar-accent);
}

.mobile-nav {
  display: none;
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px 8px 0;
  font-size: 11px;
  color: #9fb0c2;
  white-space: nowrap;
}

.sidebar-resizer {
  position: absolute;
  top: 0;
  right: -5px;
  width: 10px;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: col-resize;
  z-index: 10;
}

.sidebar-resizer::after {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 4px;
  width: 2px;
  border-radius: 999px;
  background: rgba(47, 111, 176, 0);
  transition: background 140ms ease;
}

.sidebar-resizer:hover::after,
.is-resizing-sidebar .sidebar-resizer::after {
  background: rgba(47, 111, 176, 0.4);
}

.is-resizing-sidebar {
  cursor: col-resize;
  user-select: none;
}

.app-shell.is-secondary-route #logoutBtn {
  display: none;
}

.app-shell.is-secondary-route .topbar,
.app-shell.is-secondary-route .mobile-nav {
  display: none;
}

.main {
  min-width: 0;
  width: 100%;
}

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

.topbar-title {
  font-size: 14px;
  font-weight: 600;
  color: #4a505b;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-todo {
  border: 1px solid #b8d9f5;
  background: #eef7ff;
  color: #1769aa;
  height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.topbar-todo span {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff7a45;
  color: #fff;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-name {
  font-weight: 600;
}

.topbar-divider {
  width: 1px;
  height: 18px;
  background: var(--line-strong);
  margin: 0 2px;
}

.page {
  padding: 24px;
  min-width: 0;
  overflow-x: hidden;
}

.sticky-action-bar {
  position: sticky;
  top: 0;
  z-index: 25;
  background: rgba(244, 245, 247, 0.98);
  backdrop-filter: blur(10px);
  padding: 10px 0 0;
  margin: -10px 0 16px;
  border-bottom: 1px solid rgba(216, 220, 227, 0.72);
  box-shadow: 0 8px 18px rgba(31, 35, 41, 0.06);
}

.app-shell.is-secondary-route .page {
  padding-top: 154px;
}

.app-shell.is-secondary-route .sticky-action-bar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width, 204px);
  right: 0;
  z-index: 25;
  padding: 20px 24px 0;
  margin: 0;
}

.sticky-action-bar .page-header {
  margin-bottom: 10px;
}

.sticky-action-bar .tabs {
  margin-bottom: 0;
}

.page-enter {
  animation: pageEnter 180ms ease both;
}

@keyframes pageEnter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.page-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
}

.page-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- 统计卡片 ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--line-strong);
}

.stat-card.t-total::before {
  background: var(--brand);
}

.stat-card.t-pending::before {
  background: var(--warning);
}

.stat-card.t-returned::before {
  background: var(--danger);
}

.stat-card.t-approved::before {
  background: var(--success);
}

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

.stat-value {
  font-size: 24px;
  font-weight: 700;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* ---------- 工具条 / 面板 ---------- */

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.todo-panel {
  margin-bottom: 16px;
  border: 1px solid #cfe4f6;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f7fbff 0%, #fffaf4 100%);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.todo-head {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(207, 228, 246, 0.9);
}

.todo-head strong {
  font-size: 15px;
}

.todo-list {
  padding: 10px 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.todo-item {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  padding: 10px 12px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.todo-item:hover {
  transform: translateY(-1px);
  border-color: #9ccdf5;
  box-shadow: 0 8px 20px rgba(47, 111, 170, 0.12);
}

.todo-item span {
  color: var(--muted);
  font-size: 12px;
}

.todo-item strong {
  color: var(--text);
  font-size: 14px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.panel-body {
  padding: 18px;
}

.section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.section-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.section-title {
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 999px;
  background: var(--brand);
}

.section-body {
  padding: 18px;
}

.section-header[data-collapse-ready="1"] {
  cursor: pointer;
  user-select: none;
}

.section.is-collapsed .section-header {
  border-bottom-color: transparent;
}

.section.is-collapsed > .section-body {
  display: none;
}

.section-collapse-button {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  margin-left: auto;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #6f7883;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.section-collapse-button:hover {
  color: var(--brand-strong);
  border-color: #ead8cc;
  background: var(--brand-soft);
}

.section-collapse-chevron {
  width: 8px;
  height: 8px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 160ms ease;
}

.section.is-collapsed .section-collapse-chevron {
  transform: rotate(-45deg) translate(-1px, -1px);
}

/* ---------- 表单 ---------- */

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

.grid.two {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.form-group-block {
  margin-top: 22px;
}

.form-group-block:first-child {
  margin-top: 0;
}

.form-group-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: #2f3540;
  font-size: 13px;
  font-weight: 700;
}

.form-group-heading::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #edf0f3;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

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

.field label {
  color: #4a505b;
  font-size: 13px;
  font-weight: 500;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 6px 10px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #b9c0ca;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(221, 90, 19, 0.12);
}

.textarea {
  min-height: 104px;
  resize: vertical;
}

.smart-fill-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #f1d6c2;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffaf6, #fff);
}

.smart-fill-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.smart-fill-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.smart-fill-textarea {
  min-height: 136px;
  background: #fff;
}

.smart-fill-btn {
  width: auto;
  min-width: 92px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.clearable-control {
  position: relative;
  min-width: 0;
}

.clearable-control .input,
.clearable-control .select {
  padding-right: 62px;
}

.select-control::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #77818d;
  border-bottom: 1.5px solid #77818d;
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.select-control .select {
  appearance: none;
  -webkit-appearance: none;
}

.select-control .select.is-placeholder {
  color: #9aa1ac;
}

.select-control .select option {
  color: var(--text);
}

.select-placeholder {
  position: absolute;
  left: 11px;
  top: 50%;
  color: #9aa1ac;
  pointer-events: none;
  transform: translateY(-50%);
}

.clear-control {
  position: absolute;
  right: 34px;
  top: 50%;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #7a828e;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.clear-control:hover {
  background: #f3f5f7;
  color: var(--brand-strong);
}

.clear-control-icon {
  position: relative;
  width: 12px;
  height: 8px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  transform: rotate(-42deg);
}

.clear-control-icon::after {
  content: "";
  position: absolute;
  top: -1.5px;
  right: 3px;
  width: 1.5px;
  height: 8px;
  background: currentColor;
}

.readonly {
  min-height: var(--control-height);
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius);
  color: #3d434d;
  word-break: break-word;
}

.readonly-form .drop-zone,
.readonly-form [data-remove-file],
.readonly-form #queryBigDataBtn {
  display: none;
}

.readonly-form .input,
.readonly-form .select,
.readonly-form .textarea,
.readonly-form .check-chip {
  pointer-events: none;
  background: var(--surface-2);
  color: #3d434d;
}

.readonly-form .clear-control {
  display: none;
}

/* ---------- 按钮 ---------- */

.btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #3d434d;
  min-height: var(--control-height);
  padding: 0 14px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn.primary:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #fff;
}

.btn.success {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.btn.success:hover {
  background: #27784b;
  border-color: #27784b;
  color: #fff;
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn.danger:hover {
  background: #b23a2e;
  border-color: #b23a2e;
  color: #fff;
}

.btn.ghost {
  background: transparent;
}

.btn.small {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 5px;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn[disabled]:hover {
  border-color: var(--line-strong);
  color: #3d434d;
}

.btn.primary[disabled]:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ---------- 表格 ---------- */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1120px;
}

.compact-table {
  min-width: 680px;
}

th,
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #5f6b7c;
  font-weight: 600;
  font-size: 13px;
  background: #f5f8fb;
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tr:hover td {
  background: #fbf7f3;
}

.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* ---------- 状态标签 ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge.draft::before,
.badge.pending::before,
.badge.returned::before,
.badge.approved::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge.draft {
  color: #5c6470;
  background: #f1f3f5;
  border-color: #e0e4e9;
}

.badge.pending {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: #f2dfb4;
}

.badge.returned {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #f4c7c2;
}

.badge.rejected {
  color: #a61b1b;
  background: #fff0f0;
  border-color: #f3b8b8;
}

.badge.approved {
  color: var(--success);
  background: var(--success-soft);
  border-color: #bfe3cd;
}

.badge.role {
  color: var(--info);
  background: var(--info-soft);
  border-color: #c6d8ef;
}

/* ---------- 表单底部操作条 ---------- */

.form-footer {
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding: 12px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  z-index: 4;
}

/* ---------- 上传区域 ---------- */

.upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  margin-bottom: 14px;
}

.upload-grid.single {
  grid-template-columns: 1fr;
}

.guarantor-presence-panel {
  margin-bottom: 14px;
}

.guarantor-presence-option {
  width: min(100%, 520px);
  min-height: 72px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.guarantor-presence-option:hover {
  border-color: var(--line-strong);
}

.guarantor-presence-option.selected {
  border-color: #ee9a72;
  background: #fff8f3;
  box-shadow: inset 3px 0 0 var(--brand);
}

.guarantor-presence-option.readonly {
  cursor: default;
}

.guarantor-check-box {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border: 1px solid #aeb8c5;
  border-radius: 5px;
  background: #fff;
}

.guarantor-presence-option.selected .guarantor-check-box {
  border-color: var(--brand);
  background: var(--brand);
}

.guarantor-presence-option.selected .guarantor-check-box span {
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

.guarantor-presence-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.guarantor-presence-copy strong {
  color: var(--text);
  font-size: 14px;
}

.guarantor-presence-copy small,
.guarantor-empty-state {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.guarantor-empty-state {
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.guarantor-details {
  min-width: 0;
}

.upload-box {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 13px 14px;
  min-height: 116px;
  transition: border-color 140ms ease;
}

.upload-box:hover {
  border-color: var(--line-strong);
}

.upload-box.is-dragover,
.drop-zone.is-dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.upload-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
  color: #4a505b;
}

.drop-zone {
  display: grid;
  gap: 3px;
  align-content: center;
  min-height: 68px;
  padding: 10px;
  border: 1px dashed #c4cad3;
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.drop-zone:hover {
  border-color: var(--brand);
}

.drop-main {
  color: #4a505b;
  font-size: 13px;
  font-weight: 500;
}

.drop-sub {
  color: var(--muted);
  font-size: 12px;
}

.visually-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 10px;
}

.file-list a {
  color: var(--info);
  text-decoration: none;
}

.file-list a:hover {
  text-decoration: underline;
}

.file-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.file-row-main > span {
  min-width: 0;
  word-break: break-word;
}

.file-thumb {
  width: 52px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: #f1f3f5;
}

.file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- 详情 / 其他 ---------- */

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

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

.detail-item {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.detail-label {
  color: var(--muted);
  font-size: 12px;
}

.detail-value {
  min-height: var(--control-height);
  padding: 7px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  word-break: break-word;
}

.review-box {
  display: grid;
  gap: 12px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  min-width: 220px;
  max-width: 420px;
  background: #2b2f36;
  color: #fff;
  padding: 11px 16px;
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(31, 35, 41, 0.24);
  font-size: 13px;
  animation: toastIn 160ms ease both;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.muted {
  color: var(--muted);
}

.danger-text {
  color: var(--danger);
}

/* ---------- Tab 栏 ---------- */

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line-strong);
}

.tab-button {
  border: 0;
  background: transparent;
  color: #5f6b7c;
  font-size: 14px;
  padding: 10px 18px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}

.tab-button:hover {
  color: var(--brand);
}

.tab-button.active {
  color: var(--brand);
  font-weight: 600;
  border-bottom-color: var(--brand);
}

/* ---------- 放款信息 ---------- */

.loan-release-board .section-header {
  background: linear-gradient(180deg, #ffffff, #fbf8f5);
}

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

.loan-release-grid .textarea {
  min-height: 46px;
  height: 46px;
  resize: vertical;
}

.loan-release-grid .input { height: 46px; }

.suffix-control { position: relative; }
.suffix-control .input { padding-right: 42px; }
.suffix-control > span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: #667085; pointer-events: none; }

.vehicle-compare-field label { display: flex; align-items: center; gap: 7px; }
.vehicle-conflict-warning { color: #d92d20; font-size: 12px; font-weight: 600; }
.vehicle-compare-field.has-conflict .input { border-color: #f97066; background: #fffafa; }
.vehicle-conflict-panel { display:grid; gap:0; margin:16px 0; border:1px solid #f3b7aa; background:#fffaf8; }
.vehicle-conflict-panel-title { padding:11px 14px; border-bottom:1px solid #f5d4cc; color:#9f2d20; font-size:13px; font-weight:700; }
.vehicle-conflict-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:14px; align-items:center; padding:10px 14px; }
.vehicle-conflict-row + .vehicle-conflict-row { border-top:1px solid #f7e1dc; }
.vehicle-conflict-row > div { display:flex; flex-wrap:wrap; gap:4px 14px; min-width:0; }
.vehicle-conflict-row strong { color:#b42318; font-size:13px; }
.vehicle-conflict-row span { color:#667085; font-size:12px; overflow-wrap:anywhere; }
.vehicle-conflict-row button { border:0; background:transparent; color:#d94f13; font-weight:700; cursor:pointer; white-space:nowrap; }

.driver-recognition-panel { margin-top: 16px; padding: 16px; border: 1px solid #e4e8ef; background: #f8fafc; }
.driver-recognition-panel > div:first-child { display:flex; justify-content:space-between; gap:12px; color:#475467; }
.driver-recognition-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-top:14px; }
.driver-recognition-grid span { display:flex; flex-direction:column; gap:4px; min-width:0; }
.driver-recognition-grid small { color:#8a93a3; }
.driver-recognition-grid b { overflow-wrap:anywhere; }
.driver-recognition-grid em { color:#d92d20; font-size:12px; font-style:normal; }

.loan-account-panel { margin: 4px 0 18px; padding: 16px; border: 1px solid #e4e8ef; background:#fafbfc; }
.loan-account-head { display:flex; align-items:baseline; gap:10px; margin-bottom:14px; }
.loan-account-head span { color:#8a93a3; font-size:12px; }
.transfer-receipt-panel { display:grid; grid-template-columns:minmax(220px,1fr) auto; gap:12px; align-items:center; margin-top:18px; padding:16px; border:1px solid #e4e8ef; background:#fff; }
.transfer-receipt-panel > div:first-child { display:flex; flex-direction:column; gap:4px; }
.transfer-receipt-panel > div:first-child span { color:#8a93a3; font-size:12px; }
.transfer-receipt-files { grid-column:1/-1; }

.repayment-components { display:flex; flex-wrap:wrap; gap:4px; }
.repayment-components span { padding:3px 6px; background:#f2f4f7; color:#475467; font-size:11px; white-space:nowrap; }
.insurance-expiry-strip { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:16px; }
.insurance-expiry-strip span { display:flex; gap:8px; padding:9px 12px; background:#f3f4f6; color:#475467; font-size:13px; }
.insurance-expiry-strip .warning { background:#fff0f0; color:#d92d20; font-weight:700; }
.insurance-expiry-strip .urgent { background:#fff0f0; color:#d92d20; font-weight:700; }
.post-loan-insurance-summary { display:grid; gap:10px; margin:16px 0; padding:14px; border:1px solid #e4e8ef; background:#fafbfc; }
.post-loan-insurance-summary > div:first-child { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.post-loan-insurance-summary .insurance-expiry-strip { margin:0; justify-content:flex-end; }
.post-loan-insurance-meta { display:flex; flex-wrap:wrap; gap:8px 18px; color:#667085; font-size:12px; }
.insurance-review-alert { color:#d92d20; font-weight:700; }
.insurance-loan-list { display:grid; gap:10px; }
.insurance-loan-item { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:14px; align-items:center; padding:14px; border:1px solid #e4e8ef; }
.insurance-loan-item > div:first-child { display:flex; flex-wrap:wrap; gap:8px 14px; align-items:center; }
.insurance-loan-item small { color:#8a93a3; }
.postloan-inline-requests { margin:12px 0 16px; }
.section-inline-actions { display:flex; justify-content:flex-end; margin-bottom:12px; }
.component-schedule-list { display:grid; gap:10px; margin-top:16px; }
.component-schedule { border:1px solid #e4e8ef; background:#fff; }
.component-schedule summary { display:flex; justify-content:space-between; gap:16px; padding:13px 15px; cursor:pointer; color:#344054; }
.component-schedule summary b { color:#667085; font-size:12px; font-weight:600; }
.component-schedule .table-wrap { margin:0; border-top:1px solid #e4e8ef; }
.repayment-plan-tabs > h4 { margin:0 0 12px; }
.modal.insurance-review-modal { width:min(620px,100%); padding:0; overflow:hidden; }
.insurance-review-head { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:14px; align-items:center; padding:20px 22px 17px; border-bottom:1px solid #e8ebf0; background:#fff; }
.insurance-review-head .modal-title { margin:0 0 3px; font-size:18px; }
.insurance-review-head p { margin:0; color:#8490a1; font-size:12px; }
.insurance-review-icon { width:42px; height:42px; display:grid; place-items:center; border-radius:6px; background:#fff1e8; color:#df581a; font-weight:800; }
.insurance-review-modal > .modal-body { margin:0; padding:20px 22px; background:#fafbfc; }
.insurance-review-amount { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 18px; border:1px solid #f0d5c7; border-left:4px solid #e85d1c; background:#fff; }
.insurance-review-amount > div { display:flex; flex-direction:column; gap:3px; }
.insurance-review-amount small { color:#8490a1; }
.insurance-review-amount strong { color:#202936; font-size:28px; line-height:1.2; }
.insurance-review-amount > span { padding:6px 11px; border-radius:4px; background:#fff2eb; color:#d95720; font-weight:700; }
.insurance-review-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:12px; }
.insurance-review-facts > div { display:flex; flex-direction:column; gap:4px; min-width:0; padding:11px 13px; border:1px solid #e4e8ef; background:#fff; }
.insurance-review-facts small, .insurance-review-reason small { color:#8490a1; }
.insurance-review-facts b { color:#344054; overflow-wrap:anywhere; }
.insurance-review-reason { margin-top:12px; padding:12px 14px; border:1px solid #e4e8ef; background:#fff; }
.insurance-review-reason p { margin:5px 0 0; color:#475467; line-height:1.6; white-space:pre-wrap; }
.insurance-prior-review { margin-top:12px; padding:12px 14px; border-left:3px solid #4b86d1; background:#f3f7fc; }
.insurance-prior-review > div { display:flex; align-items:baseline; gap:8px; }
.insurance-prior-review small, .insurance-prior-review span { color:#8490a1; }
.insurance-prior-review span { margin-left:auto; font-size:11px; }
.insurance-prior-review p { margin:6px 0 0; color:#475467; }
.insurance-review-comment { margin-top:16px; }
.insurance-review-comment label { font-weight:700; }
.insurance-review-comment .textarea { min-height:110px; margin-top:7px; background:#fff; }
.insurance-review-actions { align-items:center; justify-content:space-between; padding:14px 22px; border-top:1px solid #e4e8ef; background:#fff; }
.insurance-review-actions > div { display:flex; gap:8px; }
.ghost-danger { border-color:#efb6b0; background:#fff; color:#b42318; }
.inspection-summary { display:grid; gap:10px; padding:16px; border:1px solid #dfe4eb; background:#fafbfc; }
.inspection-summary > div { display:flex; flex-wrap:wrap; gap:10px 18px; align-items:center; }
.inspection-summary strong { font-size:20px; }
.inspection-summary span, .inspection-summary small { color:#667085; }
.inspection-summary p { margin:0; color:#475467; }
.inspection-summary.soon { border-color:#f5c78b; background:#fffaf2; }
.inspection-summary.urgent, .inspection-summary.overdue { border-color:#f5aaa4; background:#fff7f6; }
.inspection-summary.urgent strong, .inspection-summary.overdue strong { color:#b42318; }
.postloan-record-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.postloan-record-columns h4 { margin:0 0 10px; }
.postloan-record-columns article { display:grid; gap:4px; padding:11px 12px; border:1px solid #e4e8ef; }
.postloan-record-columns article + article { margin-top:8px; }
.postloan-record-columns article span, .postloan-record-columns article small { color:#667085; font-size:12px; }

@media (max-width: 760px) {
  .vehicle-conflict-row { grid-template-columns:1fr; gap:8px; }
  .vehicle-conflict-row button { justify-self:start; }
  .postloan-record-columns { grid-template-columns:1fr; }
}
.role-chip-picker { display:flex; flex-wrap:wrap; gap:8px; }
.role-chip-picker label { cursor:pointer; }
.role-chip-picker input { position:absolute; opacity:0; pointer-events:none; }
.role-chip-picker span { display:block; padding:8px 13px; border:1px solid #d9dee7; background:#fff; color:#475467; }
.role-chip-picker input:checked + span { border-color:#e85d1c; background:#fff4ed; color:#c7460e; font-weight:700; }

.loan-release-uploads {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.loan-release-cell {
  min-width: 0;
}

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #3d434d;
}

.check-chip input {
  accent-color: var(--brand);
}

.required-mark {
  color: var(--danger);
  margin-left: 3px;
}

.soft-danger-text {
  color: #c26058;
}

.loan-release-sign {
  margin-top: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.loan-sign-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 220px));
  gap: 12px;
}

.loan-sign-done {
  color: var(--success);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.loan-sign-done::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.finance-confirm-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  overflow: hidden;
}

.finance-confirm-panel .section-header.inline {
  border-bottom: 1px solid var(--line);
}

.finance-check-grid {
  padding: 14px 16px 4px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.finance-check {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.finance-check input {
  accent-color: var(--brand);
}

.finance-check span {
  flex: 1;
  min-width: 0;
}

.finance-check em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

.finance-check.available em {
  color: var(--success);
}

.finance-check.missing {
  background: #fff8f7;
  border-color: #f0c9c4;
}

.finance-check.missing em {
  color: var(--danger);
}

/* ---------- 确认弹窗 ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(23, 30, 39, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: overlayIn 140ms ease both;
}

@keyframes overlayIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  width: min(400px, 100%);
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(23, 30, 39, 0.22);
  padding: 20px 22px 18px;
  animation: modalIn 160ms ease both;
}

.modal.wide {
  width: min(720px, 100%);
}

.modal.robot-config-modal {
  width: min(1080px, calc(100vw - 36px));
  height: min(92vh, 900px);
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.robot-config-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.robot-config-head .modal-title {
  margin: 0;
  font-size: 20px;
}

.robot-config-head .modal-title span {
  color: var(--brand);
}

.robot-config-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.icon-close {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.icon-close:hover {
  color: var(--text);
}

.robot-config-body {
  margin: 0;
  padding: 28px;
  overflow: auto;
  background: #f5f7fa;
  display: grid;
  gap: 24px;
  align-content: start;
}

.robot-config-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(23, 30, 39, 0.05);
  padding: 24px;
}

.robot-card-title {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid #d9e8ff;
  margin-bottom: 18px;
}

.robot-card-title strong {
  display: block;
  color: var(--text);
  font-size: 18px;
}

.robot-card-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.robot-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #e8f3ff;
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex: 0 0 auto;
}

.robot-basic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.robot-feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.robot-feature-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid #e3e8ef;
  border-radius: 6px;
  background: #f8fafc;
}

.robot-feature-row > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.robot-feature-row span {
  color: #778396;
  font-size: 13px;
  line-height: 1.45;
}

.robot-command-grid {
  border-top: 1px solid #e8ecf1;
  padding-top: 16px;
}

.permission-note {
  margin-bottom: 16px;
  padding: 11px 14px;
  border-left: 3px solid #a8b2c1;
  background: #f5f7fa;
  color: #687486;
  font-size: 14px;
}

.car300-tabs {
  display: flex;
  gap: 26px;
  overflow-x: auto;
  border-bottom: 1px solid #e1e6ed;
  margin-bottom: 20px;
}

.car300-tabs button {
  flex: 0 0 auto;
  padding: 0 2px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #657286;
  font: inherit;
  cursor: pointer;
}

.car300-tabs button.active {
  border-bottom-color: #e85718;
  color: #d94d12;
  font-weight: 700;
}

.car300-tabs button:disabled {
  color: #a8b0bc;
  cursor: not-allowed;
}

.vehicle-workspace-tabs {
  margin-bottom: 18px;
  padding: 0 4px;
}

.vehicle-workspace-tabs a {
  flex: 0 0 auto;
  padding: 0 2px 12px;
  border-bottom: 2px solid transparent;
  color: #657286;
  text-decoration: none;
}

.vehicle-workspace-tabs a.active {
  border-bottom-color: #e85718;
  color: #d94d12;
  font-weight: 700;
}

.car300-license-upload {
  margin-bottom: 20px;
}

.car300-license-upload .drop-zone {
  min-height: 112px;
}

.car300-license-state {
  margin-top: 10px;
  color: #7c8798;
  font-size: 13px;
}

.car300-license-upload.has-file .car300-license-state {
  color: #1f7a4d;
}

.car300-city-field {
  position: relative;
}

.car300-city-trigger {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0 42px 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.car300-city-trigger span {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.car300-city-trigger small {
  display: none;
}

.car300-city-trigger i {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #7b8797;
  border-bottom: 1.5px solid #7b8797;
  transform: translateY(-70%) rotate(45deg);
}

.car300-city-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid #dbe2ea;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(24, 37, 56, 0.16);
}

.car300-city-popover.is-portal {
  position: fixed;
  z-index: 10050;
  right: auto;
  overflow: hidden;
}

.car300-city-popover.is-portal .car300-city-results {
  max-height: min(320px, calc(100vh - 190px));
}

.car300-query-section,
.car300-query-section .section-body,
.car300-panel {
  overflow: visible;
}

.car300-city-search {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 10px;
  padding: 0 11px;
  border: 1px solid #dce3eb;
  border-radius: 5px;
  background: #f7f9fb;
}

.car300-city-search span {
  color: #d94d12;
  font-size: 12px;
  font-weight: 700;
}

.car300-city-search input {
  width: 100%;
  height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
}

.car300-city-results {
  max-height: 272px;
  overflow-y: auto;
  border-top: 1px solid #edf0f4;
}

.car300-city-results button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  border-bottom: 1px solid #edf0f4;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.car300-city-results button:hover {
  background: #fff8f3;
}

.car300-city-results button span {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.car300-city-results small,
.car300-city-results code {
  color: var(--muted);
  font-size: 12px;
}

.vehicle-evaluation-detail-modal { max-width: 820px; }
.evaluation-detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 20px;
  border-bottom: 1px solid #e4e8ed;
  background: #f7f8fa;
}
.evaluation-detail-hero > div { display: grid; min-width: 0; gap: 5px; }
.evaluation-detail-hero span,
.evaluation-detail-hero small { color: var(--muted); font-size: 12px; }
.evaluation-detail-hero strong {
  overflow: hidden;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.evaluation-detail-hero em {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 4px;
  background: #eaf7ef;
  color: #237d4e;
  font-size: 12px;
  font-style: normal;
}
.evaluation-detail-hero em.pending { background: #fff6dd; color: #9a6700; }
.evaluation-detail-hero em.failed { background: #fff0ef; color: #c33d35; }
.evaluation-detail-section { margin-top: 20px; }
.evaluation-detail-section h4 {
  margin: 0 0 9px;
  padding-left: 9px;
  border-left: 3px solid #e85718;
  font-size: 15px;
}
.evaluation-detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border-top: 1px solid #e3e7ec;
  border-left: 1px solid #e3e7ec;
}
.evaluation-detail-list > div {
  display: grid;
  min-width: 0;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  padding: 12px 14px;
  border-right: 1px solid #e3e7ec;
  border-bottom: 1px solid #e3e7ec;
}
.evaluation-detail-list span { color: var(--muted); font-size: 13px; }
.evaluation-detail-list strong { overflow-wrap: anywhere; font-size: 14px; }
.vehicle-history-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1.7fr) repeat(3, minmax(130px, 0.6fr));
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid #edf0f4;
  border-bottom: 1px solid #edf0f4;
  background: #fafbfc;
}
.history-search-box { position: relative; }
.history-search-box > span {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 12px;
  color: #d94d12;
  font-size: 12px;
  font-weight: 700;
  transform: translateY(-50%);
}
.history-search-box .input { padding-left: 38px; }
.vehicle-history-count {
  padding: 9px 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.evaluation-report-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 16px;
  border-left: 3px solid #e85718;
  background: #fff7f2;
}

.evaluation-report-box div {
  display: grid;
  gap: 5px;
}

.evaluation-report-box span {
  color: var(--muted);
  font-size: 13px;
}

.business-config-panel {
  display: grid;
  gap: 14px;
}

.business-config-panel .robot-feature-row {
  padding: 14px 16px;
  border: 1px solid #e1e6ec;
  border-radius: 5px;
  background: #fafbfc;
}

.business-image-mode-field {
  margin: 0;
}

.business-image-mode-head,
.business-private-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.business-private-switch {
  justify-content: flex-end;
  color: #66758a;
  font-size: 13px;
}

.business-image-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.business-image-mode label {
  cursor: pointer;
}

.business-image-mode input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.business-image-mode span {
  display: grid;
  gap: 4px;
  min-height: 66px;
  padding: 12px 14px;
  border: 1px solid #dfe5ec;
  border-radius: 5px;
  background: #fff;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.business-image-mode strong {
  color: #263241;
  font-size: 14px;
}

.business-image-mode small {
  color: #7a8798;
  line-height: 1.45;
}

.business-image-mode input:checked + span {
  border-color: #e85718;
  background: #fff7f2;
  box-shadow: inset 3px 0 0 #e85718;
}

@media (max-width: 720px) {
  .business-image-mode {
    grid-template-columns: 1fr;
  }
}

.business-city-trigger {
  min-height: 44px;
  padding-top: 0;
  padding-bottom: 0;
  background: #fafbfc;
}

.robot-variable-box button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.robot-variable-box button code { color: #d94d12; }
.robot-variable-box button span { color: #66758a; font-size: 12px; }

@media (max-width: 900px) {
  .vehicle-history-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(120px, 0.45fr);
  }
  .evaluation-detail-list { grid-template-columns: 1fr; }
}

.business-config-panel[hidden] {
  display: none;
}

.business-command-field,
.business-city-field {
  position: relative;
}

.business-command-editor {
  display: grid;
  gap: 9px;
}

.business-command-editor > div:last-child {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.business-command-list {
  display: flex;
  min-height: 28px;
  flex-wrap: wrap;
  gap: 7px;
}

.business-command-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 10px;
  border: 1px solid #f2c7b2;
  border-radius: 5px;
  background: #fff7f2;
  color: #b94312;
  font-size: 13px;
}

.business-command-chip button {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #9a6d58;
  cursor: pointer;
}

.business-variable-box {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #e2e7ed;
  border-radius: 5px;
  background: #f8fafc;
}

.business-variable-box button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.business-variable-box code {
  color: #d94d12;
}

.business-variable-box button span {
  color: #64748b;
}

.business-group-picker {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid #e2e7ed;
  border-radius: 5px;
  background: #f8fafc;
}

.textarea.compact {
  min-height: 88px;
}

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

.billing-price-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.billing-price-card > span {
  font-weight: 700;
}

.billing-price-card > div {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 8px;
}

.billing-price-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.billing-price-grid > .actions {
  grid-column: 1 / -1;
}

@media (max-width: 760px) {
  .billing-price-grid { grid-template-columns: 1fr; }
  .evaluation-detail-grid { grid-template-columns: 1fr; }
  .evaluation-report-box { align-items: stretch; flex-direction: column; }
}

.car300-panel .actions {
  margin-top: 16px;
}

.car300-history {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e1e6ed;
}

.car300-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.car300-history-header > div {
  display: grid;
  gap: 4px;
}

.car300-history-header span,
.car300-log-list small {
  color: #7a8595;
  font-size: 13px;
}

.car300-log-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.car300-log-list > div:not(.empty) {
  display: grid;
  grid-template-columns: minmax(130px, .7fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e5e9ef;
  border-radius: 5px;
  background: #fafbfc;
}

.car300-log-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.result-summary-grid > span,
.query-state-card {
  display: grid;
  gap: 6px;
  padding: 15px;
  border: 1px solid #e2e7ee;
  border-radius: 6px;
  background: #f8fafc;
}

.result-summary-grid small,
.query-state-card p {
  color: #7a8595;
}

.car300-result-modal {
  width: min(860px, calc(100vw - 32px));
}

@media (max-width: 760px) {
  .robot-feature-list {
    grid-template-columns: 1fr;
  }

  .result-summary-grid {
    grid-template-columns: 1fr;
  }

  .car300-log-list {
    grid-template-columns: 1fr;
  }

  .car300-log-list > div:not(.empty) {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.robot-template-tabs {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  overflow-x: auto;
}

.robot-template-tabs button {
  border: 0;
  background: transparent;
  padding: 0 0 12px;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.robot-template-tabs button.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.robot-template-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 24px;
}

.robot-template-toolbar {
  margin-bottom: 14px;
}

.robot-template-toolbar strong {
  color: var(--text);
  font-size: 17px;
}

.robot-template-toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.robot-template-editor {
  min-height: 260px;
  resize: vertical;
  background: #fff;
  font-family: Consolas, "Microsoft YaHei", sans-serif;
  line-height: 1.7;
}

.robot-variable-box {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.robot-variable-box strong {
  color: var(--text);
  font-size: 13px;
}

.robot-variable-box div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.robot-variable-box button {
  border: 1px solid #cfe2ff;
  background: #eef6ff;
  color: var(--brand);
  border-radius: 5px;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 12px;
}

.robot-variable-box button:hover {
  background: #e0efff;
}

.robot-delivery-box {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid #dfe6ef;
  background: #f8fafc;
  border-radius: 6px;
}

.robot-delivery-box > strong { display: block; margin-bottom: 12px; }
.choice-row { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 14px; }
.choice-row label, .check-line { display: flex; align-items: center; gap: 8px; }
.robot-group-picker { max-height: 190px; overflow: auto; display: grid; gap: 8px; }
.robot-group-picker label, .task-target-picker label { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid #e2e8f0; background: white; border-radius: 5px; }
.robot-group-picker code, .task-target-picker code, .contact-main code { color: #64748b; font-size: 12px; }

.contact-toolbar { display: grid; grid-template-columns: minmax(220px, 1.3fr) minmax(180px, 1fr) 150px 170px; gap: 12px; padding: 16px; margin-bottom: 16px; }
.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.contact-main { min-width: 0; }
.contact-side { display: grid; gap: 16px; }
.contact-batch-bar { min-height: 52px; padding: 10px 14px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #e7ebf0; }
.contact-batch-bar > span { color: #64748b; margin-right: auto; }
.contact-type { display: inline-flex; min-width: 48px; justify-content: center; padding: 3px 7px; border-radius: 4px; font-size: 12px; }
.contact-type.group { color: #1d4ed8; background: #eff6ff; }
.contact-type.contact { color: #0f766e; background: #ecfdf5; }
.contact-group-list, .task-list { display: grid; gap: 8px; }
.task-item { display: grid; gap: 7px; padding: 12px; border: 1px solid #e3e8ef; background: #fff; border-radius: 6px; }
.task-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.task-item-actions { display: flex; gap: 8px; }
.task-schedule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; padding: 9px; background: #f7f9fc; border-radius: 5px; }
.task-schedule-grid span { display: grid; gap: 2px; min-width: 0; }
.task-schedule-grid b { color: #7a8494; font-size: 11px; font-weight: 500; }
.task-schedule-grid em { color: #d95720; font-style: normal; font-variant-numeric: tabular-nums; }
.task-status { font-size: 12px; line-height: 1.5; padding: 2px 7px; border-radius: 4px; background: #eef4ff; color: #2867a8; }
.task-status.done { background: #eaf7ef; color: #247447; }
.task-status.failed { background: #fff0ed; color: #b63b28; }
.task-status.paused { background: #f1f3f6; color: #687386; }
.task-option-row { display: flex; flex-wrap: wrap; gap: 20px; margin: 10px 0; }
.task-recipient-section { margin-top: 14px; padding: 12px; border: 1px solid #e3e8ef; background: #f8fafc; border-radius: 6px; }
.task-recipient-section > p { color: #7a8494; font-size: 13px; margin: 4px 0 10px; }
.task-group-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.task-group-picker label { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; background: #fff; border: 1px solid #dce3ec; border-radius: 5px; }
.task-repeat-summary { color: #697586; font-size: 13px; min-height: 20px; margin-bottom: 6px; }
.task-run-detail { display: grid; gap: 5px; margin-top: 14px; padding: 12px; background: #f5f7fa; border-radius: 6px; color: #596477; }
.task-variable-panel { margin: 8px 0 14px; padding: 12px; border: 1px solid #dde5ee; border-radius: 6px; background: #f8fafc; }
.task-variable-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.task-variable-head span { color: #778397; font-size: 13px; }
.task-variable-list { display: flex; flex-wrap: wrap; gap: 8px; }
.task-variable-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 9px; border: 1px solid #d9e2ec; border-radius: 5px; background: #fff; color: #354052; cursor: pointer; }
.task-variable-chip:hover { border-color: #ed6a2c; background: #fff8f4; }
.task-variable-chip code { color: #d9541b; font-weight: 700; }
.task-variable-chip span { color: #788497; font-size: 12px; }
.task-variable-examples { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; color: #697586; font-size: 13px; }
.task-variable-examples code { color: #344155; }
.task-template-preview { margin: 0 0 14px; padding: 12px; border-left: 3px solid #ed6a2c; background: #fff8f4; color: #596477; }
.task-template-preview > strong { display: block; margin-bottom: 8px; color: #273142; }
.task-template-preview p { display: grid; grid-template-columns: minmax(90px, 160px) 1fr; gap: 10px; margin: 5px 0; }
.task-template-preview p b { overflow: hidden; color: #344155; text-overflow: ellipsis; white-space: nowrap; }
.task-template-preview p span { white-space: pre-wrap; overflow-wrap: anywhere; }
.task-template-preview small { display: block; margin-top: 8px; color: #8993a2; }
.modal.wide.contact-task-modal {
  width: min(920px, calc(100vw - 40px));
  height: min(90vh, 900px);
  max-height: calc(100dvh - 40px);
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}
.contact-task-modal > .modal-title {
  margin: 0;
  padding: 17px 22px 14px;
  border-bottom: 1px solid #e4e9ef;
  background: #fff;
}
.contact-task-modal > .modal-body {
  min-height: 0;
  margin: 0;
  padding: 18px 22px 22px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.contact-task-modal > .modal-actions {
  padding: 13px 22px;
  border-top: 1px solid #e4e9ef;
  background: #fff;
  box-shadow: 0 -5px 16px rgba(35, 45, 60, .05);
}
@media (max-width: 720px) {
  .driver-recognition-grid { grid-template-columns:1fr 1fr; }
  .insurance-loan-item { grid-template-columns:1fr auto; }
  .insurance-loan-item .actions { grid-column:1/-1; }
  .post-loan-insurance-summary > div:first-child { display:grid; }
  .post-loan-insurance-summary .insurance-expiry-strip { justify-content:flex-start; }
  .transfer-receipt-panel { grid-template-columns:1fr; }
  .transfer-receipt-files { grid-column:auto; }
  .loan-account-head { align-items:flex-start; flex-direction:column; }
  .task-variable-head { align-items: flex-start; flex-direction: column; }
  .task-variable-chip span { display: none; }
  .task-template-preview p { grid-template-columns: 1fr; gap: 2px; }
  .modal.wide.contact-task-modal {
    width: 100%;
    height: calc(100dvh - 20px);
    max-height: calc(100dvh - 20px);
    padding: 0;
    overflow: hidden;
  }
  .contact-task-modal > .modal-title,
  .contact-task-modal > .modal-body,
  .contact-task-modal > .modal-actions { padding-left: 16px; padding-right: 16px; }
}
.xbox-switch { display: inline-flex; vertical-align: middle; cursor: pointer; }
.xbox-switch input { position: absolute; opacity: 0; pointer-events: none; }
.xbox-switch-track { position: relative; width: 48px; height: 26px; border-radius: 13px; background: #aeb7c4; transition: background .18s ease; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.xbox-switch-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: #8791a0; font-size: 10px; font-weight: 800; transition: transform .18s ease, color .18s ease; box-shadow: 0 1px 4px rgba(15,23,42,.22); }
.xbox-switch input:checked + .xbox-switch-track { background: #29a45c; }
.xbox-switch input:checked + .xbox-switch-track .xbox-switch-knob { transform: translateX(22px); color: #239153; }
.xbox-switch input:focus-visible + .xbox-switch-track { outline: 2px solid #2d78c4; outline-offset: 2px; }
.robot-state-text { display: inline-block; margin-left: 8px; color: #7a8494; font-size: 13px; }
.robot-state-text.enabled { color: #25834d; }
.contact-group-item { border: 1px solid #e3e8ef; background: #fff; border-radius: 6px; overflow: hidden; }
.contact-group-item summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; cursor: pointer; font-weight: 600; }
.contact-group-item summary b { color: #2d78c4; font-size: 12px; }
.contact-group-meta { padding: 0 10px 8px; color: #7a8494; font-size: 12px; }
.contact-group-members { display: grid; gap: 6px; padding: 8px 10px; border-top: 1px solid #edf0f4; background: #f8fafc; }
.contact-group-members > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; padding: 7px; background: #fff; border-radius: 4px; }
.contact-group-members code { grid-column: 1 / -1; color: #7a8494; font-size: 11px; overflow-wrap: anywhere; }
.contact-group-members .btn { grid-column: 2; grid-row: 1; }
.contact-group-item > .btn { margin: 8px 10px 10px; }
.quick-group-select { min-width: 108px; height: 34px; padding: 5px 28px 5px 8px; font-size: 12px; }
.task-item span { color: #64748b; font-size: 12px; }
.task-item-actions .btn { justify-self: auto; }
.task-target-picker { max-height: 260px; overflow: auto; display: grid; gap: 8px; margin-top: 12px; }
.contact-sync-hint { margin-top: 12px; }
.empty.compact { padding: 12px; }

.robot-config-modal .modal-actions {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: #fff;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}

.modal-body {
  color: #4a505b;
  line-height: 1.7;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.analytics-grid {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}

.post-loan-stat-grid,
.profit-stat-grid {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}

.analytics-panel,
.post-loan-card {
  margin-bottom: 16px;
}

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

.chart-panel {
  overflow: hidden;
}

.chart-body {
  padding: 16px 18px;
  min-height: 190px;
}

.empty.compact {
  padding: 46px 12px;
}

.chart-row {
  display: grid;
  grid-template-columns: 118px minmax(120px, 1fr) 92px;
  gap: 10px;
  align-items: center;
  min-height: 30px;
}

.chart-label {
  color: #4d5663;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-track {
  height: 9px;
  background: #eef2f6;
  border-radius: 999px;
  overflow: hidden;
}

.chart-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f6fb0, #dd5a13);
}

.chart-value {
  color: #5f6b7c;
  font-size: 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.trend-chart {
  height: 142px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  align-items: end;
}

.trend-item {
  min-width: 0;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.trend-bars {
  height: 112px;
  display: flex;
  align-items: end;
  gap: 4px;
}

.trend-bars span {
  width: 12px;
  min-height: 6px;
  border-radius: 4px 4px 0 0;
}

.trend-bars .intake,
.chart-legend .intake {
  background: #2f6fb0;
}

.trend-bars .disbursed,
.chart-legend .disbursed {
  background: #dd5a13;
}

.trend-label,
.chart-legend {
  color: var(--muted);
  font-size: 12px;
}

.chart-legend {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.chart-legend span {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.post-loan-workbench {
  padding: 16px;
}

.post-loan-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px 160px;
  gap: 10px;
  align-items: center;
}

.post-loan-list {
  display: grid;
  gap: 14px;
}

.post-loan-card {
  border-left: 3px solid #7d98b6;
}
.post-loan-card.follow-soon { border-left-color: #e0a126; box-shadow: 0 0 0 1px rgba(224, 161, 38, .18), var(--shadow-card); }
.post-loan-card.follow-urgent { border-left-color: #e9682d; background: #fffaf6; box-shadow: 0 0 0 1px rgba(233, 104, 45, .22), var(--shadow-card); }
.post-loan-card.follow-overdue { border-left-color: #c83e32; background: #fff8f7; box-shadow: 0 0 0 1px rgba(200, 62, 50, .26), var(--shadow-card); }

.post-loan-card .section-header {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.post-loan-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.post-loan-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 4px;
}

.modal-grid {
  margin-top: 14px;
}

.profit-table td:nth-child(8) {
  font-weight: 700;
}

.repayment-wrap {
  margin-top: 14px;
}
.latest-follow-preview { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-top: 14px; padding: 10px 12px; border: 1px solid #e3e8ef; border-radius: 6px; background: #f8fafc; }
.latest-follow-preview strong { color: #344155; font-size: 13px; }
.latest-follow-preview span { overflow-wrap: anywhere; }
.latest-follow-preview small { color: #8490a1; }
.rule-date-preview { display: grid; min-height: 44px; padding: 8px 11px; border: 1px solid #d7dee8; border-radius: 5px; background: #f8fafc; }
.rule-date-preview strong { color: #d95720; }
.rule-date-preview span { color: #7b8798; font-size: 12px; }
.modal.wide.post-loan-history-modal { width: min(860px, calc(100vw - 40px)); height: min(86vh, 780px); padding: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
.post-loan-history-modal > .modal-title { margin: 0; padding: 17px 22px 14px; border-bottom: 1px solid var(--line); }
.post-loan-history-modal > .modal-body { min-height: 0; margin: 0; padding: 18px 22px; overflow-y: auto; }
.post-loan-history-modal > .modal-actions { padding: 13px 22px; border-top: 1px solid var(--line); }
.history-summary { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; padding: 12px 14px; background: #f5f7fa; border-radius: 6px; }
.history-summary strong { color: #d95720; font-size: 24px; }
.history-summary small { margin-left: auto; color: #7c8798; }
.follow-history-list, .location-history-list { display: grid; gap: 10px; }
.follow-history-item { border: 1px solid #dfe6ee; border-radius: 6px; overflow: hidden; background: #fff; }
.follow-history-item summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; cursor: pointer; }
.follow-history-item summary div { display: grid; min-width: 0; }
.follow-history-item summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.follow-history-item summary span { color: #8490a1; font-size: 12px; }
.follow-history-item summary em { color: #d95720; font-size: 12px; font-style: normal; white-space: nowrap; }
.follow-history-detail { padding: 12px 14px; border-top: 1px solid #e7ebf0; background: #f8fafc; }
.location-history-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 14px; border: 1px solid #dfe6ee; border-radius: 6px; background: #fff; }
.location-history-item > div { display: grid; gap: 3px; min-width: 0; }
.location-history-item span { color: #788496; font-size: 12px; }
.location-history-item code { color: #596779; font-size: 12px; }

/* ---------- 响应式 ---------- */

/* ---------- 小程序信息管理 ---------- */
.mini-program-summary { display: flex; gap: 10px; }
.mini-program-summary span { min-width: 92px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); font-size: 12px; }
.mini-program-summary b { color: var(--text); font-size: 17px; margin-right: 4px; }
.mini-program-admin { overflow: hidden; }
.mini-program-tabs { display: flex; gap: 26px; padding: 0 20px; border-bottom: 1px solid var(--line); background: #fff; overflow-x: auto; }
.mini-program-tabs button { height: 52px; padding: 0 2px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #667085; white-space: nowrap; }
.mini-program-tabs button.active { border-bottom-color: var(--brand); color: var(--brand); font-weight: 700; }
.mini-program-tab-body { padding: 20px; }
.mini-tab-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.mini-tab-toolbar strong { display: block; font-size: 16px; }
.mini-tab-toolbar p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.mini-vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.mini-vehicle-item { border: 1px solid var(--line); border-radius: 7px; background: #fff; overflow: hidden; }
.mini-vehicle-thumb { height: 150px; background: #e9edf2; position: relative; display: grid; place-items: center; color: #728092; font-weight: 700; overflow: hidden; }
.mini-vehicle-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mini-vehicle-thumb em { position: absolute; left: 10px; top: 10px; padding: 4px 8px; border-radius: 4px; background: rgba(29, 38, 50, .78); color: #fff; font-size: 11px; font-style: normal; }
.mini-vehicle-copy { display: flex; flex-direction: column; gap: 5px; padding: 14px; }
.mini-vehicle-copy strong { font-size: 15px; }
.mini-vehicle-copy span { color: var(--muted); font-size: 12px; }
.mini-vehicle-copy b { color: var(--brand); font-size: 20px; }
.mini-vehicle-item > .actions { padding: 0 14px 14px; }
.mini-activity-list { display: grid; gap: 10px; }
.mini-activity-item { display: grid; grid-template-columns: 42px minmax(180px, 1fr) auto auto auto; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 7px; }
.mini-activity-item p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.mini-activity-item > em { padding: 4px 8px; border-radius: 4px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-style: normal; }
.mini-activity-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 7px; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.mini-settings-form .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mini-field-config { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mini-field-config > strong { grid-column: 1 / -1; }
.mini-field-config label { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; }
.mini-field-config label span { margin-right: auto; font-weight: 600; }

.modal:has(#miniVehicleForm) {
  width: min(980px, calc(100vw - 32px));
  max-height: min(92vh, 860px);
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.modal:has(#miniVehicleForm) > .modal-title {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
}

.modal:has(#miniVehicleForm) > .modal-body {
  max-height: none;
  padding: 20px 24px;
  overflow: auto;
  background: #fafbfc;
}

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

#miniVehicleForm .field {
  padding: 0;
}

#miniVehicleForm .field.span-2 {
  grid-column: span 2;
}

#miniVehicleForm .field:has(#miniVehicleImageFile) {
  grid-column: 1 / -1;
  padding: 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 7px;
  background: #fff;
}

#miniVehicleForm .field:has(#miniVehicleImageFile)::before {
  content: "上传车辆实拍图后，小程序会优先展示上传图片";
  color: var(--muted);
  font-size: 12px;
  order: 2;
}

#miniVehicleImageFile {
  width: 100%;
  max-width: 100%;
  min-height: 42px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: #667085;
  overflow: hidden;
  box-sizing: border-box;
  order: 3;
}

#miniVehicleImageFile::file-selector-button {
  height: 28px;
  margin-right: 10px;
  padding: 0 14px;
  border: 0;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand);
  cursor: pointer;
}

#miniVehicleForm > .check-line {
  grid-column: 1 / -1;
  width: fit-content;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fff7ed;
}

.modal:has(#miniVehicleForm) > .modal-actions {
  margin: 0;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: #fff;
}

@media (max-width: 1100px) {
  .contact-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-layout { grid-template-columns: 1fr; }
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .mobile-nav {
    position: sticky;
    top: 52px;
    z-index: 4;
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    box-shadow: 0 6px 18px rgba(31, 35, 41, 0.05);
    scrollbar-width: thin;
    scrollbar-color: #c9d3df transparent;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    cursor: grab;
  }

  .mobile-nav::-webkit-scrollbar { display: block; height: 5px; }
  .mobile-nav::-webkit-scrollbar-thumb { border-radius: 999px; background: #c9d3df; }

  .mobile-nav a {
    flex: 0 0 auto;
    min-height: 34px;
    color: #596576;
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 12px;
    background: #fff;
    scroll-snap-align: start;
  }

  .mobile-nav a .nav-icon {
    width: 18px;
    height: 18px;
  }

  .mobile-nav a.active {
    color: var(--brand);
    background: var(--brand-soft);
    border-color: var(--brand-border);
    font-weight: 700;
  }

  .grid,
  .detail-list {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .post-loan-stat-grid,
  .profit-stat-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .analytics-chart-grid {
    grid-template-columns: 1fr;
  }

  .post-loan-toolbar {
    grid-template-columns: 1fr;
  }

  .finance-check-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .upload-grid,
  .loan-release-grid {
    grid-template-columns: 1fr;
  }

  .smart-fill-panel {
    grid-template-columns: 1fr;
  }

  .smart-fill-head {
    align-items: flex-start;
  }

  .sticky-action-bar {
    top: 0;
  }

  .app-shell.is-secondary-route .page {
    padding-top: 146px;
  }

  .app-shell.is-secondary-route .sticky-action-bar {
    left: 0;
    padding: 14px 16px 0;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 15px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .mobile-nav {
    position: sticky;
    top: 54px;
    z-index: 4;
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    box-shadow: 0 6px 18px rgba(31, 35, 41, 0.05);
    scrollbar-width: thin;
    scrollbar-color: #c9d3df transparent;
    overscroll-behavior-inline: contain;
  }

  .mobile-nav::-webkit-scrollbar { display: block; height: 5px; }
  .mobile-nav::-webkit-scrollbar-thumb { border-radius: 999px; background: #c9d3df; }

  .mobile-nav a {
    flex: 0 0 auto;
    min-height: 34px;
    color: #596576;
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 11px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 12px;
    background: #fff;
  }

  .mobile-nav a .nav-icon {
    width: 18px;
    height: 18px;
  }

  .mobile-nav a.active {
    color: var(--brand);
    background: var(--brand-soft);
    border-color: var(--brand-border);
    font-weight: 700;
  }

  .topbar {
    min-height: 54px;
    height: auto;
    padding: 0 16px;
  }

  .topbar-title {
    display: none;
  }

  .topbar-user {
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 0;
  }

  .user-name {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page {
    padding: 12px;
  }

  .app-shell.is-secondary-route .page {
    padding-top: 178px;
  }

  .app-shell.is-secondary-route .sticky-action-bar {
    left: 0;
    padding: 10px 12px 0;
  }

  .sticky-action-bar .page-header {
    align-items: flex-start;
  }

  .sticky-action-bar .page-header .actions {
    width: 100%;
  }

  .sticky-action-bar .page-header .actions .btn {
    flex: 1 1 auto;
  }

  .page-header {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
  }

  .page-title {
    font-size: 18px;
  }

  .page-subtitle {
    font-size: 12px;
  }

  .grid,
  .grid.two,
  .detail-list,
  .stat-grid,
  .finance-check-grid,
  .loan-sign-fields {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    gap: 8px;
  }

  .analytics-grid,
  .stat-grid.analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-row {
    grid-template-columns: 92px minmax(80px, 1fr) 76px;
  }

  .stat-card {
    padding: 10px 12px;
  }

  .stat-value {
    font-size: 20px;
  }

  .toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 8px;
    align-items: center;
  }

  .toolbar .input,
  .toolbar .select {
    max-width: none !important;
    min-height: 34px;
    font-size: 13px;
    padding: 5px 9px;
  }

  .toolbar .input {
    min-width: 0;
  }

  .tabs {
    overflow-x: auto;
    margin: 0 -12px 14px;
    padding: 0 12px;
  }

  .tab-button {
    flex: 0 0 auto;
    min-width: 96px;
    padding: 11px 12px;
  }

  .section {
    margin-bottom: 12px;
  }

  .section-header {
    padding: 12px 14px;
  }

  .section-body {
    padding: 14px;
  }

  .input,
  .select {
    min-height: 42px;
  }

  .textarea {
    min-height: 96px;
  }

  .btn {
    min-height: 38px;
  }

  .btn.small {
    min-height: 34px;
    padding: 0 10px;
  }

  .table-wrap {
    overflow-x: auto;
  }

  .application-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .application-table thead {
    display: none;
  }

  .application-table tbody,
  .application-table tr,
  .application-table td {
    display: block;
    width: 100%;
  }

  .application-table tr {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
  }

  .application-table tr:hover td {
    background: #fff;
  }

  .application-table td {
    min-height: 42px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
  }

  .application-table td:last-child {
    border-bottom: 0;
  }

  .application-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
  }

  .application-table td[data-label="操作"] {
    grid-template-columns: 1fr;
  }

  .application-table td[data-label="操作"]::before {
    display: none;
  }

  .actions {
    gap: 8px;
  }

  .application-table td[data-label="操作"] .actions .btn {
    flex: 1 1 calc(50% - 8px);
  }

  .compact-table {
    min-width: 620px;
  }

  .analytics-panel .section-header,
  .post-loan-card .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .upload-box {
    padding: 12px;
  }

  .drop-zone {
    min-height: 82px;
  }

  .file-list li {
    align-items: flex-start;
    flex-direction: column;
  }

  .file-row-main {
    width: 100%;
  }

  .file-thumb {
    width: 52px;
    height: 52px;
  }

  .todo-list {
    grid-template-columns: 1fr;
  }

  .finance-confirm-panel .actions,
  .loan-sign-area .actions,
  .modal-actions,
  .form-footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 10px;
  }

  .modal,
  .modal.wide {
    width: 100%;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    padding: 18px 16px;
  }

  .form-footer {
    padding: 12px 16px;
  }

  .login-card {
    padding: 28px 22px 24px;
  }
}

/* Account and role permission center */
.account-page-header { margin-bottom: 14px; }
.account-tabs {
  display: flex;
  gap: 24px;
  min-height: 46px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.account-tab {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 4px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.account-tab.active { color: var(--primary); }
.account-tab.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: var(--primary);
}
.security-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.security-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.security-summary span { color: var(--muted); font-size: 13px; }
.security-summary strong { font-size: 24px; }
.account-table-panel { overflow: hidden; }
.account-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.account-toolbar > div { display: flex; align-items: baseline; gap: 10px; }
.account-toolbar span { color: var(--muted); font-size: 12px; }
.account-toolbar .input { width: min(280px, 40vw); }
.account-table { min-width: 1040px; }
.account-identity { display: flex; align-items: center; gap: 10px; }
.account-identity > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  color: var(--primary);
  background: #fff2ea;
  font-weight: 700;
}
.account-identity div { display: grid; gap: 2px; }
.account-identity small,
.account-id-preview { display: block; max-width: 220px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.password-value { color: #374151; font-family: Consolas, monospace; background: #f5f7fa; padding: 4px 7px; border-radius: 4px; }
.password-cell { display: flex; align-items: center; gap: 8px; min-width: 132px; }
.password-cell .password-value { min-width: 72px; overflow-wrap: anywhere; }
.system-settings-panel { margin-top: 18px; }
.system-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}
.system-settings-head > div { display: grid; gap: 6px; }
.system-settings-head strong { font-size: 18px; }
.system-settings-head span { color: var(--muted); }
.settings-group {
  margin: 0;
  padding: 22px 24px 24px;
  border: 0;
  border-bottom: 1px solid var(--border);
}
.settings-group legend {
  width: 100%;
  padding: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}
.configured-mark {
  margin-left: 8px;
  color: #17884b;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
}
.settings-actions {
  display: flex;
  justify-content: flex-end;
  padding: 20px 24px;
}
.backup-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 20px 24px 24px;
}
.backup-summary > div {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.backup-summary span { color: var(--muted); font-size: 13px; }
.backup-summary strong { overflow-wrap: anywhere; }
.runtime-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.audit-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.audit-table th, .audit-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
}
.audit-table th { color: var(--muted); background: var(--soft); font-weight: 600; }
@media (max-width: 760px) {
  .settings-grid, .backup-summary, .runtime-summary { grid-template-columns: 1fr; }
  .system-settings-head { align-items: flex-start; flex-direction: column; }
}
.id-count { display: inline-block; margin-bottom: 3px; color: #2563a8; font-size: 12px; }
.protected-label { color: var(--muted); font-size: 12px; }
.danger-text { color: #c53b32 !important; }
.status-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.status-switch > span {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 10px;
  background: #cfd6df;
  transition: background .18s ease;
}
.status-switch > span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(15 23 42 / 22%);
  transition: transform .18s ease;
}
.status-switch.on > span { background: #2f9d72; }
.status-switch.on > span::after { transform: translateX(16px); }
.status-switch b { font-size: 12px; font-weight: 500; }
.status-switch:disabled { cursor: not-allowed; opacity: .55; }
.xbox-switch.readonly {
  cursor: default;
  opacity: .72;
}
.readonly-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.readonly-fieldset:disabled .btn[type="submit"] {
  display: none;
}
.permission-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.role-list-panel,
.permission-panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.role-list-title { display: flex; align-items: center; justify-content: space-between; padding: 17px 16px 12px; }
.role-list-title span { color: var(--muted); font-size: 12px; }
.role-list { display: grid; gap: 4px; padding: 0 8px 10px; }
.role-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 62px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.role-card:hover { background: #f7f9fc; }
.role-card.active { border-color: #f4b48f; background: #fff5ef; }
.role-card-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 5px; color: #2563a8; background: #eef5fc; font-weight: 700; }
.role-card.active .role-card-icon { color: var(--primary); background: #ffe8db; }
.role-card > span:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.role-card small { color: var(--muted); }
.role-card em { color: #78879a; font-size: 11px; font-style: normal; }
.permission-panel { overflow: hidden; }
.permission-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.permission-title { display: flex; align-items: center; gap: 8px; }
.permission-title strong { font-size: 18px; }
.permission-title span { color: #a45b1e; background: #fff1df; padding: 3px 7px; border-radius: 3px; font-size: 11px; }
.permission-panel-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.permission-warning { margin: 16px 20px 0; padding: 11px 13px; border-left: 3px solid var(--primary); background: #fff7f2; color: #81452b; font-size: 13px; }
.permission-groups { padding: 4px 20px 88px; }
.permission-group { padding: 18px 0; border-bottom: 1px solid var(--line); }
.permission-group:last-child { border-bottom: 0; }
.permission-group-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.permission-group-head > div { display: grid; gap: 3px; }
.permission-group-head span { color: var(--muted); font-size: 12px; }
.permission-group-head label { color: var(--muted); font-size: 12px; white-space: nowrap; }
.permission-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.permission-chip { position: relative; cursor: pointer; }
.permission-chip input { position: absolute; opacity: 0; pointer-events: none; }
.permission-chip span { display: block; min-width: 74px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; background: #fafbfc; text-align: center; color: #526173; font-size: 13px; }
.permission-chip.checked span { border-color: #ef9b6b; background: #fff3ec; color: var(--primary); }
.permission-chip:has(input:disabled) { cursor: default; }
.permission-actions { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--line); background: rgb(255 255 255 / 96%); box-shadow: 0 -8px 20px rgb(31 45 61 / 6%); }
.permission-actions span { color: var(--muted); font-size: 13px; }
.account-editor-modal { max-width: 680px; }
.account-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.account-editor-grid .span-2 { grid-column: 1 / -1; }
.account-enabled { display: flex; align-items: center; gap: 8px; min-height: 42px; }

@media (max-width: 980px) {
  .security-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .permission-layout { grid-template-columns: 210px minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .security-summary { grid-template-columns: 1fr 1fr; }
  .security-summary > div { padding: 12px; }
  .security-summary strong { font-size: 20px; }
  .account-toolbar { align-items: stretch; flex-direction: column; }
  .account-toolbar .input { width: 100%; }
  .permission-layout { grid-template-columns: 1fr; }
  .role-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .role-card { grid-template-columns: 32px minmax(0, 1fr); }
  .role-card em { display: none; }
  .permission-panel-head { flex-direction: column; }
  .permission-group-head { align-items: flex-start; }
  .account-editor-grid { grid-template-columns: 1fr; }
  .account-editor-grid .span-2 { grid-column: 1; }
}

@media (max-width: 760px) {
  .mini-program-summary { width: 100%; overflow-x: auto; }
  .mini-program-summary span { flex: 0 0 auto; }
  .mini-program-tab-body { padding: 14px; }
  .mini-tab-toolbar { align-items: flex-start; }
  .mini-vehicle-grid { grid-template-columns: 1fr; }
  .mini-activity-item { grid-template-columns: 42px minmax(0, 1fr); }
  .mini-activity-item > em,
  .mini-activity-item > .task-status,
  .mini-activity-item > .actions { grid-column: 2; }
  .mini-settings-form .grid,
  .mini-field-config { grid-template-columns: 1fr; }
  .modal:has(#miniVehicleForm) {
    width: 100%;
    max-height: calc(100vh - 20px);
  }
  #miniVehicleForm {
    grid-template-columns: 1fr;
  }
  #miniVehicleForm .field.span-2,
  #miniVehicleForm .field:has(#miniVehicleImageFile) {
    grid-column: 1;
  }
  .modal:has(#miniVehicleForm) > .modal-title,
  .modal:has(#miniVehicleForm) > .modal-body,
  .modal:has(#miniVehicleForm) > .modal-actions {
    padding-left: 16px;
    padding-right: 16px;
  }
}
/* Insurance document recognition */
.loan-total-field .input[readonly] {
  color: #1d2935;
  font-weight: 700;
  background: #f3f5f6;
}

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

.insurance-document-column,
.loan-insurance-block {
  min-width: 0;
}

.insurance-recognition-panel,
.loan-insurance-block {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid #dfe4e8;
  background: #f8fafb;
  border-radius: 6px;
}

.insurance-recognition-title,
.loan-insurance-head strong {
  color: #202a33;
  font-size: 15px;
  font-weight: 700;
}

.insurance-recognition-empty {
  min-height: 78px;
  margin-top: 12px;
  padding: 18px;
  color: #7a8691;
  line-height: 1.7;
  background: #fff;
  border: 1px dashed #d5dce1;
}

.insurance-recognition-grid,
.loan-amount-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.insurance-recognition-grid .detail-item,
.loan-amount-summary .detail-item,
.loan-insurance-block .detail-item {
  min-width: 0;
}

.insurance-recognized-at {
  display: block;
  margin-top: 12px;
}

.insurance-recognition-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #dfe4e8;
}

.insurance-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.insurance-edit-grid .field {
  min-width: 0;
}

.insurance-edit-grid .field.full {
  grid-column: 1 / -1;
}

.insurance-edit-grid .field label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.insurance-name-warning {
  color: #c33b31;
  font-size: 12px;
  font-weight: 500;
}

.insurance-textarea {
  min-height: 76px;
}

.insurance-coverage-table {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #dfe4e8;
  overflow-x: auto;
}

.insurance-coverage-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.insurance-coverage-title > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.insurance-coverage-title span {
  color: #7a8691;
  font-size: 12px;
}

.insurance-coverage-header,
.insurance-coverage-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.5fr) minmax(115px, 1fr) minmax(95px, .8fr) minmax(95px, .8fr) minmax(150px, 1.4fr) 34px;
  gap: 8px;
  align-items: center;
  min-width: 720px;
}

.insurance-coverage-header {
  padding: 8px 10px;
  color: #66727d;
  font-size: 12px;
  background: #eef2f4;
}

.insurance-coverage-row {
  padding: 8px 0;
  border-bottom: 1px solid #e6eaed;
}

.insurance-coverage-row .input {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
}

.insurance-coverage-empty {
  padding: 18px;
  color: #7a8691;
  text-align: center;
  background: #fff;
  border: 1px dashed #d5dce1;
}

.insurance-save-hint {
  margin-top: 12px;
  color: #71808d;
  font-size: 12px;
  text-align: right;
}

.loan-insurance-section {
  margin-bottom: 16px;
}

.loan-amount-summary {
  margin-top: 0;
  margin-bottom: 16px;
  padding: 14px 16px;
  border-left: 3px solid #df5a1f;
  background: #faf7f4;
}

.loan-insurance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #dfe4e8;
}

.loan-insurance-head span {
  color: #75808a;
  font-size: 12px;
}

.loan-insurance-block .detail-grid {
  margin-top: 14px;
}

.loan-insurance-files {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #dfe4e8;
}

@media (max-width: 1100px) {
  .insurance-document-grid,
  .loan-insurance-grid {
    grid-template-columns: 1fr;
  }

  .insurance-recognition-grid,
  .loan-amount-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .insurance-recognition-grid,
  .loan-amount-summary {
    grid-template-columns: 1fr;
  }

  .insurance-edit-grid {
    grid-template-columns: 1fr;
  }

  .insurance-edit-grid .field.full {
    grid-column: 1;
  }

  .guarantor-presence-option {
    width: 100%;
    min-height: 66px;
    padding: 12px;
  }

  .guarantor-details .upload-grid {
    grid-template-columns: 1fr;
  }

  .insurance-review-facts { grid-template-columns:1fr; }
  .insurance-review-actions { display:grid; grid-template-columns:1fr; }
  .insurance-review-actions > div { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
  .insurance-review-actions .btn { width:100%; min-width:0; padding-left:8px; padding-right:8px; }
}
