:root {
  --bg: #f5f6f8; --card: #fff; --ink: #1c2330; --muted: #5e6878; --line: #dde1e7; --line2: #eceff3;
  --accent: #b3122e; --accent-ink: #fff; --accent-soft: #fbe9ec;
  --r1: #1f8a4c; --r2: #6fb33b; --r3: #d9a21b; --r4: #e0702a; --r0: #c23b3b;
  --ok: #1f8a4c; --warn: #b36b00; --err: #b3261e;
  --radius: 10px; --shadow: 0 1px 2px rgba(20,30,50,.06), 0 2px 8px rgba(20,30,50,.05);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.45; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 .3rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 64px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input:not([type]), select, textarea {
  width: 100%; font: inherit; padding: 9px 11px; border: 1px solid #c9cfd8; border-radius: 8px; background: #fff; color: var(--ink);
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 200px; }
.btn { font: inherit; font-weight: 600; border: 1px solid #c9cfd8; background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #f0f2f5; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(.95); }
.btn.danger { color: var(--err); border-color: #e3b5b1; }
.btn.small { padding: 4px 9px; font-size: .85rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.msg { padding: 10px 14px; border-radius: 8px; margin: 10px 0; }
.msg.err { background: #fdecea; color: var(--err); }
.msg.ok { background: #e8f5ec; color: var(--ok); }
.msg.info { background: #eef3fb; color: #24478f; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; font-size: .78rem; font-weight: 700; color: #fff; }
.r1 { background: var(--r1); } .r2 { background: var(--r2); } .r3 { background: var(--r3); } .r4 { background: var(--r4); } .r0 { background: var(--r0); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--line2); color: var(--muted); }
.pill.open { background: #e8f5ec; color: var(--ok); } .pill.closed { background: #fff3e0; color: var(--warn); } .pill.pub { background: #eef3fb; color: #24478f; }
table.grid { border-collapse: collapse; width: 100%; background: #fff; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line2); padding: 7px 9px; text-align: left; vertical-align: top; }
table.grid th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #fafbfc; position: sticky; top: 0; }
.center { text-align: center !important; }
.hidden { display: none !important; }

/* student page */
.dates { display: grid; gap: 8px; }
.datebtn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; padding: 12px 14px; border: 2px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.datebtn:hover { border-color: #b9c0cb; }
.datebtn.on { border-color: var(--accent); background: var(--accent-soft); }
.datebtn .num { width: 34px; height: 34px; border-radius: 50%; border: 2px dashed #c3c9d2; display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--muted); flex: none; }
.datebtn.on .num { border: none; background: var(--accent); color: #fff; }
.datebtn .d { font-weight: 700; } .datebtn .rk { margin-left: auto; font-size: .85rem; color: var(--accent); font-weight: 600; }
.conf-row { display: flex; gap: 8px; margin-bottom: 8px; }
.conf-row input[type=date] { flex: 0 0 170px; }
.result { border-left: 5px solid var(--ok); }
.big { font-size: 1.35rem; font-weight: 800; }
