:root {
  --ink: #0f3d3e;
  --ink-2: #134e4a;
  --teal: #0f766e;
  --paper: #f3f1eb;
  --card: #fff;
  --line: rgba(28, 25, 23, 0.08);
  --muted: #78716c;
  --warn: #c2410c;
  --ok: #0f766e;
  --shadow: 0 12px 32px rgba(15, 61, 62, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--paper);
  color: #1c1917;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 36%),
    linear-gradient(160deg, #0f3d3e 0%, #134e4a 48%, #f3f1eb 48%);
}

.login-card {
  width: 420px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 20px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow);
}

.brand {
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--teal);
  font-weight: 700;
}
.login-card h1 {
  margin: 8px 0 6px;
  font-size: 26px;
}
.hint {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 24px;
  line-height: 1.6;
}

label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 8px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fafaf9;
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--teal);
  background: #fff;
}
.field { margin-bottom: 16px; }

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-warn { background: #fff1e8; color: var(--warn); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.error {
  color: var(--warn);
  font-size: 13px;
  min-height: 20px;
  margin: 4px 0 12px;
}

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.side {
  background: var(--ink);
  color: #ecfdf5;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
}
.side .logo {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}
.side .sub {
  color: rgba(236, 253, 245, 0.68);
  font-size: 12px;
  margin-bottom: 28px;
}
.nav a {
  display: block;
  padding: 11px 12px;
  border-radius: 10px;
  color: rgba(236, 253, 245, 0.82);
  margin-bottom: 6px;
}
.nav a.active, .nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.side-foot {
  margin-top: auto;
  font-size: 13px;
  color: rgba(236, 253, 245, 0.72);
}
.side-foot button {
  margin-top: 10px;
  width: 100%;
}

.main { padding: 28px 32px 48px; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
}
.top h2 { margin: 0; font-size: 24px; }
.top p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 18px;
}
.filters .field { margin: 0; min-width: 180px; }
.filters .actions { display: flex; gap: 8px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}
.stat .num { font-size: 26px; font-weight: 800; color: var(--ink); }
.stat .lbl { color: var(--muted); font-size: 12px; margin-top: 4px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 18px;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.card-head h3 { margin: 0; font-size: 16px; }
.card-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-wrap { overflow: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th { color: var(--muted); font-weight: 600; }
td.remark,
td.driver {
  max-width: 280px;
  white-space: normal;
  line-height: 1.45;
}
td.remark {
  color: var(--muted);
}
.tag {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 61, 62, 0.08);
  color: var(--ink);
  font-size: 12px;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 36px 0;
}

.row-actions { display: flex; gap: 8px; }
.row-actions button { padding: 6px 10px; border-radius: 8px; font-size: 12px; }

.mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 23, 0.42);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 20;
}
.mask.show { display: flex; }
.modal {
  width: 520px;
  max-width: 100%;
  background: #fff;
  border-radius: 18px;
  padding: 22px;
}
.modal h3 { margin: 0 0 16px; }
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { flex-direction: row; align-items: center; gap: 16px; padding: 16px; }
  .nav { display: flex; gap: 8px; flex: 1; }
  .side .sub, .side-foot span { display: none; }
  .side-foot { margin: 0; }
  .grid-2 { grid-template-columns: 1fr; }
}
