/* ==========================================================
   Weektick — mockups v1
   Κοινό stylesheet για όλες τις οθόνες.
   Χρώματα, τυπογραφία, αποστάσεις, ακτίνες και ύψη είναι
   tokens στο :root. Στους κανόνες μένουν μόνο λεπτομέρειες
   (πάχη γραμμών, μεγέθη εικονιδίων).
   ========================================================== */

/* ---------- 1. Tokens ---------- */

:root {
  /* Χρώματα */
  --bg: #F5F5F2;
  --surface: #FFFFFF;
  --surface-alt: #F7F7F4;
  --ink: #15171C;
  --ink-hover: #2A2D35;
  --muted: #5E636E;
  --faint: #8B909A;
  --on-ink: #FFFFFF;
  --line: #E6E6E1;
  --line-soft: #EFEFEA;
  --line-strong: #D9D9D3;
  --chip: #F1F1EC;
  --chip-hover: #E8E8E2;
  --track: #E4E4DF;
  --control: #9A9EA8;
  --accent: #2E46D1;
  --accent-hover: #1F33A8;
  --accent-soft: #E9ECFB;
  --ok: #0F7A5F;
  --ok-soft: #E3F2EC;
  --warn-bg: #FDF3E3;
  --warn-ink: #3D2A10;
  --warn-icon: #9A5A0C;
  --shadow-sm: 0 1px 2px rgba(21, 23, 28, 0.08);

  /* Ένα χρώμα ανά μάθημα */
  --c1: #2E46D1;
  --c2: #E08A1E;
  --c3: #0F7A5F;
  --c4: #8A3FB8;

  /* Τυπογραφία */
  --font: "Commissioner", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-2xs: 11px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-base: 15px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-3xl: 26px;
  --fs-4xl: 28px;
  --fs-5xl: 30px;
  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-body: 1.45;
  --tracking-tight: -0.02em;

  /* Αποστάσεις */
  --sp-1: 4px;
  --sp-2: 6px;
  --sp-3: 8px;
  --sp-4: 10px;
  --sp-5: 12px;
  --sp-6: 14px;
  --sp-7: 16px;
  --sp-8: 18px;
  --sp-9: 20px;
  --sp-10: 24px;
  --sp-11: 28px;
  --sp-12: 32px;
  --sp-13: 48px;
  --sp-14: 56px;

  /* Ακτίνες */
  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-full: 999px;

  /* Ύψη στοιχείων */
  --h-hit: 44px;
  --h-control: 40px;
  --h-chip: 32px;
  --h-input: 48px;
  --h-btn: 54px;
  --size-check: 22px;
  --size-dot: 8px;

  /* Πλάτος */
  --screen-max: 430px;
  --gutter: var(--sp-9);
}

/* ---------- 2. Βάση ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-lg);
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd, fieldset { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
svg { display: block; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 3. Διάταξη οθόνης ---------- */

.screen {
  max-width: var(--screen-max);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--sp-14) var(--gutter) var(--sp-12);
  display: flex;
  flex-direction: column;
  gap: var(--sp-10);
}
.screen--footer { padding-bottom: 0; }
.screen--roomy { gap: var(--sp-11); }

.footer {
  position: sticky; bottom: 0;
  margin: auto calc(var(--gutter) * -1) 0;
  padding: var(--sp-7) var(--gutter) var(--sp-12);
  background: var(--bg);
  display: flex; flex-direction: column; gap: var(--sp-2);
}

/* ---------- 4. Κεφαλίδα ---------- */

.header { display: flex; flex-direction: column; gap: var(--sp-1); }
.header--intro { gap: var(--sp-4); }

.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-5); }

.eyebrow { font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }

.title {
  font-size: var(--fs-5xl);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-tight);
}
.title--md { font-size: var(--fs-4xl); margin-top: var(--sp-1); }
.title--sm { font-size: var(--fs-3xl); line-height: 1.2; }

.lead { font-size: var(--fs-sm); color: var(--muted); line-height: var(--lh-body); }

