/* App styles on top of Tabler. */

/* Urdu text: Noto Nastaliq Urdu from /assets/fonts (see public/assets/README.md).
   Until the file is copied in, browsers fall back to a system font. */
@font-face {
  font-family: "Noto Nastaliq Urdu";
  src: url("../fonts/NotoNastaliqUrdu-Regular.ttf") format("truetype");
  font-display: swap;
}

[lang="ur"] {
  font-family: "Noto Nastaliq Urdu", serif;
  line-height: 2.2;
}

/* Sidebar brand: school logo (or icon) and name, cut short with "..." when too long. */
.app-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.app-brand-logo {
  height: 2rem;
  width: auto;
  max-width: 3rem;
  object-fit: contain;
}

.app-brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Support session banner (a platform admin in the school's app, layouts/app.php): above the top bar and, on wide
   screens, beside the sidebar like the top bar. */
@media (min-width: 992px) {
  .navbar-vertical ~ .app-support-banner {
    margin-left: 15rem;
  }
}

.app-support-allow .form-control {
  min-width: 12rem;
}

/* Top bar switchers. */
.app-switchers {
  min-width: 0;
}

.app-switchers .form-select {
  max-width: 11rem;
}

/* Phones and tablets: brand next to the menu button. The session picker keeps its full
   label ("2026-27 (current)"); the branch picker takes the width that is left. */
@media (max-width: 991.98px) {
  .app-brand {
    flex: 1 1 0; /* shrink beside the menu button instead of wrapping to a new line */
    margin-left: 0.75rem;
  }

  .app-switchers {
    flex: 1 1 auto;
  }

  .app-switchers > * {
    flex: 1 1 auto;
    min-width: 0;
  }

  .app-switchers > .app-session-switcher {
    flex: 0 0 auto;
  }

  .app-switchers .form-select {
    max-width: none;
    padding-right: 1.75rem;
    background-position: right 0.5rem center;
  }
}

/* Logo preview on the settings page. */
.app-logo-preview {
  max-height: 4rem;
  max-width: 12rem;
  object-fit: contain;
}

/* Student photo on the profile (passport proportions) and the current photo on the edit form. */
.app-student-photo {
  width: 6rem;
  height: 7.5rem;
  object-fit: cover;
}

.app-photo-preview {
  max-width: 6rem;
  max-height: 6rem;
  object-fit: cover;
}

/* Notes keep the line breaks they were typed with. */
.app-pre-line {
  white-space: pre-line;
}

details > summary {
  cursor: pointer;
}

/* Print pages (app/Views/layouts/print.php): A4, black on white, headings repeated on every page. */
.app-print {
  background: #fff;
}

.app-print-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--tblr-border-color);
}

.app-print-page {
  max-width: 210mm;
  margin: 0 auto;
  padding: 1rem;
}

.app-print-table th,
.app-print-table td {
  padding: 0.25rem 0.4rem;
  font-size: 0.8rem;
}

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  .app-print-page {
    max-width: none;
    padding: 0;
  }

  .app-print-table thead {
    display: table-header-group;
  }

  .app-print-table tr {
    break-inside: avoid;
  }
}

/* Amount boxes in the fee structure grid and on the other voucher form. */
.app-fee-input {
  width: 6.5rem;
  min-width: 5rem;
  text-align: right;
}

.app-fee-grid th {
  vertical-align: top;
  min-width: 7.5rem;
}

/* Fee vouchers (Fees/views/print.php): one student per A4 landscape page (the layout sets 7 mm margins),
   the copies side by side to cut apart along the dashed lines. Sizes are in mm, so the screen shows the
   page as it prints; a copy never grows past the page. */
.app-voucher-sheet {
  display: flex;
  width: 283mm;
  height: 194mm;
  margin: 1rem auto;
  background: #fff;
  color: #000;
  box-shadow: 0 0 0 1px var(--tblr-border-color);
  font-size: 8.5pt;
  line-height: 1.3;
}

.app-voucher-copy {
  position: relative;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-width: 0;
  padding: 4mm 5mm;
  overflow: hidden;
}

.app-voucher-copy + .app-voucher-copy {
  border-left: 1px dashed #000;
}

