/*
  Teacher Assessment System: the one stylesheet of all pages.

  It is taken from the three previews: navy top bar, teal accent, pale page background and white
  cards with rounded corners. Bootstrap 5.0.2 (Content/bootstrap.min.css) is loaded before it.

  Order of this file:
    1. Shared by all pages
    2. Sign-in page                 body.page-signin
    3. Entry page                   body.page-entry
    4. Teacher profile page         body.page-profile
    5. Admin page                   body.page-admin

  The Content-Security-Policy of the site allows style attributes, but no style block in a page.
  So everything that is not worked out from data (a score colour, a bar width) is in this file.
*/

/* ------------------------------------------------------------------ 1. Shared by all pages */

:root {
  --ink: #18364b;
  --teal: #007e82;
  --teal-dark: #006568;
  --line: #dce7eb;
  --bg: #f4f8fa;
  --muted: #60798a;
  --neutral: #647b8a; /* the text of a missing or removed score */
  --neutral-bar: #cbd5dc; /* its bar and its marker */
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}

/* The top bar: 'SM SCHOOL Staff development' at the left; links, name and Sign out at the right. */
.top {
  background: #12354b;
  color: #fff;
}

.top .brand {
  white-space: nowrap;
}

.brand-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-right: 3px;
}

.brand-dot.d1 {
  background: #f3b641;
}

.brand-dot.d2 {
  background: #e97566;
}

.brand-dot.d3 {
  background: #7ac9a4;
}

.brand-dot.d4 {
  background: #7baae4;
}

.top-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.875rem;
}

.top-nav a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid #ffffff66;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  border-bottom-color: #fff;
}

.top-nav .top-name {
  color: #d5e4ec;
  overflow-wrap: anywhere;
}

@media (max-width: 575px) {
  .top .subtitle {
    display: none;
  }
}

.card {
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: 0 5px 22px #12354b0a;
}

.eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 750;
}

.muted {
  color: var(--muted);
}

.small-note {
  font-size: 0.8rem;
  color: var(--muted);
}

.section-title {
  font-weight: 750;
  font-size: 1.15rem;
}

.form-text {
  color: #64798a;
}

.required::after {
  content: " *";
  color: #bf2633;
}