.steps { display: flex; gap: var(--sp-2); }
.steps span { width: var(--sp-11); height: var(--sp-1); border-radius: var(--r-full); background: var(--line-strong); }
.steps .is-done { background: var(--ink); }

/* ---------- 5. Ενότητες, κάρτες, γραμμές ---------- */

.section { display: flex; flex-direction: column; gap: var(--sp-5); }
.section--tight { gap: var(--sp-4); }

.label { padding: 0 var(--sp-1); font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.hint { padding: 0 var(--sp-1); font-size: var(--fs-sm); color: var(--muted); line-height: var(--lh-body); }
.hint a, .small a { text-decoration: none; font-weight: 500; }
.small { font-size: var(--fs-sm); color: var(--muted); line-height: var(--lh-body); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.list > li + li { border-top: 1px solid var(--line-soft); }

.row { display: flex; align-items: center; gap: var(--sp-5); padding: var(--sp-6) var(--sp-7); }
.row--edit { padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-7); }
.row__key { width: 40px; flex: none; font-size: var(--fs-base); font-weight: 600; }
.row__main { flex: 1; min-width: 0; font-size: var(--fs-base); }
.row__meta { flex: none; font-size: var(--fs-sm); color: var(--muted); }

a.row { color: inherit; text-decoration: none; }
a.row:hover { background: var(--surface-alt); color: inherit; }
.row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row__title { font-size: var(--fs-base); font-weight: 600; }
.row__sub { font-size: var(--fs-sm); color: var(--muted); }

.icon-btn {
  width: var(--h-hit); height: var(--h-hit); flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--chip); color: var(--ink); }

.chevron { color: var(--faint); }

/* ---------- 6. Χρώμα μαθήματος ---------- */

.course-1 { --course: var(--c1); }
.course-2 { --course: var(--c2); }
.course-3 { --course: var(--c3); }
.course-4 { --course: var(--c4); }

.dot { width: var(--size-dot); height: var(--size-dot); border-radius: 50%; flex: none; background: var(--course, var(--muted)); }

/* ---------- 7. Κουμπιά ---------- */

.pill {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  height: var(--h-control); padding: 0 var(--sp-6);
  border: 0; border-radius: var(--r-full);
  background: var(--chip); color: var(--ink);
  font-size: var(--fs-md); font-weight: 500;
  text-decoration: none; white-space: nowrap; cursor: pointer;
}
.pill:hover { background: var(--chip-hover); color: var(--ink); }
.pill--accent { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pill--accent:hover { background: #DCE1F8; color: var(--accent-hover); }

.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: var(--h-btn);
  border: 0; border-radius: var(--sp-7);
  font-size: var(--fs-lg); font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn--primary { background: var(--ink); color: var(--on-ink); }
.btn--primary:hover { background: var(--ink-hover); color: var(--on-ink); }
.btn--ghost { background: transparent; color: var(--ink); font-weight: 500; }
.btn--ghost:hover { background: var(--chip); color: var(--ink); }
.btn--danger { background: var(--warn-icon); color: var(--on-ink); }
.btn--danger:hover { background: #7A4609; color: var(--on-ink); }

/* ---------- 8. Φόρμες ---------- */

.input-group { display: flex; flex-direction: column; gap: var(--sp-3); }

.input {
  width: 100%; height: var(--h-input);
  padding: 0 var(--sp-7);
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
  font-size: var(--fs-lg);
  outline: none;
}
.input:focus { border-color: var(--ink); }
.input::placeholder { color: var(--faint); }

.dropzone {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-3);
  padding: var(--sp-12) var(--sp-9);
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
}
.dropzone:hover { border-color: var(--control); }
.dropzone:focus-within { border-color: var(--ink); border-style: solid; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone__icon {
  width: var(--h-hit); height: var(--h-hit);
  display: grid; place-items: center;
  border-radius: var(--r-md);
  background: var(--chip); color: var(--ink);
}
.dropzone__title { font-size: var(--fs-lg); font-weight: 600; }
.dropzone__sub { font-size: var(--fs-sm); color: var(--muted); }

.field { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-6) var(--sp-7); color: var(--accent); }
.field input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: var(--fs-base); color: var(--ink); }
.field input::placeholder { color: var(--faint); }

/* Checkbox (στρογγυλό) με περιοχή αφής 44px */
.check {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: var(--size-check); height: var(--size-check);
  margin: 0;
  border: 1.5px solid var(--control);
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
}
.check::before { content: ""; position: absolute; inset: calc((var(--size-check) - var(--h-hit)) / 2); }
.check::after {
  content: "";
  width: 10px; height: 5px;
  border: solid var(--on-ink);
  border-width: 0 0 1.8px 1.8px;
  transform: translateY(-1px) rotate(-45deg);
  opacity: 0;
}
.check:checked { background: var(--ink); border-color: var(--ink); counter-increment: done; }
.check:checked::after { opacity: 1; }
.check:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Switch */
.switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 44px; height: 26px; margin: 0;
  border-radius: var(--r-full);
  background: var(--line-strong);
  cursor: pointer;
  transition: background 0.15s;
}
.switch::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s;
}
.switch:checked { background: var(--ink); }
.switch:checked::after { transform: translateX(18px); }

