/* ============================================================
   多成物流系统 · 全新设计系统（依据项目《抖音.txt》设计规范）
   专业 / 现代 / 克制 / 清爽 / 可信 / 企业级 / 留白充足 / 卡片化
   —— 兼容层：模板中的 Bootstrap 类名与旧 vben 变量保持不变，仅换视觉皮肤。
   ============================================================ */

/* ---------- 1. Design Tokens ---------- */
:root {
  --duo-primary: #3370FF;
  --duo-primary-hover: #245BDB;
  --duo-primary-soft: #EBF1FF;
  --duo-success: #00B578;
  --duo-success-soft: #E6F7F1;
  --duo-warning: #FF8F1F;
  --duo-warning-soft: #FFF3E5;
  --duo-danger: #F54A45;
  --duo-danger-soft: #FEEDEC;
  --duo-info: #3370FF;

  --duo-text-1: #1F2329;
  --duo-text-2: #646A73;
  --duo-text-3: #6F7680;
  --duo-text-4: #707780;

  --duo-border: #DEE0E3;
  --duo-border-light: #EBEDF0;
  --duo-bg: #F5F6F7;
  --duo-surface: #FFFFFF;

  --duo-shadow: 0 2px 8px rgba(31, 35, 41, 0.08);
  --duo-shadow-hover: 0 8px 24px rgba(31, 35, 41, 0.10);

  --duo-radius-btn: 8px;
  --duo-radius-card: 12px;
  --duo-radius-input: 6px;

  --duo-sidebar-w: 216px;
  --duo-sidebar-collapsed: 64px;
  --duo-header-h: 56px;
  --duo-tabbar-h: 58px;

  --duo-font: Inter, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;

  /* —— 旧 vben 变量别名（login / expense_form 内联样式仍引用） —— */
  --vben-primary: var(--duo-primary);
  --vben-primary-hover: var(--duo-primary-hover);
  --vben-primary-soft: var(--duo-primary-soft);
  --vben-bg: var(--duo-bg);
  --vben-surface: var(--duo-surface);
  --vben-surface-muted: #FAFBFC;
  --vben-text: var(--duo-text-1);
  --vben-text-secondary: var(--duo-text-2);
  --vben-text-tertiary: var(--duo-text-3);
  --vben-border: var(--duo-border);
  --vben-border-light: var(--duo-border-light);
  --vben-sidebar: var(--duo-surface);
  --vben-sidebar-deep: #FAFBFC;
  --vben-sidebar-text: var(--duo-text-2);
  --vben-sidebar-width: var(--duo-sidebar-w);
  --vben-sidebar-collapsed: var(--duo-sidebar-collapsed);
  --vben-header-height: var(--duo-header-h);
  --vben-radius: var(--duo-radius-card);
  --vben-shadow: var(--duo-shadow);
  --vben-shadow-hover: var(--duo-shadow-hover);
}

body[data-theme="dark"] {
  --duo-text-1: #F0F1F2;
  --duo-text-2: #A8ABB2;
  --duo-text-3: #969CA4;
  --duo-text-4: #8C929A;
  --duo-border: #3A3F47;
  --duo-border-light: #2E3238;
  --duo-bg: #1A1D21;
  --duo-surface: #23262B;
  --duo-primary-soft: rgba(51, 112, 255, 0.16);
  --duo-success-soft: rgba(0, 181, 120, 0.14);
  --duo-warning-soft: rgba(255, 143, 31, 0.14);
  --duo-danger-soft: rgba(245, 74, 69, 0.14);
  --duo-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  --duo-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.4);
  --vben-surface-muted: #2A2D32;
  --vben-sidebar-deep: #202327;
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--duo-text-1);
  background: var(--duo-bg);
  font-family: var(--duo-font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--duo-primary); text-decoration: none; }
a:hover { color: var(--duo-primary-hover); }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--duo-border); border-radius: 2px; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--duo-primary); outline-offset: 2px; }