/* Teal for every main button. */
.btn-primary,
.btn-primary:disabled,
.btn-primary.disabled {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:active:focus {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  color: #fff;
}

.btn-primary:focus,
.btn-primary:active:focus {
  box-shadow: 0 0 0 0.25rem #007e8255;
}

.btn-outline-primary {
  color: var(--teal);
  border-color: var(--teal);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-outline-primary:active:focus {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.btn-outline-primary:focus,
.btn-outline-primary:active:focus {
  box-shadow: 0 0 0 0.25rem #007e8255;
}

.btn-outline-primary:disabled {
  color: var(--teal);
  background: transparent;
}

.btn-link-plain {
  border: 0;
  background: none;
  padding: 0;
  color: var(--teal);
  text-decoration: underline;
  font: inherit;
}

.btn-link-plain:hover {
  color: var(--teal-dark);
}

button:focus-visible,
summary:focus-visible,
.btn:focus-visible {
  outline: 3px solid #f3bd38;
  outline-offset: 2px;
}

a {
  color: #00686c;
}

.progress {
  height: 8px;
  background: #e9eff2;
}

.progress-bar {
  background: var(--teal);
}

.score {
  font-weight: 750;
}

.chip {
  display: inline-block;
  border-radius: 99px;
  background: #e4f4f0;
  color: #116961;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 650;
}

/* A photo, or the initials when there is no usable photo. Never a broken image. */
.avatar {
  width: 55px;
  height: 55px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #d8efeb;
  color: #006c70;
  font-size: 1.15rem;
  font-weight: 800;
  overflow: hidden;
  flex: none;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Changed (yellow), New (teal) and the red label of an unread message are three separate marks. */
.changed-badge {
  display: inline-block;
  background: #ffe39a;
  color: #694800;
  font-size: 0.72rem;
  font-weight: 750;
  border-radius: 99px;
  padding: 3px 9px;
  margin-left: 8px;
}

.new-badge {
  display: inline-block;
  background: var(--teal);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 750;
  border-radius: 99px;
  padding: 3px 9px;
  margin-left: 8px;
}

.new-label {
  font-size: 0.7rem;
  background: #d22b35;
  color: #fff;
  border-radius: 99px;
  padding: 2px 7px;
}

.message-note {
  background: #fff8e7;
  border-left: 3px solid #d99b22;
  padding: 9px 11px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pre-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.field-error {
  color: #b02a37;
  font-size: 0.875em;
  margin-top: 0.25rem;
}

.field-error:empty {
  display: none;
}

.file-list a,
.file-list li {
  word-break: break-word;
}

.file-list .taken-off {
  text-decoration: line-through;
  color: var(--muted);
}

/* The page states: loading, no access, error. */
.page-state {
  border-radius: 12px;
}

/* 'Your session has ended ...' stays in view while the person reads or types. */
.session-banner {
  position: sticky;
  top: 8px;
  z-index: 30;
  box-shadow: 0 8px 24px #12354b33;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.875rem;
}

.pager:empty {
  display: none;
}

/* A pop-up is a <dialog>. */
.app-dialog {
  width: min(1000px, calc(100vw - 24px));
  max-height: 90vh;
  border: 0;
  border-radius: 18px;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 20px 80px #12354b60;
}

.app-dialog::backdrop {
  background: #12354b85;
}

.dialog-top {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  padding: 18px 24px;
}

.dialog-content {
  padding: 24px;
}

.small-dialog {
  border: 0;
  border-radius: 17px;
  width: min(520px, calc(100vw - 24px));
  padding: 24px;
  color: var(--ink);
  box-shadow: 0 20px 70px #12354b50;
}

.small-dialog::backdrop {
  background: #12354b80;
}

@media (max-width: 575px) {
  .dialog-content {
    padding: 15px;
  }

  .dialog-top {
    padding: 15px;
  }
}

/* A folding row is a <details> that opens and closes only by its arrow button. */
.category-arrow {
  border: 1px solid var(--line);
  background: #edf6f4;
  border-radius: 8px;
  width: 36px;
  height: 32px;
  color: var(--teal);
  font-weight: 800;
  flex: none;
}

.category-window > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 750;
  cursor: default;
}

.category-window > summary::-webkit-details-marker {
  display: none;
}

/* The email reply card and the list of unreplied emails. */
.metric-value {
  font-size: 1.65rem;
  font-weight: 750;
}

.email-box {
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  padding: 0.5rem;
  height: 100%;
}

button.email-box {
  width: 100%;
  text-align: left;
  background: #f8f9fa;
  color: var(--ink);
}

button.email-box:disabled {
  color: var(--ink);
  opacity: 0.75;
}

.email-scroll {
  max-height: 440px;
  overflow-y: auto;
}

.email-table td.subject {
  min-width: 180px;
  overflow-wrap: anywhere;
}

.email-table td.ids {
  min-width: 180px;
  max-width: 260px;
  overflow-wrap: anywhere;
}

/* The review history of an appeal, and the history of a record. */
.history {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
}

.history > li {
  border-left: 3px solid var(--line);
  padding: 4px 0 4px 10px;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.history > li.decision {
  border-left-color: #dea328;
}

.history .when {
  color: var(--muted);
  white-space: nowrap;
}

.history .change-old {
  color: var(--muted);
  text-decoration: line-through;
}

.email-state {
  display: inline-block;
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 0.8rem;
  background: #eef3f5;
}

.email-state.sent {
  background: #d8f1df;
  color: #17663a;
}

.email-state.failed {
  background: #f9dcdc;
  color: #8a1f27;
}

.email-state.notsent {
  background: #e6eaed;
  color: #4b5d69;
}

/* ---------------------------------------------------------------------- 2. Sign-in page */

.page-signin .signin-card {
  max-width: 440px;
  margin: 6vh auto 0;
}

.page-signin .signin-notes {
  font-size: 0.85rem;
  color: var(--muted);
  padding-left: 1.1rem;
}

/* ------------------------------------------------------------------------ 3. Entry page */

.page-entry .side {
  position: sticky;
  top: 18px;
}

@media (max-width: 991px) {
  .page-entry .side {
    position: static;
  }
}

.area {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  width: 100%;
  color: var(--ink);
}

.area.active {
  border-color: var(--teal);
  background: #eaf7f4;
}

.area .num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #e8f1f3;
  margin-right: 8px;
  font-size: 0.8rem;
  font-weight: 750;
}

.page-entry .chip {
  background: #e6f5ee;
  color: #1d6f50;
  padding: 3px 9px;
  font-weight: 400;
}

.score-readout {
  color: var(--teal);
  font-weight: 800;
}

.files {
  font-size: 0.87rem;
  overflow-wrap: anywhere;
}

/* The calculated attendance figures that area 1 shows in place of a score field. */
.attendance-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7fbfc;
  padding: 12px 14px;
}

.attendance-panel .figure {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px 9px;
  height: 100%;
}

.attendance-panel .figure .eyebrow {
  font-size: 0.64rem;
  letter-spacing: 0.06em;
}

/* One line of the recent entries. */
.entry {
  border-left: 4px solid var(--teal);
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 1px 0 var(--line);
}

.entry.withdrawn {
  border-left-color: var(--neutral-bar);
  background: #f6f8f9;
}

.entry .observation-line {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.tag {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 1px 8px;
  font-size: 0.76rem;
  background: #fff;
  white-space: nowrap;
}

.tag.withdrawn {
  background: #e6eaed;
  border-color: #d5dbdf;
  color: #4b5d69;
}

/* The list of files being sent. */
.send-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  background: #fff;
  font-size: 0.9rem;
}

.send-item .send-name {
  overflow-wrap: anywhere;
}

.send-item .progress {
  height: 6px;
  margin-top: 6px;
}

.send-item.saved .progress-bar {
  background: #2f9e5b;
}

.send-item.failed .progress-bar {
  background: #c9404a;
}

/* The record view. */
.record-facts dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 750;
}

.record-facts dd {
  margin-bottom: 0.6rem;
  overflow-wrap: anywhere;
}

.record-block {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

.withdrawn-box {
  border-left: 4px solid #8fa0aa;
  background: #eef2f4;
  padding: 10px 13px;
  border-radius: 6px;
}

.conflict-box {
  border-left: 4px solid #dea328;
  background: #fff8e7;
  padding: 10px 13px;
  border-radius: 6px;
}

.edit-box {
  border: 1px solid var(--teal);
  border-radius: 12px;
  background: #f4fbfa;
  padding: 16px;
}

/* The period summary form. */
.summary-line {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.summary-line textarea {
  flex: 1 1 auto;
  min-width: 0;
}

.summary-line .line-tools {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: none;
}

.summary-line .line-tools .btn {
  padding: 0 7px;
  line-height: 1.35;
  font-size: 0.8rem;
}

/* Teacher appeals. From 1200 px it is a table; below that each appeal is a stacked card, so that
   the four buttons are always in view. */
.appeal-scroll {
  max-height: 70vh;
  overflow-y: auto;
}

.appeal-table thead th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.appeal-table > :not(caption) > * > * {
  padding: 0.5rem 0.4rem;
}

.appeal-table td.reason {
  min-width: 150px;
  max-width: 350px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.appeal-table td.action {
  min-width: 200px;
}

.appeal-table > tbody.appeal > tr > td {
  border-bottom-color: var(--line);
}

.appeal-table > tbody.appeal > tr.main-row > td {
  border-bottom: 0;
}

.appeal-table > tbody.appeal > tr.history-row > td {
  padding-top: 0;
  border-bottom: 2px solid var(--line);
}

.appeal-table > tbody.appeal.target > tr > td {
  background: #f0faf6;
}

@media (max-width: 1199.98px) {
  .appeal-scroll {
    max-height: none;
    overflow: visible;
  }

  .appeal-table,
  .appeal-table > tbody,
  .appeal-table > tbody > tr,
  .appeal-table > tbody > tr > td {
    display: block;
    width: 100%;
  }

  .appeal-table > thead {
    display: none;
  }

  .appeal-table > tbody.appeal {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: #fff;
  }

  .appeal-table > tbody.appeal.target {
    background: #f0faf6;
    outline: 2px solid var(--teal);
    outline-offset: -2px;
  }

  .appeal-table > tbody.appeal > tr > td,
  .appeal-table > tbody.appeal > tr.history-row > td {
    border: 0;
    padding: 6px 0;
    min-width: 0;
    max-width: none;
    background: transparent;
  }

  .appeal-table > tbody.appeal > tr > td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 750;
    margin-bottom: 2px;
  }
}

/* ------------------------------------------------------------- 4. Teacher profile page */

.page-profile .card {
  box-shadow: 0 7px 24px rgba(24, 51, 74, 0.045);
}

.page-profile .staff-avatar {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  font-size: 1.6rem;
  font-weight: 750;
}

.attendance-bar {
  height: 10px;
}

.observation {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 17px;
  background: #fff;
}

.category-window {
  scroll-margin-top: 20px;
}

.category-window.changed-category {
  background: #fff7dc;
  border-color: #e8bd55;
}

.category-window[open] > summary {
  margin-bottom: 8px;
}

.category-scroll {
  max-height: 390px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 8px;
}

.assessment-entry {
  padding: 14px 2px 14px 12px;
  border-left: 4px solid var(--neutral-bar);
}

.assessment-entry + .assessment-entry {
  border-top: 1px solid var(--line);
}

.assessment-entry.changed-entry {
  background: #fff2c5;
  border-radius: 10px;
}

.assessment-entry.target {
  background: #f0faf6;
  outline: 2px solid var(--teal);
  outline-offset: -2px;
}

.assessment-date {
  border-radius: 99px;
  background: #eaf2f5;
  color: #244a5b;
  padding: 5px 10px;
  font-size: 0.83rem;
  font-weight: 700;
  white-space: nowrap;
}

.detail {
  font-size: 0.91rem;
  overflow-wrap: anywhere;
}

.detail strong {
  color: #334f62;
}

.file-status {
  min-height: 1.3em;
}

.message-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(360px, 90vw);
  max-height: 330px;
  overflow: auto;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 15px 35px #102f4660;
  z-index: 20;
}

.message-link {
  display: block;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  border: 0;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.message-link:hover,
.message-link:focus-visible {
  background: #edf7f6;
}

.tab-btn {
  border: 0;
  background: none;
  color: #536c7b;
  padding: 12px 15px;
  border-bottom: 3px solid transparent;
  font-weight: 650;
  text-align: left;
}

.tab-btn:not(:last-child)::after {
  content: "|";
  color: #d22b35;
  font-size: 1.15rem;
  font-weight: 800;
  margin-left: 20px;
}

.tab-btn:not(:last-child) {
  padding-right: 0;
}

.tab-btn.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

.appeal-status {
  font-size: 0.8rem;
  color: #755306;
}

.appeal-reason {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 575px) {
  .page-profile .staff-avatar {
    width: 62px;
    height: 62px;
  }

  .metric-value {
    font-size: 1.4rem;
  }

  .observation {
    padding: 14px;
  }

  .tab-btn {
    padding: 10px;
  }
}

/* ------------------------------------------------------------------------ 5. Admin page */

.page-admin .card {
  border-radius: 16px;
  box-shadow: 0 5px 20px #17364b08;
}

.stat {
  font-size: 1.8rem;
  font-weight: 800;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 4px 9px;
  font-size: 0.77rem;
  white-space: nowrap;
}

.metric {
  background: #f5f8fa;
  border-radius: 9px;
  padding: 9px;
  height: 100%;
}

/* A label on a teacher card must never break into two lines, also not at 1366 px. */
.teacher-card .metric {
  padding: 9px 7px;
}

.teacher-card .metric .eyebrow {
  font-size: 0.6rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.teacher-card .metric strong {
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 700;
}

.legend {
  background: linear-gradient(90deg, #b32424, #cbac28, #249135);
  width: 70px;
  height: 7px;
  border-radius: 10px;
  display: inline-block;
}

.category {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px;
  margin-top: 10px;
}

.category.changed {
  background: #fff6d8;
}

.records {
  max-height: 330px;
  overflow-y: auto;
  padding-right: 8px;
}

.record {
  padding: 15px 3px;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.record + .record {
  border-top: 1px solid var(--line);
}

.record.changed-entry {
  background: #fff2c5;
  border-radius: 10px;
  padding-left: 10px;
  padding-right: 10px;
}

.page-admin .progress {
  height: 7px;
  background: #e5edef;
}

.appeal-box {
  border-left: 4px solid #dea328;
  padding: 10px 13px;
  background: #fff8e7;
  margin-top: 10px;
  overflow-wrap: anywhere;
}

.detail-list {
  word-break: break-word;
}

@media (max-width: 575px) {
  .stat {
    font-size: 1.5rem;
  }
}