/* Ομάδα επιλογών (radio/checkbox που μοιάζουν με κουμπιά) */
.toggles { display: flex; gap: var(--sp-3); }
.toggles--indent { padding-left: calc(40px + var(--sp-5)); }
.toggle { flex: 1; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle span {
  display: flex; align-items: center; justify-content: center;
  height: var(--h-hit); padding: 0 var(--sp-3);
  border: 1px solid #E0E0DA; border-radius: var(--sp-5);
  background: var(--surface); color: var(--ink);
  font-size: var(--fs-md); font-weight: 500;
  text-align: center;
  cursor: pointer;
}
.toggle input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--on-ink); font-weight: 600; }
.toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Ρύθμιση σε μία γραμμή */
.setting { display: flex; align-items: center; gap: var(--sp-5); padding: var(--sp-6) var(--sp-7); }
.setting__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.setting__title { font-size: var(--fs-base); font-weight: 500; }
.setting__sub { font-size: var(--fs-sm); color: var(--muted); line-height: var(--lh-snug); }

/* ---------- 9. Προσθήκη μαθήματος ---------- */

.file { display: flex; align-items: center; gap: var(--sp-5); padding: var(--sp-6) var(--sp-7); }
.file__icon {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--chip);
}
.file__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.file__name { font-size: var(--fs-base); font-weight: 600; }
.file__sub { font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.status { flex: none; padding: var(--sp-1) var(--sp-3); border-radius: var(--r-xs); font-size: var(--fs-xs); font-weight: 600; text-decoration: none; }
.status--ok { background: var(--ok-soft); color: var(--ok); }
.status--todo { background: var(--warn-bg); color: var(--warn-ink); }
a.status--todo:hover { color: var(--warn-ink); background: #FAE9CC; }

/* ---------- 10. Επιβεβαίωση ---------- */

.source { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-sm); color: var(--muted); }
.source strong { color: var(--ink); font-weight: 600; }

.ask {
  display: flex; flex-direction: column; gap: var(--sp-5);
  padding: var(--sp-7);
  border-radius: var(--sp-7);
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.ask__head { display: flex; gap: var(--sp-4); align-items: flex-start; font-size: var(--fs-md); line-height: var(--lh-body); }
.ask__head svg { color: var(--warn-icon); margin-top: 1px; }
.ask__title { display: block; font-weight: 600; }
.ask:has(input:checked) { background: var(--surface); border: 1px solid var(--line); }
.ask:has(input:checked) .ask__head svg { color: var(--ok); }

.choose { display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-6) var(--sp-7); }
.choose__head { display: flex; align-items: baseline; gap: var(--sp-5); }

/* Ημερομηνία που εξαρτάται από την απάντηση Σάββατο/Κυριακή */
.dow { display: none; }
.dow--unknown { display: inline; color: var(--warn-icon); font-weight: 600; }
.screen:has(#dow-sat:checked) .dow--sat,
.screen:has(#dow-sun:checked) .dow--sun { display: inline; }
.screen:has(#dow-sat:checked) .dow--unknown,
.screen:has(#dow-sun:checked) .dow--unknown { display: none; }

/* Πόσες ερωτήσεις εκκρεμούν */
.pending { text-align: center; font-size: var(--fs-sm); color: var(--warn-icon); font-weight: 500; }
.pending__one, .pending__none { display: none; }
.screen:has([name="oss1"]:checked) .pending__two,
.screen:has([name="dow"]:checked) .pending__two { display: none; }
.screen:has([name="oss1"]:checked) .pending__one,
.screen:has([name="dow"]:checked) .pending__one { display: inline; }
.screen:has([name="oss1"]:checked):has([name="dow"]:checked) .pending__one { display: none; }
.screen:has([name="oss1"]:checked):has([name="dow"]:checked) .pending__none { display: inline; color: var(--ok); }

/* ---------- 11. Η εβδομάδα μου ---------- */

.course { position: relative; counter-reset: done; }
.course__head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-7) 88px var(--sp-5) var(--sp-7); }
.course__code { font-size: var(--fs-base); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course__topic { font-size: var(--fs-md); color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course__count { position: absolute; top: var(--sp-7); right: var(--sp-7); font-size: var(--fs-sm); color: var(--muted); }
.course__empty { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); padding: 0 var(--sp-7) var(--sp-7); }

.items > li { border-top: 1px solid var(--line-soft); }
.item { display: flex; align-items: center; gap: var(--sp-5); padding: var(--sp-5) var(--sp-7); min-height: 52px; }
.item__label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.item__title { font-size: var(--fs-base); line-height: var(--lh-snug); }
.item__sub { font-size: var(--fs-xs); color: var(--muted); }
.item:has(.check:checked) .item__title { color: var(--faint); text-decoration: line-through; }

/* «Συνεχίζεις εδώ»: εμφανίζεται στο πρώτο ανολοκλήρωτο κομμάτι κάθε μαθήματος */
.item__next {
  display: none;
  flex: none;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-xs);
  background: var(--accent-soft); color: var(--accent);
  font-size: var(--fs-xs); font-weight: 600;
}
.items > li:has(.check:not(:checked)):not(.items > li:has(.check:not(:checked)) ~ li) .item__next { display: inline-flex; }

/* Επόμενα γεγονότα */
.event {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-areas: "date body" "actions actions";
  gap: var(--sp-3) var(--sp-6);
  align-items: start;
  padding: var(--sp-6) var(--sp-7);
}
@media (min-width: 540px) {
  .event {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-areas: "date body actions";
    align-items: center;
  }
}
.event__date { grid-area: date; }
.date { width: 40px; flex: none; display: flex; flex-direction: column; align-items: center; }
.date__dow { font-size: var(--fs-2xs); font-weight: 600; color: var(--muted); }
.date__day { font-size: var(--fs-xl); font-weight: 600; }
.event__body { grid-area: body; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.event__title { font-size: var(--fs-base); font-weight: 600; line-height: 1.3; }
.event__sub { font-size: var(--fs-sm); color: var(--muted); line-height: 1.35; }
.event__actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  padding-left: calc(40px + var(--sp-6));
}
@media (min-width: 540px) {
  .event__actions { padding-left: 0; justify-content: flex-end; }
}

/* «Παραδόθηκε»: κατάσταση παράδοσης της εργασίας. Χωρίς email σε αυτό το βήμα. */
.delivered { flex: none; margin: 0; }
.delivered__btn {
  display: inline-flex; align-items: center;
  height: var(--h-chip); padding: 0 var(--sp-5);
  border: 1px solid var(--line); border-radius: var(--r-full);
  background: transparent;
  font: inherit; font-size: var(--fs-sm); font-weight: 500; color: var(--ink);
  cursor: pointer;
}
.delivered__btn.is-on { background: var(--ok-soft); border-color: var(--ok-soft); color: var(--ok); font-weight: 600; }
.delivered__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Πρόοδος έτους */
.year { display: flex; flex-direction: column; gap: var(--sp-3); padding: 0 var(--sp-1); }
.year__head { display: flex; justify-content: space-between; font-size: var(--fs-sm); color: var(--muted); }
.year__form { padding: 0; gap: var(--sp-3); }
.year__form .pill { align-self: flex-start; }
.year__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4); }
.year__actions form { margin: 0; }
.bar { height: var(--sp-1); border-radius: var(--r-full); background: var(--track); overflow: hidden; }
.bar > span { display: block; height: 100%; width: var(--p, 0%); border-radius: var(--r-full); background: var(--ink); }
/* Στην εφαρμογή το --p το ορίζει η JS. Εδώ, κλάση για το mockup. */
.p-6 { --p: 6%; }

/* ---------- 12. Ενημέρωση Δευτέρας (email) ---------- */

.page-mail { background: var(--surface); }

.mail {
  max-width: var(--screen-max);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--sp-13) var(--sp-10) var(--sp-12);
  background: var(--surface);
  display: flex; flex-direction: column; gap: var(--sp-11);
}
.mail__head { display: flex; flex-direction: column; gap: var(--sp-6); padding-bottom: var(--sp-10); border-bottom: 1px solid var(--line-soft); }
.mail__text { font-size: var(--fs-base); line-height: 1.5; }
.mail__foot { margin-top: auto; padding-top: var(--sp-9); border-top: 1px solid var(--line-soft); font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; }
.mail__foot a { text-decoration: none; font-weight: 500; }
.mail .btn { height: 52px; border-radius: var(--r-md); }

