:root {
  --navy: #0b1f3a;
  --navy-2: #142a4d;
  --gold: #c9a063;
  --ink: #1e2733;
  --muted: #6b7280;
  --light: #f5f6f8;
  --court: #2e6b46;
  --court-2: #1f4d33;
  --ball: #d8e84e;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--light);
  color: var(--ink);
  margin: 0;
}

.topbar {
  background: var(--navy);
  color: white;
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar .brand {
  font-weight: 700;
  letter-spacing: 0.5px;
}

.topbar .brand .gold { color: var(--gold); font-weight: 400; margin-left: 8px; }

.topbar a.logout {
  color: #d3d9e6;
  text-decoration: none;
  font-size: 14px;
}

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
}

.auth-card {
  background: white;
  border-radius: 14px;
  padding: 40px;
  width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-card h1 {
  font-size: 22px;
  margin: 0 0 6px 0;
  color: var(--navy);
}

.auth-card p.sub {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 24px 0;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0 6px 0;
}

input[type=email], input[type=password], input[type=text], input[type=url], textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dfe3ea;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

textarea { resize: vertical; min-height: 70px; }

button, .btn {
  background: var(--navy);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 11px 18px;
  font-size: 14px;
  cursor: pointer;
  margin-top: 16px;
}

button:hover, .btn:hover { background: var(--navy-2); }

.error {
  background: #fbe9e9;
  color: #a33;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

.toast {
  background: #e7f6ec;
  color: #1a7a3a;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin: 20px 32px 0 32px;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 32px 60px 32px;
}

.student-card {
  background: white;
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.student-card h2 {
  color: var(--navy);
  margin: 0 0 4px 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.stat {
  background: var(--light);
  border-radius: 10px;
  padding: 12px 14px;
}

.stat .num { font-size: 20px; font-weight: 700; color: var(--navy); }
.stat .label { font-size: 12px; color: var(--muted); }

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin: 22px 0 8px 0;
  border-top: 1px solid #eee;
  padding-top: 18px;
}

.updates-log {
  background: var(--light);
  border-radius: 8px;
  padding: 12px 14px;
  white-space: pre-wrap;
  font-size: 13px;
  max-height: 220px;
  overflow-y: auto;
  color: var(--ink);
}

.attachments a {
  display: inline-block;
  margin: 4px 8px 4px 0;
  font-size: 13px;
  color: var(--navy);
}

form.inline { display: flex; gap: 8px; margin-top: 8px; }
form.inline input { flex: 1; }
form.inline button { margin-top: 0; }

.roadmap-wrap {
  position: relative;
  margin: 10px 0 6px 0;
  padding-left: 20px;
  max-height: 480px;
  overflow-y: auto;
}
.roadmap-wrap::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: #e3e6eb;
}
.roadmap-item {
  position: relative;
  padding-bottom: 20px;
}
.roadmap-item::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--gold);
}
.roadmap-month {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
}
.roadmap-cat {
  display: inline-block;
  font-size: 10px;
  color: var(--gold);
  font-weight: 700;
  margin-left: 6px;
}
.roadmap-action {
  font-size: 13px;
  color: var(--ink);
  margin-top: 2px;
}

/* --- Admin / Case Management back office --- */
main.admin-main { max-width: 1120px; }

.admin-table-wrap { background: white; border-radius: 14px; padding: 8px 8px 4px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); overflow-x: auto; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.admin-table th { text-align: left; color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; padding: 10px 12px; border-bottom: 2px solid var(--light); white-space: nowrap; }
table.admin-table td { padding: 10px 12px; border-bottom: 1px solid #f0f1f3; vertical-align: middle; white-space: nowrap; }
table.admin-table tr:hover td { background: var(--light); }
table.admin-table a.row-link { color: var(--navy); font-weight: 700; text-decoration: none; }
table.admin-table a.row-link:hover { text-decoration: underline; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-navy { background: var(--navy); color: white; }
.badge-gold { background: #f4ead9; color: #8a6a2f; }
.badge-green { background: #e7f6ec; color: #1a7a3a; }
.badge-red { background: #fbe9e9; color: #a33; }
.badge-gray { background: var(--light); color: var(--muted); }

.admin-tabs { display: flex; gap: 4px; margin: 18px 0 0 0; border-bottom: 2px solid #eee; flex-wrap: wrap; }
.admin-tabs a { padding: 10px 16px; font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.admin-tabs a.active { color: var(--navy); border-bottom-color: var(--gold); }
.admin-tabs a.disabled { color: #c7cbd1; cursor: default; }

.admin-search { margin: 4px 0 16px 0; }
.admin-search input { max-width: 320px; }

.task-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f1f3; }
.task-row:last-child { border-bottom: none; }
.task-row .task-title { flex: 1; font-size: 14px; color: var(--ink); }
.task-row .task-meta { font-size: 12px; color: var(--muted); }
.task-row.task-done .task-title { text-decoration: line-through; color: var(--muted); }

.checklist-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-bottom: 1px solid #f0f1f3; }
.checklist-row:last-child { border-bottom: none; }
.checklist-code { flex-shrink: 0; width: 34px; height: 34px; border-radius: 8px; background: var(--light); color: var(--navy); font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.checklist-body { flex: 1; }
.checklist-title { font-size: 14px; color: var(--ink); font-weight: 600; }
.checklist-criteria, .checklist-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.checklist-notes { font-size: 12px; color: #8a6a2f; background: #f4ead9; padding: 6px 10px; border-radius: 6px; margin-top: 6px; display: inline-block; }
.checklist-date { font-size: 13px; font-weight: 700; color: var(--navy); margin: 2px 0; }
.checklist-date-overdue { color: #a33; }

.status-select { font-size: 12px; padding: 6px 8px; border-radius: 6px; border: 1px solid #dfe3ea; font-weight: 700; }
.status-select.s-未开始 { background: var(--light); color: var(--muted); }
.status-select.s-进行中 { background: var(--navy); color: #fff; }
.status-select.s-待客户 { background: #f4ead9; color: #8a6a2f; }
.status-select.s-已完成 { background: #e7f6ec; color: #1a7a3a; }
.status-select.s-待审核 { background: var(--light); color: var(--muted); }
.status-select.s-合规 { background: #e7f6ec; color: #1a7a3a; }
.status-select.s-有风险 { background: #fbe9e9; color: #a33; }

.admin-form-inline { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.admin-form-inline input, .admin-form-inline select { padding: 8px 10px; font-size: 13px; }
.admin-form-inline input[name=title] { flex: 1; min-width: 180px; }
.admin-form-inline button { margin-top: 0; padding: 8px 16px; }