/* ---------- 标题字号规范（原 Bootstrap 默认偏大，统一收敛到舒适企业级） ---------- */
.main-container h1 { font-size: 26px; font-weight: 700; }
.main-container h2 { font-size: 24px; font-weight: 700; }        /* 看板大数字（财务卡除外，见 .admin-fin-card） */
.main-container h3 { font-size: 22px; font-weight: 700; }        /* 统计卡数字 */
.main-container h4 { font-size: 20px; font-weight: 700; }        /* 页面大标题 */
.main-container h5 { font-size: 16px; font-weight: 600; }        /* 区块/卡片标题、空态 */
.main-container h6 { font-size: 13px; font-weight: 600; }        /* 小标签 */
.modal h1, .modal h2, .modal h3, .modal h4 { font-size: 18px; font-weight: 600; }
.fs-1 { font-size: 30px !important; }
.fs-2 { font-size: 26px !important; }
.fs-3 { font-size: 22px !important; }
.fs-4 { font-size: 18px !important; }
.fs-5 { font-size: 16px !important; }
.fs-6 { font-size: 14px !important; }
.display-1 { font-size: 40px !important; }
.display-2 { font-size: 34px !important; }
.display-3 { font-size: 34px !important; }   /* 运费计算器净利润 */
.display-4 { font-size: 28px !important; }
.display-5 { font-size: 24px !important; }
.display-6 { font-size: 24px !important; }   /* 车辆档案车牌号 */
.lead { font-size: 16px; }

.wrapper { display: flex; width: 100%; min-height: 100vh; }

/* ---------- 3. 侧栏（浅色企业风） ---------- */
#sidebar {
  position: sticky;
  top: 0;
  width: var(--duo-sidebar-w);
  min-width: var(--duo-sidebar-w);
  max-width: var(--duo-sidebar-w);
  height: 100vh;
  overflow: hidden;
  color: var(--duo-text-2);
  background: var(--duo-surface);
  border-right: 1px solid var(--duo-border-light);
  z-index: 1040;
}
#sidebar .sidebar-header {
  display: flex;
  align-items: center;
  height: var(--duo-header-h);
  padding: 0 18px;
  overflow: hidden;
  color: var(--duo-text-1);
  background: var(--duo-surface);
  border-bottom: 1px solid var(--duo-border-light);
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
}
#sidebar .sidebar-header i {
  width: 30px; height: 30px; min-width: 30px; line-height: 30px;
  margin-right: 10px;
  background: var(--duo-primary); color: #fff;
  border-radius: 8px; font-size: 15px; text-align: center;
}
#sidebar ul.components {
  height: calc(100vh - var(--duo-header-h));
  padding: 8px 10px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--duo-border) transparent;
}
#sidebar ul li { padding: 0; }
#sidebar ul li.px-3 { padding: 0 10px !important; }
#sidebar ul li.px-3.mt-2,
#sidebar ul li.px-3.mt-3,
#sidebar ul li.px-3.mt-4 {
  margin-top: 14px !important; margin-bottom: 4px !important;
  color: var(--duo-text-3) !important; font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
#sidebar ul li a {
  display: flex;
  align-items: center;
  min-height: 38px;
  margin: 1px 0;
  padding: 0 10px;
  overflow: hidden;
  color: var(--duo-text-2);
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
#sidebar ul li a:hover { color: var(--duo-text-1); background: var(--duo-bg); }
#sidebar ul li.active > a, #sidebar ul li a.active { color: var(--duo-primary); background: var(--duo-primary-soft); font-weight: 600; }
#sidebar ul li a i { flex: 0 0 20px; width: 20px; margin-right: 10px; color: inherit !important; font-size: 14px; text-align: center; }
#sidebar .sidebar-heading-label { font-size: 13px; font-weight: 600; }
#sidebar ul ul { padding-left: 0 !important; }
#sidebar ul ul li a { padding-left: 40px; font-size: 13px; color: var(--duo-text-2); }

/* 可折叠分组标题（垫付与报销 / 财务资金 / 车队与员工 等）：中和旧 text-white-50，保证浅色侧栏下清晰可读 */
#sidebar .text-white-50 { color: var(--duo-text-2) !important; }
#sidebar a.sidebar-heading { color: var(--duo-text-1) !important; font-weight: 600; }
#sidebar a.sidebar-heading:hover { color: var(--duo-primary) !important; background: transparent; }
#sidebar a.sidebar-heading i { color: var(--duo-text-3) !important; }
/* 子菜单项：常规态深灰，悬停更深，选中态品牌蓝 */
#sidebar ul ul li a:hover { color: var(--duo-text-1); background: var(--duo-bg); }
#sidebar ul ul li.active > a { color: var(--duo-primary); background: var(--duo-primary-soft); font-weight: 600; }