.brand { display: flex; align-items: center; gap: var(--sp-4); font-size: var(--fs-md); font-weight: 700; letter-spacing: -0.01em; }
.brand--logo { gap: 0; text-decoration: none; color: inherit; }
.brand__logo { display: block; height: 28px; width: auto; max-width: min(100%, 200px); }
.brand__mark { width: var(--sp-11); height: var(--sp-11); border-radius: var(--r-xs); background: var(--ink); color: var(--on-ink); display: grid; place-items: center; }
.brand__time { margin-left: auto; font-size: var(--fs-sm); font-weight: 400; color: var(--muted); }

.plan { display: flex; flex-direction: column; gap: var(--sp-9); }
.plan__item { display: flex; gap: var(--sp-6); }
.plan__item::before { content: ""; width: 3px; flex: none; border-radius: var(--r-full); background: var(--course); }
.plan__body { display: flex; flex-direction: column; gap: var(--sp-1); }
.plan__code { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.plan__topic { font-size: var(--fs-lg); font-weight: 500; }
.plan__days { font-size: var(--fs-md); color: var(--muted); }

.panel { display: flex; flex-direction: column; gap: var(--sp-5); padding: var(--sp-8); border-radius: var(--sp-7); background: var(--bg); }
.panel .label { padding: 0; }
.panel__list { display: flex; flex-direction: column; gap: var(--sp-5); }
.kv { display: flex; justify-content: space-between; gap: var(--sp-5); font-size: var(--fs-base); }
.kv dt { font-weight: 500; }

/* ---------- 14. Σύνδεση ---------- */

.auth { justify-content: flex-start; gap: var(--sp-11); }
.auth .brand { color: var(--ink); text-decoration: none; align-self: flex-start; }
.auth__form { display: flex; flex-direction: column; gap: var(--sp-7); }

.code-input {
  width: 100%; height: 64px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
  text-align: center;
  font-size: 28px; font-weight: 600; letter-spacing: 0.4em; text-indent: 0.4em;
  font-variant-numeric: tabular-nums;
  outline: none;
}
.code-input:focus { border-color: var(--ink); }
.code-input::placeholder { color: var(--line-strong); }

.links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2) var(--sp-9); font-size: var(--fs-md); }
.links a, .links button { text-decoration: none; font-weight: 500; color: inherit; background: none; border: none; padding: 0; font: inherit; cursor: pointer; }

