:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --line: #dfe4ea;
  --text: #22303f;
  --muted: #6b7a8d;
  --primary: #1f6feb;
  --primary-dark: #1757c1;
  --ok: #1e9e5a;
  --warn: #d97706;
  --err: #d64545;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.topnav { background: #17233b; color: #fff; position: sticky; top: 0; z-index: 10; }
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 18px; min-height: 52px;
}
.brand { color: #fff; font-weight: 700; font-size: 16px; }
.brand:hover { text-decoration: none; }
.links { display: flex; gap: 16px; flex: 1; }
.links a { color: #cdd8ea; }
.links a:hover { color: #fff; }
.user { color: #cdd8ea; display: flex; align-items: center; gap: 10px; }
.user a { color: #cdd8ea; }
.inline-form { display: inline; }
.linklike { background: none; border: none; color: var(--primary); cursor: pointer; padding: 0; font-size: inherit; }
.user .linklike { color: #cdd8ea; }
.container { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 22px; margin: 4px 0 14px; }
h2 { font-size: 18px; margin: 16px 0 10px; }
h3 { font-size: 15px; margin: 12px 0 8px; }
.muted { color: var(--muted); }
.hint { margin-top: 16px; font-size: 12px; }
.flashes { margin: 10px 0; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; border: 1px solid; }
.flash.ok { background: #eaf7ef; border-color: #bfe8cf; color: var(--ok); }
.flash.error { background: #fdeeee; border-color: #f3c4c4; color: var(--err); }
.card, .panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px; margin-bottom: 16px;
}
.narrow { max-width: 560px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.stat-card .num { font-size: 30px; font-weight: 700; margin: 6px 0; }
.stat-card .label { color: var(--muted); }
.btn {
  display: inline-block; border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 7px; padding: 8px 14px; cursor: pointer; font-size: 14px;
}
.btn:hover { border-color: #b8c2cf; text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.small { padding: 4px 10px; font-size: 13px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; }
th { background: #f8fafc; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; white-space: nowrap;
  background: #eef2f7; color: #44566c;
}
.badge.green { background: #e6f6ed; color: #177245; }
.badge.blue { background: #e8f0fe; color: #1a56c8; }
.badge.orange { background: #fef3e2; color: #a45307; }
.badge.red { background: #fdeaea; color: #b3261e; }
.badge.gray { background: #eef0f3; color: #5b6470; }
.badge.purple { background: #f0eafa; color: #5b3fa8; }
tr.row-completed td { background: #f3f4f6; color: #8a94a3; }
tr.row-completed td a { color: #8a94a3; }
tr.row-void td { background: #fafafa; color: #a2a8b0; text-decoration: line-through; }
tr.row-void td a { color: #a2a8b0; }
tr.row-void td .badge { text-decoration: none; }
.field { margin-bottom: 12px; }
.field label { display: block; margin-bottom: 4px; color: #44566c; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 14px; font-family: inherit;
}
.field textarea { min-height: 70px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar form { display: flex; gap: 8px; }
.toolbar input, .toolbar select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 20px; }
.meta-row .item { color: var(--muted); }
.meta-row .item strong { color: var(--text); font-weight: 600; margin-left: 4px; }
.section-title { font-size: 16px; font-weight: 700; margin: 24px 0 10px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.quote-item { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 8px 0; background: #fbfcfe; }
.shortlisted-border { border-color: #c4d7f5; background: #f5f9ff; }
.quote-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.quote-tiers td, .quote-tiers th { padding: 5px 8px; }
.cost-summary { display: flex; gap: 20px; flex-wrap: wrap; }
.cost-summary .cost { font-size: 20px; font-weight: 700; color: var(--primary); }
.login-card {
  max-width: 420px; margin: 90px auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 28px; box-shadow: 0 8px 24px rgba(20,40,80,.08);
}
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .btn { width: 100%; margin-top: 6px; }
.check-item { margin: 6px 0; }
.check-item input { margin-right: 8px; }
@media (max-width: 760px) {
  .nav-inner { flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .links { order: 3; width: 100%; overflow-x: auto; }
}