/* 折叠（桌面图标栏） */
.wrapper.sidebar-is-collapsed #sidebar { width: var(--duo-sidebar-collapsed); min-width: var(--duo-sidebar-collapsed); max-width: var(--duo-sidebar-collapsed); }
.wrapper.sidebar-is-collapsed #sidebar .sidebar-header { justify-content: center; padding: 0; font-size: 0; }
.wrapper.sidebar-is-collapsed #sidebar .sidebar-header i { margin: 0; font-size: 15px; }
.wrapper.sidebar-is-collapsed #sidebar ul li.px-3 { padding: 0 !important; font-size: 0; }
.wrapper.sidebar-is-collapsed #sidebar ul li.px-3 span { display: none; }
.wrapper.sidebar-is-collapsed #sidebar ul li a { justify-content: center; padding: 0; font-size: 0; }
.wrapper.sidebar-is-collapsed #sidebar ul li a i { margin: 0; font-size: 14px; }
.wrapper.sidebar-is-collapsed #sidebar ul ul li a { padding-left: 0; }
.wrapper.sidebar-is-collapsed #sidebar .sidebar-heading .fa-chevron-down { display: none; }

/* ---------- 4. 顶栏 ---------- */
#content { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; min-height: 100vh; background: var(--duo-bg); }
.top-navbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--duo-header-h);
  padding: 0 24px;
  color: var(--duo-text-1);
  background: var(--duo-surface);
  border-bottom: 1px solid var(--duo-border-light);
}
.top-navbar .navbar-left, .top-navbar .navbar-right, .top-navbar .topbar-actions { display: flex; align-items: center; }
.topbar-brand { display: none; font-weight: 600; color: var(--duo-text-1); white-space: nowrap; }
.topbar-brand i { margin-right: 8px; color: var(--duo-primary); }
.topbar-search { position: relative; width: min(320px, 34vw); margin-left: 18px; }
.topbar-search i { position: absolute; top: 9px; left: 11px; color: var(--duo-text-3); }
.topbar-search input {
  width: 100%; height: 34px; padding: 0 12px 0 32px;
  color: var(--duo-text-1); background: var(--duo-bg);
  border: 1px solid transparent; border-radius: 8px;
  font-family: inherit; font-size: 13px;
}
.topbar-search input:focus { outline: 0; background: var(--duo-surface); border-color: var(--duo-primary); box-shadow: 0 0 0 3px rgba(51, 112, 255, .12); }
.top-navbar .user-info { display: flex; align-items: center; min-height: 40px; padding: 0 8px; color: var(--duo-text-2) !important; }
.top-navbar .user-info > i { margin-right: 8px; color: var(--duo-primary); font-size: 20px; }
.top-navbar .user-info .badge { margin-left: 8px; font-weight: 600; }
.top-navbar .btn { min-height: 32px; }
.topbar-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; margin-left: 4px;
  color: var(--duo-text-2); background: transparent; border: 0; border-radius: 8px;
}
.topbar-icon-btn:hover { color: var(--duo-primary); background: var(--duo-primary-soft); }
#sidebarCollapse { width: 36px; height: 36px; padding: 0; color: var(--duo-text-2); background: transparent; border: 0; border-radius: 8px; }
#sidebarCollapse:hover { color: var(--duo-primary); background: var(--duo-bg); }
.main-container { flex: 1 1 auto; min-width: 0; padding: 20px 24px 40px; }
.page-breadcrumb { display: flex; align-items: center; min-height: 22px; margin-bottom: 14px; color: var(--duo-text-3); font-size: 12px; }
.page-breadcrumb i { margin: 0 6px; font-size: 10px; }
.page-breadcrumb strong { color: var(--duo-text-2); font-weight: 500; }

/* ---------- 5. 底部 TabBar（司机 / 调度，仅移动端） ---------- */
.duo-tabbar { display: none; }
body.duo-has-tabs { padding-bottom: 0; }
@media (max-width: 767.98px) {
  body.duo-has-tabs { padding-bottom: calc(var(--duo-tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  .duo-tabbar {
    display: block;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    height: var(--duo-tabbar-h);
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: var(--duo-surface);
    border-top: 1px solid var(--duo-border-light);
  }
  .duo-tabbar-inner { display: flex; height: 100%; }
  .duo-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--duo-text-3); font-size: 11px; text-decoration: none; user-select: none;
  }
  .duo-tab .duo-ico { font-size: 20px; line-height: 1; }
  .duo-tab.duo-active { color: var(--duo-primary); font-weight: 600; }
  .duo-tab.duo-tab-hero { position: relative; }
  .duo-tab.duo-tab-hero .duo-hero-btn {
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--duo-primary); color: #fff; font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    margin-top: -22px; box-shadow: 0 4px 12px rgba(51, 112, 255, .4);
    border: 4px solid var(--duo-surface);
  }
  .duo-tab.duo-tab-hero span { margin-top: 2px; }
}