.app-voucher-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2mm;
  font-size: 7.5pt;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.app-voucher-school {
  display: flex;
  align-items: center;
  gap: 3mm;
  margin-bottom: 2mm;
  padding-bottom: 2mm;
  border-bottom: 1.5px solid #000;
}

.app-voucher-logo {
  height: 12mm;
  width: auto;
  max-width: 20mm;
  object-fit: contain;
}

.app-voucher-school-name {
  font-size: 11pt;
  font-weight: 700;
  line-height: 1.2;
}

.app-voucher-bank {
  margin-bottom: 2mm;
  padding: 1.2mm 2mm;
  border: 1px solid #000;
}

.app-voucher-table {
  width: 100%;
  margin-bottom: 2mm;
  border-collapse: collapse;
}

.app-voucher-table th,
.app-voucher-table td {
  padding: 0.5mm 1mm;
  border: 1px solid #000;
  vertical-align: top;
}

.app-voucher-table th {
  font-weight: 600;
  white-space: nowrap;
}

.app-voucher-amount {
  text-align: right;
  white-space: nowrap;
}

.app-voucher-pay {
  padding: 1.2mm 2mm;
  border: 1.5px solid #000;
}

.app-voucher-pay-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2mm;
}

.app-voucher-payable {
  font-size: 11pt;
  font-weight: 700;
}

.app-voucher-note {
  margin-top: 2mm;
  white-space: pre-line;
}

.app-voucher-sign {
  display: flex;
  justify-content: space-between;
  gap: 4mm;
  margin-top: auto;
  padding-top: 8mm;
}

.app-voucher-sign span {
  min-width: 28mm;
  padding-top: 0.5mm;
  border-top: 1px solid #000;
  text-align: center;
}

.app-voucher-cancelled {
  position: absolute;
  top: 45%;
  left: 50%;
  padding: 1mm 4mm;
  border: 2px solid #c00;
  color: #c00;
  font-size: 20pt;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.6;
  transform: translate(-50%, -50%) rotate(-20deg);
}

@media print {
  .app-voucher-sheet {
    margin: 0;
    box-shadow: none;
    break-after: page;
  }

  .app-voucher-sheet:last-child {
    break-after: auto;
  }
}

/* Attendance marking (Attendance/views/mark.php): each student is one big button showing their mark. The mark's
   colour is on the row and on its count at the top. The Save bar stays at the bottom of the screen. */
.app-mark-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  text-align: start;
}

.app-mark-roll {
  flex: 0 0 2rem;
  color: var(--tblr-secondary);
  font-weight: 600;
  text-align: end;
}

.app-mark-name {
  flex: 1 1 auto;
  min-width: 0;
}

.app-mark-status {
  flex: 0 0 5.5rem;
  padding: 0.6rem 0;
  border-radius: var(--tblr-border-radius);
  color: #fff;
  font-weight: 600;
  text-align: center;
}

.app-mark-present .app-mark-status {
  background: var(--tblr-success);
}

.app-mark-absent .app-mark-status {
  background: var(--tblr-danger);
}

.app-mark-late .app-mark-status {
  background: var(--tblr-orange);
}

.app-mark-leave .app-mark-status {
  background: var(--tblr-azure);
}

.app-mark-row.app-mark-absent {
  background: var(--tblr-danger-lt);
}

.app-mark-row.app-mark-late {
  background: var(--tblr-orange-lt);
}

.app-mark-row.app-mark-leave {
  background: var(--tblr-azure-lt);
}

.app-mark-count {
  padding: 0.35rem 0;
  border-radius: var(--tblr-border-radius);
}

.app-mark-count.app-mark-present {
  background: var(--tblr-success-lt);
  color: var(--tblr-success);
}

.app-mark-count.app-mark-absent {
  background: var(--tblr-danger-lt);
  color: var(--tblr-danger);
}

.app-mark-count.app-mark-late {
  background: var(--tblr-orange-lt);
  color: var(--tblr-orange);
}

.app-mark-count.app-mark-leave {
  background: var(--tblr-azure-lt);
  color: var(--tblr-azure);
}

/* Staff attendance marking (Staff/views/attendance.php): the same row as students, as a button over the whole row,
   with the in and out times or the leave type under it. Half day has its own colour. */
