* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  background: #f4f6f9;
  color: #1b2430;
  font-size: 15px;
}
header.app {
  background: #1f4e79;
  color: #fff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
header.app h1 { font-size: 17px; margin: 0; font-weight: 700; }
header.app .env { background: #ffd966; color: #5a3e00; border-radius: 4px; padding: 2px 8px; font-size: 12px; font-weight: 700; }
header.app .spacer { flex: 1; }
header.app button { background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.4); }
nav.tabs { display: flex; gap: 4px; background: #e8edf3; padding: 0 12px; border-bottom: 2px solid #c9d4e0; flex-wrap: wrap; }
nav.tabs button {
  background: none; border: none; padding: 11px 16px; font-size: 15px; cursor: pointer;
  border-bottom: 3px solid transparent; color: #44536b; font-weight: 600; border-radius: 0;
}
nav.tabs button.on { color: #1f4e79; border-bottom-color: #1f4e79; background: #f4f6f9; }
main { padding: 16px; max-width: 1100px; margin: 0 auto; }
section.panel { display: none; }
section.panel.on { display: block; }
.card { background: #fff; border: 1px solid #d8e0ea; border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.card h2 { font-size: 16px; margin: 0 0 12px; color: #1f4e79; border-left: 4px solid #1f4e79; padding-left: 8px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 12px; }
.row > label { min-width: 110px; padding-top: 7px; font-weight: 600; color: #44536b; }
.row > .ctl { flex: 1; min-width: 240px; }
.hint { font-size: 13px; color: #6b7a90; margin-top: 4px; }
input[type=text], input[type=number], input[type=password], select {
  padding: 7px 9px; border: 1px solid #b9c6d6; border-radius: 5px; font-size: 15px; font-family: inherit; background: #fff;
}
input[type=number] { width: 90px; }
button {
  padding: 8px 14px; border: 1px solid #1f4e79; background: #1f4e79; color: #fff;
  border-radius: 5px; cursor: pointer; font-size: 14px; font-family: inherit; font-weight: 600;
}
button.sub { background: #fff; color: #1f4e79; }
button.ghost { background: #fff; color: #44536b; border-color: #b9c6d6; font-weight: 500; }
button.danger { background: #fff; color: #b3261e; border-color: #e3a9a4; font-weight: 500; }
button:disabled { opacity: .5; cursor: default; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips label {
  border: 1px solid #b9c6d6; background: #fff; border-radius: 16px; padding: 6px 13px; cursor: pointer; user-select: none; font-size: 14px;
}
.chips label.on { background: #e3eefb; border-color: #1f4e79; color: #1f4e79; font-weight: 700; }
.chips input { display: none; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { border-bottom: 1px solid #e3e9f0; padding: 8px 7px; text-align: left; vertical-align: middle; }
th { background: #eef2f7; color: #44536b; font-weight: 700; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr:hover td { background: #fafcff; }
.pill { display: inline-block; border-radius: 10px; padding: 2px 9px; font-size: 12px; font-weight: 700; }
.pill.wait { background: #fff3cd; color: #7a5c00; }
.pill.done { background: #d9f2e2; color: #14663a; }
.pill.weak { background: #fde2e1; color: #8c231c; }
.students-pick { max-height: 240px; overflow-y: auto; border: 1px solid #d8e0ea; border-radius: 6px; padding: 8px; background: #fff; }
.students-pick label { display: inline-block; width: 170px; padding: 4px 6px; cursor: pointer; border-radius: 4px; }
.students-pick label:hover { background: #eef4fb; }
.msg { padding: 10px 12px; border-radius: 6px; margin-bottom: 12px; font-weight: 600; }
.msg.ok { background: #d9f2e2; color: #14663a; }
.msg.ng { background: #fde2e1; color: #8c231c; }
.msg.info { background: #e3eefb; color: #1f4e79; }
#login { max-width: 360px; margin: 80px auto; }
.grade-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 6px; }
.grade-item { display: flex; align-items: center; gap: 8px; border: 1px solid #e3e9f0; border-radius: 6px; padding: 6px 9px; background: #fff; }
.grade-item .no { color: #6b7a90; font-size: 13px; width: 26px; text-align: right; }
.grade-item .w { font-weight: 700; flex: 1; font-size: 15px; }
.grade-item .mean { color: #6b7a90; font-size: 12px; flex: 1.2; }
.grade-item button { padding: 3px 11px; font-size: 14px; }
.grade-item button.o { background: #fff; color: #14663a; border-color: #9ed4b5; }
.grade-item button.o.on { background: #15803d; color: #fff; border-color: #15803d; }
.grade-item button.x { background: #fff; color: #b3261e; border-color: #e3a9a4; }
.grade-item button.x.on { background: #b3261e; color: #fff; border-color: #b3261e; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.count-big { font-size: 15px; font-weight: 700; color: #1f4e79; }

/* ---- 毎日のテスト（周回） ---- */
.gstat { border: 1px solid #d8e0ea; border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; background: #fbfcfe; }
.gstat.done { background: #f2fbf5; border-color: #b7e0c6; }
.gstat .top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.gstat .gname { font-size: 16px; font-weight: 700; color: #1f4e79; }
.gstat .round { background: #1f4e79; color: #fff; border-radius: 12px; padding: 2px 11px; font-size: 13px; font-weight: 700; }
.gstat.done .round { background: #15803d; }
.gstat .range { color: #6b7a90; font-size: 13px; }
.gstat .spacer { flex: 1; }
.gstat .nums { font-size: 14px; }
.gstat .nums b { font-size: 18px; color: #1f4e79; }
.bar { background: #e3e9f0; border-radius: 5px; height: 10px; overflow: hidden; margin: 8px 0 6px; }
.bar > i { display: block; height: 100%; background: #1f4e79; }
.gstat.done .bar > i { background: #15803d; }
.gstat .hist { font-size: 12.5px; color: #6b7a90; margin-top: 6px; }
.gstat .warn { color: #8c231c; font-weight: 700; font-size: 13px; }
