/* =========================================================
   pages/timetables.css
   ---------------------------------------------------------
   Weekly timetable page.
   Minimal, flat styling aligned with the dashboard controls.
   ========================================================= */

/* 1) PAGE / HEADER */

.nn-weekly {
  padding: 18px 0 40px;
}

.nn-weekly__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
  margin-bottom: 18px;
}

.nn-weekly__titleWrap {
  min-width: 0;
}

.nn-weekly__title {
  margin: 0;
  color: #0f172a;
  font-size: clamp(1.7rem, 2vw, 2rem);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.nn-weekly__controls {
  display: grid;
  justify-items: end;
  gap: 12px;
  min-width: 0;
}

/* 2) DAY FILTERS */

.nn-weekly__dayToggles {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.nn-weekly__dayTogglesLabel {
  margin-right: 4px;
  color: #64748b;
  font-size: 0.84rem;
}

.nn-weekly__dayToggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #d8dee6;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.nn-weekly__dayToggle:hover {
  border-color: #bfc7d1;
  background: #f8fafc;
  color: #0f172a;
  text-decoration: none;
}

.nn-weekly__dayToggle.is-active {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

/* 3) WEEK DATE CONTROLS */

.nn-weekly__dateForm {
  margin: 0;
}

.nn-weekly .nn-date-center--topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.nn-weekly .nn-date-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #d0d5dd;
  border-radius: 9px;
  background: #fff;
  color: #111827;
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
}

.nn-weekly .nn-date-arrow:hover {
  border-color: #bfc7d1;
  background: #f8fafc;
  color: #111827;
  text-decoration: none;
}

.nn-weekly .nn-date-display-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 210px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid #d0d5dd;
  border-radius: 9px;
  background: #fff;
  color: #111827;
  cursor: pointer;
}

.nn-weekly .nn-date-text {
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nn-weekly .nn-date-icon {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 0.92rem;
}

.nn-weekly .nn-date-display-wrap input[type="date"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.nn-weekly .nn-date-today {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #d0d5dd;
  border-radius: 9px;
  background: #fff;
  color: #1f2937;
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.nn-weekly .nn-date-today:hover {
  border-color: #bfc7d1;
  background: #f8fafc;
  color: #111827;
  text-decoration: none;
}

/* 4) TIMETABLE BOARD */

.nn-weekly__grid {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid #dfe5eb;
  border-radius: 8px;
  background: #fff;
}

.nn-weekly__day {
  min-width: 0;
  background: #fff;
  border-right: 1px solid #e5eaf0;
}

.nn-weekly__day:last-child {
  border-right: 0;
}

.nn-weekly__dayHead {
  min-height: 132px;
  padding: 14px 14px 11px;
  border-bottom: 1px solid #dfe5eb;
  background: #fff;
}

.nn-weekly__dayHead h2 {
  margin: 0;
  color: #111827;
  font-size: 0.98rem;
  font-weight: 750;
  line-height: 1.2;
}

.nn-weekly__dayHead p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 0.8rem;
}

.nn-weekly__dayMeta {
  margin-top: 9px;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 550;
}

.nn-weekly__dayBody {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 420px;
  padding: 10px;
  background: #fbfcfd;
}

.nn-weekly__empty {
  padding: 13px 12px;
  border: 1px dashed #d8dee6;
  border-radius: 7px;
  background: #fff;
  color: #64748b;
  font-size: 0.84rem;
}

/* 5) SCHOOL STATUS */

.nn-weekly__schoolStatus {
  display: grid;
  gap: 2px;
  margin: 9px 0 0;
  padding: 7px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
}

.nn-weekly__schoolStatus strong {
  color: #0f172a;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.nn-weekly__schoolStatus span {
  color: #64748b;
  font-size: 0.69rem;
  font-weight: 600;
  line-height: 1.25;
}

.nn-weekly__schoolStatus.is-open {
  border-color: #b7e2dc;
  background: #f4fbfa;
}

.nn-weekly__schoolStatus.is-open strong {
  color: #087780;
}

.nn-weekly__schoolStatus.is-closed {
  border-color: #fecaca;
  background: #fff7f7;
}

.nn-weekly__schoolStatus.is-closed strong {
  color: #991b1b;
}

.nn-weekly__schoolStatus.is-out_of_term {
  border-color: #f3d783;
  background: #fffbeb;
}

.nn-weekly__schoolStatus.is-out_of_term strong {
  color: #92400e;
}

.nn-weekly__schoolStatus.is-no_school {
  border-color: #e2e8f0;
  background: #f8fafc;
}

.nn-weekly__schoolStatus.is-no_school strong {
  color: #475569;
}

/* 6) LESSON / GAP ITEMS */

.nn-week-card {
  display: block;
  padding: 9px 9px 9px 10px;
  border: 1px solid #e1e6eb;
  border-left: 3px solid #c5cbd3;
  border-radius: 7px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.nn-week-card:hover {
  border-color: #cbd3dc;
  background: #fafcfd;
  text-decoration: none;
}

.nn-week-card__time {
  color: #111827;
  font-size: 0.75rem;
  font-weight: 750;
}

.nn-week-card__name {
  margin-top: 4px;
  color: #111827;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
}

.nn-week-card__meta {
  margin-top: 3px;
  color: #64748b;
  font-size: 0.66rem;
  line-height: 1.25;
}

.nn-week-card--attended {
  border-left-color: #2e7d32;
}

.nn-week-card--missed {
  border-left-color: #b00020;
}

.nn-week-card--no_charge {
  border-left-color: #64748b;
}

.nn-week-card--unknown {
  border-left-color: #c5cbd3;
}

.nn-week-gap {
  padding: 7px 9px;
  border: 1px dashed #d7dce3;
  border-radius: 7px;
  background: #f3f5f7;
}

.nn-week-gap__time {
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 650;
}

.nn-week-gap__label {
  margin-top: 2px;
  color: #475569;
  font-size: 0.72rem;
}

/* 7) RESPONSIVE */

@media (max-width: 1100px) {
  .nn-weekly__top {
    align-items: stretch;
  }

  .nn-weekly__controls {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .nn-weekly__top {
    display: grid;
    gap: 16px;
  }

  .nn-weekly__controls {
    justify-items: stretch;
  }

  .nn-weekly__dayToggles,
  .nn-weekly .nn-date-center--topbar {
    justify-content: flex-start;
  }

  .nn-weekly__grid {
    grid-template-columns: 1fr !important;
  }

  .nn-weekly__day {
    border-right: 0;
    border-bottom: 1px solid #dfe5eb;
  }

  .nn-weekly__day:last-child {
    border-bottom: 0;
  }

  .nn-weekly__dayHead,
  .nn-weekly__dayBody {
    min-height: 0;
  }
}

@media (max-width: 700px) {
  .nn-weekly {
    padding-top: 8px;
  }

  .nn-weekly__title {
    font-size: 1.6rem;
  }

  .nn-weekly__dayToggles {
    gap: 6px;
  }

  .nn-weekly__dayTogglesLabel {
    flex-basis: 100%;
    margin: 0 0 2px;
  }

  .nn-weekly .nn-date-center--topbar {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    width: 100%;
  }

  .nn-weekly .nn-date-display-wrap {
    width: 100%;
    min-width: 0;
  }

  .nn-weekly .nn-date-today {
    display: none;
  }

  .nn-weekly__grid {
    border-inline: 0;
    border-radius: 0;
  }
}
