:root {
  --primary: #2563a8;
  --bg: #f3f5f8;
  --card: #fff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --danger: #dc2626;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: var(--bg); color: var(--text);
}
.sidebar {
  width: 220px; position: fixed; inset: 0 auto 0 0; background: #1f2d3d; color: #cbd5e1;
  display: flex; flex-direction: column;
}
.brand { padding: 18px 16px; font-weight: 700; color: #fff; border-bottom: 1px solid #334155; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.sidebar nav a {
  display: block; padding: 10px 18px; color: #cbd5e1; text-decoration: none; font-size: 14px;
}
.sidebar nav a:hover { background: #2d3f52; color: #fff; }
.nav-group { padding: 12px 18px 4px; font-size: 12px; color: #64748b; }
.sidebar-user { padding: 14px 18px; border-top: 1px solid #334155; font-size: 14px; }
.sidebar-user .muted { color: #64748b; font-size: 12px; }
.logout { color: #93c5fd; font-size: 12px; text-decoration: none; }
.content { margin-left: 220px; padding: 24px; }
.page-title { font-size: 20px; font-weight: 700; margin: 0 0 16px; }
.cards { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-stat {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 20px; min-width: 130px;
}
.card-stat .num { font-size: 26px; font-weight: 700; color: var(--primary); }
.card-stat .label { color: var(--muted); font-size: 13px; margin-top: 4px; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
input, select, textarea {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
  background: #fff;
}
button, .btn {
  padding: 8px 14px; border: 0; border-radius: 8px; background: var(--primary); color: #fff;
  cursor: pointer; font-size: 14px; text-decoration: none; display: inline-flex; align-items: center;
}
button.secondary, .btn.secondary { background: #e2e8f0; color: var(--text); }
button.danger { background: var(--danger); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:hover td { background: #f8fafc; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.tag.normal { background: #dcfce7; color: #166534; }
.tag.rent { background: #fef9c3; color: #854d0e; }
.tag.idle { background: #f1f5f9; color: #475569; }
.muted { color: var(--muted); }
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none;
  align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50;
}
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 560px; max-width: 100%; padding: 20px; }
.modal h3 { margin: 0 0 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 4px; }
.modal-actions { margin-top: 18px; display: flex; justify-content: flex-end; gap: 10px; }
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1f2d3d 0%, #2563a8 100%); }
.login-wrap { max-width: 380px; width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 32px 28px; box-shadow: 0 18px 50px rgba(15,23,42,.25); }
.login-wrap h1 { font-size: 20px; margin: 0 0 6px; }
.login-wrap .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.login-wrap .field { margin-bottom: 14px; }
.login-wrap input { width: 100%; }
.error { color: var(--danger); font-size: 13px; margin-bottom: 10px; }
.page-meta { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
@media (max-width: 860px) {
  .sidebar { position: static; width: auto; }
  .content { margin-left: 0; }
  body { display: block; }
}