/* ---------- 13. Λειτουργικές οθόνες ---------- */

.course-form { display: flex; flex-direction: column; gap: var(--sp-7); }
.weeknav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.weeknav__range { flex: 1; min-width: 0; text-align: center; font-size: var(--fs-sm); font-weight: 600; }
.weeknav__today { flex: 1 0 100%; text-align: center; font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }

textarea.input { height: auto; min-height: 96px; padding: var(--sp-5) var(--sp-7); resize: vertical; }

.stack { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-5) var(--sp-7) var(--sp-7); }
.stack .pill { align-self: flex-start; }
.stack--rule { border-top: 1px solid var(--line-soft); }
.stack .btn { margin-top: var(--sp-2); }

form.file .input { flex: 1; width: auto; min-width: 0; height: var(--h-control); padding: 0 var(--sp-5); }

.course-period {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-5); padding: var(--sp-6) var(--sp-7);
}
.course-period__label { flex: 1; min-width: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.course-list > li + li { border-top: 1px solid var(--line-soft); }
.course-list__summary {
  display: flex; align-items: center; gap: var(--sp-5);
  padding: var(--sp-6) var(--sp-7);
  list-style: none; cursor: pointer;
}
.course-list__summary::-webkit-details-marker { display: none; }
.course-list__badge {
  flex: none; width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm); font-weight: 700;
  background: color-mix(in srgb, var(--course) 14%, var(--surface));
  color: var(--course);
}
.course-list__name {
  flex: 1; min-width: 0;
  font-size: var(--fs-base); font-weight: 600; color: var(--ink);
  text-align: left;
}
.course-list__manage { flex: none; pointer-events: none; }
.course-manage:not([open]) .course-list__manage-close { display: none; }
.course-manage[open] .course-list__manage-open { display: none; }
.course-manage__panel {
  padding: var(--sp-4) var(--sp-7) var(--sp-5);
  border-top: 1px solid var(--line-soft);
}
.course-manage__error { margin: 0; }
.course-manage__panel .course-row__form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.course-manage__panel .course-row__actions {
  grid-column: auto;
  width: 100%;
  gap: var(--sp-2) var(--sp-5);
}
.course-manage__panel .course-row__actions .course-row__delete { margin-left: auto; }
.course-row__form {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  column-gap: var(--sp-5);
  row-gap: var(--sp-4);
}
.course-row__head { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--sp-5); min-width: 0; }
.course-row__color { position: relative; }
.course-row__color-select {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}
.course-row__name { flex: 1; min-width: 0; height: var(--h-control); padding: 0 var(--sp-5); }
.course-row__actions {
  grid-column: 2;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--sp-2) var(--sp-6);
  margin: 0;
}
.course-row__actions .delivered__btn {
  min-height: var(--h-hit);
  height: auto;
  padding: var(--sp-2) var(--sp-5);
}
.course-row__actions a {
  display: inline-flex; align-items: center;
  min-height: var(--h-hit);
  padding: var(--sp-2) 0;
}
.course-row__actions a.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--h-hit);
  height: var(--h-hit);
  min-height: var(--h-hit);
  padding: 0;
  text-decoration: none;
  color: var(--muted);
  background: transparent;
  border: 0;
}
.course-row__actions a.icon-btn.course-row__delete:hover {
  color: var(--ink);
  background: transparent;
}
.course-row__actions a.icon-btn.course-row__delete:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.course-row__delete-icon {
  display: block;
  width: 18px;
  height: 18px;
  background-color: currentColor;
  -webkit-mask: url("/static/icons/trash.svg") center / contain no-repeat;
  mask: url("/static/icons/trash.svg") center / contain no-repeat;
}
.course-delete-form__actions { display: flex; flex-wrap: wrap; gap: var(--sp-5); align-items: center; }
.item > form { display: flex; }

