/* ================= A.O.史密斯班车管理系统 - 企业蓝主题 ================= */
:root {
  --brand: #0b4da2;
  --brand-dark: #073b7d;
  --brand-light: #e8f0fb;
  --brand-mid: #1a6dd4;
  --accent: #e2231a;        /* A.O.史密斯红 */
  --text: #1f2937;
  --text-sub: #6b7280;
  --border: #e3e8ef;
  --bg: #f4f6fa;
  --white: #fff;
  --ok: #16a34a;
  --warn: #ea580c;
  --danger: #dc2626;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, .14);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.6;
}
.hidden { display: none !important; }
a { color: var(--brand); text-decoration: none; }

/* ============ 登录页 ============ */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0b4da2 0%, #1a6dd4 55%, #3b8ae5 100%);
  padding: 20px;
}
.auth-card {
  width: 100%; max-width: 420px; background: var(--white);
  border-radius: 14px; padding: 34px 32px 28px; box-shadow: var(--shadow-lg);
}
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-logo { font-size: 26px; font-weight: 800; letter-spacing: .5px; color: var(--brand); }
.auth-logo span { color: var(--accent); font-size: 15px; letter-spacing: 2px; display: block; margin-top: -4px; font-weight: 700; }
.auth-brand h1 { font-size: 20px; margin: 12px 0 2px; color: var(--text); }
.auth-sub { margin: 0; color: var(--text-sub); font-size: 12px; letter-spacing: .5px; }
.auth-tabs { display: flex; background: var(--bg); border-radius: var(--radius); padding: 4px; margin-bottom: 20px; }
.auth-tab {
  flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 6px;
  font-size: 14px; cursor: pointer; color: var(--text-sub); font-weight: 500;
}
.auth-tab.active { background: var(--white); color: var(--brand); box-shadow: var(--shadow); font-weight: 600; }
.auth-form label { display: block; margin-bottom: 14px; font-size: 13px; color: var(--text-sub); font-weight: 500; }
.auth-form input {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font-size: 14px;
  border: 1px solid var(--border); border-radius: var(--radius); outline: none; transition: .15s;
  background: var(--white); color: var(--text);
}
.auth-form input:focus { border-color: var(--brand-mid); box-shadow: 0 0 0 3px rgba(26,109,212,.12); }
.auth-hint { text-align: center; font-size: 12px; color: var(--text-sub); margin-top: 14px; line-height: 1.7; }

