:root {
  --ink: #1f2328;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f6f7f8;
  --card: #ffffff;
  --accent: #0f766e;
  --accent-weak: #e6f4f2;
  --warn: #b45309;
  --danger: #b91c1c;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell { display: flex; min-height: 100%; }
.side {
  width: 208px; flex: 0 0 208px; background: #fbfbfc;
  border-right: 1px solid var(--line); padding: 18px 14px;
  display: flex; flex-direction: column; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.nav {
  padding: 7px 10px; border-radius: 6px; color: var(--ink);
  text-decoration: none; font-size: 14px;
}
.nav:hover { background: #eef0f2; text-decoration: none; }
.nav.active { background: var(--accent-weak); color: var(--accent); font-weight: 600; }
.side-foot { margin-top: auto; color: var(--muted); font-size: 12px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 16px 26px;
  border-bottom: 1px solid var(--line); background: var(--card);
}
.topbar h1 { font-size: 16px; margin: 0; font-weight: 600; }
.userbox { margin-left: auto; color: var(--muted); font-size: 13px; }
.userbox a { color: var(--muted); margin-left: 8px; }

.content { padding: 22px 26px 40px; max-width: 1180px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 16px 18px; margin-bottom: 16px;
}
.card h2 { font-size: 14px; margin: 0 0 12px; font-weight: 600; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.stat .k { color: var(--muted); font-size: 12px; }
.stat .v { font-size: 24px; font-weight: 600; margin-top: 4px; }
.stat.warn .v { color: var(--warn); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }

.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; background: #eef0f2; color: var(--muted);
}
.badge.vehicle.available { background: #e8f5ee; color: #15803d; }
.badge.vehicle.rented { background: var(--accent-weak); color: var(--accent); }
.badge.vehicle.maintenance { background: #fef7e7; color: var(--warn); }
.badge.contract.active { background: var(--accent-weak); color: var(--accent); }
.badge.contract.draft { background: #eef0f2; color: var(--muted); }
.badge.contract.closed { background: #eef0f2; color: var(--muted); }
.badge.contract.cancelled { background: #fdeaea; color: var(--danger); }

.btn, button {
  display: inline-block; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); border-radius: 6px; padding: 6px 12px; font-size: 13px;
  cursor: pointer; text-decoration: none;
}
.btn:hover, button:hover { background: #f3f4f6; text-decoration: none; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: #0d655e; }
button.ghost { background: transparent; }
form.inline { display: inline-block; margin-right: 6px; }

.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.grid-form .span2 { grid-column: span 2; }
input, select {
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px;
  font-size: 14px; font-family: inherit; color: var(--ink); background: #fff;
}
input:focus, select:focus { outline: 2px solid var(--accent-weak); border-color: var(--accent); }
.grid-form button { justify-self: start; }

.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; margin-bottom: 14px; }
.kv span { color: var(--muted); display: inline-block; min-width: 56px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 84px 1fr 96px; align-items: center; gap: 10px; }
.bar-label { color: var(--muted); font-size: 12px; }
.bar { height: 14px; border-radius: 4px; background: var(--accent); min-width: 2px; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; }

.muted { color: var(--muted); }
.notice {
  margin: 14px 26px 0; padding: 9px 14px; border-radius: 6px;
  background: var(--accent-weak); color: var(--accent); font-size: 13px;
}
.login-wrap { display: flex; min-height: 70vh; align-items: center; justify-content: center; padding: 40px 16px; }
.login-card { width: 340px; padding: 26px 26px 22px; }
.login-card h2 { margin: 0 0 6px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.login-card button { margin-top: 4px; padding: 9px; }

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { width: auto; flex: none; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { display: none; }
  .grid-form, .kv { grid-template-columns: 1fr; }
  .grid-form .span2 { grid-column: span 1; }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .notice { margin: 12px 16px 0; }
}
