/* ==========================================================================
   车辆行驶登记系统 · 样式
   设计取向：纸本质感的浅色台账界面，数据密度适中，移动端优先可用
   ========================================================================== */

:root {
  --brand: #1a5fb4;
  --brand-dark: #144a8c;
  --brand-soft: #eaf1fb;
  --accent: #0e8c83;
  --accent-soft: #e5f5f3;
  --ink: #16202b;
  --ink-2: #3d4a58;
  --muted: #6b7785;
  --muted-2: #8b96a3;
  --line: #e4e8ee;
  --line-strong: #d3d9e2;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --danger: #c53b3b;
  --danger-soft: #fdecec;
  --warn: #b5761a;
  --warn-soft: #fdf4e6;
  --ok: #2b7a52;
  --ok-soft: #e9f6ee;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(18, 32, 50, 0.05);
  --shadow: 0 6px 24px rgba(18, 32, 50, 0.08);
  --shadow-lg: 0 24px 64px rgba(18, 32, 50, 0.16);
  --sidebar-w: 236px;
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Songti SC", "STSong", "SimSun", Georgia, serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ico {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] { display: none !important; }

/* ---------------------------------- 登录 --------------------------------- */
.login-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  min-height: 100vh;
  background: var(--surface);
}

.login-aside {
  position: relative;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  color: #eaf1fb;
  background:
    radial-gradient(900px 520px at 12% 8%, rgba(80, 150, 235, 0.42), transparent 62%),
    radial-gradient(700px 480px at 88% 92%, rgba(14, 140, 131, 0.38), transparent 60%),
    linear-gradient(155deg, #102a4c 0%, #123a67 46%, #0d2b4b 100%);
  overflow: hidden;
}

.login-aside::after {
  content: "";
  position: absolute;
  inset: auto -60px -120px auto;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 40px rgba(255, 255, 255, 0.04), 0 0 0 90px rgba(255, 255, 255, 0.03);
}

.brand-mark { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.brand-mark svg { width: 40px; height: 40px; border-radius: 11px; }
.brand-name { font-size: 16px; font-weight: 600; letter-spacing: 0.02em; }
.brand-sub { font-size: 12px; color: rgba(234, 241, 251, 0.68); letter-spacing: 0.08em; }

.login-quote { position: relative; z-index: 1; margin-top: auto; }
.login-quote h2 {
  font-family: var(--font-serif);
  font-size: clamp(26px, 2.6vw, 38px);
  line-height: 1.42;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.login-quote p {
  margin-top: 18px;
  max-width: 30em;
  font-size: 13.5px;
  line-height: 1.9;
  color: rgba(234, 241, 251, 0.74);
}

.login-points { position: relative; z-index: 1; display: grid; gap: 12px; margin-bottom: 8px; }
.login-points li {
  position: relative;
  padding-left: 22px;
  font-size: 13px;
  color: rgba(234, 241, 251, 0.82);
}
.login-points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #5fc4b8;
  transform: rotate(45deg);
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.login-card { width: 100%; max-width: 372px; }
.login-card h1 { font-size: 26px; font-weight: 600; letter-spacing: 0.02em; }
.login-hint { margin: 6px 0 26px; color: var(--muted); font-size: 13px; }

/* ---------------------------------- 表单 --------------------------------- */
.field { display: block; margin-bottom: 16px; }
.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.field-label .req { color: var(--danger); margin-left: 2px; }

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%236b7785' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

textarea { resize: vertical; min-height: 68px; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 95, 180, 0.12);
}

input::placeholder, textarea::placeholder { color: var(--muted-2); }
input[readonly] { background: #f7f9fc; color: var(--ink-2); }
input:disabled, select:disabled { background: #f4f6f9; color: var(--muted); cursor: not-allowed; }

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(197, 59, 59, 0.12);
}
.field-error { margin-top: 5px; font-size: 12px; color: var(--danger); }

.form-error {
  margin: 0 0 14px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  border: 1px solid #f3cccc;
  color: var(--danger);
  font-size: 12.5px;
}

/* ---------------------------------- 按钮 --------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.06s;
}
.btn:hover { background: #f7f9fc; border-color: #c3cbd7; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn .ico { width: 16px; height: 16px; }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 1px 2px rgba(26, 95, 180, 0.28);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

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

.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #eef2f7; color: var(--ink-2); border-color: transparent; }

.btn-block { width: 100%; height: 42px; font-size: 14.5px; letter-spacing: 0.08em; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: #f2f5f9; color: var(--ink); }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}
.link-btn:hover { color: var(--brand); }
.link-btn .ico { width: 15px; height: 15px; }

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 16px;
  background: #0f2a47;
  color: #dbe6f4;
  z-index: 40;
}

.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 20px; }
.sidebar-brand svg { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.sidebar-title { font-size: 14px; font-weight: 600; color: #fff; letter-spacing: 0.02em; }
.sidebar-sub { font-size: 11px; color: rgba(219, 230, 244, 0.55); letter-spacing: 0.06em; }

.nav { display: grid; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  color: rgba(219, 230, 244, 0.76);
  font-size: 13.5px;
  cursor: pointer;
  border: 0;
  background: none;
  text-align: left;
  width: 100%;
  transition: background 0.15s, color 0.15s;
}
.nav-item .ico { width: 17px; height: 17px; opacity: 0.9; }
.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, 0.12); color: #fff; box-shadow: inset 2px 0 0 #5fa8ff; }
.nav-item.active .ico { opacity: 1; }
.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e5484d;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(229, 72, 77, 0.18);
}
.nav-badge[hidden] { display: none; }
.nav-section {
  margin: 16px 12px 6px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: rgba(219, 230, 244, 0.4);
  text-transform: uppercase;
}

.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #2c7be5, #1a5fb4);
  color: #fff; font-size: 13px; font-weight: 600; flex: none;
}
.user-name { font-size: 13px; color: #fff; font-weight: 500; }
.user-role { font-size: 11px; color: rgba(219, 230, 244, 0.6); }
.foot-actions { display: flex; justify-content: space-between; padding: 0 8px; }
.sidebar .link-btn { color: rgba(219, 230, 244, 0.6); }
.sidebar .link-btn:hover { color: #fff; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 30px;
  background: rgba(243, 245, 249, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 18px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.view { padding: 24px 30px 56px; max-width: 1360px; width: 100%; }
.view:focus { outline: none; }

/* ---------------------------------- 卡片 --------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.card-title { font-size: 14px; font-weight: 600; }
.card-sub { font-size: 12px; color: var(--muted); }
.card-body { padding: 18px; }

/* 筛选栏 */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.toolbar .field { margin: 0; min-width: 0; }
.toolbar .field-label { font-size: 11.5px; color: var(--muted); }
.toolbar .f-vehicle { flex: 0 0 190px; }
.toolbar .f-status { flex: 0 0 124px; }
.toolbar .f-date { flex: 0 0 150px; }
.toolbar-grow { flex: 1 1 200px; }
.toolbar-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.toolbar select, .toolbar input { height: 36px; padding-top: 0; padding-bottom: 0; }

/* 统计摘要条 */
.summary-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.chip b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 可点击筛选的统计标签 */
.chip-btn {
  font: inherit;
  font-size: 12.5px;
  line-height: 1.4;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.chip-btn:hover { border-color: var(--brand); color: var(--brand); }
.chip-btn:hover b { color: var(--brand); }
.chip-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* 默认文字色（用类控制，避免内联样式盖掉选中态白字） */
.chip-btn[data-filter="restricted"], .chip-btn[data-filter="restricted"] b { color: #8a5a12; }
.chip-btn[data-filter="repair"], .chip-btn[data-filter="repair"] b { color: #a83c3c; }
.chip-btn.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 1px 2px rgba(26, 95, 180, .28);
}
.chip-btn.is-on b { color: #fff; }
.chip-btn[data-filter="restricted"].is-on { background: #b8791f; border-color: #b8791f; }
.chip-btn[data-filter="repair"].is-on { background: #a83c3c; border-color: #a83c3c; }
.text-brand { color: var(--brand); }

/* 筛选结果提示条 */
.filter-note {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--muted);
}
.filter-note .link-btn { font-size: 12.5px; padding: 0; color: var(--brand); text-decoration: underline; }

/* ---------------------------------- 表格 --------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th {
  text-align: left;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
table.data td {
  padding: 12px 14px;
  border-bottom: 1px solid #eef1f6;
  vertical-align: middle;
  color: var(--ink-2);
}
table.data tbody tr:hover { background: #fafcff; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
table.data .strong { color: var(--ink); font-weight: 500; }
table.data .muted { color: var(--muted); }
table.data .nowrap { white-space: nowrap; }

.cell-main { color: var(--ink); font-weight: 500; }
.cell-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.cell-value { min-width: 0; }

.plate {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: #eef4fd;
  border: 1px solid #d6e4fb;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-actions .icon-btn { width: 30px; height: 30px; border-color: transparent; background: transparent; }
.row-actions .icon-btn:hover { background: #eef2f7; }
.row-actions .icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-title { font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.empty-hint { font-size: 12.5px; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.pagination .pages { display: flex; gap: 6px; align-items: center; }

/* ---------------------------------- 报表 --------------------------------- */
.report-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  padding: 18px;
  margin-bottom: 16px;
  background:
    linear-gradient(120deg, #ffffff 0%, #f7faff 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.report-head .title { font-size: 15px; font-weight: 600; }
.report-head .desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.report-head .grow { flex: 1 1 240px; }
.report-head .r-field { margin: 0; }
.report-head .r-vehicle { flex: 0 0 190px; }
.report-head .r-period { flex: 0 0 168px; }
.report-head .r-granularity { flex: 0 0 auto; }
.report-actions { display: flex; gap: 8px; }

.segmented {
  display: inline-flex;
  padding: 3px;
  background: #eef2f7;
  border-radius: 10px;
  gap: 2px;
}
.segmented button {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.segmented button.active {
  background: #fff;
  color: var(--brand-dark);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(18, 32, 50, 0.12);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--brand);
  opacity: 0.75;
}
.kpi.k-accent::before { background: var(--accent); }
.kpi.k-warn::before { background: #d99a2b; }
.kpi.k-muted::before { background: #b9c3d0; }
.kpi-label { font-size: 11.5px; color: var(--muted); letter-spacing: 0.03em; }
.kpi-value {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.2;
}
.kpi-value .unit { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi-foot { margin-top: 6px; font-size: 11.5px; color: var(--muted-2); display: flex; align-items: center; gap: 6px; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.delta.up { color: var(--danger); }
.delta.down { color: var(--ok); }
.delta.flat { color: var(--muted); }

.report-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.report-grid.equal { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.chart-box { padding: 10px 6px 4px; }
.chart-legend { display: flex; gap: 16px; padding: 0 12px 8px; font-size: 11.5px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: #eef1f6; stroke-width: 1; }
.chart .axis-text { fill: #8b96a3; font-size: 10px; font-family: var(--font); }
.chart .bar { fill: var(--brand); opacity: 0.9; transition: opacity 0.15s; }
.chart .bar:hover { opacity: 1; }
.chart .bar-idle { fill: #dde5f0; }
.chart .bar-label { fill: var(--ink-2); font-size: 9.5px; font-family: var(--font); }

.rank-list { display: grid; gap: 12px; }
.rank-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.rank-name { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.rank-idx {
  width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 600; background: #eef2f7; color: var(--muted); flex: none;
}
.rank-row:nth-child(1) .rank-idx { background: var(--brand); color: #fff; }
.rank-row:nth-child(2) .rank-idx { background: #cfe0f7; color: var(--brand-dark); }
.rank-row:nth-child(3) .rank-idx { background: #e3ecf9; color: var(--brand-dark); }
.rank-value { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.rank-bar { grid-column: 1 / -1; height: 6px; border-radius: 4px; background: #eff3f8; overflow: hidden; }
.rank-bar span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #4a8fe0, #1a5fb4); }
.rank-meta { font-size: 11px; color: var(--muted); font-weight: 400; }

.hbar-list { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: 76px 1fr 86px; align-items: center; gap: 10px; font-size: 12.5px; }
.hbar-name { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 8px; background: #eff3f8; border-radius: 4px; overflow: hidden; }
.hbar-track span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #7fb2e8, #2f6fbf); }
.hbar-val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12px; }

.report-footnote {
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--muted-2);
  line-height: 1.9;
}

/* 报表打印头 */
.print-only { display: none; }
.print-head { margin-bottom: 14px; }
.print-head h1 { font-family: var(--font-serif); font-size: 20px; letter-spacing: 0.06em; text-align: center; }
.print-head .meta {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 10px; padding-bottom: 8px;
  border-bottom: 1px solid #333; font-size: 12px; color: #333;
}

/* ---------------------------------- 弹窗 --------------------------------- */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(14, 26, 40, 0.45);
  backdrop-filter: blur(2px);
}
.modal {
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-in 0.18s ease-out;
}
.modal.modal-sm { max-width: 420px; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}
.modal-foot .grow { flex: 1; font-size: 12px; color: var(--muted); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .field { margin-bottom: 12px; }
.form-section {
  margin: 2px 0 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

.calc-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  border: 1px solid #d8e6fa;
  font-size: 12.5px;
  color: var(--brand-dark);
}
.calc-hint b { font-variant-numeric: tabular-nums; }

/* ---------------------------------- 提示 --------------------------------- */
.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: grid;
  gap: 8px;
  max-width: min(92vw, 380px);
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #16202b;
  color: #f4f7fb;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease-out;
  line-height: 1.6;
}
.toast.error { background: #8f2c2c; }
.toast.success { background: #1f5d40; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(14, 26, 40, 0.4);
  z-index: 35;
}

.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, #eef2f7 25%, #f6f8fb 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  height: 14px;
}
@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

/* ---------------------------------- 响应式 --------------------------------- */
/* --------------------------- 用车流程与状态 --------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1;
}
.badge.blue { background: var(--brand-soft); color: var(--brand); }
.badge.green { background: var(--ok-soft); color: var(--ok); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.gray { background: #eef1f5; color: var(--muted); }
.cell-badges { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }

.alert-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #ecd8b4;
  background: #fdf8ee;
  margin-bottom: 14px;
}
.alert-banner.danger { border-color: #ecc9c9; background: #fdf3f3; }
.alert-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #f6e3c3;
  color: #8a5a12;
  display: grid;
  place-items: center;
  flex: none;
}
.alert-icon .ico { width: 17px; height: 17px; }
.alert-banner.danger .alert-icon { background: #f8dcdc; color: #a32d2d; }
.alert-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.alert-desc { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.7; }
.alert-actions { margin-left: auto; display: flex; gap: 8px; flex: none; align-items: center; }

.tabs {
  display: inline-flex;
  padding: 3px;
  background: #eef2f7;
  border-radius: 10px;
  gap: 2px;
  margin-bottom: 14px;
  max-width: 100%;
  overflow-x: auto;
}
.tabs button {
  height: 32px;
  padding: 0 13px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }
.tabs .count { color: var(--muted-2); font-size: 11.5px; margin-left: 4px; }

.approval-card { padding: 15px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.approval-card:last-child { border-bottom: 0; }
.approval-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.approval-title { font-size: 13.5px; font-weight: 600; }
.approval-reason {
  padding: 9px 11px;
  background: #f7f9fc;
  border-left: 2px solid var(--line-strong);
  border-radius: 0 8px 8px 0;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.7;
}
.approval-meta { font-size: 11.5px; color: var(--muted); }
.approval-actions { display: flex; gap: 8px; justify-content: flex-end; }

.timeline { display: grid; margin-top: 4px; }
.tl-item { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding-bottom: 14px; position: relative; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 20px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.tl-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 600;
}
.tl-dot.ok { background: var(--ok-soft); color: var(--ok); }
.tl-dot.warn { background: var(--warn-soft); color: var(--warn); }
.tl-dot.danger { background: var(--danger-soft); color: var(--danger); }
.tl-title { font-size: 13px; font-weight: 500; color: var(--ink); }
.tl-meta { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.tl-note { font-size: 12px; color: var(--ink-2); margin-top: 2px; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 18px; }
.ditem { min-width: 0; }
.dlabel { font-size: 11.5px; color: var(--muted); }
.dvalue { font-size: 13.5px; color: var(--ink); word-break: break-word; line-height: 1.65; }
.ditem.span-2 { grid-column: span 2; }

.vcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(318px, 1fr)); gap: 14px; }
.vcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vcard.state-in_use { border-color: #b9d8d4; box-shadow: 0 4px 18px rgba(14, 140, 131, 0.08); }
.vcard.state-reserved { border-color: #ecd8b4; }
.vcard.state-repair { border-color: #ecc9c9; background: #fdfafa; }
.vcard.state-inactive { opacity: 0.72; }
.vcard-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.vcard-plate { font-size: 15px; font-weight: 600; letter-spacing: 0.01em; }
.vcard-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.vrows { display: grid; gap: 6px; }
.vrow { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 8px; font-size: 12.5px; line-height: 1.6; }
.vrow > span { color: var(--muted); }
.vrow > b { font-weight: 500; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.slot-list {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
}
.slot-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.slot-row > b { font-weight: 500; color: var(--ink-2); }
.daystrip { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 3px; }
.day {
  border-radius: 6px;
  background: #eef6ef;
  color: #2b7a52;
  text-align: center;
  padding: 4px 0 3px;
  font-size: 9.5px;
  line-height: 1.3;
}
.day em { display: block; font-style: normal; font-size: 8.5px; opacity: 0.72; }
.day i { display: block; font-style: normal; font-weight: 600; font-size: 10.5px; line-height: 1.3; }
#status-legend { align-items: center; }
.day.busy { background: #fbeceb; color: #a83c3c; }
.day.mine { background: var(--brand-soft); color: var(--brand); }
.day.today { box-shadow: inset 0 0 0 1px currentColor; }
.day.past { opacity: 0.45; }
/* 限行日：黄色描边，与占用色区分，二者可叠加 */
.day.restricted { box-shadow: inset 0 0 0 1px #d8a13a; background: #fdf6e6; color: #8a5a12; }
.day.restricted.busy { background: #fbeee0; color: #8a5a12; }
.day.restricted.today { box-shadow: inset 0 0 0 2px #c98a1c; }

/* 批量导入结果 */
.import-result { margin-top: 12px; font-size: 12.5px; }
.import-errors { border: 1px solid #ecc9c9; background: #fdf6f6; border-radius: 10px; padding: 10px 12px; }
.import-error { display: flex; gap: 8px; padding: 3px 0; color: #8a2f2f; }
.import-error span { color: var(--muted); flex: none; min-width: 56px; }
.text-warn { color: #8a5a12 !important; }
.alert-banner.warn { border-color: #ecd8b4; background: #fdf8ee; }
.alert-banner.warn .alert-icon { background: #f6e3c3; color: #8a5a12; }
.vcard-foot { display: flex; gap: 8px; align-items: center; margin-top: auto; }
.vcard-foot .btn { flex: 1; }

.form-summary {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 16px;
}
.form-summary .fs-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; line-height: 1.6; }
.form-summary .fs-row > span { color: var(--muted); flex: none; }
.form-summary .fs-row > b { font-weight: 500; color: var(--ink-2); text-align: right; }

.notice {
  padding: 10px 12px;
  border-radius: 9px;
  background: #f6f9fd;
  border: 1px solid #dde8f6;
  color: #33506f;
  font-size: 12px;
  line-height: 1.75;
}
.notice.warn { background: #fdf8ee; border-color: #f0dcbc; color: #7a5312; }
.notice b { font-weight: 600; }

.check-line {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  line-height: 1.7;
}
.check-line input { width: 15px; height: 15px; margin-top: 2px; accent-color: var(--brand); flex: none; }

@media (max-width: 1080px) {
  .report-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    width: 264px;
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .topbar-title h1 { font-size: 16.5px; }
  .topbar-sub { display: none; }
  .view { padding: 16px 16px 48px; }
  .login-screen { grid-template-columns: 1fr; }
  .login-aside { padding: 28px 24px; min-height: auto; gap: 22px; }
  .login-quote h2 { font-size: 24px; }
  .login-quote p, .login-points { display: none; }
  .login-panel { padding: 28px 20px 44px; }
}

@media (max-width: 720px) {
  body { font-size: 13.5px; }
  .toolbar { padding: 12px; gap: 10px; }
  .toolbar .field { flex: 1 1 45%; }
  .toolbar .f-vehicle { flex-basis: 100%; }
  .toolbar-actions { margin-left: 0; width: 100%; }
  .toolbar-actions .btn { flex: 1; }

  /* 顶栏动作在手机上收成图标按钮，避免标题换行 */
  .topbar-actions .btn { width: 38px; height: 38px; padding: 0; }
  .topbar-actions .btn span { display: none; }

  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }
  table.data tbody tr:last-child { border-bottom: 0; }
  table.data td {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    align-items: start;
    column-gap: 12px;
    padding: 3px 0;
    border: 0;
    text-align: right;
    font-size: 13px;
  }
  table.data td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    text-align: left;
    line-height: 1.7;
  }
  .cell-value { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; }
  .cell-value .cell-sub { margin-top: 0; }
  .cell-value .plate { align-self: flex-end; }
  table.data td[data-role="actions"]::before { content: ""; }
  .row-actions { justify-content: flex-end; }

  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-value { font-size: 20px; }
  .report-head { padding: 14px; }
  .report-head > .grow { flex-basis: 100%; }
  .report-head > .field { flex: 1 1 calc(50% - 7px); min-width: 0; }
  .report-head > .field:has(#r-vehicle) { order: 1; }
  .report-head > .field:has(#r-period) { order: 2; }
  .report-head > .field:has(.segmented) { order: 3; flex-basis: 100%; }
  .report-actions { width: 100%; }
  .report-actions .btn { flex: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .modal { max-height: calc(100vh - 24px); border-radius: 14px; }
  .modal-root { padding: 12px; align-items: flex-end; }
  .modal-body { padding: 14px 16px; }
  .modal-head, .modal-foot { padding: 14px 16px; }
  .toast-root { right: 12px; left: 12px; bottom: 12px; max-width: none; }
  .hbar { grid-template-columns: 68px 1fr 78px; gap: 8px; }
  .alert-banner { flex-wrap: wrap; padding: 12px; }
  .alert-actions { margin-left: 0; width: 100%; }
  .alert-actions .btn { flex: 1; }
  .detail-grid { grid-template-columns: 1fr; gap: 11px; }
  .ditem.span-2 { grid-column: span 1; }
  .vcard-grid { grid-template-columns: 1fr; }
  .daystrip { gap: 2px; }
  .day { font-size: 9px; padding: 3px 0 2px; }
  .day em { display: none; }
  .approval-actions { justify-content: stretch; }
  .approval-actions .btn { flex: 1; }
  .tabs { width: 100%; }
  .tabs button { flex: 1; padding: 0 8px; }
}

/* ==========================================================================
   移动端适配增强（2026-12-02）
   解决：iPhone 聚焦输入框自动放大、触屏点击目标过小、刘海屏安全区、
   手机浏览器地址栏伸缩导致弹窗被裁、横屏登录页挤压等问题
   ========================================================================== */

/* 基础：禁止横屏字号自动放大；去掉触屏点击高亮与双击缩放延迟 */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
button, .btn, .chip-btn, .icon-btn, .link-btn, .tabs button, .nav-item, .day {
  touch-action: manipulation;
}
button, a, .chip-btn { -webkit-tap-highlight-color: rgba(26, 95, 180, 0.12); }

/* 刘海屏 / 底部手势条安全区（viewport-fit=cover 已开启） */
@supports (padding: env(safe-area-inset-bottom)) {
  @media (max-width: 900px) {
    .topbar { padding-top: calc(10px + env(safe-area-inset-top)); }
    .view {
      padding-left: max(16px, env(safe-area-inset-left));
      padding-right: max(16px, env(safe-area-inset-right));
    }
    .sidebar { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
    .toast-root { bottom: calc(12px + env(safe-area-inset-bottom)); }
    .modal-root { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  }
}

@media (max-width: 720px) {
  /* iOS Safari 在输入框字号 < 16px 时会放大整页，这里统一提到 16px
     （选择器权重需与第 170 行的原规则一致，否则被 14px 覆盖） */
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  select,
  textarea { font-size: 16px; }

  /* 卡片网格用 minmax(0,1fr)，避免内容（如 14 天日期条、图表）把卡片撑出屏幕 */
  .vcard-grid { grid-template-columns: minmax(0, 1fr); }
  .vcard { min-width: 0; }
  .daystrip { min-width: 0; }
  /* .report-grid.equal 用 minmax(320px,1fr)，窄屏会把卡片顶出屏幕，需一并覆盖 */
  .report-grid,
  .report-grid.equal { grid-template-columns: minmax(0, 1fr); }
  .report-grid > *, .card { min-width: 0; }

  /* 触屏点击目标不小于 40px（原 30/32px 手指容易点错） */
  .icon-btn,
  .row-actions .icon-btn { width: 40px; height: 40px; flex: 0 0 auto; }
  .row-actions { gap: 8px; }
  .btn-sm { height: 40px; }
  .topbar-actions .btn { width: 40px; height: 40px; }
  .vcard-foot .btn { min-height: 40px; }
  .nav-item { min-height: 38px; }
  .link-btn { min-height: 40px; }
  .chip-btn { min-height: 34px; }

  /* 弹窗：用 dvh 兼容手机地址栏伸缩；正文独立滚动、底部按钮常驻 */
  .modal { max-height: calc(100dvh - 24px); }
  .modal-body { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .modal-foot {
    position: sticky;
    bottom: 0;
    background: #fff;
    box-shadow: 0 -1px 0 var(--line);
  }
  .modal-foot .btn { min-height: 40px; }

  /* 长车号 / 长品牌名不撑破卡片 */
  .vcard-plate, .vcard-sub, .cell-value, .report-footnote { overflow-wrap: anywhere; }

  /* 表格卡片化后操作行留出更清晰的间距 */
  table.data td[data-role="actions"] { padding-top: 8px; }

  /* 输入框变高后工具栏别挤在一起 */
  .toolbar input, .toolbar select { height: 40px; }
  .toolbar .btn { min-height: 40px; }
}

/* 触屏设备（手机 / 平板）：不管屏幕多宽都保证点击目标够大；桌面鼠标环境不受影响 */
@media (hover: none) and (pointer: coarse) {
  .icon-btn,
  .row-actions .icon-btn { width: 40px; height: 40px; flex: 0 0 auto; }
  .row-actions { gap: 8px; }
  .btn { min-height: 40px; }
  .btn-sm { height: 40px; }
  .link-btn { min-height: 40px; }
  .chip-btn { min-height: 34px; }
}

/* 380px 及以下的窄屏：日期条压缩间距与字号，保证 14 天完整可见（信息展示，不需要滑动） */
@media (max-width: 380px) {
  .view { padding-left: 12px; padding-right: 12px; }
  .daystrip { gap: 2px; }
  .day { font-size: 8.5px; padding: 3px 0 2px; }
  .day i { font-size: 9.5px; }
  .summary-strip { gap: 6px; }
  .chip { padding: 4px 10px; font-size: 12px; }
  table.data td { grid-template-columns: 64px minmax(0, 1fr); }
  .modal-root { padding: 8px; }
  .modal { max-height: calc(100dvh - 16px); }
}

/* 手机横屏（高度很矮）：登录页隐藏宣传区，弹窗用满高度 */
@media (max-height: 520px) and (orientation: landscape) {
  .login-aside { display: none; }
  .login-panel { padding: 20px 24px; }
  .modal-root { padding: 8px; align-items: center; }
  .modal { max-height: calc(100dvh - 16px); }
  .topbar { padding-top: 8px; padding-bottom: 8px; }
}

/* ------------------------------ 密码强度提示 ------------------------------ */
.pwd-meter-wrap { margin-top: 8px; }
.pwd-rules { display: flex; flex-wrap: wrap; gap: 5px; }
.pwd-rule {
  font-size: 11.5px;
  line-height: 1.75;
  padding: 1px 8px;
  border-radius: 999px;
  background: #f1f4f8;
  color: var(--muted-2);
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease;
}
.pwd-rule.ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(43, 122, 82, 0.16); }
.pwd-msg { margin-top: 6px; font-size: 12px; line-height: 1.5; min-height: 18px; color: var(--muted); }
.pwd-msg.ok { color: var(--ok); }
.pwd-msg.bad { color: var(--danger); }

/* ---------------------------------- 打印 --------------------------------- */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .toolbar, .report-head, .report-actions, .modal-root, .toast-root,
  .no-print, .row-actions, .pagination { display: none !important; }
  .main { margin: 0; }
  .view { padding: 0; max-width: none; }
  .print-only { display: block !important; }
  .card, .kpi { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .report-grid { grid-template-columns: 1fr; }
  table.data th, table.data td { padding: 6px 8px; font-size: 11px; }
  table.data th { background: #f0f0f0; }
  table.data thead { display: table-header-group; }
  table.data tr { break-inside: avoid; }
  .chart .bar { fill: #4a6f9e !important; }
  @page { size: A4; margin: 14mm 12mm; }
}

/* ==========================================================================
   车辆状态机与站内通知（2026-12-03）
   ========================================================================== */

/* 状态卡片底部可能有「查看台账 / 登记 / 报修 / 年审 / 接单」多个按钮，允许换行 */
.vcard-foot { flex-wrap: wrap; }
.vcard-foot .btn { flex: 0 1 auto; min-width: 96px; }

.field-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }

.notice-danger {
  background: var(--danger-soft);
  border-left: 3px solid var(--danger);
  color: var(--ink-2);
}

/* ------------------------------ 顶栏铃铛 ------------------------------ */
.notice-btn { position: relative; }
.notice-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  line-height: 16px;
  text-align: center;
  font-weight: 500;
}

/* --------------------------- 右下角进度弹窗 --------------------------- */
.notice-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 190;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 340px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}

.notice-card {
  pointer-events: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  animation: notice-in 0.24s ease-out;
}
.notice-card.warn { border-left-color: var(--warn); }
.notice-card.err { border-left-color: var(--danger); }
.notice-card.ok { border-left-color: var(--ok); }
.notice-card.leaving { opacity: 0; transform: translateY(6px); transition: all 0.2s ease-in; }

@keyframes notice-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.notice-head { display: flex; align-items: center; gap: 8px; }
.notice-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand); flex: none;
}
.notice-card.warn .notice-dot { background: var(--warn); }
.notice-card.err .notice-dot { background: var(--danger); }
.notice-card.ok .notice-dot { background: var(--ok); }
.notice-title { font-size: 13.5px; font-weight: 500; color: var(--ink); flex: 1; min-width: 0; }
.notice-x {
  border: 0; background: transparent; color: var(--muted-2);
  font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.notice-x:hover { color: var(--ink); }
.notice-text { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.notice-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; font-size: 11.5px; color: var(--muted-2);
}

/* ------------------------------ 消息列表 ------------------------------ */
.notice-panel { display: flex; flex-direction: column; gap: 2px; max-height: 56vh; overflow-y: auto; }
.notice-item {
  display: flex; gap: 10px; width: 100%; text-align: left;
  padding: 11px 10px; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; cursor: pointer; border-radius: var(--radius-sm);
}
.notice-item:hover { background: var(--bg); }
.notice-item.unread { background: var(--brand-soft); }
.notice-item-dot {
  width: 6px; height: 6px; border-radius: 50%; margin-top: 7px; flex: none;
  background: var(--muted-2);
}
.notice-item-dot.warn { background: var(--warn); }
.notice-item-dot.err { background: var(--danger); }
.notice-item-dot.ok { background: var(--ok); }
.notice-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notice-item-main b { font-size: 13px; font-weight: 500; color: var(--ink); }
.notice-item-body { font-size: 12.5px; color: var(--ink-2); }
.notice-item-time { font-size: 11.5px; color: var(--muted-2); }

@media (max-width: 640px) {
  .notice-root { right: 12px; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; }
}

/* ==========================================================================
   同乘人员选择器（2026-12-04）
   让「同乘人员」可与账号关联，被选中的人可在台账看到本行程
   ========================================================================== */

.passenger-picker { display: flex; flex-direction: column; gap: 8px; }

.pp-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 24px; }
.pp-empty { font-size: 12.5px; color: var(--muted); }
.pp-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px 3px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.4;
}
.pp-chip-x {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  border-radius: 50%;
}
.pp-chip-x:hover { color: var(--danger); background: rgba(0, 0, 0, 0.05); }

.pp-actions { display: flex; align-items: center; gap: 10px; }
.pp-count { font-size: 12px; color: var(--muted); }

.pp-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pp-search {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg);
  color: var(--ink);
}
.pp-list { max-height: 190px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.pp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
}
.pp-item:hover { background: var(--bg); }
.pp-item input { flex: none; }
.pp-name { flex: 1; min-width: 0; color: var(--ink); }
.pp-dept { font-size: 12px; color: var(--muted); }
.pp-foot { display: flex; align-items: center; justify-content: space-between; }

@media (max-width: 640px) {
  .pp-list { max-height: 160px; }
}

/* ==========================================================================
   车辆归属部门分组（2026-12-04）
   登记表单默认只看本部门车辆，跨部门用车取消勾选即可，不做硬限制
   ========================================================================== */
.check-line.dept-only {
  margin-top: 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
}

.vcard-dept { margin-top: 3px; font-size: 11.5px; color: var(--muted-2); }
.vcard-dept.own { color: var(--brand); font-weight: 500; }
