:root {
  --primary: #0ea5b7;
  --primary-d: #0b8593;
  --bg: #eef3f7;
  --card: #ffffff;
  --ink: #1f2d3d;
  --muted: #7d8da3;
  --ok: #2bb673;
  --warn: #f0a020;
  --bad: #e3493c;
  --line: #e6edf2;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 360px;
  max-width: 100%;
  background: var(--card);
  border-radius: 20px;
  padding: 36px 28px;
  box-shadow: 0 12px 40px rgba(31, 45, 61, 0.12);
}
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-card .sub { color: var(--muted); margin-bottom: 24px; }

/* ---------- 后台外壳 ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 220px;
  background: #0f2a33;
  color: #cfe3e8;
  padding: 22px 14px;
  flex-shrink: 0;
}
.side .brand { font-size: 18px; font-weight: 700; color: #fff; padding: 6px 10px 18px; }
.nav-item {
  display: block;
  padding: 13px 14px;
  border-radius: 12px;
  color: #cfe3e8;
  cursor: pointer;
  margin-bottom: 6px;
  font-size: 15px;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.08); }
.nav-item.on { background: var(--primary); color: #fff; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.topbar .who { color: var(--muted); }
.view { padding: 24px; overflow: auto; }

/* ---------- 通用控件 ---------- */
.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 14px;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  transition: filter 0.15s;
}
.btn:hover { filter: brightness(1.05); }
.btn-primary { background: var(--primary); }
.btn-ghost { background: #e3eef1; color: var(--primary-d); }
.btn-danger { background: var(--bad); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input, .toolbar select {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
}
.panel { background: var(--card); border-radius: 16px; padding: 18px; box-shadow: 0 6px 20px rgba(31,45,61,0.05); }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td .acts { display: flex; gap: 8px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- 徽标 ---------- */
.badge { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.badge-ok { background: #e3f6ec; color: var(--ok); }
.badge-full { background: #fde7e4; color: var(--bad); }
.badge-wait { background: #fdeed5; color: var(--warn); }
.badge-off { background: #eceff3; color: var(--muted); }

/* ---------- 模态框 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(15, 42, 51, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.modal { background: #fff; border-radius: 16px; width: 460px; max-width: 100%; max-height: 90vh; overflow: auto; }
.modal-h { padding: 18px 22px; font-size: 17px; font-weight: 700; border-bottom: 1px solid var(--line); }
.modal-b { padding: 20px 22px; }
.modal-f { padding: 14px 22px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }
.modal.wide { width: 920px; max-width: 94vw; }

/* ---------- 教练周排课网格 ---------- */
.lnk { color: var(--primary-d); cursor: pointer; text-decoration: none; border-bottom: 1px dashed var(--primary); }
.lnk:hover { color: var(--primary); }
.sched-grid { max-height: 62vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.sched-grid table { border-collapse: collapse; width: 100%; min-width: 620px; }
.sched-grid th, .sched-grid td { border: 1px solid var(--line); padding: 6px 8px; text-align: center; font-size: 13px; }
.sched-grid thead th { position: sticky; top: 0; background: #f4f8fa; z-index: 2; }
.sched-grid .tcol { position: sticky; left: 0; background: #f4f8fa; z-index: 1; font-weight: 600; color: var(--muted); }
.sched-grid td.has { background: rgba(14, 165, 183, 0.06); }
.ctype { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; }
.ctype-1 { background: #2bb673; }  /* 初级 */
.ctype-2 { background: #f0a020; }  /* 进阶 */
.ctype-3 { background: #8b6fd6; }  /* 长效班 */
.fld { display: block; margin-bottom: 14px; }
.fld > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.fld input, .fld select, .fld textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; font-family: inherit;
}
.warn-bar { background: #fdeed5; color: var(--warn); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: 24px; transform: translateX(-50%);
  background: #0f2a33; color: #fff; padding: 10px 18px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 99; font-size: 14px;
}
.toast.show { opacity: 1; }
.toast.err { background: var(--bad); }
