/* Teacher web dashboard. Colors and spacing follow the Pekan design (see DESIGN.md). */

:root {
  --paper: #FAF7F0;
  --card: #FFFFFF;
  --line: #E6E0D2;
  --line-strong: #CFC8B6;
  --ink: #1B2340;
  --ink-soft: #3A4160;
  --muted: #5B6279;
  --brand: #2F3FBF;
  --brand-ink: #2331A0;
  --brand-tint: #E4E7FB;
  --flag: #E8721C;
  --flag-strong: #B4510B;
  --flag-tint: #FFF7EE;
  --flag-ink: #8A3A06;
  --ok-tint: #D9F0EC;
  --ok-ink: #0B4F49;
  --note-tint: #FCE8D5;
  --extracurricular-tint: #FFF3C9;
  --pickup-tint: #DCE6F5;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Instrument Sans', system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 40px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 14px; }

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--brand);
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  background: var(--brand-tint);
  color: var(--brand-ink);
  font-size: 14px;
  font-weight: 600;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 24px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.btn-primary {
  padding: 0 24px;
  border: 0;
  background: var(--brand);
  color: #fff;
}

.layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 40px 48px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}

.sidebar {
  flex: 0 1 380px;
  min-width: min(320px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--line);
}

.cal { display: flex; flex-direction: column; gap: 12px; padding: 20px; }

.cal-head { display: flex; align-items: center; gap: 6px; }

.cal-head h1 {
  margin: 0 6px;
  flex: 1;
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.01em;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.icon-btn[aria-disabled="true"] { opacity: 0.35; pointer-events: none; }

.week-grid,
.day-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.week-grid span {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.day {
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.day.has-schedule { background: var(--card); color: var(--ink); }

.day.is-today { border: 2px solid var(--brand); }

.day.is-selected {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.day-num {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

.dots { display: flex; gap: 4px; height: 6px; }

.dot { width: 6px; height: 6px; border-radius: 50%; }
.dot-exam { background: var(--flag); }
.dot-prep { background: var(--brand); }
.day.is-selected .dot-prep { background: #fff; }

.legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
}

.legend span { display: flex; align-items: center; gap: 6px; }

.draft-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
  border-radius: 20px;
  background: var(--flag-tint);
  border: 2px solid var(--flag);
}

.draft-card .label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--flag-ink); }
.draft-card .file { font-size: 15px; font-weight: 600; line-height: 1.35; }
.draft-card .meta { font-size: 14px; color: #6E2D04; }

.main {
  flex: 1 1 560px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--line);
}

.day-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.day-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: #EEF0F6;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.empty {
  margin: 0;
  padding: 24px 20px;
  border-radius: 16px;
  background: var(--paper);
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.flag-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--flag-tint);
  border: 2px solid var(--flag);
}

.flag-card .text { flex: 1 1 320px; display: flex; flex-direction: column; gap: 2px; }
.flag-card .label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--flag-ink); }
.flag-card p { margin: 0; font-size: 15px; line-height: 1.4; color: #4A2203; }

.btn-ghost-small {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 22px;
  border: 1px solid var(--flag-strong);
  background: var(--card);
  color: #6E2D04;
  font-size: 14px;
  font-weight: 600;
}

.btn-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 22px;
  border: 0;
  background: var(--flag-strong);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 12px;
}

.info-card {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
}

