:root {
  --primary: #2563eb;
  --primary-d: #1d4ed8;
  --bg: #f4f6fb;
  --card: #ffffff;
  --line: #e5e8f0;
  --text: #1f2937;
  --muted: #6b7280;
  --danger: #dc2626;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}
.topbar {
  background: linear-gradient(90deg, var(--primary), var(--primary-d));
  color: #fff;
  padding: 14px 24px;
  display: flex; justify-content: space-between; align-items: center;
}
.topbar .brand { font-weight: 700; font-size: 18px; }
.topbar .user { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.container { max-width: 1080px; margin: 24px auto; padding: 0 20px; }
.container.wide { max-width: 100%; }
h2 { margin: 0 0 16px; }

.login-page {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
}
.login-card {
  background: var(--card); padding: 36px 32px; border-radius: 14px;
  width: 340px; box-shadow: 0 10px 40px rgba(0,0,0,.08); text-align: center;
}
.login-card h1 { margin: 0; font-size: 22px; color: var(--primary-d); }
.login-card .sub { color: var(--muted); margin: 6px 0 22px; }
.login-card label { display: block; text-align: left; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
.login-card input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
}
.login-card button {
  width: 100%; margin-top: 20px; padding: 11px; border: 0; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 15px; cursor: pointer;
}
.login-card .hint { color: var(--muted); font-size: 12px; margin-top: 14px; }
.alert { background: #fef2f2; color: var(--danger); padding: 9px; border-radius: 8px; font-size: 13px; }

.form-grid {
  background: var(--card); padding: 24px; border-radius: 12px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px;
  box-shadow: 0 6px 24px rgba(0,0,0,.05);
}
.field { display: flex; flex-direction: column; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field small { color: #9ca3af; }
.field input, .field textarea, .field select {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
  font-family: inherit; background: #fff; color: var(--text);
}
.error { background: #fef2f2; color: var(--danger); padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.form-grid + .list, .form-grid + .empty { margin-top: 20px; }
.checks { display: flex; flex-wrap: wrap; gap: 14px; padding: 6px 0; }
.chk { font-size: 14px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.actions { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
button.primary, .btn-primary {
  background: var(--primary); color: #fff; border: 0; border-radius: 8px;
  padding: 10px 18px; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn-mini {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 7px; padding: 6px 12px; font-size: 13px; text-decoration: none; cursor: pointer;
}
.btn-mini.primary { border-color: var(--primary); color: var(--primary); }
.btn-mini.danger { border-color: #fecaca; color: var(--danger); }

.head-row { display: flex; justify-content: space-between; align-items: center; }
.list { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: 0 6px 24px rgba(0,0,0,.05); }
.list th, .list td { padding: 12px 14px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--line); }
.list th { background: #f8fafc; color: var(--muted); font-weight: 600; }
.list tbody tr:hover { background: #f9fbff; }
.ops { white-space: nowrap; }
.empty { background: var(--card); padding: 40px; text-align: center; color: var(--muted); border-radius: 12px; }
.detail th { background: #f8fafc; color: var(--muted); font-weight: 600; text-align: left; }

/* 服务时间日期区间 */
.date-range { display: flex; align-items: center; gap: 8px; }
.date-range input[type=date] {
  flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff;
}
/* “其他”说明输入框 */
.qita-input {
  margin-left: 6px; padding: 6px 10px; border: 1px solid var(--line);
  border-radius: 6px; font-size: 13px; min-width: 200px;
}
/* 上传合同相关 */
.ok { color: #16a34a; font-weight: 600; margin-right: 6px; }
.callout {
  background: #eef2ff; color: var(--primary-d); border: 1px solid #dbe3ff;
  padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 16px;
}
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* ===== 列表筛选区 ===== */
.filter-bar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 10px 28px -14px rgba(16,24,40,.18);
  margin-bottom: 18px;
  overflow: hidden;
}
.filter-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px;
  background: linear-gradient(180deg, #fbfcfe, #f5f7fc);
  border-bottom: 1px solid var(--line);
}
.filter-head .fh-title {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.filter-head .fh-title svg { width: 15px; height: 15px; color: var(--primary); }
.filter-head .fh-badge {
  padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--primary-d); background: #e8f0ff; border: 1px solid #d3e2ff;
}
.filter-body {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px 16px; padding: 16px 18px 14px;
}
.filter-bar .f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.filter-bar .f > label {
  font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em;
}
.filter-bar .f input,
.filter-bar .f select {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid #dee3ed; border-radius: 10px; background: #fff;
  font-size: 14px; font-family: inherit; color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.filter-bar .f input::placeholder { color: #9aa4b2; }
.filter-bar .f input:hover,
.filter-bar .f select:hover { border-color: #c3cfe2; }
.filter-bar .f input:focus,
.filter-bar .f select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.14);
}
.filter-bar .f select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 14px;
}
.filter-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 0 18px 16px;
}
.btn-search {
  display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 22px; border: 0; border-radius: 10px;
  background: linear-gradient(180deg, #3b82f6, #2563eb); color: #fff;
  font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer;
  box-shadow: 0 1px 2px rgba(37,99,235,.25), 0 8px 18px -10px rgba(37,99,235,.65);
  transition: filter .15s ease, transform .12s ease, box-shadow .15s ease;
}
.btn-search svg { width: 15px; height: 15px; }
.btn-search:hover {
  filter: brightness(1.06); transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(37,99,235,.28), 0 12px 22px -10px rgba(37,99,235,.7);
}
.btn-search:active { transform: translateY(0); }
.btn-reset {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--muted); font-size: 14px; text-decoration: none;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.btn-reset svg { width: 14px; height: 14px; }
.btn-reset:hover { border-color: #c3cfe2; color: var(--text); background: #f8fafc; }
.count-tip {
  margin-left: auto; display: inline-flex; align-items: baseline; gap: 4px;
  padding: 6px 13px; border-radius: 999px; font-size: 13px;
  color: var(--primary-d); background: #eef4ff; border: 1px solid #dbe6ff;
}
.count-tip b { font-size: 14px; font-weight: 700; }
.count-tip .ct-sub { color: #7b8aa3; font-size: 12px; }

/* 表格轻微优化：表头更清晰、行间距更舒展 */
.list th {
  background: #f6f8fc; color: #4b5563; font-weight: 600; font-size: 13px;
  border-bottom: 1px solid #e7ebf3; white-space: nowrap;
}
.list td { border-bottom: 1px solid #f0f2f7; }
.list tbody tr:last-child td { border-bottom: 0; }
.list tbody tr:hover { background: #f7faff; }

@media (max-width: 720px) {
  .filter-body { grid-template-columns: 1fr 1fr; }
  .count-tip { margin-left: 0; }
}
