html {
  font-size: 15px;
  min-height: 100%;
  position: relative;
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

:root {
  --besd-ink: #152033;
  --besd-text: #26354d;
  --besd-muted: #647089;
  --besd-line: #d8e0ea;
  --besd-soft-line: #e8edf3;
  --besd-panel: #ffffff;
  --besd-bg: #eef3f8;
  --besd-blue: #1f5d9c;
  --besd-blue-dark: #164a7e;
  --besd-green: #2f735d;
  --besd-gold: #b8842f;
  --besd-shadow: 0 18px 45px rgba(21, 32, 51, 0.11);
  --besd-soft-shadow: 0 12px 30px rgba(21, 32, 51, 0.08);
}

body {
  min-height: 100vh;
  margin-bottom: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(31, 93, 156, 0.12), rgba(238, 243, 248, 0) 320px),
    radial-gradient(circle at top right, rgba(47, 115, 93, 0.1), transparent 360px),
    var(--besd-bg);
  color: var(--besd-text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.app-frame {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  max-width: 100vw;
  height: calc(100vh - 72px);
  min-height: 0;
  overflow-x: hidden;
}

.app-topbar {
  min-height: 72px;
  border-bottom: 1px solid rgba(216, 224, 234, 0.9);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 30px rgba(21, 32, 51, 0.06);
}

.app-topbar-inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-right: 28px;
  padding-left: 28px;
}

.app-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: calc(100vh - 72px);
  padding: 26px 16px 18px;
  border-right: 1px solid rgba(216, 224, 234, 0.95);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 12px 0 30px rgba(21, 32, 51, 0.05);
  z-index: 10;
}

.app-content {
  height: calc(100vh - 72px);
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

.topbar-account {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--besd-text);
  font-weight: 800;
}

.sidebar-brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  padding: 4px 8px 14px;
  border-bottom: 1px solid var(--besd-soft-line);
  color: var(--besd-ink);
  font-size: 1.08rem;
  font-weight: 900;
  text-decoration: none;
}

.sidebar-brand:hover,
.sidebar-brand:focus {
  color: var(--besd-blue);
}

.sidebar-nav {
  display: grid;
  gap: 20px;
}

.sidebar-section {
  display: grid;
  gap: 6px;
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 7px 10px;
  color: var(--besd-ink);
  cursor: pointer;
  font-size: 0.98rem;
  font-weight: 900;
  letter-spacing: 0;
  user-select: none;
}

.sidebar-section-title::-webkit-details-marker {
  display: none;
}

.sidebar-section-title::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.16s ease;
}

.sidebar-section[open] > .sidebar-section-title::after {
  transform: rotate(225deg) translateY(-1px);
}

.sidebar-section-title:hover,
.sidebar-section-title:focus {
  color: var(--besd-blue-dark);
}

.sidebar-link {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 11px 7px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--besd-text);
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
}

.sidebar-link:hover,
.sidebar-link:focus {
  border-color: rgba(31, 93, 156, 0.16);
  background: rgba(31, 93, 156, 0.08);
  color: var(--besd-blue-dark);
}

.sidebar-link.is-active {
  border-color: rgba(31, 93, 156, 0.16);
  background: rgba(31, 93, 156, 0.08);
  color: var(--besd-blue-dark);
  font-weight: 900;
}

.sidebar-account {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 16px 8px 0;
  border-top: 1px solid var(--besd-soft-line);
}

.sidebar-account form {
  margin: 0;
}

.sidebar-account-label {
  color: var(--besd-muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sidebar-account-name {
  color: var(--besd-green);
  font-weight: 900;
  line-height: 1.25;
}

.sidebar-logout {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--besd-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--besd-blue-dark);
  font-weight: 850;
  text-align: center;
}

.sidebar-logout:hover,
.sidebar-logout:focus {
  border-color: rgba(31, 93, 156, 0.36);
  background: rgba(31, 93, 156, 0.08);
}

.app-nav {
  min-height: 72px;
  border-bottom: 1px solid rgba(216, 224, 234, 0.9);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 30px rgba(21, 32, 51, 0.06);
}

.navbar-brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--besd-ink);
  font-weight: 800;
}