button.check { padding: 0; background: transparent; }
button.check.is-checked { background: var(--ink); border-color: var(--ink); }
button.check.is-checked::after { opacity: 1; }
.item.is-done .item__title { color: var(--faint); text-decoration: line-through; }
.item__next.is-on { display: inline-flex; }

.event.is-done .event__title { color: var(--faint); text-decoration: line-through; }
.event__edit { flex: none; font-size: var(--fs-xs); font-weight: 500; color: var(--muted); text-decoration: none; }
.event__edit:hover { color: var(--ink); }

.backlog > * + * { margin-top: var(--sp-5); }
.backlog summary { cursor: pointer; }

.import-cards { display: flex; flex-direction: column; gap: var(--sp-5); }
.import-card { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-7); }
.import-card__title { font-size: var(--fs-lg); font-weight: 600; }
.import-card .lead, .import-card .small { margin: 0; }

form.import-form { display: flex; flex-direction: column; gap: var(--sp-7); }
form.import-form .footer { position: static; }
.import-row { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-5) var(--sp-7); }
.import-row.is-open { background: var(--warn-bg); }
.import-row .setting { padding: 0; }

/* Κύρια πλοήγηση εφαρμογής (κινητό κάτω / επιτραπέζιο πάνω) */
:root {
  --app-nav-h: 56px;
  --app-nav-top-h: 44px;
}