.info-card.ok { background: var(--ok-tint); color: var(--ok-ink); }
.info-card.note { background: var(--note-tint); color: #6E2D04; }
.info-card > div { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.info-card .label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.info-card .big { font-family: var(--display); font-size: 20px; font-weight: 700; line-height: 1.2; }
.info-card p { margin: 0; font-size: 15px; line-height: 1.4; font-weight: 500; }
.info-card .line { font-size: 14px; line-height: 1.4; }

.ubah-link {
  flex: none;
  align-self: flex-start;
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
}

.section-title {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.schedule { display: flex; flex-direction: column; gap: 8px; }

.row { display: flex; gap: 16px; align-items: stretch; }

.time {
  flex: none;
  width: 56px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 12px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.time small { font-weight: 400; color: var(--muted); font-size: 13px; }

.break {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 44px;
}

.break .title { font-size: 15px; color: var(--ink-soft); font-weight: 500; }
.break .info { font-size: 13px; color: var(--muted); }

.pickup {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--pickup-tint);
}

.pickup .title { font-size: 16px; font-weight: 700; }
.pickup .info { font-size: 13px; color: #33405F; }

.lesson {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
}

.lesson.highlighted { background: #FFF6E0; border: 1px solid #E9C46A; }
.lesson.exam { border: 2px solid var(--flag); }

.lesson-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lesson-body .title { font-size: 16px; font-weight: 600; line-height: 1.25; }
.lesson-body .desc { font-size: 14px; line-height: 1.4; color: var(--ink-soft); }
.lesson-body .place { font-size: 13px; font-weight: 600; }
.lesson-body .bring { font-size: 13px; color: var(--muted); }

.badge-exam {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--flag-strong);
  border-radius: 6px;
  padding: 2px 8px;
}

.btn-edit {
  flex: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--brand-ink);
  font-size: 14px;
  font-weight: 600;
}

.extracurricular-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 8px;
}

.extracurricular {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--extracurricular-tint);
  color: #4B3A00;
}

.extracurricular .time-range { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.extracurricular .name { font-size: 15px; font-weight: 600; }
.extracurricular .place { font-size: 13px; line-height: 1.35; }

@media (max-width: 720px) {
  .topbar, .layout { padding-left: 16px; padding-right: 16px; }
  .main { padding: 18px; }
  .day-head h2 { font-size: 24px; }
}

.day-padding { min-height: 52px; }

.display-title {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.display-big {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.muted { margin: 0; font-size: 15px; line-height: 1.45; color: var(--muted); }

.alert-error {
  padding: 12px 14px;
  border-radius: 14px;
  background: #FBE9E7;
  border: 1px solid #E0A29B;
  color: #7A1F16;
  font-size: 14px;
  line-height: 1.4;
}

.alert-error p { margin: 0; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field-label { font-size: 14px; font-weight: 500; }

.field-input,
.file-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
}

.file-input { padding: 12px 14px; }

.field-error { margin: 0; font-size: 13px; color: #9B2C21; }

.step-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.4; }

.step-num {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-tint);
  color: var(--brand-ink);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dot-flag {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--flag);
}

.day-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

.day-title {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}

.pill-exam { background: var(--flag-strong); color: #fff; }

.flag-card.stacked { flex-direction: column; align-items: stretch; }

.flag-actions { display: flex; gap: 8px; }

.flag-actions form { flex: 1; display: flex; }

.flag-actions .btn-ghost-small,
.flag-actions .btn-flag { flex: 1; min-height: 48px; }

.flag-actions .btn-flag:disabled { opacity: 0.5; cursor: default; }

.summary-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
}

.summary-card .label { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: #EEF0F6;
  color: var(--ink-soft);
  font-size: 13px;
}

.tag-exam { background: var(--flag-strong); color: #fff; font-weight: 700; }

.warning-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--flag-tint);
  border: 2px solid var(--flag);
  color: #4A2203;
}

.warning-card p { margin: 0; font-size: 15px; line-height: 1.4; }

/* Web import page (Impor PDF). Same shell as the dashboard, narrower centered card. */

.page-narrow {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 40px 48px;
}

.import-card {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px;
}

.import-intro { display: flex; flex-direction: column; gap: 8px; }

.import-intro .display-title { font-size: 30px; }

.import-form { display: flex; flex-direction: column; gap: 24px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 20px;
}

.field-hint { font-size: 13px; line-height: 1.4; color: var(--muted); }

.steps-row {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 16px;
}

.steps-row li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.4;
}

.steps-row strong { display: block; margin-bottom: 4px; font-size: 15px; font-weight: 600; }
.steps-row p { margin: 0; font-size: 14px; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.form-actions .btn:disabled { opacity: 0.6; cursor: default; }

@media (max-width: 720px) {
  .page-narrow { padding: 20px 16px 32px; }
  .import-card, .publish-card { padding: 20px; }
}

/* Web review and publish pages (Periksa hasil AI, Publikasi). Same shell as the dashboard. */

.review-days { display: flex; flex-direction: column; gap: 16px; padding: 20px; }

.review-days-head { display: flex; flex-direction: column; gap: 6px; }

.review-days-head h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.01em;
}

.review-days-head .muted strong { color: var(--ink); }

.day-list { display: flex; flex-direction: column; gap: 8px; }

.day-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.day-item.is-selected { background: var(--brand); border-color: var(--brand); color: #fff; }

.day-item .dot-flag { position: static; flex: none; }

.flag-hint { margin: 0; font-size: 15px; line-height: 1.4; color: #4A2203; }

.btn-block { width: 100%; }

.publish-card { display: flex; flex-direction: column; gap: 24px; padding: 32px; }

.publish-card .display-title { font-size: 30px; }

.publish-card .form-actions form { display: flex; }

/* Ubah pelajaran (web). Checkbox card follows DESIGN.md 4.9. */

.check-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.check-card.is-checked {
  background: var(--flag-tint);
  border: 2px solid var(--flag);
}

.check-card.is-checked-highlight { background: #FFF6E0; border: 2px solid #E9C46A; }

.check-help { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--muted); }

.field-check { width: 24px; height: 24px; margin: 0; accent-color: var(--flag-strong); }

textarea.field-input { min-height: 0; padding: 12px 14px; resize: none; }

/* Form controls on the web forms: dropdown and file picker share one height and look. */

select.field-input {
  appearance: none;
  min-height: 52px;
  padding-right: 44px;
  background-color: var(--card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 9l5-5 5 5'/%3E%3Cpath d='M7 15l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.file-input {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
}

.file-input::file-selector-button {
  flex: none;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--brand-tint);
  color: var(--brand-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* Timetable legend: explains the colour of lessons that need special attention. */

.timetable-legend { font-size: 13px; color: var(--muted); }

.timetable-legend span { display: inline-flex; align-items: center; gap: 8px; }

.swatch { width: 14px; height: 14px; border-radius: 4px; }

.swatch-highlight { background: #FFF6E0; border: 1px solid #E9C46A; }

/* Login page */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px;
}

.login-card .import-intro .display-title { font-size: 28px; }

@media (max-width: 480px) {
  .login-card { padding: 20px; }
}

/* Error pages (403, 404, 500) */

.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 20px;
  text-align: center;
}

.error-art { width: min(280px, 70vw); }

.art { display: block; width: 100%; height: auto; overflow: visible; }

.art-shadow { fill: var(--line); transform-box: fill-box; transform-origin: center; }

.error-code {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--flag-strong);
}

.error-text { max-width: 440px; }

.error-actions { justify-content: center; margin-top: 16px; }

.art-search { animation: art-search 4s ease-in-out infinite; }
.art-blink { animation: art-blink 1.6s ease-in-out infinite; }
.art-lock { transform-box: fill-box; transform-origin: 50% 100%; animation: art-wiggle 3s ease-in-out infinite; }
.art-spark circle { animation: art-twinkle 2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.art-spark circle:nth-child(2) { animation-delay: 0.6s; }
.art-spark circle:nth-child(3) { animation-delay: 1.2s; }
.art-paper { transform-box: fill-box; transform-origin: 50% 100%; animation: art-sway 4s ease-in-out infinite; }
.art-badge { transform-box: fill-box; transform-origin: center; animation: art-pulse 1.6s ease-in-out infinite; }
.art-gear-spin { animation: art-spin 6s linear infinite; }
.art-smoke path { animation: art-smoke 2.4s ease-in-out infinite; }
.art-smoke path:nth-child(2) { animation-delay: 1.2s; }

@keyframes art-search {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-70px, -26px); }
  50% { transform: translate(-30px, -50px); }
  75% { transform: translate(-80px, 4px); }
}

@keyframes art-blink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes art-wiggle {
  0%, 60%, 100% { transform: rotate(0); }
  66% { transform: rotate(-7deg); }
  72% { transform: rotate(6deg); }
  78% { transform: rotate(-5deg); }
  84% { transform: rotate(3deg); }
  90% { transform: rotate(0); }
}

@keyframes art-twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes art-sway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

@keyframes art-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.14); }
}

@keyframes art-spin { to { transform: rotate(360deg); } }

@keyframes art-smoke {
  0% { opacity: 0; transform: translateY(8px); }
  40% { opacity: 0.9; }
  100% { opacity: 0; transform: translateY(-10px); }
}

@media (prefers-reduced-motion: reduce) {
  .art *, .art { animation: none !important; }
}