.navbar-brand:hover,
.navbar-brand:focus {
  color: var(--besd-blue);
}

.brand-mark {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--besd-blue);
  color: #ffffff;
  font-weight: 900;
}

.brand-mark img {
  width: 26px;
  height: 26px;
  display: block;
}

.app-nav .nav-link {
  color: var(--besd-muted);
  font-weight: 700;
}

.app-nav .nav-link:hover,
.app-nav .nav-link:focus {
  color: var(--besd-blue);
}

.app-nav .dropdown-menu {
  border: 1px solid var(--besd-line);
  border-radius: 8px;
  box-shadow: var(--besd-soft-shadow);
}

.app-nav .dropdown-item {
  color: var(--besd-text);
  font-weight: 700;
}

.app-nav .dropdown-item:hover,
.app-nav .dropdown-item:focus {
  background: rgba(31, 93, 156, 0.08);
  color: var(--besd-blue-dark);
}

@media (min-width: 576px) {
  .app-nav .dropdown:hover .dropdown-menu {
    display: block;
  }

  .app-nav .dropdown:hover .dropdown-toggle {
    color: var(--besd-blue);
  }
}

.staff-name {
  color: var(--besd-green) !important;
}

.view-as-banner {
  background: #0f1c36;
  color: #ffffff;
}

.view-as-banner-inner {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.view-as-banner-inner span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 999px;
  background: linear-gradient(135deg, #a329d9, #5d54e8);
  box-shadow: 0 10px 28px rgba(93, 84, 232, 0.35);
  font-size: 0.9rem;
  font-weight: 850;
}

.view-as-banner-inner form {
  margin: 0;
}

.view-as-banner-inner .btn {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  color: #5d54e8;
  font-weight: 850;
}

.account-nav {
  margin-left: auto;
}

.account-nav .dropdown-menu form {
  margin: 0;
}

.page-shell {
  width: 100%;
  max-width: 100%;
  padding-top: 34px;
  padding-bottom: 56px;
}

.home-panel,
.form-page {
  max-width: 980px;
  margin: 0 auto;
  min-width: 0;
}

.home-panel {
  display: grid;
  gap: 28px;
  padding: 36px 0;
}

.home-copy {
  max-width: 720px;
}

.home-copy-centered {
  display: grid;
  justify-items: center;
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.home-logo {
  display: block;
  width: min(100%, 560px);
  height: auto;
  margin-bottom: 22px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--besd-green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-copy h1,
.form-intro h1 {
  margin: 0;
  color: var(--besd-ink);
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  font-weight: 850;
  line-height: 1.05;
}

.home-copy .lead,
.form-intro p {
  max-width: 680px;
  margin-top: 14px;
  color: var(--besd-muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.home-copy-centered .lead {
  margin-right: auto;
  margin-left: auto;
}

.signup-choice-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
  width: min(75%, 570px);
  max-width: 100%;
  margin-right: auto;
  margin-left: auto;
}

.home-empty-message {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px;
  border: 1px solid var(--besd-line);
  border-radius: 8px;
  background: var(--besd-panel);
  color: var(--besd-muted);
  box-shadow: var(--besd-shadow);
  font-weight: 800;
  text-align: center;
}

.choice-card {
  display: grid;
  min-height: 150px;
  align-content: space-between;
  padding: 28px;
  border: 1px solid var(--besd-line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(31, 93, 156, 0.06), rgba(255, 255, 255, 0) 45%),
    var(--besd-panel);
  color: var(--besd-ink);
  text-decoration: none;
  box-shadow: var(--besd-shadow);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.choice-card:hover,
.choice-card:focus {
  border-color: rgba(31, 93, 156, 0.48);
  color: var(--besd-ink);
  box-shadow: 0 22px 52px rgba(21, 32, 51, 0.16);
  transform: translateY(-3px);
}

.choice-card span:not(.choice-kicker) {
  display: block;
  margin-bottom: 8px;
  font-size: 1.45rem;
  font-weight: 850;
}

.choice-kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(31, 93, 156, 0.1);
  color: var(--besd-blue);
  font-size: 0.78rem;
  font-weight: 850;
}

.choice-card small {
  color: var(--besd-muted);
  font-size: 0.98rem;
}

.choice-card-alt {
  background:
    linear-gradient(180deg, rgba(47, 115, 93, 0.08), rgba(255, 255, 255, 0) 45%),
    var(--besd-panel);
}

.choice-card-alt .choice-kicker {
  background: rgba(47, 115, 93, 0.12);
  color: var(--besd-green);
}

.admin-tile-list {
  display: grid;
  gap: 16px;
}

.admin-tile-preview-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.admin-tile-preview-row .choice-card {
  min-height: 150px;
}

.admin-tile-visible-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--besd-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--besd-ink);
  font-weight: 850;
}

.admin-tile-visible-toggle input {
  width: 18px;
  height: 18px;
}

.admin-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--besd-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--besd-muted);
  font-weight: 750;
  box-shadow: var(--besd-soft-shadow);
}

