/* School Desk — bright blue theme: clean sky blues, white cards, deep
   navy text. Same polish family as Gather & Graze (serif headings, pill
   buttons, soft shadows), led by blue — the student's favorite color. */
:root {
  --navy: #0b3b6e;
  --navy-deep: #082c54;
  --sky: #0284c7;
  --sky-bright: #38bdf8;
  --sky-soft: #e0f2fe;
  --sun: #fbbf24;
  --paper: #ffffff;
  --bg: #eef6ff;
  --ink: #12314e;
  --muted: #5b7a94;
  --line: #d3e5f5;
  --ok: #1d7a46;
  --ok-bg: #e0f4e7;
  --warn: #a85b00;
  --warn-bg: #fdf0da;
  --bad: #c22f3d;
  --bad-bg: #fde7ea;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(11, 59, 110, 0.10);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}
h1, h2, h3, .serif {
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", serif;
  color: var(--navy);
  margin: 0;
}
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); }
a { color: var(--sky); }

/* ---------- header ---------- */
header.app {
  background: linear-gradient(135deg, var(--navy-deep), var(--sky) 70%, var(--sky-bright));
  color: #fff;
  padding: 14px 18px 0;
  position: sticky; top: 0; z-index: 20;
  box-shadow: var(--shadow);
}
header.app .title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
header.app h1 { color: #fff; font-size: 26px; letter-spacing: 0.3px; }
header.app .logo { font-size: 26px; }
header.app .spacer { flex: 1; }
header.app .head-btn {
  background: rgba(255,255,255,0.16); color: #fff; border: 1px solid rgba(255,255,255,0.4);
  border-radius: 999px; padding: 6px 14px; font-size: 14px;
}
header.app .head-btn:hover { background: rgba(255,255,255,0.28); }
nav.tabs { display: flex; gap: 4px; margin-top: 12px; overflow-x: auto; }
nav.tabs button {
  background: transparent; border: none; color: #d6efff;
  padding: 9px 16px; font-size: 15px; border-radius: 10px 10px 0 0; white-space: nowrap;
}
nav.tabs button.active { background: var(--bg); color: var(--navy); font-weight: 600; }
nav.tabs .tab-dot {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 5px;
  background: var(--bad); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700;
  text-align: center; vertical-align: 2px;
}
.sky-rule { height: 3px; background: linear-gradient(90deg, var(--sky-bright), var(--sun), var(--sky-bright)); }

/* ---------- layout & cards ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 18px 14px 60px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--sky-bright);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px;
}
.card h3 { font-size: 18px; margin-bottom: 4px; }
.card.sun { border-top-color: var(--sun); }
.card.bad-top { border-top-color: var(--bad); }
.section-title { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; }
.section-title h2 { font-size: 21px; }
.section-title .spacer { flex: 1; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.banner {
  background: var(--warn-bg); border: 1px solid #f0d9ae; color: #6d4305;
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; font-size: 15px;
}
.big-pct { font-size: 30px; font-weight: 700; color: var(--navy); font-family: Georgia, serif; }

/* ---------- buttons, badges, chips ---------- */
.btn {
  background: var(--sky); color: #fff; border: none; border-radius: 999px;
  padding: 8px 16px; font-size: 14px; font-weight: 600;
}
.btn:hover { background: #0369a1; }
.btn.secondary { background: #fff; color: var(--sky); border: 1px solid var(--sky); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.danger { background: #fff; color: var(--bad); border: 1px solid var(--bad); }
.btn.tiny { padding: 4px 10px; font-size: 13px; }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.plain { background: var(--sky-soft); color: var(--sky); }
.badge.grey { background: #e8eff5; color: var(--muted); }
.badge.sun { background: #fdf3d3; color: #8a6100; }
.chip {
  border: 1px solid var(--sky); color: var(--sky); background: #fff;
  border-radius: 999px; padding: 5px 13px; font-size: 14px;
}
.chip.active { background: var(--sky); color: #fff; }
.tag { font-size: 12px; color: var(--muted); }

/* ---------- lists & rows ---------- */
.row {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: none; }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-weight: 600; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0 14px; }
.toolbar input[type="search"], .toolbar select {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
}
.toolbar input[type="search"] { flex: 1; min-width: 180px; }
.day-head {
  font-family: Georgia, serif; color: var(--navy); font-size: 17px;
  margin: 18px 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--sky-soft);
}
.unread-dot {
  flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%;
  background: var(--sky); margin-top: 7px;
}
.unread-dot.off { background: transparent; }

/* ---------- forms & modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(8, 44, 84, 0.5);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 12px; overflow-y: auto; z-index: 50;
}
.modal {
  background: var(--paper); border-radius: var(--radius); border-top: 4px solid var(--sky-bright);
  box-shadow: var(--shadow); max-width: 620px; width: 100%; padding: 20px;
}
.modal h2 { font-size: 21px; margin-bottom: 10px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
}
.field textarea { min-height: 90px; resize: vertical; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.msg-body { white-space: pre-wrap; font-size: 15px; line-height: 1.55; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { max-width: 400px; width: 100%; text-align: center; padding: 28px 24px; }
.login-card .logo { font-size: 44px; }
.login-card h1 { font-size: 27px; margin: 8px 0 4px; }
.login-card input {
  width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px;
  margin: 14px 0 10px; text-align: center; font-size: 17px;
}
.error { color: var(--bad); font-size: 14px; min-height: 20px; }
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 999px;
  box-shadow: var(--shadow); z-index: 90; font-size: 14px; max-width: 92vw; text-align: center;
}
.hidden { display: none !important; }
.strike { text-decoration: line-through; color: var(--muted); }
.checkline { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.checkline input[type="checkbox"] { width: 21px; height: 21px; accent-color: var(--sky); flex: 0 0 auto; margin-top: 1px; }
.kv { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.divider { border: none; border-top: 1px solid var(--line); margin: 14px 0; }
ul.plain { list-style: none; margin: 0; padding: 0; }
details.assignments { margin-top: 10px; }
details.assignments summary { cursor: pointer; color: var(--sky); font-weight: 600; font-size: 14px; }
@media (max-width: 560px) {
  header.app h1 { font-size: 21px; }
  .grid { grid-template-columns: 1fr; }
}