/* ---------- 6. 卡片（Bootstrap 兼容皮肤） ---------- */
.card {
  margin-bottom: 16px;
  color: var(--duo-text-1);
  background: var(--duo-surface);
  border: 1px solid var(--duo-border-light);
  border-radius: var(--duo-radius-card);
  box-shadow: var(--duo-shadow);
}
.card:hover { border-color: var(--duo-border); }
.card-header { color: var(--duo-text-1); background: transparent; border-bottom: 1px solid var(--duo-border-light); }
.card-footer { background: transparent; border-top: 1px solid var(--duo-border-light); }
.card-body { min-width: 0; }

/* 彩色统计卡 → 克制的白卡 + 顶部色条（红黄蓝绿仅作语义提示） */
.card.bg-primary, .card.bg-success, .card.bg-danger, .card.bg-warning, .card.bg-info, .card.bg-dark {
  color: var(--duo-text-1) !important;
  background: var(--duo-surface) !important;
  border: 1px solid var(--duo-border-light) !important;
}
.card.bg-primary { border-top: 3px solid var(--duo-primary) !important; }
.card.bg-success { border-top: 3px solid var(--duo-success) !important; }
.card.bg-danger { border-top: 3px solid var(--duo-danger) !important; }
.card.bg-warning { border-top: 3px solid var(--duo-warning) !important; }
.card.bg-info { border-top: 3px solid var(--duo-primary) !important; }
.card.bg-dark { border-top: 3px solid var(--duo-text-1) !important; }
.card.bg-primary .text-white, .card.bg-success .text-white, .card.bg-danger .text-white,
.card.bg-warning .text-white, .card.bg-info .text-white, .card.bg-dark .text-white,
.card.bg-primary.text-white, .card.bg-success.text-white, .card.bg-danger.text-white,
.card.bg-warning.text-white, .card.bg-info.text-white, .card.bg-dark.text-white { color: var(--duo-text-1) !important; }
.card.bg-primary .opacity-75, .card.bg-success .opacity-75, .card.bg-danger .opacity-75,
.card.bg-warning .opacity-75, .card.bg-info .opacity-75, .card.bg-dark .opacity-75 { opacity: 1 !important; color: var(--duo-text-2); }
.card.bg-primary h2, .card.bg-success h2, .card.bg-danger h2, .card.bg-warning h2, .card.bg-info h2 { color: var(--duo-text-1); }
.card.bg-primary small.bg-white, .card.bg-danger small.bg-white, .card.bg-success small.bg-white, .card.bg-warning small.bg-white, .card.bg-info small.bg-white {
  background: var(--duo-bg) !important; color: var(--duo-text-2) !important;
}
.card.bg-warning .text-dark { color: var(--duo-text-1) !important; }

