/* English 9 — школьный журнал, а не игрушка. Никаких очков, бейджей и медалек. */
:root {
  --ink: #16191d;
  --muted: #6b7480;
  --line: #dfe3e8;
  --bg: #f6f7f9;
  --card: #ffffff;
  --accent: #14213d;
  --good: #1a7f4b;
  --bad: #b3261e;
  --now: #8a6d00;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--accent); }

/* --- шапка --- */
.top {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 28px; background: var(--accent); color: #fff;
}
.top .brand { font-weight: 700; font-size: 18px; color: #fff; text-decoration: none; letter-spacing: .02em; }
.top nav { display: flex; gap: 18px; flex: 1; }
.top nav a { color: #cfd6e4; text-decoration: none; }
.top nav a:hover { color: #fff; }
.top form { margin: 0; }

main { padding: 24px 28px 64px; max-width: 1220px; }

h1 { font-size: 26px; margin: 0 0 8px; }
h2 { font-size: 16px; margin: 20px 0 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
h3 { font-size: 15px; margin: 16px 0 8px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }

/* --- сообщения --- */
.flashes { padding: 12px 28px 0; }
.flash {
  background: #fff7d6; border: 1px solid #e6d48a; border-radius: 6px;
  padding: 10px 14px; margin-bottom: 8px;
}
.alarm {
  background: #fdecea; border: 1px solid #f0b3ae; border-left: 4px solid var(--bad);
  border-radius: 6px; padding: 14px 16px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}

/* --- главные цифры --- */
.hero { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.big { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.big .label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.big .number { font-size: 44px; font-weight: 700; line-height: 1.1; margin: 6px 0 2px; }
.big .number.small { font-size: 26px; }
.big .number .of { font-size: 20px; font-weight: 400; color: var(--muted); }
.big .sub { font-size: 13px; color: var(--muted); }
.big.bad .number { color: var(--bad); }
.big.good .number { color: var(--good); }
.bar { height: 6px; background: #eceff3; border-radius: 3px; margin-top: 12px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }

/* --- карточки --- */
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px; margin-bottom: 16px;
}
.card.wide { grid-column: span 2; }
.card h2:first-child { margin-top: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

/* --- кнопки и поля --- */
button, .button {
  font: inherit; cursor: pointer; border-radius: 6px; padding: 9px 14px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  text-decoration: none; display: inline-block;
}
button:hover, .button:hover { opacity: .9; }
button:disabled { opacity: .4; cursor: not-allowed; }
button.secondary, .button.secondary { background: #fff; color: var(--accent); }
button.ghost, .button.ghost { background: transparent; color: inherit; border-color: var(--line); }
.top button.ghost { color: #cfd6e4; border-color: #3a4a6b; }
button.danger { background: var(--bad); border-color: var(--bad); }
.inline { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.field { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea, input[type="datetime-local"], input[type="number"] {
  display: block; width: 100%; font: inherit; color: var(--ink); margin-top: 4px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
.inline input { width: auto; margin: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
textarea { resize: vertical; }

/* --- таблицы --- */
table { width: 100%; border-collapse: collapse; background: var(--card); }
.plan, .log, .slots-table {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 20px;
}
.plan th, .slots-table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc;
}
.plan td, .log td, .slots-table td { padding: 9px 12px; border-bottom: 1px solid #eef1f4; vertical-align: top; }
.plan tr:last-child td, .log tr:last-child td { border-bottom: none; }
.plan tr.passed { background: #f4faf6; }
.plan tr.debt, .slots-table tr.missed { background: #fdf3f2; }
.plan tr.current { background: #fffdf2; }
.plan tr.overdue td:nth-child(5) { color: var(--bad); font-weight: 600; }
.grades td { padding: 7px 0; border-bottom: 1px solid #eef1f4; }
.grades .val { text-align: right; font-weight: 700; font-size: 17px; }
.grades .val.bad { color: var(--bad); }
.grades tr.total td { border-bottom: none; padding-top: 12px; font-weight: 600; }
.log .actor { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
.log .actor.teacher { color: var(--accent); font-weight: 700; }
.log .actor.manual { color: var(--now); }

/* --- метки --- */
.tag {
  display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 20px;
  background: #eef1f4; color: var(--muted); white-space: nowrap;
}
.tag.ok { background: #e6f4ec; color: var(--good); }
.tag.err { background: #fdecea; color: var(--bad); }
.tag.now { background: #fff6d9; color: var(--now); }

/* --- слоты --- */
.slots { list-style: none; padding: 0; margin: 0; }
.slots li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #eef1f4; }
.slots .when { font-weight: 600; }
.slots .what { color: var(--muted); }

/* --- выбор темпа --- */
.pace-choice { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.pace {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px; text-align: center;
  cursor: pointer; background: #fff;
}
.pace.chosen { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pace input { display: none; }
.pace .n { display: block; font-size: 24px; font-weight: 700; }
.pace .price { display: block; font-size: 11px; color: var(--muted); }
.pace .price em { display: block; font-style: normal; font-weight: 700; }
.pace .price em.bad { color: var(--bad); }
.pace .price em.good { color: var(--good); }

/* --- таймер сессии --- */
.timer-bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 18px;
  background: var(--accent); color: #fff; padding: 12px 18px; border-radius: 10px; margin-bottom: 18px;
}
.timer-bar .kind { font-weight: 600; }
.timer-bar .clock { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; margin-left: auto; }
.timer-bar .muted { color: #b9c2d4; }
.timer-bar.expired { background: var(--bad); }
.running { font-size: 16px; }

/* --- тетрадь --- */
.notes { list-style: none; padding: 0; margin: 0; }
.notes li { border-bottom: 1px solid #eef1f4; padding: 12px 0; }
.notes pre {
  white-space: pre-wrap; font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #fafbfc; border: 1px solid var(--line); border-radius: 6px; padding: 10px; margin: 8px 0 0;
}

/* --- читалка --- */
.reader-top { display: flex; align-items: center; gap: 20px; margin-bottom: 14px; flex-wrap: wrap; }
.nav-pages { display: flex; align-items: center; gap: 10px; }
.goto input { width: 90px; }
.page-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; text-align: center; }
img.page { max-width: 100%; height: auto; }
.jump { margin-top: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip {
  font-size: 13px; padding: 5px 10px; border-radius: 20px; background: #fff;
  border: 1px solid var(--line); text-decoration: none; color: var(--ink);
}
.chip.chosen { border-color: var(--accent); font-weight: 600; }
.chip.ref { color: var(--muted); }
.ref { list-style: none; padding: 0; }
.ref li { padding: 5px 0; }

/* --- вход --- */
.login-page { display: flex; align-items: center; justify-content: center; height: 100vh; background: var(--accent); }
.login-box { background: #fff; padding: 34px; border-radius: 12px; width: 340px; text-align: center; }
.login-box h1 { margin: 0 0 4px; }
.pin {
  display: block; width: 100%; font-size: 30px; letter-spacing: .35em; text-align: center;
  padding: 12px; margin: 18px 0 12px; border: 1px solid var(--line); border-radius: 8px;
}
.login-box button { width: 100%; padding: 12px; font-size: 16px; }

.big .sub.hours { margin-top: 6px; font-weight: 600; color: var(--ink); }