/* ============ 主框架 ============ */
.app-wrap { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: 0 0 232px; background: #0d2c56;
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 40;
}
.sidebar-brand { padding: 20px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-logo { font-size: 20px; font-weight: 800; color: #fff; }
.brand-logo span { color: #ff6b5e; font-size: 12px; letter-spacing: 2px; display: block; margin-top: -3px; }
.brand-title { color: #a9c2e3; font-size: 13px; margin-top: 6px; letter-spacing: .5px; }
.nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 2px;
  color: #cfdcf0; border-radius: var(--radius); cursor: pointer; font-size: 14px; transition: .15s;
  border: 0; background: transparent; width: 100%; text-align: left; font-family: inherit;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--brand-mid); color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.nav-item .ico { width: 18px; text-align: center; font-size: 15px; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.1); }
.user-info { color: #a9c2e3; font-size: 12px; }
.user-info b { color: #fff; display: block; font-size: 13px; margin-bottom: 2px; }
.role-badge {
  display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px;
  background: var(--brand-mid); color: #fff; margin-left: 4px;
}
.role-badge.user { background: #4b5f7d; }

.main { flex: 1; margin-left: 232px; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px; background: var(--white); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 22px; gap: 14px; position: sticky; top: 0; z-index: 30;
}
.topbar h2 { font-size: 17px; margin: 0; font-weight: 600; color: var(--text); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.top-user { font-size: 13px; color: var(--text-sub); }
.menu-toggle { display: none; border: 0; background: transparent; font-size: 20px; cursor: pointer; color: var(--text); }
.content { padding: 22px; flex: 1; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .spacer { flex: 1; }

/* ============ 卡片/统计 ============ */
.card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 18px;
}
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand); }
.stat-card.green::before { background: var(--ok); }
.stat-card.orange::before { background: var(--warn); }
.stat-card.red::before { background: var(--accent); }
.stat-label { font-size: 13px; color: var(--text-sub); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--brand); line-height: 1.1; }
.stat-card.green .stat-value { color: var(--ok); }
.stat-card.orange .stat-value { color: var(--warn); }
.stat-card.red .stat-value { color: var(--accent); }
.stat-extra { font-size: 12px; color: var(--text-sub); margin-top: 6px; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; font-size: 13px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--border); background: var(--white); color: var(--text);
  font-family: inherit; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--brand-mid); color: var(--brand); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-danger { background: var(--white); border-color: #f3bcbc; color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-sub); }
.btn-ghost:hover { background: var(--bg); color: var(--brand); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; padding: 11px; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ============ 表格 ============ */
/* 冻结列使用 position:sticky，需 border-collapse: separate 才能在各浏览器生效；
   为保证边框不因 separate 出现双线，统一用 box-shadow 画底部分隔线 */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.data th, table.data td { padding: 10px 12px; text-align: left; box-shadow: inset 0 -1px 0 var(--border); white-space: nowrap; }
table.data th { background: #f8fafc; color: var(--text-sub); font-weight: 600; font-size: 12.5px; position: sticky; top: 0; z-index: 2; }
table.data tbody tr:hover { background: var(--brand-light); }
table.data td.actions { white-space: nowrap; text-align: left; }
table.data td.actions .btn { margin-right: 4px; }
/* 操作列固定在最左：表头文字与单元格左对齐，宽度紧凑 */
table.data th[data-col="__actions"] { text-align: left; }

/* ---- 冻结视图：操作列 + 指定数据列（车辆车牌号 / 司机姓名 / 线路名称+编号 / 站点名称 / 人员姓名+工号） ---- */
/* z-index 层级：表头冻结列(6) > 表头普通(2) > 冻结单元格(1) > 普通单元格(auto) */
table.data th[data-col="__actions"],
table.data th.frozen {
  position: sticky;
  z-index: 6;
  background: #eef2f7;
  box-shadow: inset 0 -1px 0 var(--border), inset -1px 0 0 var(--border);
}
table.data td.actions,
table.data td.frozen {
  position: sticky;
  z-index: 1;
  background: #fff;
  box-shadow: inset 0 -1px 0 var(--border), inset -1px 0 0 var(--border);
}
table.data tbody tr:hover td.actions,
table.data tbody tr:hover td.frozen { background: var(--brand-light); }
/* 最右侧的冻结列加一点右侧阴影，暗示还有内容可横向滚动 */
table.data th.frozen-last,
table.data td.frozen-last { box-shadow: inset 0 -1px 0 var(--border), 1px 0 5px -2px rgba(15, 23, 42, .25); }

.empty { text-align: center; padding: 46px 20px; color: var(--text-sub); }
.empty .big { font-size: 40px; display: block; margin-bottom: 10px; opacity: .5; }

/* ============ 表单 ============ */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 5px; font-weight: 600; }
.field label .req { color: var(--danger); margin-left: 2px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 8px 11px; font-size: 13.5px; border: 1px solid var(--border);
  border-radius: var(--radius); outline: none; font-family: inherit; background: var(--white); color: var(--text);
  transition: .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand-mid); box-shadow: 0 0 0 3px rgba(26,109,212,.12);
}
.field textarea { resize: vertical; min-height: 68px; }
.field .hint { font-size: 12px; color: var(--text-sub); margin-top: 3px; }

/* 字段有值：浅蓝底 + 蓝色文字，一眼区分「已填 / 未填」 */
.field.is-filled input,
.field.is-filled select,
.field.is-filled textarea {
  background: #eef5ff;
  border-color: #bcd4f2;
  color: var(--brand);
  font-weight: 500;
}
.field.is-filled label { color: var(--brand); }
/* 保留只读/禁用态的可读性 */
.field.is-filled input:read-only { background: #eef5ff; }

/* 字段异常（超期/越界）：红色底 + 红边，优先级高于「有值」 */
.field.is-error input,
.field.is-error select,
.field.is-error textarea {
  background: #fff1f1;
  border-color: #f3b4b4;
  color: #b91c1c;
  font-weight: 500;
}
.field.is-error label { color: #b91c1c; }
.field.is-error input:focus,
.field.is-error select:focus,
.field.is-error textarea:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220,38,38,.14);
}
.field .hint-error { color: #b91c1c; font-weight: 500; }

/* ============ 工具条 ============ */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.search-box { position: relative; }
.search-box input {
  padding: 7px 12px 7px 32px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; width: 220px; outline: none; font-family: inherit;
}
.search-box input:focus { border-color: var(--brand-mid); box-shadow: 0 0 0 3px rgba(26,109,212,.12); }
.search-box::before { content: '🔍'; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; opacity: .6; }

/* ============ 标签页 ============ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 18px; overflow-x: auto; }
.tab {
  border: 0; background: transparent; padding: 11px 16px; font-size: 14px; cursor: pointer;
  color: var(--text-sub); border-bottom: 2px solid transparent; font-family: inherit; white-space: nowrap;
}
.tab:hover { color: var(--brand); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ============ 分页 ============ */
.pager { display: flex; align-items: center; gap: 8px; padding: 14px 18px; font-size: 13px; color: var(--text-sub); flex-wrap: wrap; }
.pager .spacer { flex: 1; }
.pager button {
  min-width: 32px; height: 32px; border: 1px solid var(--border); background: var(--white);
  border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text); font-family: inherit;
}
.pager button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pager button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

/* ============ 状态徽章 ============ */
.badge { display: inline-block; padding: 2px 9px; border-radius: 11px; font-size: 12px; font-weight: 500; }
.badge.gray { background: #eef1f5; color: #5b6472; }
.badge.blue { background: #dbeafe; color: #1d4ed8; }
.badge.green { background: #dcfce7; color: #15803d; }
.badge.orange { background: #ffedd5; color: #c2410c; }
.badge.red { background: #fee2e2; color: #b91c1c; }
.expired { color: var(--danger); font-weight: 600; }
.warn-text { color: var(--warn); font-weight: 600; }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
  animation: fadeIn .15s;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: var(--white); border-radius: 12px; width: 100%; max-width: 680px;
  box-shadow: var(--shadow-lg); animation: slideUp .2s; margin-bottom: 40px;
}
.modal.wide { max-width: 900px; }
.modal.narrow { max-width: 440px; }
@keyframes slideUp { from { transform: translateY(14px); opacity: .6 } to { transform: translateY(0); opacity: 1 } }
.modal-head { padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-head h3 { margin: 0; font-size: 16px; flex: 1; }
.modal-close { border: 0; background: transparent; font-size: 22px; cursor: pointer; color: var(--text-sub); line-height: 1; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 20px 22px; max-height: 68vh; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ============ Toast ============ */
.toast-root { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--white); border-left: 4px solid var(--brand); border-radius: 8px;
  padding: 12px 18px; box-shadow: var(--shadow-lg); font-size: 13.5px; min-width: 220px;
  animation: slideInR .2s; color: var(--text);
}
.toast.success { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
@keyframes slideInR { from { transform: translateX(30px); opacity: 0 } to { transform: translateX(0); opacity: 1 } }

/* ============ 附件 ============ */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 22px;
  text-align: center; color: var(--text-sub); cursor: pointer; transition: .15s; font-size: 13px;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--brand); background: var(--brand-light); color: var(--brand); }
.upload-zone .big { font-size: 28px; display: block; margin-bottom: 6px; }
.file-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #f8fafc;
  border: 1px solid var(--border); border-radius: 6px; font-size: 13px;
}
.file-item .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .fsize { color: var(--text-sub); font-size: 12px; }
.file-thumb { width: 34px; height: 34px; object-fit: cover; border-radius: 5px; border: 1px solid var(--border); }

/* ============ 站点时间线 ============ */
.stops-list { display: flex; flex-direction: column; gap: 8px; }
.stop-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #f8fafc; border: 1px solid var(--border); border-radius: 6px; }
.stop-order { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: 0 0 26px; }
.stop-row .sname { font-weight: 500; }
.stop-row .saddr, .stop-row .stime { font-size: 12px; color: var(--text-sub); }
.stop-row .spacer { flex: 1; }

/* ============ 导入 ============ */
.import-hint { background: var(--brand-light); border-radius: var(--radius); padding: 12px 14px; font-size: 12.5px; color: var(--brand-dark); margin-bottom: 14px; line-height: 1.8; }
.import-hint code { background: #fff; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.import-textarea { width: 100%; min-height: 170px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12.5px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); outline: none; resize: vertical; }
.import-textarea:focus { border-color: var(--brand-mid); }
#import-file { font-size: 13px; }

/* ============ 提醒列表 ============ */
.reminder-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.reminder-item:last-child { border-bottom: 0; }
.reminder-item .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); flex: 0 0 7px; }
.reminder-item .dot.red { background: var(--danger); }
.reminder-item .spacer { flex: 1; }
.reminder-item .rdate { color: var(--text-sub); font-size: 12px; }

/* ============ 详情描述 ============ */
.desc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 20px; }
.desc-item { border-bottom: 1px dashed var(--border); padding-bottom: 8px; padding-left: 6px; border-left: 3px solid transparent; }
.desc-item .k { font-size: 12px; color: var(--text-sub); margin-bottom: 2px; font-weight: 600; }
.desc-item .v { font-size: 13.5px; word-break: break-all; }

/* 有值：浅蓝底 + 蓝色字，未填保持灰色「—」 */
.desc-item.is-filled {
  background: #f2f7ff;
  border-left-color: #9dc2ec;
  border-radius: 4px;
  padding-left: 8px;
  padding-right: 6px;
}
.desc-item.is-filled .k { color: #4a7bbd; }
.desc-item.is-filled .v { color: var(--brand); font-weight: 500; }

/* 异常（超期/越界）：红色标识，优先级高于有值 */
.desc-item.is-error {
  background: #fff5f5;
  border-left-color: var(--danger);
  border-radius: 4px;
  padding-left: 8px;
  padding-right: 6px;
}
.desc-item.is-error .k { color: #b91c1c; }
.desc-item.is-error .v { color: #b91c1c; font-weight: 600; }
.desc-item .hint-error { font-size: 11.5px; color: #b91c1c; margin-top: 2px; font-weight: 500; }

.chart-bars { display: flex; flex-direction: column; gap: 10px; }
.chart-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.chart-row .cl { width: 90px; color: var(--text-sub); flex: 0 0 90px; }
.chart-row .ct { flex: 1; background: #eef2f7; border-radius: 5px; height: 20px; overflow: hidden; }
.chart-row .cf { display: block; height: 100%; min-width: 2px; background: linear-gradient(90deg, var(--brand-mid), var(--brand)); border-radius: 5px; }
.chart-row .cv { width: 110px; text-align: right; flex: 0 0 110px; font-weight: 600; color: var(--brand); }

/* ============ 表头排序 / 列拖拽 ============ */
table.data th.sortable { cursor: pointer; user-select: none; position: sticky; top: 0; padding-right: 22px; }
table.data th.sortable:hover { color: var(--brand); background: #eef4fd; }
table.data th.sortable::after {
  content: '⇅'; position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  font-size: 11px; opacity: .45;
}
table.data th.sort-asc::after { content: '▲'; opacity: 1; color: var(--brand); }
table.data th.sort-desc::after { content: '▼'; opacity: 1; color: var(--brand); }
table.data th[draggable="true"] { cursor: grab; }
table.data th.dragging { opacity: .4; }
table.data th.dragover { background: var(--brand-light); box-shadow: inset 2px 0 0 var(--brand); }
table.data th::before {
  content: ''; position: absolute; left: 0; top: 22%; bottom: 22%; width: 0;
}
.col-hint { font-size: 11.5px; color: var(--text-sub); padding: 0 18px 10px; }

/* ============ 日期段筛选 ============ */
.filter-date {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 13px; color: var(--text);
}
.filter-date:focus { border-color: var(--brand-mid); outline: none; box-shadow: 0 0 0 3px rgba(26,109,212,.12); }
.filter-tilde { color: #9ca3af; }
.toolbar select.filter-sel {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 13px;
}

/* ============ checkbox 组 / 多选 ============ */
.checkbox-group {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--white);
}
.cb-item {
  display: inline-flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer;
  padding: 4px 10px; border-radius: 14px; background: #f2f5f9; color: var(--text); transition: .12s;
  min-width: 0; box-sizing: border-box;
}
.cb-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-item:hover { background: var(--brand-light); }
.cb-item input { margin: 0; cursor: pointer; flex: none; }
.cb-item input:checked + span { color: var(--brand); font-weight: 600; }
.cb-item:has(input:checked) { background: var(--brand-light); box-shadow: inset 0 0 0 1px #bcd4f2; }

/* ============ 统计表/里程表 ============ */
.num-cell { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--brand); }
.mileage-summary { display: flex; gap: 24px; flex-wrap: wrap; padding: 14px 18px; background: var(--brand-light); border-radius: var(--radius); margin-bottom: 14px; }
.mileage-summary .mi { }
.mileage-summary .mk { font-size: 12px; color: var(--text-sub); }
.mileage-summary .mv { font-size: 20px; font-weight: 700; color: var(--brand); }
.mileage-summary b { color: var(--brand); font-size: 17px; }
.mileage-formula { font-size: 12px; color: var(--text-sub); }

/* ============ 多行工具条 / 筛选 ============ */
.toolbar-wrap { flex-wrap: wrap; row-gap: 10px; }
.filter-label { font-size: 13px; color: var(--text-sub); }
.table-hint { font-size: 12px; color: var(--text-sub); padding: 0 2px 10px; }
.card-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
td .sub { font-size: 11.5px; color: var(--text-sub); margin-top: 2px; }

/* ============ 系统设置卡片 ============ */
.settings-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px; margin-top: 4px;
}
.setting-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; background: var(--white); display: flex; flex-direction: column; gap: 10px;
}
.setting-card .sc-title { font-size: 14px; font-weight: 700; color: var(--text); }
.setting-card .sc-desc { font-size: 12.5px; color: var(--text-sub); line-height: 1.6; flex: 1; }
.setting-card .btn { align-self: flex-start; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: .2s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .form-grid { grid-template-columns: 1fr; }
  .content { padding: 14px; }
  .stat-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ============ 链接式可点击文本 ============ */
.link-strong { color: var(--brand); font-weight: 700; cursor: pointer; }
.link-strong:hover { text-decoration: underline; }

/* ============ 线路悬浮小弹框 ============ */
.route-hover { position: relative; display: inline-block; }
.route-hover .rh-pop {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 60;
  min-width: 260px; max-width: 360px; padding: 10px 12px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg); font-size: 12.5px; color: var(--text);
  white-space: normal; line-height: 1.7;
}
.route-hover .rh-title { font-weight: 700; margin-bottom: 6px; color: var(--brand); }
.route-hover .rh-row { display: flex; justify-content: space-between; gap: 12px; }
.route-hover .rh-row .t { color: var(--text-sub); }

/* ============ 月度费用汇总表 ============ */
.monthly-wrap { overflow-x: auto; }
.monthly-wrap table.mtable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.monthly-wrap table.mtable th, .monthly-wrap table.mtable td {
  border: 1px solid var(--border); padding: 7px 10px; text-align: right; white-space: nowrap;
}
.monthly-wrap table.mtable th { background: #f8fafc; color: var(--text-sub); font-weight: 600; text-align: center; }
.monthly-wrap table.mtable td.mlabel { text-align: center; font-weight: 600; background: #fbfcfe; }
.monthly-wrap table.mtable tr.total-row td { background: var(--brand-light); font-weight: 700; color: var(--brand); }

/* ============ 看板 · 每日里程卡片 ============ */
.mc-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.mc-kpi-item { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.mc-kpi-label { font-size: 12px; color: var(--text-sub); font-weight: 600; margin-bottom: 4px; }
.mc-kpi-val { font-size: 22px; font-weight: 700; line-height: 1.2; color: var(--text); }
.mc-kpi-val em { font-style: normal; font-size: 12px; font-weight: 500; margin-left: 3px; color: #9ca3af; }
.mc-kpi-val.brand { color: var(--brand); }
.mc-kpi-val.blue { color: #2f6fed; }
.mc-kpi-val.green { color: #16a34a; }
.mc-kpi-val.gray { color: #9ca3af; }
.mc-kpi-sub { font-size: 11.5px; color: #9ca3af; margin-top: 3px; }

.mc-warn { background: #fffbeb; border: 1px solid #fde68a; color: #b45309; font-size: 12.5px;
  padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; line-height: 1.6; }

.mc-chart { position: relative; border: 1px solid var(--border); border-radius: 8px; padding: 10px 6px 4px; background: #fff; }
.mc-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-sub); padding: 0 10px 6px; }
.mc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mc-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.mc-legend i.dash { background: repeating-linear-gradient(90deg, #c7d2e0 0 4px, transparent 4px 7px); }
.mc-svg { display: block; }

.mc-table-wrap { margin-top: 14px; max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
table.mc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.mc-table th, table.mc-table td { padding: 7px 10px; border-bottom: 1px solid #f1f4f8; text-align: left; white-space: nowrap; }
table.mc-table thead th { position: sticky; top: 0; background: #f8fafc; color: var(--text-sub);
  font-weight: 600; z-index: 1; text-align: right; }
table.mc-table thead th:first-child { text-align: left; }
table.mc-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.mc-table td.strong { font-weight: 600; color: var(--brand); }
table.mc-table td.gray { color: #9ca3af; }
table.mc-table tr.mc-total td { background: var(--brand-light); font-weight: 700; color: var(--brand); border-top: 1px solid #cfdcee; }

/* ============ AI 问答 ============ */
.ai-panel { display: flex; flex-direction: column; gap: 10px; }
.ai-msgs { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px; }
.ai-msg { display: flex; gap: 8px; align-items: flex-start; }
.ai-msg .av { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; flex: none; }
.ai-msg.user .av { background: var(--brand-light); }
.ai-msg.bot .av { background: #fef3c7; }
.ai-msg .bubble { background: #f4f6fa; border-radius: 10px; padding: 8px 12px; font-size: 13px; line-height: 1.7; max-width: 88%; white-space: pre-wrap; }
.ai-msg.user { flex-direction: row-reverse; }
.ai-msg.user .bubble { background: var(--brand); color: #fff; }
.ai-input-row { display: flex; gap: 8px; }
.ai-input-row input { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-family: inherit; font-size: 13px; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-chip { font-size: 12px; padding: 4px 10px; border-radius: 14px; background: #f2f5f9; cursor: pointer; color: var(--text-sub); }
.ai-chip:hover { background: var(--brand-light); color: var(--brand); }

/* ============ 提醒清除按钮 ============ */
.reminder-row { display: flex; align-items: center; gap: 8px; }
.reminder-row .btn-clear { margin-left: auto; font-size: 11.5px; padding: 2px 8px; }

/* ============ 合同 / 加油卡卡片 ============ */
.doc-cat-badge { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 12px; background: var(--brand-light); color: var(--brand); }
.terms-cell { max-width: 320px; white-space: normal; line-height: 1.6; }


/* ============ 侧边栏二级菜单 ============ */
.nav-item.nav-child { padding-left: 34px; font-size: 13.5px; }
.nav-item.nav-child .ico { font-size: 13px; }
.nav-item.parent-active { background: rgba(255,255,255,.07); color: #fff; }

/* ============ 车辆 GPS 信息 ============ */
.gps-summary {
  display: flex; gap: 34px; flex-wrap: wrap; align-items: center;
  padding: 14px 18px; background: var(--brand-light); border-bottom: 1px solid var(--border);
}
.gps-summary .mi { min-width: 96px; }
.gps-summary .mk { font-size: 12px; color: var(--text-sub); margin-bottom: 2px; }
.gps-summary .mv { font-size: 21px; font-weight: 700; color: var(--brand); line-height: 1.2; }
.gps-summary .mv small { font-size: 12px; font-weight: 500; color: var(--text-sub); }

.gps-tabs {
  display: flex; align-items: center; gap: 4px;
  padding: 0 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.gps-tabs .spacer { flex: 1; }
.gps-tab {
  border: 0; background: transparent; padding: 11px 16px; font-size: 14px; cursor: pointer;
  color: var(--text-sub); border-bottom: 2px solid transparent; font-family: inherit; white-space: nowrap;
}
.gps-tab:hover { color: var(--brand); }
.gps-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.gps-log { font-size: 12.5px; color: var(--text-sub); padding: 8px 0; display: flex; align-items: center; flex-wrap: wrap; }

.gps-hint {
  padding: 12px 18px; font-size: 12.5px; color: var(--text-sub); line-height: 1.8;
  background: #fafbfd; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
}

/* 行内筛选控件 */
.field-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-sub); }
.field-inline input[type="date"] {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; font-family: inherit; outline: none; color: var(--text); background: #fff;
}
.field-inline input[type="date"]:focus { border-color: var(--brand-mid); box-shadow: 0 0 0 3px rgba(26,109,212,.12); }
.field-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-sub); cursor: pointer; user-select: none; }

/* 表格合计行 */
table.data tfoot tr.total-row td {
  background: var(--brand-light); font-weight: 700; color: var(--brand);
  border-top: 2px solid var(--border); position: static;
}
table.data tfoot tr.total-row td.actions { position: sticky; background: var(--brand-light); }

/* ============ 站点规划选站弹窗（三块式） ============ */
.pick-block { margin-bottom: 16px; }
.pick-title { font-size: 13px; font-weight: 600; color: var(--text-sub); margin-bottom: 8px; }
.pk-seq { display: flex; flex-wrap: wrap; gap: 8px; min-height: 30px; }
.pk-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; background: var(--brand-light); border: 1px solid var(--brand-mid); border-radius: 16px; font-size: 13px; }
.pk-chip b { color: var(--brand); }
.pk-mv { border: none; background: transparent; cursor: pointer; font-size: 13px; padding: 0 2px; color: var(--brand); line-height: 1; }
.pk-mv:hover:not(:disabled) { color: var(--brand-dark); }
.pk-mv:disabled { opacity: .25; cursor: default; }
.pk-regions { display: flex; flex-wrap: wrap; gap: 8px; }
.pk-tag { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border: 1px solid var(--border); border-radius: 16px; font-size: 13px; cursor: pointer; user-select: none; }
.pk-tag.on { background: var(--brand-light); border-color: var(--brand-mid); color: var(--brand); font-weight: 600; }
.pk-group { margin-bottom: 14px; }
.pk-group-title { font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 6px; padding-left: 7px; border-left: 3px solid var(--brand); }
.pk-group-n { color: var(--text-sub); font-weight: 400; }
.pk-stops { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.pk-stop { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; cursor: pointer; user-select: none; }
.pk-stop:hover { border-color: var(--brand-mid); }
.pk-stop.on { background: var(--brand-light); border-color: var(--brand-mid); }
.pk-stop.cur { opacity: .72; cursor: default; }
.pk-sname { font-weight: 500; }
.pk-scode { color: var(--text-sub); font-size: 12px; }
.pk-used { width: 100%; color: var(--accent); font-size: 11px; line-height: 1.3; }

/* 线路悬浮明细：悬停时提升所在单元格层级，避免被后续行的冻结单元格（同为 sticky 层叠上下文）遮挡 */
table.data td.rh-open { z-index: 70 !important; }
.pk-search input { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; outline: none; box-sizing: border-box; }
.pk-search input:focus { border-color: var(--brand-mid); box-shadow: 0 0 0 2px var(--brand-light); }

/* 批量排班：日期段预览 */
.batch-preview { margin-top: 10px; padding: 10px 12px; background: var(--brand-light); border: 1px solid var(--brand-mid); border-radius: 8px; font-size: 12.5px; line-height: 1.9; color: var(--text); }
.batch-preview:empty { display: none; }
.batch-preview .seg { display: inline-block; margin: 0 6px 0 0; padding: 1px 9px; background: #fff; border: 1px solid var(--border); border-radius: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.batch-preview .warn { color: var(--accent); font-weight: 600; }