.app-staff-tap {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.app-staff-times,
.app-staff-leave {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.app-staff-time {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.app-staff-time input {
  width: 7.5rem;
}

.app-staff-leave select {
  max-width: 20rem;
}

.app-mark-half_day .app-mark-status {
  background: var(--tblr-purple);
}

.app-mark-machine .app-mark-status {
  background: var(--tblr-secondary);
}

.app-staff-mark.app-mark-absent {
  background: var(--tblr-danger-lt);
}

.app-staff-mark.app-mark-late {
  background: var(--tblr-orange-lt);
}

.app-staff-mark.app-mark-half_day {
  background: var(--tblr-purple-lt);
}

.app-staff-mark.app-mark-leave {
  background: var(--tblr-azure-lt);
}

.app-mark-count.app-mark-half_day {
  background: var(--tblr-purple-lt);
  color: var(--tblr-purple);
}

.app-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom));
  background: var(--tblr-body-bg);
}

/* Marks entry (Exams/views/marks.php): the attendance row with a marks box and A and E buttons. The box's text is
   18px, so phones don't zoom in when it gets the focus. An error goes on its own line under the row. */
.app-marks-row {
  flex-wrap: wrap;
}

.app-marks-row .app-mark-name {
  flex-basis: 0; /* the name shrinks (and is cut short) before the marks box would wrap to a line of its own */
}

.app-marks-entry {
  display: flex;
  flex: 0 0 auto;
  gap: 0.25rem;
}

.app-marks-input {
  width: 4.25rem;
  padding-right: 0.25rem;
  padding-left: 0.25rem;
  font-size: 1.125rem;
  font-weight: 600;
  text-align: center;
}

.app-marks-input.is-invalid {
  padding-right: 0.25rem; /* no warning icon: it would cover the digits in so narrow a box */
  background-image: none;
  color: var(--tblr-danger);
}

.app-marks-key {
  width: 2.5rem;
  padding-right: 0;
  padding-left: 0;
  font-weight: 600;
}

.app-marks-value {
  flex: 0 0 4.25rem;
  font-size: 1.125rem;
  font-weight: 600;
  text-align: center;
}

.app-marks-row .invalid-feedback {
  flex-basis: 100%;
  margin-top: 0;
  text-align: end;
}

/* Small number boxes: order of class subjects, maximum marks of papers. */
.app-order-input {
  width: 5rem;
  min-width: 4rem;
}

/* Award lists (Exams/views/award_list.php): the blank list has tall rows to write marks in. */
.app-award-blank td {
  height: 9mm;
}

.app-award-marks {
  width: 28mm;
}

/* Print views with several pages (date sheets): each page after the first starts on a new sheet. */
@media screen {
  .app-print-next {
    margin-top: 2rem;
    border-top: 1px dashed var(--tblr-border-color);
  }
}

@media print {
  .app-print-next {
    break-before: page;
  }
}

/* Attendance register (Attendance/views/reports/register.php): a narrow column per day of the month. Printed on
   A4 landscape. */
.app-register th,
.app-register td {
  padding: 0.2rem 0.25rem;
  text-align: center;
  white-space: nowrap;
}

.app-register .app-register-name {
  text-align: start;
}

.app-register-absent {
  color: var(--tblr-danger);
  font-weight: 700;
}

