/* 租个车 · 管理后台样式 v2 */

:root {
  --brand: #1763ff;
  --brand-deep: #0e49d6;
  --brand-2: #00b578;
  --ink: #0f2340;
  --text: #22304a;
  --text-2: #5d6d84;
  --text-3: #96a3b7;
  --line: #e7ecf4;
  --bg: #f3f5fa;
  --side: #101c33;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 35, 95, .04), 0 8px 24px rgba(15, 35, 95, .06);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2 { margin: 0; color: var(--ink); }

/* ---------- 外壳 ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; flex: none; background: var(--side); color: #9fb0ca;
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0;
}
.sidebar .logo {
  padding: 20px 20px 16px; font-size: 17px; font-weight: 800; color: #fff;
  display: flex; flex-direction: column; gap: 3px; line-height: 1.3;
}
.sidebar .logo span { font-size: 11px; font-weight: 400; color: #7d90ad; letter-spacing: 2px; }
.sidebar nav { display: flex; flex-direction: column; padding: 8px 10px; gap: 4px; flex: 1; }
.sidebar nav a {
  padding: 11px 14px; border-radius: 10px; font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 2px; transition: all .15s;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, .07); color: #e6edf7; }
.sidebar nav a.on {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff; font-weight: 700;
  box-shadow: 0 6px 16px rgba(23, 99, 255, .35);
}
.sidebar-foot { padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; justify-content: space-between; font-size: 12px; color: #7d90ad; }
.sidebar-foot a { color: #9fb0ca; }
.sidebar-foot a:hover { color: #fff; }
.content { flex: 1; min-width: 0; padding: 26px 28px 44px; margin-left: 216px; }
.content-title { font-size: 22px; margin-bottom: 20px; font-weight: 800; letter-spacing: .01em; }

/* ---------- 卡片 / 表格 ---------- */
.card { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border: 1px solid #f0f3f8; }
.card-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-hd h2 { font-size: 16px; font-weight: 700; }
.link { color: var(--brand); font-size: 13px; font-weight: 600; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 11px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--text-3); font-weight: 600; white-space: nowrap; background: #f8fafd; }
.table th:first-child { border-top-left-radius: 8px; }
.table th:last-child { border-top-right-radius: 8px; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f8fafd; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .ellipsis { max-width: 320px; }
.table td a { color: var(--brand); font-weight: 500; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.muted { color: var(--text-2); }
.tiny { font-size: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border: 1px solid #f0f3f8; position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--brand), var(--brand-2)); }
.stat-card span { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 6px; font-weight: 500; }
.stat-card b { font-size: 27px; color: var(--ink); font-weight: 800; letter-spacing: -.01em; }
.stat-card.accent b { color: var(--brand); }
.stat-card.accent2 b { color: #f0433e; }

/* ---------- 状态药丸 ---------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg); color: var(--text-2); }
.pill.s1 { background: #fff5e0; color: #b35c00; }
.pill.s2 { background: #e7f8ee; color: #177245; }
.pill.s3 { background: var(--bg); color: var(--text-2); }
.pill.s4 { background: #ffedec; color: #b0201f; }
.pill.s5 { background: #eaf1ff; color: #0d3f9e; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: all .15s;
}
.btn:hover { background: #f8fafd; border-color: #c8d4e4; transform: translateY(-1px); box-shadow: 0 3px 8px rgba(15, 35, 95, .07); }
.btn.xs { padding: 5px 11px; font-size: 12px; }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn.block { display: flex; width: 100%; }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-deep)); border-color: transparent; color: #fff; box-shadow: 0 5px 14px rgba(23, 99, 255, .3); }
.btn.primary:hover { background: linear-gradient(135deg, #2870ff, var(--brand-deep)); color: #fff; }
.btn.danger { color: #f0433e; border-color: #ffd2cf; }
.btn.danger:hover { background: #fff3f2; }

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .tabs { display: flex; gap: 6px; background: #fff; border-radius: 999px; padding: 4px; box-shadow: var(--shadow); border: 1px solid #f0f3f8; }
.toolbar .tabs .tab { padding: 7px 15px; font-size: 13px; color: var(--text-2); border-radius: 999px; font-weight: 500; }
.toolbar .tabs .tab.on { background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff; font-weight: 700; }
.search-inline { display: flex; gap: 8px; }
.search-inline input {
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: 13px; background: #fff; min-width: 220px; outline: none; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.search-inline input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23, 99, 255, .12); }
.inline-form { display: flex; gap: 6px; align-items: center; }
.mini-input { width: 66px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 13px; background: #fff; outline: none; color: var(--text); }
.mini-input:focus { border-color: var(--brand); }
.ops-cell { white-space: nowrap; }
.ops-cell form { display: inline-block; margin-right: 6px; }
.empty-line { padding: 40px; text-align: center; color: var(--text-3); }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; margin-bottom: 15px; }
.field input {
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font-size: 14px; background: #fff; outline: none; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23, 99, 255, .12); }
.alert { background: #ffedec; color: #b0201f; border-radius: 10px; padding: 11px 13px; font-size: 13px; margin-bottom: 15px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: 26px; transform: translateX(-50%) translateY(-10px);
  background: rgba(15, 35, 64, .94); color: #fff; padding: 10px 20px; border-radius: 999px;
  font-size: 13px; z-index: 200; opacity: 0; pointer-events: none; transition: opacity .22s, transform .22s;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 弹层 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center;
  background: rgba(15, 35, 64, .5); padding: 20px; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 16px; width: 100%; max-width: 380px; padding: 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .28); animation: pop .2s ease; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-title { font-size: 17px; margin-bottom: 10px; color: var(--ink); font-weight: 700; }
.modal-body { font-size: 13px; color: var(--text-2); line-height: 1.7; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal-field { width: 100%; margin-top: 10px; }
.modal-field input, .modal-field select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; background: #fff; color: var(--text); outline: none;
}
.modal-field input:focus, .modal-field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23, 99, 255, .12); }

/* ---------- 后台登录 ---------- */
.login-body {
  display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px;
  background: linear-gradient(135deg, #101c33 0%, #1b2c4d 60%, #173a5e 100%);
}
.login-card { background: #fff; border-radius: 18px; padding: 30px; width: 100%; max-width: 380px; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); }
.login-card .logo {
  font-size: 22px; font-weight: 800; display: flex; flex-direction: column; margin-bottom: 22px; line-height: 1.3;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.login-card .logo span { font-size: 12px; font-weight: 400; color: var(--text-3); -webkit-text-fill-color: var(--text-3); letter-spacing: 3px; margin-top: 3px; }
.login-card .muted { font-size: 12px; margin-top: 12px; line-height: 1.7; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .sidebar { position: static; width: 100%; flex-direction: row; align-items: center; height: auto; padding: 0 10px; overflow-x: auto; }
  .sidebar .logo { padding: 12px 10px; flex-direction: row; gap: 6px; font-size: 15px; align-items: baseline; flex: none; }
  .sidebar nav { flex-direction: row; gap: 4px; padding: 8px 0; }
  .sidebar nav a { padding: 9px 11px; font-size: 13px; white-space: nowrap; }
  .sidebar-foot { display: none; }
  .shell { flex-direction: column; }
  .content { margin-left: 0; padding: 18px 14px 32px; }
  .card { padding: 14px; overflow-x: auto; }
  .table { min-width: 740px; }
  .content-title { font-size: 19px; }
}
