/* Homework Tracker — calm lavender + cream theme */
:root {
  --bg: #f0eaf8;            /* lavender wash */
  --card: #fffdf7;          /* cream */
  --ink: #3d3654;
  --muted: #7d7594;
  --line: #e3d9f3;
  --brand: #8b76c6;         /* soft lavender */
  --brand-dark: #7460b3;
  --brand-soft: #e9e2f8;
  --danger: #c26d6d;
  --chip-ink: #4a4458;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
.appbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--brand);
  color: #fff;
  padding: 14px 16px;
  font-size: 19px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.appbar .brand { color: #fff; text-decoration: none; }
.appnav { display: flex; align-items: center; gap: 12px; }
.appnav a { color: #fff; font-size: 15px; font-weight: 600; text-decoration: none; }
.appnav form { margin: 0; }
.appnav button {
  background: transparent; border: 1px solid rgba(255,255,255,0.7);
  color: #fff; border-radius: 10px; padding: 8px 12px;
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 12px 14px 110px; }

/* Day navigation */
.daynav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin: 4px 0 2px;
}
.navbtn {
  flex: 0 0 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; line-height: 1;
  background: var(--card); color: var(--brand-dark);
  border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none;
}
.daytitle { text-align: center; }
.daytitle h1 { margin: 0; font-size: 22px; }
.weekbtn {
  display: inline-block;
  margin-top: 8px;
  padding: 9px 24px;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid var(--line);
  color: var(--brand-dark);
  font-size: 16px; font-weight: 700;
  text-decoration: none;
}
.weekbtn:active { background: var(--line); }

/* Week view */
.weekday { margin: 14px 0 4px; }
.weekdayhead {
  display: flex; align-items: baseline; gap: 8px;
  text-decoration: none; color: var(--ink);
  padding: 8px 2px;
}
.weekdayname { font-size: 18px; font-weight: 700; }
.weekdaydate { font-size: 14px; color: var(--muted); }
.weekdaygo { margin-left: auto; color: var(--brand-dark); font-size: 22px; }
.weekempty {
  margin: 2px 0 8px; padding: 10px 14px;
  color: var(--muted); font-size: 15px;
  background: var(--card); border: 1px dashed var(--line);
  border-radius: 12px;
}
.cards.compact { gap: 8px; }
.cards.compact .card { padding: 10px 12px; }
.check.small { width: 42px; height: 42px; font-size: 20px; border-width: 2px; }
.cardnotes.trunc {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.todaylink { text-align: center; margin: 6px 0; }
.todaylink a { color: var(--brand-dark); font-size: 16px; }
.remaining { text-align: center; color: var(--muted); font-size: 15px; margin: 6px 0 10px; }
.remaining.done-all { color: var(--brand-dark); font-weight: 600; }

/* Subject filter row */
.filterrow {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 6px 2px 12px; margin-top: 6px;
  -webkit-overflow-scrolling: touch;
}
.fchip {
  flex: 0 0 auto;
  padding: 9px 15px; border-radius: 999px;
  background: var(--chip, var(--card));
  border: 1px solid var(--line);
  color: var(--chip-ink);
  text-decoration: none; font-size: 15px; font-weight: 600;
  white-space: nowrap;
}
.fchip.active { box-shadow: 0 0 0 2px var(--brand-dark); }

/* Due tomorrow strip */
.duetomorrow {
  background: var(--brand-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px; margin: 2px 0 12px;
}
.duetomorrow h2 {
  font-size: 13px; margin: 0 0 8px; color: var(--muted);
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.duetomorrow ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.duetomorrow li { font-size: 15px; }
.minichip {
  font-size: 12px; font-weight: 700;
  padding: 2px 9px; border-radius: 999px;
  background: var(--chip, var(--card)); color: var(--chip-ink);
  margin-right: 7px; white-space: nowrap;
}

/* Cards */
.cards { display: flex; flex-direction: column; gap: 10px; }
.card {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 2px 8px rgba(61, 54, 84, 0.07);
}
.card.is-done { opacity: 0.45; }
.card.is-done .cardtitle { text-decoration: line-through; }
.toggleform { flex: 0 0 auto; margin: 0; }
.check {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 3px solid var(--brand);
  background: var(--card); color: #fff;
  font-size: 26px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.card.is-done .check { background: var(--brand); }
.cardbody { flex: 1 1 auto; min-width: 0; }
.cardtop { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.chip {
  background: var(--chip, var(--card)); color: var(--chip-ink);
  font-size: 13px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
}
.period { color: var(--muted); font-size: 14px; }
.cardtitle { font-size: 18px; font-weight: 600; overflow-wrap: break-word; }
.cardnotes { color: var(--muted); font-size: 15px; margin-top: 4px; overflow-wrap: break-word; }
.cardactions { flex: 0 0 auto; }
.iconbtn {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  font-size: 22px; color: var(--brand-dark);
  border: 1px solid var(--line); border-radius: 12px;
  text-decoration: none; background: var(--brand-soft);
}

/* Empty state */
.empty {
  text-align: center; padding: 48px 20px;
  background: var(--card); border: 1px dashed var(--line);
  border-radius: var(--radius); color: var(--muted);
}
.empty p { margin: 6px 0; font-size: 18px; }
.empty .emptysub { font-size: 15px; }

/* Floating add button */
.fab {
  position: fixed; right: 20px; bottom: 24px;
  width: 68px; height: 68px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 36px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(139, 118, 198, 0.45);
}
.fab:active { background: var(--brand-dark); }

/* Forms */
.pagetitle { font-size: 22px; margin: 8px 0 14px; }
.hwform { display: flex; flex-direction: column; gap: 14px; }
.hwform label { display: flex; flex-direction: column; gap: 6px; font-size: 16px; font-weight: 600; }
.hwform label em { font-weight: 400; color: var(--muted); font-style: normal; }
.hwform input, .hwform textarea, .hwform select {
  font-size: 17px; padding: 14px 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink);
  font-family: inherit;
}
.hwform input:focus, .hwform textarea:focus, .hwform select:focus {
  outline: 3px solid rgba(139, 118, 198, 0.3); border-color: var(--brand);
}
.hint { color: var(--muted); font-size: 14px; margin: 0; }
.formrow { display: flex; gap: 10px; margin-top: 4px; }
.btn {
  flex: 1; min-height: 56px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  border-radius: 14px; border: 1px solid var(--line);
  text-decoration: none; cursor: pointer;
  font-family: inherit;
}
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:active { background: var(--brand-dark); }
.btn.secondary { background: var(--card); color: var(--ink); }
.btn.danger { background: var(--card); color: var(--danger); border-color: var(--danger); width: 100%; }
.deleteform { margin-top: 18px; }

/* Login */
.loginwrap {
  display: flex; justify-content: center;
  padding: 48px 0;
}
.logincard {
  width: 100%; max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 28px 22px;
  box-shadow: 0 4px 18px rgba(61, 54, 84, 0.08);
  display: flex; flex-direction: column; gap: 14px;
}
.logincard h1 { margin: 0; font-size: 24px; text-align: center; }
.loginsub { margin: 0; text-align: center; color: var(--muted); font-size: 15px; }
.logincard label { display: flex; flex-direction: column; gap: 6px; font-size: 16px; font-weight: 600; }
.logincard input {
  font-size: 17px; padding: 14px 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); font-family: inherit;
}
.logincard input:focus { outline: 3px solid rgba(139, 118, 198, 0.3); border-color: var(--brand); }
.loginerr {
  margin: 0; padding: 10px 12px;
  background: #fbeeee; border: 1px solid var(--danger); border-radius: 10px;
  color: #a04a4a; font-size: 15px; text-align: center;
}

/* Settings subject list */
.subjlist { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }

/* Multi-day work-on picker */
.daypicker { display: flex; gap: 8px; }
.daypicker input[type="date"] { flex: 1; min-width: 0; }
.daychips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.daychip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand-soft); border: 1px solid var(--line);
  color: var(--ink); border-radius: 999px; padding: 6px 6px 6px 12px;
  font-size: 14px; font-weight: 600;
}
.daychipx {
  border: none; background: var(--line); color: var(--muted);
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 14px; line-height: 1; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}

/* List view: per-day progress tags under each assignment */
.daytags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.daytag {
  display: inline-flex; align-items: center; gap: 4px;
  background: #f6f1fb; border: 1px solid var(--line);
  color: var(--muted); border-radius: 999px; padding: 4px 10px;
  font-size: 13px; font-weight: 600;
}
.daytag.done { background: var(--brand-soft); color: var(--brand-dark); border-color: transparent; }
.workdays-label { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