/* Staff register (Staff/views/reports/staff_register.php): weekly off days and holidays shaded, on paper too. */
.app-register-off {
  --tblr-table-bg-state: var(--tblr-gray-200);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.app-print-landscape {
  max-width: 297mm;
}

@media print {
  .app-register th,
  .app-register td {
    padding: 0.05rem 0.12rem;
    font-size: 7pt;
  }

  .app-register-absent {
    color: #000;
  }
}

/* Ledger and payment rows of something cancelled: greyed, amounts struck through. */
.app-cancelled td {
  color: var(--tblr-secondary);
}

.app-cancelled .app-strike {
  text-decoration: line-through;
}

/* Fee receipts (Fees/views/receipt.php): the top half of an A4 page (210 x 148.5 mm), to cut along the dashed
   line. The named page prints it without page margins; the receipt's own padding keeps it off the edges.
   Uses the voucher table and amount classes above. */
.app-receipt {
  page: receipt;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 210mm;
  height: 148.5mm;
  margin: 1rem auto;
  padding: 9mm 11mm 7mm;
  overflow: hidden;
  background: #fff;
  color: #000;
  box-shadow: 0 0 0 1px var(--tblr-border-color);
  border-bottom: 1px dashed #000;
  font-size: 9.5pt;
  line-height: 1.35;
}

@page receipt {
  size: A4;
  margin: 0;
}

.app-receipt-head {
  display: flex;
  align-items: center;
  gap: 4mm;
  margin-bottom: 3mm;
  padding-bottom: 2mm;
  border-bottom: 1.5px solid #000;
}

.app-receipt-title {
  text-align: right;
}

.app-receipt-name {
  font-size: 13pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.app-receipt-cancelled td {
  text-decoration: line-through;
}

.app-receipt-printed {
  margin-top: 1mm;
  font-size: 7.5pt;
  text-align: right;
}

@media print {
  .app-receipt {
    margin: 0;
    box-shadow: none;
  }
}

/* Vouchers and receipts (salary slips and subscription receipts too) on a screen narrower than their paper, such as a
   phone: app.js sets --app-fit to the share of the paper's width that fits, and the sheet is zoomed to it, so the whole
   page shows as it prints (pinch to read the small print). Only on screen: printing never zooms. */
@media screen {
  .app-voucher-sheet,
  .app-receipt {
    zoom: var(--app-fit, 1);
  }
}

/* Subscription receipts (Platform/views/receipt.php): the receipt layout above on a whole A5 portrait page
   (148 x 210 mm), with how to renew at the foot. */
.app-receipt-a5 {
  page: receipt-a5;
  width: 148mm;
  height: 210mm;
  padding: 10mm 10mm 8mm;
  border-bottom: 0;
}

@page receipt-a5 {
  size: A5;
  margin: 0;
}

.app-receipt-a5 .app-voucher-sign {
  padding-top: 14mm;
}

.app-receipt-a5-pay {
  margin-top: 5mm;
  padding-top: 2mm;
  border-top: 1px solid #000;
  font-size: 8pt;
}

/* Salary slips (Payroll/views/slips.php): the receipt layout above, two to an A4 page. 148 mm rather than 148.5, so
   two always fit on one page; earnings and deductions side by side. */
.app-slip {
  height: 148mm;
  break-inside: avoid;
}

.app-slip-columns {
  display: flex;
  align-items: flex-start;
  gap: 3mm;
}

.app-slip-columns > .app-voucher-table {
  flex: 1 1 0;
  min-width: 0;
}

/* Messages: a message's text keeps its line breaks; long words wrap. */
.app-message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.app-message-cell {
  min-width: 14rem;
  max-width: 32rem;
}

.app-message-cell summary {
  cursor: pointer;
}

/* A long list of checkboxes (families for an announcement) scrolls inside its box. */
.app-pick-list {
  max-height: 20rem;
  overflow-y: auto;
}

/* Grade bands in Settings > Results (Exams/views/grading.php): narrow boxes for the percentage and the grade. */
.app-band-min {
  width: 4.5rem;
}

.app-band-grade {
  width: 5.5rem;
}

/* Tabulation sheet (Exams/views/tabulation.php): students against subjects. A failed mark is bold, red on screen
   and underlined on paper; a subject the student doesn't take is shaded. Printed on A4 landscape. */
.app-tabulation th,
.app-tabulation td {
  text-align: center;
  white-space: nowrap;
}

.app-tabulation .app-tabulation-name {
  text-align: start;
}

.app-tabulation-fail {
  color: var(--tblr-danger);
  font-weight: 700;
}

.app-tabulation-none {
  background: var(--tblr-bg-surface-secondary);
}

@media print {
  .app-tabulation th,
  .app-tabulation td {
    padding: 0.08rem 0.2rem;
    font-size: 7.5pt;
  }

  .app-tabulation-fail {
    color: #000;
    text-decoration: underline;
  }
}

/* Cash book (CashBook/views): a bill photo on an entry's page, and the group headings of Income vs expense. */
.app-bill-preview {
  max-height: 28rem;
}

.app-report-group th {
  background: var(--tblr-bg-surface-secondary);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Parent portal (Portal/views, layouts/portal.php): narrow cards on phones and computers alike, children's photos, the
   code box. Urdu pages use the RTL build of Tabler. */
.app-portal .page-body {
  margin-top: 1rem;
}

.app-portal-card {
  max-width: 28rem;
  margin: 0 auto;
}

/* Urdu pages: Tabler sets the font on body, so the [lang="ur"] rule on <html> doesn't reach it. Latin letters and
   numbers the Urdu font lacks fall back to Tabler's font. */
.app-portal-ur {
  font-family: "Noto Nastaliq Urdu", var(--tblr-font-sans-serif), sans-serif;
  line-height: 2;
}

/* Badges on Urdu pages: Tabler gives a badge a line height of 1 and hides what spills over, which cut off the Urdu
   font's tall letters. With 2 they fit, and the tallest (the kaf in the Urdu for Incomplete) may stick out a little. */
.app-portal-ur .badge {
  --tblr-badge-line-height: 2;
  overflow: visible;
}

.app-portal-photo {
  object-fit: cover;
}

.app-code-input {
  letter-spacing: 0.4em;
  font-variant-numeric: tabular-nums;
}

.app-portal-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
}

.app-portal-tabs .nav-link {
  white-space: nowrap;
}

/* A child's Fees page: the ledger opens on a tap (its arrow turns); cancelled lines are grey and their amounts struck
   through. */
details.card > summary {
  cursor: pointer;
  list-style: none;
}

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

details[open] > summary .app-portal-toggle {
  transform: rotate(180deg);
}

.app-portal-cancelled {
  color: var(--tblr-secondary);
}

.app-portal-cancelled .app-strike {
  text-decoration: line-through;
}

/* A child's Attendance page: a month as a calendar, Monday first (right to left in Urdu), each day with its mark in the
   colours of attendance marking. */
.app-portal-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
}

.app-portal-weekday {
  text-align: center;
  font-size: 0.75rem;
  color: var(--tblr-secondary);
}

.app-portal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  border-radius: var(--tblr-border-radius);
  background: var(--tblr-bg-surface-secondary);
  line-height: 1.2;
}