.admin-links a {
  padding: 7px 11px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--besd-blue);
  text-decoration: none;
}

.admin-links a:hover,
.admin-links a:focus {
  color: var(--besd-blue-dark);
  text-decoration: underline;
}

.home-login-action {
  display: flex;
  justify-content: flex-end;
  justify-self: stretch;
}

.home-login-action .btn {
  width: auto;
  min-height: 34px;
  padding: 5px 12px;
  font-size: 0.9rem;
}

.form-intro {
  margin-bottom: 24px;
}

.mode-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -8px 0 18px;
}

.signup-form {
  overflow: hidden;
  border: 1px solid var(--besd-line);
  border-radius: 8px;
  background: var(--besd-panel);
  box-shadow: var(--besd-shadow);
}

.form-section {
  padding: 28px;
  border-bottom: 1px solid var(--besd-soft-line);
}

.ptc-flow-section {
  padding: 26px 28px 30px;
}

.ptc-flow-section .field-grid {
  gap: 18px 20px;
}

.ptc-flow-section .form-control,
.ptc-flow-section .form-select {
  min-height: 48px;
  background-color: #ffffff;
}

.ptc-flow-section .field-grid label span {
  font-size: 0.76rem;
}

.ptc-school-day-grid {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(260px, 1fr);
  gap: 20px;
  align-items: start;
}

.ptc-school-day-grid > label,
.ptc-school-day-grid #createDateField {
  display: grid;
  gap: 8px;
  align-self: start;
}