/* 旧自定义财务卡 */
.feature-card, .admin-fin-card { transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; }
.feature-card:hover, .admin-fin-card:hover { transform: translateY(-2px); box-shadow: var(--duo-shadow-hover) !important; border-color: var(--duo-border); }
.icon-box {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.icon-box.bg-success { background: var(--duo-success-soft) !important; color: var(--duo-success); }
.icon-box.bg-danger { background: var(--duo-danger-soft) !important; color: var(--duo-danger); }
.icon-box.bg-primary { background: var(--duo-primary-soft) !important; color: var(--duo-primary); }
.icon-box.bg-warning { background: var(--duo-warning-soft) !important; color: var(--duo-warning); }
.icon-box.bg-info { background: var(--duo-primary-soft) !important; color: var(--duo-primary); }
.card-indicator { position: absolute; bottom: 0; left: 0; width: 100%; height: 4px; opacity: .6; }

/* ---------- 7. 按钮 ---------- */
.btn {
  border-radius: var(--duo-radius-btn);
  border: 1px solid transparent;
  font-weight: 500;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover { transform: none; }
.btn-primary { background-color: var(--duo-primary); border-color: var(--duo-primary); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background-color: var(--duo-primary-hover); border-color: var(--duo-primary-hover); color: #fff; box-shadow: none; }
.btn-primary:active { background-color: var(--duo-primary-hover) !important; border-color: var(--duo-primary-hover) !important; }
.btn-outline-primary { color: var(--duo-primary); border-color: var(--duo-primary); }
.btn-outline-primary:hover { color: #fff; background: var(--duo-primary); border-color: var(--duo-primary); }
.btn-outline-secondary { color: var(--duo-text-2); border-color: var(--duo-border); }
.btn-outline-secondary:hover { color: var(--duo-text-1); background: var(--duo-bg); border-color: var(--duo-border); }
.btn-outline-warning { color: var(--duo-warning); border-color: var(--duo-warning); }
.btn-outline-warning:hover { color: #fff; background: var(--duo-warning); border-color: var(--duo-warning); }
.btn-outline-danger { color: var(--duo-danger); border-color: var(--duo-danger); }
.btn-outline-danger:hover { color: #fff; background: var(--duo-danger); border-color: var(--duo-danger); }
.btn-success { background-color: var(--duo-success); border-color: var(--duo-success); color: #fff; }
.btn-success:hover, .btn-success:focus { background-color: #009E69; border-color: #009E69; color: #fff; }
.btn-danger { background-color: var(--duo-danger); border-color: var(--duo-danger); color: #fff; }
.btn-danger:hover, .btn-danger:focus { background-color: #D9413D; border-color: #D9413D; color: #fff; }
.btn-warning { background-color: var(--duo-warning); border-color: var(--duo-warning); color: #fff; }
.btn-warning:hover, .btn-warning:focus { background-color: #E97E12; border-color: #E97E12; color: #fff; }
.btn-warning.text-dark, .btn-warning.fw-bold { color: #fff; }
.btn-info { background-color: var(--duo-primary); border-color: var(--duo-primary); color: #fff; }
.btn-dark { background-color: var(--duo-text-1); border-color: var(--duo-text-1); color: #fff; }
.btn-light { color: var(--duo-text-1); background: var(--duo-surface); border-color: var(--duo-border); }
.btn-light:hover { color: var(--duo-primary); background: var(--duo-primary-soft); border-color: var(--duo-primary); }
.btn-link { color: var(--duo-primary); text-decoration: none; }
.btn-sm { border-radius: 6px; }
.btn:disabled { opacity: .5; }

/* ---------- 8. 徽章（语义色 → 柔和底色） ---------- */
.badge { padding: .32em .6em; border-radius: 6px; font-weight: 500; }
.badge.bg-primary { background: var(--duo-primary-soft) !important; color: var(--duo-primary); }
.badge.bg-success { background: var(--duo-success-soft) !important; color: var(--duo-success); }
.badge.bg-danger { background: var(--duo-danger-soft) !important; color: var(--duo-danger); }
.badge.bg-warning { background: var(--duo-warning-soft) !important; color: #B25E00; }
.badge.bg-warning.text-dark { color: #B25E00 !important; }
.badge.bg-info { background: var(--duo-primary-soft) !important; color: var(--duo-primary); }
.badge.bg-secondary { background: var(--duo-bg) !important; color: var(--duo-text-2); }
.badge.bg-dark { background: var(--duo-text-1) !important; color: #fff; }
.badge.bg-light { background: var(--duo-bg) !important; color: var(--duo-text-1); border: 1px solid var(--duo-border); }

/* ---------- 9. 表单 ---------- */
.form-control, .form-select, .input-group-text {
  min-height: 38px;
  color: var(--duo-text-1);
  background-color: var(--duo-surface);
  border-color: var(--duo-border);
  border-radius: var(--duo-radius-input);
  font-family: inherit;
}
.form-control::placeholder { color: var(--duo-text-4); }
.form-control:focus, .form-select:focus {
  color: var(--duo-text-1);
  background-color: var(--duo-surface);
  border-color: var(--duo-primary);
  box-shadow: 0 0 0 3px rgba(51, 112, 255, .12);
}
.input-group-text { color: var(--duo-text-2); background: var(--duo-bg); }
.form-label { color: var(--duo-text-1); font-size: 13px; font-weight: 600; }
.form-text, .text-muted { color: var(--duo-text-3) !important; }
.form-check-input:checked { background-color: var(--duo-primary); border-color: var(--duo-primary); }

/* ---------- 10. 表格 ---------- */
.table {
  --bs-table-color: var(--duo-text-1);
  --bs-table-bg: transparent;
  margin-bottom: 0;
  font-size: 13px;
}
.table > :not(caption) > * > * { padding: 12px 16px; border-bottom-color: var(--duo-border-light); }
.table thead th, .table-light th {
  color: var(--duo-text-2);
  background: #F7F8FA !important;
  border-bottom: 1px solid var(--duo-border-light) !important;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
body[data-theme="dark"] .table thead th, body[data-theme="dark"] .table-light th { background: #1E2125 !important; }
.table tbody td { font-size: 13px; }
.table tbody td .fw-bold, .table tbody td strong { font-size: 14px; }
.table .text-danger, .table .text-success, .table .text-primary, .table .text-warning { font-weight: 600; }
.table-hover > tbody > tr:hover > * { --bs-table-accent-bg: var(--duo-primary-soft); color: var(--duo-text-1); }
.table-responsive { border-radius: var(--duo-radius-card); background: var(--duo-surface); }

/* 全局工单总览：给用户明确的横向滚动提示，并固定关键识别列。 */
.table-scroll-hint {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  color: var(--duo-text-2);
  font-size: 12px;
}
.orders-table-scroll {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.orders-table { min-width: 1560px; }
.orders-table th,
.orders-table td { position: relative; }
.orders-table .order-col,
.orders-table .date-col,
.orders-table .plate-col {
  position: sticky;
  z-index: 2;
  background: var(--duo-surface);
}
.orders-table thead .order-col,
.orders-table thead .date-col,
.orders-table thead .plate-col { background: var(--vben-surface-muted) !important; z-index: 4; }
.orders-table .order-col { left: 0; min-width: 92px; }
.orders-table .date-col { left: 92px; min-width: 116px; }
.orders-table .plate-col { left: 208px; min-width: 128px; box-shadow: 6px 0 8px -8px rgba(31, 35, 41, .35); }
body[data-theme="dark"] .orders-table .order-col,
body[data-theme="dark"] .orders-table .date-col,
body[data-theme="dark"] .orders-table .plate-col { background: var(--duo-surface) !important; }
body[data-theme="dark"] .orders-table thead .order-col,
body[data-theme="dark"] .orders-table thead .date-col,
body[data-theme="dark"] .orders-table thead .plate-col { background: #1E2125 !important; }

/* 可排序表头：深色文字 + 彩色小圆点标识，排序激活时品牌蓝 */
.table thead th a.duo-sort-link { color: var(--duo-text-2); }
.table thead th a.duo-sort-link:hover { color: var(--duo-primary); }
.table thead th a.duo-sort-active { color: var(--duo-primary); font-weight: 700; }
.table thead th a.duo-sort-active i { color: var(--duo-primary); }
.duo-sort-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; vertical-align: 1px; margin-right: 6px; }

/* ---------- 11. 分页 / 弹窗 / 下拉 / 其他 ---------- */
.pagination { --bs-pagination-bg: transparent; --bs-pagination-border-width: 0; }
.pagination .page-link { min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; border-radius: 6px; font-size: 13px; color: var(--duo-text-2); }
.pagination .page-link:hover { background: var(--duo-bg); color: var(--duo-text-1); }
.pagination .page-item.active .page-link { background: var(--duo-primary); color: #fff; font-weight: 600; border-radius: 6px; }
.pagination .page-item.disabled .page-link { color: var(--duo-text-4); }

.modal-content { color: var(--duo-text-1); background: var(--duo-surface); border: 0; border-radius: var(--duo-radius-card); box-shadow: 0 12px 40px rgba(31, 35, 41, .2); }
.modal-header { border-bottom: 1px solid var(--duo-border-light); padding: 16px 20px; }
.modal-header .modal-title { font-size: 16px; font-weight: 600; }
.modal-footer { border-top: 1px solid var(--duo-border-light); padding: 12px 20px; }

.alert { border-radius: 8px; border: 0; font-size: 13px; }
.alert-danger { background: var(--duo-danger-soft); color: var(--duo-danger); }
.alert-warning { background: var(--duo-warning-soft); color: #B25E00; }
.alert-success { background: var(--duo-success-soft); color: var(--duo-success); }
.alert-info, .alert-primary { background: var(--duo-primary-soft); color: var(--duo-primary); }
.alert-secondary { background: var(--duo-bg); color: var(--duo-text-2); }

.dropdown-menu { color: var(--duo-text-1); background: var(--duo-surface); border-color: var(--duo-border-light); border-radius: 10px; box-shadow: var(--duo-shadow-hover); padding: 6px; }
.dropdown-item { color: var(--duo-text-2); border-radius: 6px; font-size: 13px; padding: 7px 12px; }
.dropdown-item:hover { color: var(--duo-primary); background: var(--duo-primary-soft); }
.dropdown-item.text-danger:hover { color: var(--duo-danger); background: var(--duo-danger-soft); }

.progress { background: var(--duo-border-light); border-radius: 99px; }
.progress-bar { background: var(--duo-primary); }
.progress-bar.bg-success { background: var(--duo-success); }

.list-group-item { color: var(--duo-text-1); background: var(--duo-surface); border-color: var(--duo-border-light); }

.shadow-sm { box-shadow: var(--duo-shadow) !important; }
.rounded-4 { border-radius: var(--duo-radius-card) !important; }
.rounded-pill { border-radius: 99px !important; }
.text-primary { color: var(--duo-primary) !important; }
.bg-primary { background-color: var(--duo-primary) !important; }
.bg-light { background-color: var(--duo-bg) !important; }
.border-start.border-4 { border-left-width: 4px !important; }
.turbolinks-progress-bar { display: none !important; }
.sidebar-overlay { display: none; }

/* 金额 / 业务数字等宽 */
.data-number, .metric-value, .charge-value,
.admin-fin-card h2, .admin-fin-card h3,
.analysis-page table td, .charging-page table td { font-variant-numeric: tabular-nums; }
.admin-fin-card h2 { font-size: 1.85rem; font-weight: 700; }
.analysis-mobile-card .metric-value, .charging-mobile-card .charge-value { font-size: 15px; }
.analysis-mobile-card strong, .charging-mobile-card > .card-body > .d-flex > strong { font-size: 18px; }

/* ---------- 12. 深色主题收尾 ---------- */
body[data-theme="dark"] .bg-white,
body[data-theme="dark"] .bg-light,
body[data-theme="dark"] .card-header,
body[data-theme="dark"] .card-footer,
body[data-theme="dark"] .table-light,
body[data-theme="dark"] .top-navbar,
body[data-theme="dark"] .form-control,
body[data-theme="dark"] .form-select { color: var(--duo-text-1) !important; background-color: var(--duo-surface) !important; }
body[data-theme="dark"] .table-dark { --bs-table-bg: #262626; }
body[data-theme="dark"] .text-dark { color: var(--duo-text-1) !important; }
body[data-theme="dark"] .border, body[data-theme="dark"] .border-light { border-color: var(--duo-border) !important; }
body[data-theme="dark"] .bg-light { background-color: var(--vben-surface-muted) !important; }
body[data-theme="dark"] .input-group-text { background: var(--vben-surface-muted); color: var(--duo-text-2); }

/* ---------- 13. 中屏：图标栏 ---------- */
@media (max-width: 1199.98px) and (min-width: 768px) {
  .wrapper:not(.sidebar-is-expanded) #sidebar { width: var(--duo-sidebar-collapsed); min-width: var(--duo-sidebar-collapsed); max-width: var(--duo-sidebar-collapsed); }
  .wrapper:not(.sidebar-is-expanded) #sidebar .sidebar-header { justify-content: center; padding: 0; font-size: 0; }
  .wrapper:not(.sidebar-is-expanded) #sidebar .sidebar-header i { margin: 0; font-size: 15px; }
  .wrapper:not(.sidebar-is-expanded) #sidebar ul li.px-3 { padding: 0 !important; font-size: 0; }
  .wrapper:not(.sidebar-is-expanded) #sidebar ul li.px-3 span { display: none; }
  .wrapper:not(.sidebar-is-expanded) #sidebar ul li a { justify-content: center; padding: 0; font-size: 0; }
  .wrapper:not(.sidebar-is-expanded) #sidebar ul li a i { margin: 0; }
  .wrapper:not(.sidebar-is-expanded) #sidebar ul ul li a { padding-left: 0; }
  .topbar-search { width: 240px; }
}

/* ---------- 14. 移动端 ---------- */
@media (max-width: 767.98px) {
  #sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: var(--duo-sidebar-w); min-width: var(--duo-sidebar-w); max-width: var(--duo-sidebar-w); transform: translateX(-100%); box-shadow: none; }
  #sidebar.active { transform: translateX(0); box-shadow: 10px 0 28px rgba(0, 0, 0, .18); }
  .sidebar-overlay { position: fixed; inset: 0; display: block; visibility: hidden; background: rgba(31, 35, 41, .45); opacity: 0; transition: opacity .25s ease, visibility .25s ease; z-index: 1030; }
  .sidebar-overlay.active { visibility: visible; opacity: 1; }
  .top-navbar { padding: 0 12px; }
  .topbar-brand { display: block; margin-left: 4px; font-size: 14px; font-weight: 600; }
  .topbar-search, .top-navbar .user-info { display: none !important; }
  .top-navbar .topbar-actions { margin-left: auto; }
  .main-container { padding: 14px 12px 28px; }
  .page-breadcrumb { margin-bottom: 12px; font-size: 12px; }
  .card { border-radius: var(--duo-radius-card); }
  .card-body { padding: 16px !important; }
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .btn, .form-control, .form-select, .input-group-text { min-height: 44px; }
  .btn-sm, .form-control-sm, .form-select-sm { min-height: 36px; }
  .topbar-icon-btn, #sidebarCollapse { width: 44px; height: 44px; }
  .modal-dialog { margin: 0; }
  .modal-content { min-height: 100vh; border-radius: 0; }
  .modal-dialog.modal-dialog-centered { align-items: stretch; }

  /* 带 data-label 的表格转为卡片列表（财务明细 / 油耗大盘等） */
  table:has(td[data-label]) thead { display: none; }
  table:has(td[data-label]), table:has(td[data-label]) tbody, table:has(td[data-label]) tr, table:has(td[data-label]) td { display: block; }
  table:has(td[data-label]) tr {
    background: var(--duo-surface); border-radius: var(--duo-radius-card);
    box-shadow: var(--duo-shadow); padding: 12px 14px; margin-bottom: 10px;
  }
  table:has(td[data-label]) td {
    display: flex; gap: 10px; padding: 4px 0; border: 0; text-align: left !important;
  }
  table:has(td[data-label]) td::before {
    content: attr(data-label);
    width: 84px; flex-shrink: 0; color: var(--duo-text-3); font-size: 12px;
  }
}

/* ---------- 15. 动效尊重系统设置 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- 16. 可读性字号优化 ----------
   统一提升正文、菜单、表格和辅助文字，重点保证金额、公里数等业务数字在桌面和手机上清晰可读。 */
body { font-size: 15px; }
body .small { font-size: .875em; }
.main-container h5 { font-size: 17px; }
.main-container h6 { font-size: 14px; }
#sidebar ul li.px-3.mt-2,
#sidebar ul li.px-3.mt-3,
#sidebar ul li.px-3.mt-4 { font-size: 13px; }
#sidebar ul li a { font-size: 15px; }
#sidebar .sidebar-heading-label,
#sidebar ul ul li a { font-size: 14px; }
.topbar-search input { font-size: 14px; }
.page-breadcrumb { font-size: 13px; }
.page-breadcrumb i { font-size: 11px; }
.duo-tab { font-size: 12px; }
.form-label { font-size: 14px; }
.form-text, .text-muted { font-size: 13px; }
.table { font-size: 14px; }
.table thead th { font-size: 14px; }
.table tbody td { font-size: 14px; }
.table tbody td .fw-bold, .table tbody td strong { font-size: 15px; }
.table-scroll-hint { font-size: 13px; }
.pagination .page-link { font-size: 14px; }
.alert { font-size: 14px; }
.dropdown-item { font-size: 14px; }
.data-number, .metric-value, .charge-value { font-size: 1.05em; }

@media (max-width: 767.98px) {
  .page-breadcrumb { font-size: 13px; }
  .duo-tab { font-size: 12px; }
  table:has(td[data-label]) td::before { font-size: 13px; }
  .table tbody td .fw-bold, .table tbody td strong { font-size: 15px; }
}

/* ---------- 17. 车牌号可读性 ----------
   车牌号是车辆识别的核心字段，在列表、卡片和详情中保持一致的字号与高对比度。 */
.plate-number,
.plate-display {
  display: inline-block;
  color: var(--duo-text-1) !important;
  font-size: 1.08em;
  font-weight: 700;
  letter-spacing: .025em;
  line-height: 1.45;
}
.plate-number.text-primary,
.plate-display.text-primary {
  color: var(--duo-primary) !important;
}
.table .plate-number { font-size: 1.08em; }
.badge.plate-number {
  padding: .34em .68em;
  background: var(--duo-primary-soft) !important;
  border: 1px solid var(--duo-primary);
}
body[data-theme="dark"] .plate-number.text-primary,
body[data-theme="dark"] .plate-display.text-primary { color: #8db3ff !important; }
body[data-theme="dark"] .badge.plate-number { color: #b5ccff !important; }
@media (max-width: 767.98px) {
  .plate-number,
  .plate-display { font-size: 1.1em; letter-spacing: .03em; }
}

/* 全局工单表在手机端取消固定识别列，让整张宽表可以自由左右滑动。 */
@media (max-width: 767.98px) {
  .orders-table-scroll { overflow-x: auto; overflow-y: visible; -webkit-overflow-scrolling: touch; touch-action: pan-x; }
  .orders-table { min-width: 1560px; }
  .orders-table th,
  .orders-table td { position: static; }
  .orders-table .order-col,
  .orders-table .date-col,
  .orders-table .plate-col {
    position: static;
    left: auto;
    min-width: auto;
    z-index: auto;
    box-shadow: none;
    background: inherit;
  }
  .orders-table thead .order-col,
  .orders-table thead .date-col,
  .orders-table thead .plate-col { background: var(--vben-surface-muted) !important; }
}