.app-portal-day-no {
  font-size: 0.7rem;
  color: var(--tblr-secondary);
}

.app-portal-day-mark {
  font-weight: 700;
}

.app-portal-day.app-mark-present {
  background: var(--tblr-success-lt);
  color: var(--tblr-success);
}

.app-portal-day.app-mark-absent {
  background: var(--tblr-danger-lt);
  color: var(--tblr-danger);
}

.app-portal-day.app-mark-late {
  background: var(--tblr-orange-lt);
  color: var(--tblr-orange);
}

.app-portal-day.app-mark-leave {
  background: var(--tblr-azure-lt);
  color: var(--tblr-azure);
}

.app-portal-day-today {
  box-shadow: inset 0 0 0 2px var(--tblr-primary);
}

.app-portal-day-future {
  opacity: 0.5;
}

.app-portal-day-blank {
  background: transparent;
}

/* Notices: a long link wraps instead of widening the page. */
.app-portal-notice {
  overflow-wrap: anywhere;
}

/* A child's Diary page: the calendar's days with a diary are links in the primary colour; photos as small thumbnails
   that open full size. */
a.app-portal-day {
  text-decoration: none;
}

.app-portal-day.app-portal-day-diary {
  background: var(--tblr-primary-lt);
  color: var(--tblr-primary);
}

.app-diary-photo {
  height: 6rem;
  max-width: 100%;
  object-fit: cover;
  border-radius: var(--tblr-border-radius);
  border: 1px solid var(--tblr-border-color);
}

/* Writing the diary: the students to tick for a note, in columns on a wide screen, scrolling when the class is long. */
.app-diary-students {
  max-height: 18rem;
  overflow-y: auto;
  columns: 2 13rem;
}

.app-diary-students .form-check {
  break-inside: avoid;
}

/* Timetable grids (Timetable/views/_grid.php): school days against periods. Break columns are narrow and shaded, a period a
   day doesn't have is striped, today's row is tinted. In the editor every period is a link to its cell panel. The cell
   panel shows the teacher's week (.app-tt-busy-grid). Printed one timetable to an A4 landscape page (.app-tt-print); the
   master timetable (.app-tt-master) prints a weekday's sections on one page. */
