:root {
  --ink: #1d2433; --muted: #5d6679; --line: #e3e7ef; --bg: #f7f8fb; --card: #fff;
  --brand: #2f6fde; --brand-d: #1f54b3; --good: #2f7d4f; --warn: #b54a2f; --sun: #f2c12e;
  --r: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.5; }
a { color: var(--brand); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
header.top { background: #fff; border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo { font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo b { color: var(--brand); }
nav.links { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 15px; }
nav.links a { text-decoration: none; color: var(--muted); font-weight: 600; }
nav.links a:hover { color: var(--ink); }
main { padding: 28px 0 60px; }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 21px; margin: 28px 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; padding: 10px 16px; font: inherit; font-weight: 700; cursor: pointer; background: #eef1f7; color: var(--ink); text-decoration: none; }
.btn.pri { background: var(--brand); color: #fff; }
.btn.pri:hover { background: var(--brand-d); }
.btn.good { background: var(--good); color: #fff; }
.btn.warn { background: #fbe3dc; color: var(--warn); }
.btn.sm { padding: 6px 10px; font-size: 14px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: default; }
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 4px; }
input[type=text], input[type=password], select, textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #cdd3df; border-radius: 10px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 6px 0; }
.err { color: var(--warn); font-weight: 600; min-height: 1.4em; margin: 10px 0 0; }
.ok { color: var(--good); font-weight: 600; }
.narrow { max-width: 420px; margin: 40px auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #eef1f7; color: var(--muted); }
.pill.admin { background: #ece4ff; color: #5b3fb5; }
.pill.teacher { background: #e1f0ff; color: #1f54b3; }
.pill.student { background: #e3f5e9; color: #2f7d4f; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #c4c9d4; }
.dot.on { background: #2fbf5f; box-shadow: 0 0 0 4px rgba(47,191,95,.18); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.space { justify-content: space-between; }

/* home page */
.hero { padding: 56px 0 30px; text-align: center; }
.hero h1 { font-size: 44px; }
.hero p { font-size: 19px; color: var(--muted); max-width: 640px; margin: 10px auto 24px; }
.feature { text-align: center; }
.feature .ic { font-size: 42px; }

/* child home */
.tiles { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tile { display: block; text-decoration: none; color: var(--ink); background: #fff; border: 3px solid var(--line); border-radius: 26px; padding: 30px 24px; text-align: center; transition: transform .15s, border-color .15s; }
.tile:hover, .tile:focus { transform: translateY(-3px); border-color: var(--brand); }
.tile .ic { font-size: 72px; line-height: 1.1; }
.tile h3 { font-size: 26px; margin: 10px 0 4px; }

/* teacher */
.student { display: flex; flex-direction: column; gap: 10px; }
.student h3 { margin: 0; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.now { font-size: 14px; background: #f3f6fb; border-radius: 10px; padding: 8px 10px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px; z-index: 50; }
