:root {
  --brand: #1f5f8b;
  --st-planned: #2f6fde;
  --st-in-progress: #e0a106;
  --st-awaiting: #0aa2c0;
  --st-completed: #2e8b57;
  --st-canceled: #8a8f98;
}

body { background: var(--bs-tertiary-bg); }
.bg-brand { background-color: var(--brand) !important; }
.min-w-0 { min-width: 0; }

/* Discipline badges */
.badge-ot  { background: #7a4fbf; color: #fff; }
.badge-pt  { background: #0f8a8a; color: #fff; }
.badge-slp { background: #c2571a; color: #fff; }

/* Session list items: a colored edge shows status at a glance. */
.session-item { border-left: 4px solid transparent; }
.session-item.status-planned     { border-left-color: var(--st-planned); }
.session-item.status-in_progress { border-left-color: var(--st-in-progress); }
.session-item.status-awaiting_approval { border-left-color: var(--st-awaiting); }
.session-item.status-completed   { border-left-color: var(--st-completed); }
.session-item.status-canceled    { border-left-color: var(--st-canceled); opacity: .75; }

/* Calendar events and legend */
.fc .ev-planned,     .legend-dot.ev-planned     { background: var(--st-planned);     border-color: var(--st-planned); }
.fc .ev-in_progress, .legend-dot.ev-in_progress { background: var(--st-in-progress); border-color: var(--st-in-progress); }
.fc .ev-awaiting_approval, .legend-dot.ev-awaiting_approval { background: var(--st-awaiting); border-color: var(--st-awaiting); }
.fc .ev-completed,   .legend-dot.ev-completed   { background: var(--st-completed);   border-color: var(--st-completed); }
.fc .ev-canceled,    .legend-dot.ev-canceled    { background: var(--st-canceled);    border-color: var(--st-canceled); }
.fc .ev-in_progress .fc-event-main { color: #222; }
.fc .ev-canceled .fc-event-title { text-decoration: line-through; }
.fc-list-event.ev-planned, .fc-list-event.ev-in_progress, .fc-list-event.ev-awaiting_approval, .fc-list-event.ev-completed, .fc-list-event.ev-canceled { background: transparent; }
.legend-dot { display: inline-block; width: .75rem; height: .75rem; border-radius: 50%; margin-right: .35rem; vertical-align: -1px; }
.fc .fc-toolbar-title { font-size: 1.15rem; }
.fc .fc-timegrid-event { cursor: pointer; }
/* Month view: compact bars, and status colours on the "+N more" popover's events too. */
.fc .fc-daygrid-block-event { cursor: pointer; font-size: .8rem; }
.fc .fc-daygrid-block-event .fc-event-time { font-weight: 600; flex-shrink: 0; }
.fc .fc-daygrid-more-link { font-size: .8rem; }
.fc .fc-daygrid-day-number { text-decoration: none; }
@media (max-width: 767.98px) {
  .fc .fc-toolbar.fc-header-toolbar { margin-bottom: .5rem; }
  .fc .fc-button { padding: .3rem .55rem; }
}

/* Student picker */
.student-picker-list { max-height: 18rem; overflow-y: auto; }
/* Session student chooser: the chosen students as chips with ×, and the "Add student" window. */
.student-chip { display: inline-flex; align-items: center; gap: .375rem; max-width: 100%; padding: .125rem .125rem .125rem .125rem;
  border: 1px solid var(--bs-border-color); border-radius: 2rem; background: var(--bs-body-bg); }
.student-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-chip-remove { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 1.75rem; height: 1.75rem;
  padding: 0 0 .125rem; border: 0; border-radius: 50%; background: none; color: var(--bs-secondary-color); font-size: 1.25rem; line-height: 1; }
.student-chip-remove:hover, .student-chip-remove:focus-visible { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }
.min-w-0 { min-width: 0; }

/* Session form */
details > summary { cursor: pointer; }
.action-bar { z-index: 5; }

/* Start time box: the list of 5-minute times that opens under it (app.js, data-time-input). */
.time-menu { width: 100%; max-height: 15rem; overflow-y: auto; margin-top: .125rem; }
.time-menu .dropdown-item { cursor: pointer; }

/* Numbered goals (1.0, 2.0) and their objectives (1.1, 1.2) */
.goal-num { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.objectives { list-style: none; padding-left: 1rem; }
.objectives li { display: flex; gap: .5rem; margin-bottom: .2rem; }
.objectives .goal-num { flex: 0 0 2.25rem; font-weight: 500; }
.goal-row { display: flex; gap: .5rem; }
.goal-row > .goal-num { flex: 0 0 2.25rem; }
.goal-row > .goal-body { flex: 1 1 auto; min-width: 0; }
.objective-position { width: 5.75rem; }
/* An objective marked Delete on the goal form (deleted when the goal is saved). */
.objective-row .delete-note { display: none; }
.objective-row.is-deleted .delete-note, .objective-row:has([data-delete-objective]:checked) .delete-note { display: inline; }
.objective-row.is-deleted textarea, .objective-row:has([data-delete-objective]:checked) textarea { text-decoration: line-through; opacity: .55; }
.objective-row.is-deleted [data-move], .objective-row.is-deleted select[data-position] { visibility: hidden; }

/* Student page: the plan being viewed rolls open to show its goals */
.plan-accordion .accordion-button { gap: .5rem; flex-wrap: wrap; }
.plan-accordion .accordion-button::after { margin-left: auto; }

/* Calendar: your own movable sessions get a move cursor; other therapists' are dimmed slightly in group views. */
.fc .ev-mine.fc-event-draggable { cursor: move; }
.fc .fc-timegrid-event.ev-other { opacity: .85; }

/* Progress notes timeline */
.progress-timeline .progress-note { border-left: 3px solid var(--bs-border-color); padding: .25rem 0 .75rem .75rem; margin-left: .25rem; }
.progress-timeline .progress-note + .progress-note { padding-top: .5rem; }

@media print {
  body { background: #fff; }
  main.container-lg { max-width: none; padding: 0; }
  .card { box-shadow: none !important; border-color: #999; }
  .progress-block, .progress-note { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  .badge { border: 1px solid #666; color: #000 !important; background: transparent !important; }
}

/* Uploaded files: photo thumbnails and file chips */
.attachment { width: 9.5rem; }
.attachment-thumb { display: block; width: 100%; height: 6.5rem; object-fit: cover; }
.attachment-file { min-height: 3rem; }

/* IEP progress report */
.report h2 { break-after: avoid; }
.report-notes { border-left: 3px solid var(--bs-border-color); padding-left: .5rem; margin-top: .25rem; }
@media print {
  .report.card { border: 0; }
  .report .card-body { padding: 0 !important; }
  .report-section, .report-update, .report-goals > li { break-inside: avoid; }
}

/* District holidays and days outside the school year */
.fc .ev-holiday, .legend-dot.ev-holiday { background: #b23a48; border-color: #b23a48; color: #fff; }
.fc .bg-closed { background: repeating-linear-gradient(135deg, rgba(178, 58, 72, .07) 0 8px, transparent 8px 16px); opacity: 1; }
.fc .bg-outside-year { background: repeating-linear-gradient(135deg, rgba(120, 120, 120, .10) 0 8px, transparent 8px 16px); }

/* Plan types */
.badge.plan-iep { background: #1f5f8b; color: #fff; }
.badge.plan-504 { background: #6a4c93; color: #fff; }
.badge.plan-esy { background: #e09f3e; color: #222; }
.badge.plan-evaluation { background: #3a7d44; color: #fff; }

/* Logo: the hands logo (white and teal, transparent background) */
.brand-logo { width: 32px; height: 32px; object-fit: contain; }
/* The version number, in very small print under the site name and at the bottom of the sign-in pages. */
.app-version { font-size: .625rem; font-weight: 400; line-height: 1; letter-spacing: .02em; opacity: .7; }
.app-version-signin { font-size: .6875rem; color: var(--bs-secondary-color); letter-spacing: .02em; }
/* On Today and the MSTAdmin's Customers page the version is a button that opens "What's new". */
.brand-link { color: inherit; text-decoration: none; }
.brand-link:hover, .brand-link:focus { color: inherit; }
.app-version-button { background: none; border: 0; padding: .125rem 0 0; color: inherit; cursor: pointer;
  text-decoration: underline dotted; text-underline-offset: .15em; }
.app-version-button:hover, .app-version-button:focus-visible { opacity: 1; text-decoration-style: solid; }
/* The "What's new" window (CHANGELOG.md). */
.changelog-version + .changelog-version { border-top: 1px solid var(--bs-border-color); padding-top: .75rem; margin-top: .75rem; }
.changelog-kind { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--bs-secondary-color); margin: .5rem 0 .25rem; }
.changelog ul { padding-left: 1.25rem; }
.changelog li + li { margin-top: .25rem; }

/* Top menu: the links fold into the menu button below 992px, where they don't fit on one line. When space runs out,
   the user's district and then their name are shortened with "…" rather than pushing the page sideways; the full
   name and district are in the dropdown and on hover. */
.navbar-collapse, .nav-user-menu, .nav-user-menu > .nav-item, .nav-user { min-width: 0; }
.nav-user { display: flex; align-items: center; gap: .25rem; max-width: 100%; }
.nav-user::after { flex-shrink: 0; }
.nav-user-name { min-width: 3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user-district { flex-shrink: 100; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 1200px) { .nav-user-district { max-width: 15rem; } }
/* Narrow phones: a smaller site name keeps the menu button on the same line (the UAT name is longer). */
@media (max-width: 399.98px) { .navbar-brand { font-size: .95rem; margin-right: .5rem; } }

/* Sign-in page: banner + splash photo */
.login-main { min-height: 100vh; }
.login-page { min-height: 100vh; padding: 1rem; background: #0b0b0b linear-gradient(160deg, #0b0b0b 0%, #123c4a 100%); }
.login-card { width: 100%; max-width: 980px; border-radius: 1rem; }
.login-splash { position: relative; min-height: 180px; }
.login-splash img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.login-banner { background: #000; padding: .75rem 1rem; }
.login-banner img { display: block; width: 100%; height: auto; }
@media (min-width: 768px) { .login-splash { min-height: 460px; } }

/* Admin time on the calendar: a muted slate color with a diagonal stripe, so it reads as "not a session". */
:root { --st-admin: #5b6b7f; }
.fc .ev-admin, .legend-dot.ev-admin {
  background: var(--st-admin) repeating-linear-gradient(135deg, rgba(255, 255, 255, .12) 0 6px, transparent 6px 12px);
  border-color: var(--st-admin);
}
.fc .ev-admin .fc-event-main { color: #fff; }
.fc .ev-admin-lunch { --st-admin: #6f7d5a; }
.fc .ev-admin-travel { --st-admin: #4f6d8a; }
.fc-list-event.ev-admin { background: transparent; }

/* Schedule form: weekday toggles */
.day-toggle { min-width: 4rem; }

/* Change log */
.log-changes { font-size: .875rem; }
.log-changes th[scope="row"] { width: 22%; }
.log-changes td { width: 39%; overflow-wrap: anywhere; }
.log-before { color: var(--bs-secondary-color); background: rgba(var(--bs-danger-rgb), .05); }
.log-after { background: rgba(var(--bs-success-rgb), .06); }
@media print { .log-list .list-group-item { break-inside: avoid; } }

/* Password reset pages share the sign-in look */
.auth-card { width: 100%; max-width: 460px; border-radius: 1rem; }

/* Users table */
.users-table td, .users-table th { white-space: nowrap; }
.users-table td:first-child { white-space: normal; min-width: 12rem; }

/* MSTAdmin viewing the system as another user */
.impersonation-banner { background: #b00020; color: #fff; position: sticky; top: 0; z-index: 1031; }
.impersonation-banner + .navbar.sticky-top { top: 2.75rem; }

/* Goal report: one page per goal with stats, a graph and the data points */
.report-stats .stat { border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .4rem .6rem; height: 100%; }
.report-stats .stat-label { font-size: .75rem; color: var(--bs-secondary-color); }
.report-stats .stat-value { font-weight: 600; }
.goal-chart { display: block; width: 100%; height: auto; font-size: 11px; }
.goal-chart text { fill: var(--bs-secondary-color); font-family: inherit; }
.goal-chart .grid { stroke: var(--bs-border-color); stroke-width: 1; }
.goal-chart .axis, .goal-chart .tick-mark { stroke: var(--bs-secondary-color); stroke-width: 1; }
.goal-chart .target { stroke: #b23a48; stroke-width: 1.5; stroke-dasharray: 7 4; }
.goal-chart .target-label { fill: #b23a48; font-weight: 600; }
.goal-chart .average { stroke: var(--bs-body-color); stroke-width: 1.25; stroke-dasharray: 2 3; }
.goal-chart .average-label { fill: var(--bs-body-color); }
.goal-chart polyline { fill: none; stroke-width: 2; stroke-linejoin: round; }
.goal-chart circle { stroke-width: 2; }
.chart-legend li { margin-bottom: .15rem; }
.legend-line { display: inline-block; width: 1.25rem; height: .25rem; border-radius: 1px; vertical-align: middle; margin-right: .25rem; }
.data-points { columns: 3 13rem; column-gap: 1.5rem; }
.data-points li { break-inside: avoid; }
.data-badge { font-weight: 500; }
@media print {
  .goal-report { break-after: page; }
  .goal-report:last-of-type { break-after: auto; }
  .goal-report.card { border: 0; }
  .goal-report .card-body { padding: 0 !important; }
  .goal-chart, .legend-line { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .data-points { columns: 3; }
}

/* Help guides. The orange letters match the markers on the screenshots (tools/help-screenshots.mjs). */
.help-step-num { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 1.75rem; height: 1.75rem;
  border-radius: 50%; background: var(--brand); color: #fff; font-size: .95rem; font-weight: 600; vertical-align: .1em; margin-right: .35rem; }
.help-step-num-sm { width: 1.4rem; height: 1.4rem; font-size: .8rem; margin-right: 0; }
.list-group-item.active .help-step-num { background: #fff; color: var(--brand); }
.help-mark { display: inline-flex; align-items: center; justify-content: center; width: 1.3rem; height: 1.3rem; border-radius: 50%;
  background: #e8590c; color: #fff; font-size: .75rem; font-weight: 700; vertical-align: .1em; }
.help-topic-card { color: inherit; text-decoration: none; transition: border-color .15s; }
.help-topic-card:hover, .help-topic-card:focus { border-color: var(--brand); }
.help-body { max-width: 52rem; }
.help-step { margin-bottom: 2rem; }
.help-step h2 { display: flex; align-items: center; }
.help-step li { margin-bottom: .35rem; }
.help-shot { margin: 0 0 1rem; }
.help-shot img { display: block; max-width: 100%; height: auto; border: 1px solid var(--bs-border-color); border-radius: .5rem;
  box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .08); background: #fff; }
.help-shot figcaption { font-size: .875rem; color: var(--bs-secondary-color); margin-top: .35rem; }
.help-go { white-space: normal; text-align: left; }
.help-tip { background: var(--bs-body-bg); border-left: 4px solid var(--brand); border-radius: .375rem; padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
@media (min-width: 992px) { .help-nav { position: sticky; top: 5rem; max-height: calc(100vh - 6rem); overflow-y: auto; } }
/* Boxes the help buttons jump to (#therapists, #ieps, #goals…) stop below the sticky top menu. */
.card[id] { scroll-margin-top: 5rem; }
@media print { .help-shot { break-inside: avoid; } }

/* MSTAdmin menu: a long customer list scrolls inside the menu. */
@media (min-width: 992px) { .mstadmin-menu { max-height: 70vh; overflow-y: auto; } }

/* A supervisor's internal note to an assistant (session reviews). */
.review-note { white-space: pre-line; border-left: 3px solid var(--bs-warning); padding-left: .5rem; }

/* Student demographics: label and value rows. */
.demographics dt { font-weight: 500; color: var(--bs-secondary-color); }
.demographics dd { margin-bottom: .5rem; }

/* Student headshots: a circle with the photo, or initials when there's none. */
.student-photo { border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--bs-border-color); background: var(--bs-secondary-bg); }
.student-photo-empty { color: var(--bs-secondary-color); font-weight: 600; letter-spacing: .02em; user-select: none; }
/* Several students' photos in a session list overlap a little. */
.photo-stack { display: inline-flex; }
.photo-stack > .student-photo + .student-photo { margin-left: -10px; }
.photo-stack > .student-photo { box-shadow: 0 0 0 2px var(--bs-body-bg); }
.photo-more { font-size: 11px !important; }

/* To-dos: a round ✓ button, and finished ones crossed out. */
.todo-check { width: 2rem; height: 2rem; padding: 0; border-radius: 50%; line-height: 1; font-weight: 700; flex-shrink: 0; }
.todo-check.btn-outline-secondary > span { opacity: .35; }
.todo-check.btn-outline-secondary:hover > span { opacity: 1; }
.todo-title { overflow-wrap: anywhere; }
.todo-done .todo-title { text-decoration: line-through; color: var(--bs-secondary-color); font-weight: 500 !important; }
.todo-done .todo-notes { color: var(--bs-secondary-color); }
.todo-notes { overflow-wrap: anywhere; }