.ptc-school-day-grid label span {
  color: var(--besd-muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.ptc-school-day-grid .form-select,
.ptc-school-day-grid .form-control {
  height: 48px;
  min-height: 48px;
}

.form-section h2 {
  margin: 0 0 20px;
  color: var(--besd-ink);
  font-size: 1.08rem;
  font-weight: 850;
}

.form-section-header {
  display: grid;
  gap: 12px;
  grid-template-columns: auto 1fr;
  align-items: start;
  margin-bottom: 20px;
}

.form-section-header h2 {
  margin-bottom: 4px;
}

.form-section-header p {
  max-width: 720px;
  margin: 0;
  color: var(--besd-muted);
  line-height: 1.5;
}

.step-badge {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 7px;
  background: #eaf1f8;
  color: var(--besd-blue);
  font-size: 0.95rem;
  font-weight: 850;
}

.field-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.field-grid label,
.modal-field-grid label,
.calendar-toolbar label {
  display: grid;
  gap: 8px;
  color: var(--besd-ink);
  font-weight: 750;
}

.field-grid label span,
.modal-field-grid label span,
.calendar-toolbar label span {
  color: var(--besd-muted);
  font-size: 0.86rem;
  font-weight: 850;
  text-transform: uppercase;
}

.form-control,
.form-select {
  min-height: 48px;
  border-color: #cbd6e2;
  border-radius: 8px;
  color: var(--besd-ink);
}

.form-control:hover,
.form-select:hover {
  border-color: #afbdcc;
}

.btn {
  min-height: 42px;
  border-radius: 8px;
  font-weight: 750;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--besd-blue);
  box-shadow: 0 0 0 0.2rem rgba(31, 93, 156, 0.18);
}

.btn-primary {
  border-color: var(--besd-blue);
  background: var(--besd-blue);
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: var(--besd-blue-dark);
  background: var(--besd-blue-dark);
}

.btn-outline-primary {
  border-color: rgba(31, 93, 156, 0.35);
  color: var(--besd-blue);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  border-color: var(--besd-blue);
  background: rgba(31, 93, 156, 0.08);
  color: var(--besd-blue-dark);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 28px 8px;
}

.form-actions .btn-link {
  color: var(--besd-muted);
  text-decoration: none;
}

.confirmation-actions {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding-bottom: 22px;
}

.confirmation-status {
  min-height: 0;
  padding: 0;
  text-align: center;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.form-status {
  min-height: 30px;
  margin: 0;
  padding: 0 28px 22px;
  color: var(--besd-muted);
  font-weight: 800;
}

.confirmation-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--besd-soft-line);
  border-radius: 8px;
}

.confirmation-list div {
  display: grid;
  grid-template-columns: minmax(120px, 190px) 1fr;
  gap: 18px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--besd-soft-line);
  background: #ffffff;
}

.confirmation-list div:last-child {
  border-bottom: 0;
}

.confirmation-list dt {
  color: var(--besd-muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.confirmation-list dd {
  margin: 0;
  color: var(--besd-ink);
  font-weight: 800;
}

.modal-content {
  border: 1px solid var(--besd-line);
  border-radius: 8px;
  box-shadow: var(--besd-shadow);
}

.modal-header,
.modal-footer {
  border-color: var(--besd-soft-line);
}

.modal-field-grid {
  display: grid;
  gap: 16px;
}

.modal-field-wide {
  grid-column: 1 / -1;
}

.field-pair {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.selected-date-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
  align-items: center;
  margin-top: 8px;
  color: var(--besd-muted);
}

.selected-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 11px;
  border: 1px solid #b9cbe0;
  border-radius: 999px;
  background: #f4f8fc;
  color: var(--besd-blue-dark);
  font-size: 0.93rem;
  font-weight: 800;
}

.selected-date-pill span {
  color: var(--besd-muted);
}

.slot-preview {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 13px 15px;
  border-left: 4px solid var(--besd-blue);
  border-radius: 0 8px 8px 0;
  background: #f6f9fc;
  color: var(--besd-text);
}

.slot-preview strong {
  color: var(--besd-ink);
  font-size: 1rem;
}

.slot-preview-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
}

.slot-preview-heading span {
  color: var(--besd-blue-dark);
  font-weight: 800;
}

.slot-preview small {
  color: var(--besd-muted);
  line-height: 1.55;
}

.weekday-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--besd-line);
  border-radius: 8px;
}

.weekday-picker legend {
  float: none;
  width: auto;
  margin: 0 0 4px;
  padding: 0 4px;
  color: var(--besd-muted);
  font-size: 0.86rem;
  font-weight: 850;
  text-transform: uppercase;
}

.weekday-picker label {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--besd-ink);
  font-weight: 750;
}

.selection-picker {
  overflow: hidden;
  border: 1px solid var(--besd-line);
  border-radius: 8px;
  background: #ffffff;
}

.teacher-transfer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.selection-picker-header {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--besd-soft-line);
  background: #fbfcfe;
}