.app-tt {
  table-layout: fixed;
  margin-bottom: 0;
}

.app-tt th,
.app-tt td {
  padding: 0.3rem;
  text-align: center;
  vertical-align: middle;
}

.app-tt .app-tt-day {
  width: 6.5rem;
  text-align: start;
}

.app-tt .app-tt-break {
  width: 3.6rem;
  padding: 0.2rem 0.1rem;
  font-size: 0.7rem;
  --tblr-table-bg-state: var(--tblr-bg-surface-secondary);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.app-tt-break-label {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.app-tt-time {
  color: var(--tblr-secondary);
  font-size: 0.7rem;
  font-weight: 400;
}

.app-tt .app-tt-none {
  background: repeating-linear-gradient(45deg, transparent 0 6px, var(--tblr-bg-surface-secondary) 6px 12px);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.app-tt .app-tt-gap {
  --tblr-table-bg-state: transparent;
}

.app-tt-today > th,
.app-tt-today > td:not(.app-tt-break):not(.app-tt-none) {
  --tblr-table-bg-state: rgba(var(--tblr-primary-rgb), 0.1);
}

.app-tt-today > th {
  color: var(--tblr-primary);
}

.app-tt-subject {
  display: block;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.app-tt-teacher,
.app-tt-room,
.app-tt-section {
  display: block;
  font-size: 0.75rem;
  color: var(--tblr-secondary);
  overflow-wrap: anywhere;
}

.app-tt-combined {
  margin-top: 0.15rem;
}

.app-tt-cell {
  display: block;
  min-height: 3.6rem;
  padding: 0.2rem;
  border-radius: var(--tblr-border-radius);
  color: inherit;
  text-decoration: none;
}

.app-tt-cell:hover,
.app-tt-cell:focus {
  background: rgba(var(--tblr-primary-rgb), 0.08);
  color: inherit;
  text-decoration: none;
}

.app-tt-cell.app-tt-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tblr-gray-400);
}

.app-tt-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* The cell panel's form sits between .modal-content and its header, body and footer: let them lay out as the modal's own,
   so a long panel scrolls inside the modal body. */
[data-tt-panel] > form {
  display: contents;
}

.app-tt-busy-grid th,
.app-tt-busy-grid td {
  min-width: 3.2rem;
  padding: 0.15rem;
  font-size: 0.7rem;
  text-align: center;
}

.app-tt-busy-grid .app-tt-busy {
  --tblr-table-bg-state: var(--tblr-azure-lt);
}

.app-tt-busy-grid .app-tt-none {
  --tblr-table-bg-state: var(--tblr-bg-surface-secondary);
}

.app-tt-busy-grid .app-tt-here {
  outline: 2px solid var(--tblr-primary);
  outline-offset: -2px;
}

.app-tt-busy-grid .app-tt-clash {
  --tblr-table-bg-state: var(--tblr-danger-lt);
  outline: 2px solid var(--tblr-danger);
  outline-offset: -2px;
}

/* The master timetable: a weekday's sections against its periods, a subject code and a teacher code in each cell. */
.app-tt-master .app-tt-day {
  width: 7rem;
}

.app-tt-code {
  display: block;
  font-weight: 600;
  white-space: nowrap;
}

.app-tt-legend {
  columns: 4 12rem;
  font-size: 0.8rem;
}

@media print {
  .app-tt-print th,
  .app-tt-print td {
    padding: 0.2rem;
    font-size: 9.5pt;
  }

  .app-tt-print .app-tt-subject {
    font-size: 10.5pt;
  }

  .app-tt-print .app-tt-teacher,
  .app-tt-print .app-tt-room,
  .app-tt-print .app-tt-section,
  .app-tt-print .app-tt-time {
    font-size: 8pt;
    color: #000;
  }

  .app-tt-print td.app-tt-slot {
    height: 21mm;
  }

  .app-tt-master th,
  .app-tt-master td {
    padding: 0.05rem 0.1rem;
    font-size: 7.5pt;
    line-height: 1.15;
  }

  .app-tt-master .app-tt-time {
    font-size: 6.5pt;
    color: #000;
  }

  .app-tt-legend {
    font-size: 7pt;
    columns: 6;
  }
}