.has-app-nav .screen {
  padding-bottom: calc(var(--app-nav-h) + env(safe-area-inset-bottom, 0px) + var(--sp-12));
}
.has-app-nav .screen--footer {
  padding-bottom: calc(var(--app-nav-h) + env(safe-area-inset-bottom, 0px) + var(--sp-4));
}
.has-app-nav .footer {
  bottom: calc(var(--app-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: calc(var(--sp-7) + env(safe-area-inset-bottom, 0px));
}

.app-nav-top,
.app-nav-bottom {
  z-index: 20;
  background: var(--surface);
  border-color: var(--line);
}
.app-nav-top {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--app-nav-top-h);
  align-items: center;
  justify-content: center;
  gap: var(--sp-10);
  border-bottom: 1px solid var(--line);
  padding: 0 var(--gutter);
}
.app-nav__brand {
  position: absolute;
  left: var(--gutter);
  display: flex;
  align-items: center;
  text-decoration: none;
}
.app-nav__logo {
  display: block;
  height: 28px;
  width: auto;
}
.app-nav-bottom {
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: var(--app-nav-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.app-nav__tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--app-nav-h);
  padding: var(--sp-2) var(--sp-3);
  text-decoration: none;
  color: var(--faint);
  font-size: var(--fs-2xs);
  font-weight: 600;
}
.app-nav__tab.is-active { color: var(--ink); }
.app-nav__icon {
  flex: none;
  display: block;
  width: 22px;
  height: 22px;
  background-color: currentColor;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}
.app-nav__icon--week { -webkit-mask-image: url("/static/icons/week.svg"); mask-image: url("/static/icons/week.svg"); }
.app-nav__icon--calendar { -webkit-mask-image: url("/static/icons/calendar.svg"); mask-image: url("/static/icons/calendar.svg"); }
.app-nav__icon--courses { -webkit-mask-image: url("/static/icons/courses.svg"); mask-image: url("/static/icons/courses.svg"); }
.app-nav__icon--settings { -webkit-mask-image: url("/static/icons/settings.svg"); mask-image: url("/static/icons/settings.svg"); }
.app-nav__label { line-height: 1.1; }
.app-nav__link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  color: var(--faint);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-xs);
}
.app-nav__link.is-active { color: var(--ink); }
.app-nav__link:focus-visible,
.app-nav__tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (min-width: 768px) {
  .has-app-nav .screen {
    padding-top: calc(var(--app-nav-top-h) + var(--sp-12));
    padding-bottom: var(--sp-12);
  }
  .has-app-nav .screen--footer { padding-bottom: 0; }
  .has-app-nav .footer {
    bottom: 0;
    padding-bottom: var(--sp-12);
  }
  .app-nav-bottom { display: none; }
  .app-nav-top { display: flex; }
  .app-nav__link--settings {
    gap: 0;
    padding: var(--sp-2);
    min-width: var(--h-hit);
    min-height: var(--h-hit);
    justify-content: center;
  }
  .app-nav__link--settings .app-nav__label--hide-desktop {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}