.selection-picker-header span {
  color: var(--besd-muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.selection-picker-count {
  color: var(--besd-blue-dark) !important;
  text-transform: none !important;
}

.selection-picker-list {
  display: grid;
  max-height: 300px;
  overflow-y: auto;
}

.selection-picker-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--besd-soft-line);
  color: var(--besd-ink);
  font-weight: 750;
}

.selection-picker-row:last-child {
  border-bottom: 0;
}

.selection-picker-row.is-selected {
  background: rgba(31, 93, 156, 0.09);
  box-shadow: inset 4px 0 0 var(--besd-blue);
}

.schedule-editor-table {
  min-width: 920px;
}

.schedule-editor-table th,
.schedule-editor-table td {
  padding: 14px 10px;
}

.schedule-editor-table .form-control,
.schedule-editor-table .form-select {
  min-height: 42px;
}

.schedule-day-name {
  color: var(--besd-ink);
  font-weight: 850;
}

.modal-hint {
  margin: 16px 0 0;
  color: var(--besd-muted);
  font-weight: 650;
}

.copy-day-preview {
  display: block;
  margin-top: 8px;
}

.modal-footer .btn-link {
  color: var(--besd-muted);
  text-decoration: none;
}

.manage-panel {
  margin-top: 26px;
  overflow: hidden;
  border: 1px solid var(--besd-line);
  border-radius: 8px;
  background: var(--besd-panel);
  box-shadow: var(--besd-soft-shadow);
}

.manage-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--besd-soft-line);
  background: #fbfcfe;
}

.manage-panel-header h2 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 850;
}

.manage-panel-help {
  margin: 0;
  padding: 14px 22px;
  border-bottom: 1px solid var(--besd-soft-line);
  color: var(--besd-muted);
  background: #ffffff;
}

.slot-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px);
  gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--besd-soft-line);
  background: #ffffff;
}

.slot-filter-grid label {
  display: grid;
  gap: 8px;
  color: var(--besd-ink);
  font-weight: 750;
}

.slot-filter-grid label span {
  color: var(--besd-muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.bulk-table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 22px 14px;
  background: #ffffff;
}

.table-sort-button {
  border: 0;
  background: transparent;
  color: var(--besd-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 850;
  padding: 0;
  text-transform: uppercase;
}

.table-sort-button:hover,
.table-sort-button:focus {
  color: var(--besd-blue-dark);
}

.table-header-filter {
  display: grid;
  gap: 6px;
  margin: 0;
}

.table-header-filter span {
  color: var(--besd-muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.manage-panel .table {
  margin-bottom: 0;
}

.table-responsive {
  max-width: 100%;
  overflow-x: auto;
}

.manage-panel th {
  color: var(--besd-muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.manage-panel td {
  color: var(--besd-text);
}

.status-pill {
  display: inline-block;
  min-width: 70px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 850;
  text-align: center;
}

.status-open {
  background: rgba(47, 115, 93, 0.12);
  color: var(--besd-green);
}

.status-closed {
  background: rgba(100, 112, 137, 0.14);
  color: var(--besd-muted);
}

.status-pending {
  background: #fff3cd;
  color: #7a4d00;
}

.room-slot-row {
  align-items: end;
}

.request-slot-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.request-slot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--besd-line);
  border-radius: 8px;
  background: #f8fbfa;
  font-weight: 750;
}

.room-calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.room-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--besd-line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.room-calendar-heading {
  padding: 9px;
  border-bottom: 1px solid var(--besd-line);
  background: #eef5f2;
  color: var(--besd-muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-align: center;
}

.room-calendar-day {
  min-height: 112px;
  padding: 8px;
  border-right: 1px solid var(--besd-line);
  border-bottom: 1px solid var(--besd-line);
}

.room-calendar-day:nth-child(7n) {
  border-right: 0;
}

.room-calendar-day.is-muted {
  background: #f7f9f8;
}

.room-calendar-date {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--besd-ink);
  font-weight: 850;
}

button.room-calendar-date:hover {
  background: #e0f0ea;
}

.room-calendar-event {
  display: grid;
  width: 100%;
  margin-top: 6px;
  padding: 6px 7px;
  border: 1px solid rgba(47, 115, 93, 0.25);
  border-radius: 6px;
  background: #d8efe5;
  color: #143f32;
  font-size: 0.78rem;
  line-height: 1.25;
  text-align: left;
}

.room-calendar-event.is-pending {
  border-color: rgba(169, 121, 38, 0.32);
  background: #fff3cd;
  color: #7a4d00;
}

.empty-row {
  padding: 24px;
  color: var(--besd-muted);
  text-align: center;
}

.email-test-result {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.email-test-details {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 10px 18px;
  margin: 0;
}

.email-test-details dt {
  color: var(--besd-muted);
  font-weight: 850;
}

.email-test-details dd {
  margin: 0;
  color: var(--besd-ink);
  overflow-wrap: anywhere;
}

.slot-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px;
  border-top: 1px solid var(--besd-soft-line);
  color: var(--besd-muted);
  font-size: 0.92rem;
  font-weight: 700;
  background: #ffffff;
}

.slot-pagination-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-filter-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(240px, 1fr) minmax(220px, 320px) auto;
  align-items: end;
  padding: 18px 22px;
  border-bottom: 1px solid var(--besd-soft-line);
  background: #ffffff;
}

.user-filter-grid label {
  display: grid;
  gap: 8px;
  color: var(--besd-ink);
  font-weight: 750;
}

.user-filter-grid label span {
  color: var(--besd-muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.users-table {
  table-layout: fixed;
}

.users-table th,
.users-table td {
  padding: 18px 16px;
  vertical-align: middle;
}

.users-table-id {
  width: 120px;
}

.users-table-name {
  width: 190px;
}

.users-table-role {
  width: 140px;
}

.users-table-school-compact {
  width: 110px;
}

.users-table-members {
  width: auto;
}

.users-table-actions {
  width: 190px;
}

.users-table-actions-compact {
  width: 150px;
}

.users-table-person {
  color: var(--besd-ink);
  font-weight: 750;
}

.assigned-staff-list {
  color: var(--besd-ink);
  line-height: 1.65;
  white-space: normal;
}

.users-table-schools {
  line-height: 1.55;
}

.user-role-pill {
  display: inline-flex;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(31, 93, 156, 0.09);
  color: var(--besd-blue-dark);
  font-size: 0.78rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.user-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.user-row-actions form {
  margin: 0;
}

.teacher-role-form {
  margin: 0;
}

.login-copy {
  margin: 0;
  color: var(--besd-muted);
}

.calendar-page {
  max-width: 1180px;
  margin: 0 auto;
}

.calendar-toolbar {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid var(--besd-line);
  border-radius: 8px;
  background: var(--besd-panel);
  box-shadow: var(--besd-soft-shadow);
}

.calendar-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

.calendar-summary {
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid var(--besd-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--besd-muted);
  font-weight: 800;
}

.calendar-day,
.empty-calendar {
  overflow: hidden;
  border: 1px solid var(--besd-line);
  border-radius: 8px;
  background: var(--besd-panel);
  box-shadow: var(--besd-soft-shadow);
}

.calendar-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--besd-soft-line);
  background: linear-gradient(180deg, rgba(31, 93, 156, 0.09), rgba(31, 93, 156, 0.03));
  cursor: pointer;
  list-style: none;
}

.calendar-day-header::-webkit-details-marker {
  display: none;
}

.calendar-day-header::before {
  content: "Show";
  flex: 0 0 auto;
  min-width: 52px;
  color: var(--besd-blue);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-day[open] .calendar-day-header::before {
  content: "Hide";
}

.calendar-day-title {
  display: grid;
  gap: 3px;
  flex: 1 1 auto;
}

.calendar-day-title > span {
  margin: 0;
  color: var(--besd-ink);
  font-size: 1.12rem;
  font-weight: 850;
}

.calendar-day-title small {
  color: var(--besd-muted);
  font-weight: 750;
}

.calendar-day-count {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(31, 93, 156, 0.1);
  color: var(--besd-blue-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.calendar-slot {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--besd-soft-line);
}

.calendar-slot-open-button {
  display: grid;
  gap: 4px;
  align-self: start;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.calendar-slot-open-button:hover,
.calendar-slot-open-button:focus {
  color: var(--besd-blue-dark);
}

.calendar-people {
  cursor: pointer;
}

.calendar-people:hover .calendar-person,
.calendar-people:focus-within .calendar-person {
  background: rgba(31, 93, 156, 0.05);
}

.calendar-slot:last-child {
  border-bottom: 0;
}

.calendar-time {
  color: var(--besd-blue);
  font-weight: 900;
}

.calendar-people {
  display: grid;
  gap: 10px;
}

.calendar-slot-teacher {
  color: var(--besd-ink);
  font-weight: 850;
}

.calendar-slot-modal-people {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.calendar-slot-modal-person {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--besd-soft-line);
  border-radius: 8px;
  background: #fbfcfe;
}

.calendar-slot-modal-person strong {
  color: var(--besd-ink);
}

.calendar-slot-modal-person a {
  color: var(--besd-muted);
  font-size: 0.92rem;
}

.calendar-clock-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.calendar-clock-stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--besd-muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.calendar-person {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--besd-soft-line);
  border-radius: 8px;
  background: #fbfcfe;
}

.calendar-person strong {
  color: var(--besd-ink);
}

.calendar-person span,
.calendar-person a {
  color: var(--besd-muted);
  font-size: 0.9rem;
}

.empty-calendar {
  padding: 30px;
  color: var(--besd-muted);
  font-weight: 750;
  text-align: center;
}

.quick-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1100;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid rgba(47, 115, 93, 0.26);
  border-radius: 8px;
  background: #d8efe5;
  color: #143f32;
  box-shadow: var(--besd-soft-shadow);
  font-weight: 850;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.quick-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.quick-toast.is-error {
  border-color: rgba(176, 56, 56, 0.28);
  background: #f8dddd;
  color: #792727;
}

.footer {
  width: 100%;
  height: 60px;
  line-height: 60px;
  border-top: 1px solid var(--besd-line);
  background: rgba(255, 255, 255, 0.78);
}

@media (max-width: 767.98px) {
  .app-frame {
    display: block;
    height: auto;
    min-height: auto;
  }

  .app-topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
  }

  .app-sidebar {
    position: static;
    height: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid rgba(216, 224, 234, 0.95);
    box-shadow: 0 12px 30px rgba(21, 32, 51, 0.08);
  }

  .sidebar-brand {
    padding-bottom: 12px;
  }

  .sidebar-nav {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
  }

  .sidebar-account {
    margin-top: 0;
  }

  .app-content {
    height: auto;
    overflow-y: visible;
  }
}

@media (max-width: 575.98px) {
  .page-shell {
    padding-top: 22px;
  }

  .home-panel {
    padding-top: 18px;
  }

  .signup-choice-grid {
    width: 100%;
  }

  .admin-tile-preview-row {
    grid-template-columns: 1fr;
  }

  .form-section,
  .form-actions,
  .form-status {
    padding-left: 18px;
    padding-right: 18px;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .action-group {
    flex-direction: column;
  }

  .form-actions .btn,
  .action-group .btn {
    width: 100%;
  }

  .form-section-header {
    grid-template-columns: 1fr;
  }

  .calendar-toolbar {
    grid-template-columns: 1fr;
  }

  .ptc-school-day-grid {
    grid-template-columns: 1fr;
  }

  .teacher-transfer-grid {
    grid-template-columns: 1fr;
  }

  .calendar-slot {
    grid-template-columns: 1fr;
  }
}
