:root {
  --app-nav-height: 64px;
}

body {
  padding-top: var(--app-nav-height);
}

#wrapper,
#content {
  max-width: 100%;
}

#content {
  padding-top: 0.35rem;
}

img,
canvas,
video {
  max-width: 100%;
  height: auto;
}

.navbar .container-fluid {
  align-items: center;
}

.navbar-toggler {
  border: 1px solid rgba(255, 255, 255, 0.55);
  padding: 0.2rem 0.4rem;
}

.navbar-toggler .hamburger span {
  background: #ffffff !important;
}

.attendance-heading-filter {
  width: auto;
  max-width: 132px;
  min-width: 84px;
  margin-top: 0.2rem;
  height: 24px;
  padding: 0 0.45rem;
  font-size: 11px;
  line-height: 1.2;
  border: 1px solid #c7ccd4;
  border-radius: 999px;
  background: #f4f7fb;
  color: #2b313a;
  display: inline-block;
  vertical-align: middle;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #5e6a79 50%), linear-gradient(135deg, #5e6a79 50%, transparent 50%);
  background-position: calc(100% - 11px) calc(50% - 2px), calc(100% - 7px) calc(50% - 2px);
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  padding-right: 1.2rem;
}

.attendance-heading-filter:focus {
  outline: none;
  border-color: #7aa7e8;
  box-shadow: 0 0 0 2px rgba(122, 167, 232, 0.25);
}

.attendance-clear-filter {
  margin-left: 0.25rem;
  margin-top: 0.2rem;
  height: 24px;
  padding: 0 0.45rem;
  font-size: 11px;
  line-height: 1.1;
  border: 1px solid #d8bfc0;
  border-radius: 999px;
  background: #fff4f4;
  color: #7f2f2f;
  cursor: pointer;
}

.attendance-photo-trigger {
  border: 0;
  background: transparent;
  padding: 0;
  line-height: 0;
  cursor: pointer;
}

.attendance-photo-thumb {
  border-radius: 4px;
  object-fit: cover;
}

.attendance-photo-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.attendance-photo-dialog {
  position: relative;
  max-width: min(92vw, 720px);
  max-height: 90vh;
}

#attendancePhotoLarge {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

.attendance-photo-close {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: #111111;
  font-size: 16px;
  line-height: 30px;
  cursor: pointer;
}

.student-detail-modal .modal-dialog {
  width: min(96vw, 1200px);
  max-width: min(96vw, 1200px);
}

.student-detail-modal .modal-content {
  min-height: 70vh;
}

.student-detail-modal .modal-header {
  border-bottom: 1px solid #dee3ea;
  padding: 0.6rem 0.9rem;
}

.student-detail-modal .modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}

#studentInfoModal .student-top-info {
  padding-right: 0.25rem;
}

#studentInfoModal .student-name-lg {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.15;
  color: #1f2a36;
  margin-bottom: 0.5rem;
}

#studentInfoModal .student-contact-lg,
#studentInfoModal .student-guardian-lg,
#studentInfoModal .student-portal-line {
  font-size: 1.3rem;
  line-height: 1.35;
  margin-bottom: 0.45rem;
}

#studentInfoModal .student-contact-lg,
#studentInfoModal .student-guardian-lg {
  font-size: 1.42rem;
}

#studentInfoModal .student-contact-lg {
  font-size: 1.42rem;
}

#studentInfoModal .student-contact-lg a {
  color: inherit;
  text-decoration: none;
}

#studentInfoModal .student-inline-link {
  color: inherit;
  text-decoration: none;
}

#studentInfoModal .student-inline-link:hover,
#studentInfoModal .student-inline-link:focus,
#studentInfoModal .student-inline-link:visited {
  color: inherit;
  text-decoration: none;
}

#studentInfoModal .student-contact-lg .student-inline-link,
#studentInfoModal .card-box .student-inline-link {
  font-size: inherit !important;
  line-height: inherit !important;
}

#studentInfoModal .student-link-icon {
  font-size: 0.78em;
  opacity: 0.72;
}

#studentInfoModal .student-portal-line a {
  font-weight: 600;
  text-decoration: none;
}

#studentInfoModal .student-portal-line {
  margin-bottom: 0.35rem;
}

#studentInfoModal .student-qr-line {
  margin-bottom: 0.45rem;
}

#studentInfoModal .student-qr-line .myButton_small {
  display: inline-block;
}

#studentInfoModal .student-top-info .myButton_med {
  margin-top: 0.4rem;
}

#studentInfoModal .student-photo-wrap {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  margin-bottom: 0.65rem;
}

#studentInfoModal .student-photo-img {
  width: 190px;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d7dde6;
  background: #f5f7fa;
}

#studentInfoModal .student-top-buttons {
  margin: 0.35rem 0 0.8rem;
}

#studentInfoModal .student-top-buttons .myButton_med {
  display: block;
  margin-bottom: 0.45rem;
}

#studentInfoModal .card-box .card-subtitle {
  font-size: 1.08rem !important;
  margin-bottom: 0.55rem !important;
  line-height: 1.4 !important;
}

#studentInfoModal .card-box strong {
  font-weight: 700 !important;
}

#studentInfoModal .student-medical-notes {
  border: 2px solid #d22525;
  background: #fff4f4;
  color: #af1111;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
}

.student-qr-modal .modal-dialog {
  width: min(92vw, 520px);
  max-width: min(92vw, 520px);
}

.student-qr-modal .modal-title {
  font-size: 1.3rem;
  font-weight: 800;
}

#studentQrFrame {
  background: #ffffff;
}

#student_info_modal_body {
  max-height: calc(90vh - 70px);
  overflow: auto;
  padding: 0.75rem;
}

.navbar .navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#Search_Box {
  width: min(48vw, 260px);
  max-width: 100%;
}

.student-photo-preview {
  width: 150px;
  height: 125px;
  object-fit: cover;
}

.student-snap-btn {
  margin-right: 0.35rem;
  margin-bottom: 0.35rem;
}

.student-form-actions {
  float: right;
}

.student-form-actions a {
  display: inline-block;
  margin-top: 0.3rem;
}

.student-media-block {
  display: flow-root;
}

.student-form-actions-list {
  display: grid;
  gap: 0.4rem;
}

.student-form-grid {
  display: grid;
  gap: 0.35rem;
}

.student-form-row {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  align-items: start;
  gap: 0.5rem;
  border-bottom: 1px solid #e7ebf2;
  padding-bottom: 0.3rem;
}

.student-form-row:last-child {
  border-bottom: 0;
}

.student-form-label {
  margin: 0;
  font-weight: 700;
  line-height: 1.3;
}

.student-form-control {
  min-width: 0;
}

.student-form-layout .card-subtitle.mbr-fonts-style.mb-3.display-4,
.student-form-layout .display-4,
.student-form-layout .display-5,
.student-form-layout label,
.student-form-layout strong {
  font-size: 0.9rem !important;
  line-height: 1.25 !important;
}

.student-form-layout h3 {
  font-size: 1.15rem;
  line-height: 1.2;
  margin: 0;
}

.student-form-layout .student-form-row {
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 0.4rem;
}

.student-form-layout input[type="text"],
.student-form-layout input[type="email"],
.student-form-layout input[type="tel"],
.student-form-layout input[type="date"],
.student-form-layout input[type="password"],
.student-form-layout select,
.student-form-layout textarea {
  width: 100%;
  max-width: 100%;
  font-size: 0.9rem !important;
  line-height: 1.25;
  padding: 0.24rem 0.35rem;
}

.student-form-actions-row .student-form-control {
  grid-column: 1 / -1;
}

.student-inline-suffix {
  margin-left: 0.3rem;
  white-space: nowrap;
}

.student-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.student-edit-actions .myButton {
  margin-bottom: 0;
}

.student-grade-section {
  margin-top: 0.35rem;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  padding: 0.45rem 0.45rem 0.25rem;
  background: #fbfcfe;
}

.student-grade-title,
.student-history-title {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #273345;
  margin-bottom: 0.35rem;
}

.student-grade-table td {
  vertical-align: middle;
  padding: 0.25rem 0.2rem !important;
}

.student-form-layout .student-grade-table,
.student-form-layout .student-tip-grid {
  display: table !important;
  width: 100% !important;
  overflow: visible !important;
  border-collapse: collapse;
  border-spacing: 0;
}

.student-form-layout .student-grade-table tr,
.student-form-layout .student-tip-grid tr {
  display: table-row !important;
}

.student-form-layout .student-grade-table td,
.student-form-layout .student-tip-grid td {
  display: table-cell !important;
}

.student-grade-table .student-grade-col-style {
  width: 33%;
}

.student-grade-table .student-grade-col-grade {
  width: 34%;
}

.student-grade-table .student-grade-col-achieved {
  width: 33%;
}

.student-grade-table tr:not(.student-tip-row) td {
  white-space: nowrap;
}

.student-grade-table .student-grade-head td {
  border-bottom: 1px solid #d8dfe9;
  padding-top: 0.1rem !important;
  padding-bottom: 0.35rem !important;
}

.student-grade-table select,
.student-grade-table input[type="date"] {
  width: 100%;
  min-height: 34px;
}

.student-grade-table td:nth-child(3) input[type="date"] {
  width: calc(100% - 22px) !important;
  display: inline-block;
  vertical-align: middle;
  margin: 0;
}

.student-grade-table td:nth-child(3) a {
  display: inline-block;
  width: 16px;
  margin-left: 4px;
  text-align: center;
  vertical-align: middle;
  text-decoration: none;
  font-weight: 700;
}

.student-grade-table tr + tr td {
  border-top: 1px solid #edf1f6;
}

.student-grade-table tr:not(.student-grade-head):not(.student-tip-row) td {
  padding-top: 0.22rem !important;
  padding-bottom: 0.22rem !important;
}

.student-grade-table tr:not(.student-grade-head):not(.student-tip-row) select,
.student-grade-table tr:not(.student-grade-head):not(.student-tip-row) input[type="date"] {
  min-height: 36px;
  height: 36px;
}

.student-grade-table td[colspan="3"] {
  background: #f4f7fb;
  border-radius: 6px;
  padding: 0.3rem !important;
}

.student-grade-table td[colspan="3"] table td {
  border-top: 0 !important;
}

.student-tip-grid {
  width: 100% !important;
  table-layout: fixed;
}

.student-tip-grid td {
  display: table-cell !important;
  width: 20% !important;
  text-align: center;
  vertical-align: middle;
  margin: 0 !important;
  padding: 0.45rem 0.2rem !important;
}

.student-history-section {
  margin-top: 0.7rem;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 0.4rem 0.45rem 0.3rem;
}

.student-history-section table {
  width: 100% !important;
}

.student-history-section td,
.student-history-section th {
  padding: 0.28rem 0.34rem;
  vertical-align: top;
  white-space: nowrap;
}

.student-history-section .display-4,
.student-history-section .card-subtitle,
.student-history-section p,
.student-history-section td,
.student-history-section th,
.student-history-section a,
.student-history-section input,
.student-history-section select,
.student-history-section textarea {
  font-size: 0.8rem !important;
  line-height: 1.2 !important;
  margin-bottom: 0 !important;
}

@media (max-width: 991.98px) {
  :root {
    --app-nav-height: 56px;
  }

  body {
    padding-top: calc(var(--app-nav-height) + 0.5rem);
  }

  .m-3 {
    margin: 0.5rem !important;
  }

  .navbar.fixed-top {
    padding: 0.25rem 0.5rem !important;
    background: rgba(0, 0, 0, 0.95);
  }

  .navbar .fa-2x {
    font-size: 1.4em;
  }

  .navbar-brand {
    width: calc(100% - 52px);
    margin-right: 0.25rem;
    min-width: 0;
  }

  .navbar .navbar-logo {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 0.4rem;
    width: 100%;
  }

  #Search_Box {
    width: 100%;
    height: 34px;
    font-size: 14px;
  }

  .navbar button[name="Action"],
  .navbar a#NewMail {
    min-width: 34px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
  }

  .navbar-collapse {
    max-height: 70vh;
    overflow-y: auto;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.93);
    border-radius: 0.5rem;
  }

  .navbar-nav .nav-link,
  .dropdown-item {
    white-space: normal;
    line-height: 1.25;
  }

  .navbar-nav {
    display: block !important;
    width: 100%;
  }

  .navbar-nav .nav-item {
    display: block;
    width: 100%;
  }

  .navbar .display-4,
  .navbar-nav .dropdown-item {
    font-size: 1rem !important;
  }

  .navbar .nav-link {
    padding: 0.45rem 0.5rem !important;
  }

  .dropdown-menu {
    position: static !important;
    float: none;
    width: 100%;
    transform: none !important;
    margin: 0.25rem 0 0.5rem;
  }

  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100vw - 1rem);
  }

  .modal-content {
    min-height: 65vh;
  }

  .modal-body {
    max-height: 60vh;
    overflow-y: auto;
  }

  .student-detail-modal .modal-dialog {
    width: calc(100vw - 0.8rem);
    max-width: calc(100vw - 0.8rem);
    margin: 0.4rem auto;
  }

  .student-detail-modal .modal-content {
    min-height: 75vh;
  }

  #studentInfoModal .student-name-lg {
    font-size: 1.6rem;
  }

  #studentInfoModal .student-contact-lg,
  #studentInfoModal .student-guardian-lg,
  #studentInfoModal .student-portal-line {
    font-size: 1.14rem;
    margin-bottom: 0.4rem;
  }

  #studentInfoModal .student-contact-lg,
  #studentInfoModal .student-guardian-lg {
    font-size: 1.24rem;
  }

  #studentInfoModal .student-contact-lg {
    font-size: 1.24rem;
  }

  .student-detail-modal .modal-title {
    font-size: 1.28rem;
  }

  #studentInfoModal .student-photo-wrap {
    justify-content: flex-end;
  }

  #studentInfoModal .student-photo-img {
    width: 150px;
    height: 180px;
  }

  #student_info_modal_body {
    max-height: calc(90vh - 74px);
    padding: 0.55rem;
  }

  #studentInfoModal .display-1,
  #studentInfoModal .display-2,
  #studentInfoModal .display-3,
  #studentInfoModal .display-4,
  #studentInfoModal .display-5,
  #studentInfoModal .display-7 {
    font-size: 1rem !important;
    line-height: 1.3 !important;
  }

  #studentInfoModal table td,
  #studentInfoModal table th,
  #studentInfoModal p,
  #studentInfoModal label,
  #studentInfoModal a:not(.myButton):not(.myButton_med):not(.myButton_small),
  #studentInfoModal input,
  #studentInfoModal select,
  #studentInfoModal textarea {
    font-size: 1rem !important;
    line-height: 1.3 !important;
  }

  .myButton {
    padding: 0.4rem 0.8rem;
    font-size: 14px;
  }

  .myButton_med,
  .myButton_small {
    min-height: 32px;
    padding: 0.28rem 0.55rem;
  }

  .table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table td,
  .table th {
    white-space: nowrap;
  }

  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="date"],
  input[type="password"],
  select,
  textarea {
    max-width: 100%;
  }

  textarea {
    min-height: 90px;
  }

  .grid-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .student-form-layout .item-wrapper {
    overflow: hidden;
  }

  .student-form-layout table,
  .reports-layout table,
  .main-dashboard table {
    display: block;
    width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .main-dashboard #myDiv,
  .main-dashboard #student_info {
    max-height: none !important;
  }

  .main-dashboard .item.features-image {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }

  .enquiry-dashboard .item.features-image {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }

  .enquiry-dashboard .enquiry-list-panel,
  .enquiry-dashboard .enquiry-report-panel {
    max-height: none !important;
    height: auto !important;
  }

  .main-dashboard .display-4 {
    font-size: 1rem !important;
    line-height: 1.25;
  }

  .main-dashboard .table td,
  .main-dashboard .table th {
    white-space: normal;
  }

  .main-dashboard #myDiv .table td,
  .main-dashboard #myDiv .table th {
    padding: 0.3rem 0.35rem;
    vertical-align: middle;
    font-size: 0.98rem;
  }

  .main-dashboard #myDiv .table th .attendance-heading-filter {
    margin-top: 0.25rem;
    max-width: 120px;
  }

  .card-subtitle.mbr-fonts-style.mb-3.display-4 {
    margin-bottom: 0.2rem !important;
  }
}

@media (max-width: 575.98px) {
  .navbar .navbar-logo {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  #NewMail {
    grid-column: 3;
    justify-self: end;
  }

  .navbar-brand {
    width: calc(100% - 52px);
  }

  #Search_Box {
    height: 32px;
    font-size: 13px;
  }

  .attendance-heading-filter {
    max-width: 108px;
    min-width: 78px;
    font-size: 10px;
    height: 22px;
    padding-left: 0.38rem;
    padding-right: 1.1rem;
  }

  .attendance-clear-filter {
    height: 22px;
    font-size: 10px;
    padding: 0 0.38rem;
    margin-left: 0.2rem;
  }

  .student-form-layout .row.mt-4 {
    margin-top: 0.5rem !important;
  }

  .student-form-layout .item {
    margin-bottom: 0.75rem;
  }

  #studentInfoModal .student-name-lg {
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
  }

  #studentInfoModal .student-contact-lg,
  #studentInfoModal .student-guardian-lg,
  #studentInfoModal .student-portal-line {
    font-size: 1.06rem;
    margin-bottom: 0.35rem;
  }

  #studentInfoModal .student-contact-lg,
  #studentInfoModal .student-guardian-lg {
    font-size: 1.16rem;
  }

  #studentInfoModal .student-contact-lg {
    font-size: 1.16rem;
  }

  .student-detail-modal .modal-title {
    font-size: 1.18rem;
  }

  #studentInfoModal .student-photo-img {
    width: 132px;
    height: 158px;
  }

  #studentInfoModal .display-1,
  #studentInfoModal .display-2,
  #studentInfoModal .display-3,
  #studentInfoModal .display-4,
  #studentInfoModal .display-5,
  #studentInfoModal .display-7,
  #studentInfoModal table td,
  #studentInfoModal table th,
  #studentInfoModal p,
  #studentInfoModal label,
  #studentInfoModal a:not(.myButton):not(.myButton_med):not(.myButton_small),
  #studentInfoModal input,
  #studentInfoModal select,
  #studentInfoModal textarea {
    font-size: 0.92rem !important;
    line-height: 1.25 !important;
  }

  .student-form-layout table[style*="cellpadding"] td {
    display: block;
    width: 100% !important;
  }

  .student-form-layout input[type="button"],
  .student-form-layout .myButton,
  .student-form-layout .myButton_small {
    width: 100%;
  }
}

@media (max-width: 991.98px) {
  #content {
    padding-inline: 0.45rem;
    padding-top: 0.65rem;
  }

  .student-form-layout {
    padding-bottom: 0.75rem;
  }

  .student-form-layout .item.features-image {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 0.7rem;
  }

  .student-form-row {
    grid-template-columns: minmax(105px, 38%) minmax(0, 1fr);
    gap: 0.45rem;
    align-items: center;
  }

  .student-form-label {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.86rem;
    color: #4a5360;
    line-height: 1.25;
  }

  .student-form-layout table[style*="cellpadding"] {
    width: 100% !important;
    table-layout: fixed;
  }

  .student-form-layout table[style*="cellpadding"] tr {
    display: block;
    border-bottom: 1px solid #e4e8ef;
    padding: 0.3rem 0;
  }

  .student-form-layout table[style*="cellpadding"] tr:last-child {
    border-bottom: 0;
  }

  .student-form-layout table[style*="cellpadding"] td {
    display: block;
    width: 100% !important;
    padding: 0.08rem 0 !important;
    white-space: normal !important;
  }

  .student-form-layout table[style*="cellpadding"] td:first-child strong {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: 0.84rem;
    color: #4a5360;
  }

  .student-form-layout input[type="text"],
  .student-form-layout input[type="email"],
  .student-form-layout input[type="tel"],
  .student-form-layout input[type="date"],
  .student-form-layout input[type="password"],
  .student-form-layout select,
  .student-form-layout textarea {
    width: 100%;
    max-width: 100%;
    min-height: 38px;
    font-size: 16px;
    line-height: 1.25;
    box-sizing: border-box;
  }

  .student-form-layout textarea {
    min-height: 100px;
    resize: vertical;
  }

  .student-form-row .student-form-control textarea {
    margin-top: 0.05rem;
  }

  .student-form-layout input[type="checkbox"] {
    width: auto;
    min-height: 0;
    transform: scale(1.1);
    transform-origin: left center;
  }

  .student-form-layout table td[style*="background-color"] {
    display: inline-block;
    width: auto !important;
    margin-right: 0.3rem;
    margin-bottom: 0.25rem;
  }

  .student-form-layout .student-tip-grid td[style*="background-color"] {
    display: table-cell !important;
    width: 20% !important;
    margin: 0 !important;
    padding: 0.45rem 0.2rem !important;
  }

  .student-grade-section {
    padding: 0.4rem 0.35rem 0.25rem;
  }

  .student-grade-title,
  .student-history-title {
    font-size: 0.88rem;
    margin-bottom: 0.3rem;
  }

  .student-grade-table td {
    white-space: normal !important;
  }

  .student-grade-table .student-grade-head td {
    font-size: 0.82rem !important;
  }

  .student-grade-table tr:not(.student-tip-row) td {
    white-space: nowrap !important;
  }

  .student-grade-table td:nth-child(3) input[type="date"] {
    min-width: 0;
    width: calc(100% - 22px) !important;
  }

  .student-grade-table td[colspan="3"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .student-history-section {
    padding: 0.35rem 0.35rem 0.25rem;
  }

  .student-history-section {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .student-history-section td,
  .student-history-section th {
    white-space: nowrap !important;
  }

  .student-form-layout #targetOuter {
    float: none !important;
    width: 100%;
  }

  .student-form-layout #my_camera,
  .student-form-layout #my_camera video,
  .student-form-layout #my_camera canvas,
  .student-form-layout #my_camera img,
  .student-form-layout .icon-choose-image {
    width: 100% !important;
    max-width: 320px;
    height: auto !important;
  }

  .student-form-layout div[style*="float:right"] {
    float: none !important;
    width: 100%;
    margin-top: 0.5rem;
  }

  .student-form-layout .myButton,
  .student-form-layout .myButton_small,
  .student-form-layout button.myButton,
  .student-form-layout input[type="submit"],
  .student-form-layout input[type="button"] {
    width: 100% !important;
    display: block;
    text-align: center;
    margin-bottom: 0.35rem;
    box-sizing: border-box;
  }

  .student-form-layout a.myButton_small {
    width: auto !important;
    display: inline-block;
    margin-bottom: 0;
  }

  .student-edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .student-edit-actions .myButton {
    width: auto !important;
    margin-bottom: 0;
    flex: 0 1 auto;
  }

  .student-photo-panel {
    width: 100%;
  }

  .student-form-actions {
    float: none;
    width: 100%;
  }

  .student-form-actions table {
    width: 100%;
  }

  .student-form-actions-list {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .student-form-actions a {
    display: inline-block;
    margin-top: 0.25rem;
    word-break: break-word;
  }

  .student-action-btn {
    width: auto !important;
    margin-bottom: 0;
    flex: 1 1 160px;
  }

  .reports-layout,
  .main-dashboard {
    padding-bottom: 0.6rem;
  }

  .reports-layout table,
  .main-dashboard table {
    width: 100% !important;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .reports-layout td,
  .reports-layout th {
    white-space: nowrap;
  }

  .full-view-layout .selectpicker,
  .full-view-layout .bootstrap-select,
  .full-view-layout .bootstrap-select > .dropdown-toggle {
    max-width: 140px !important;
    width: 100% !important;
  }

  .full-view-layout .full-view-filters th {
    min-width: 120px;
  }
}

@media (max-width: 430px) {
  .student-form-label {
    font-size: 0.8rem;
  }

  .student-edit-actions {
    display: block;
  }

  .student-edit-actions .myButton {
    width: 100% !important;
    margin-bottom: 0.35rem;
  }

  .student-form-actions-list {
    display: block;
  }

  .student-action-btn {
    width: 100% !important;
    margin-bottom: 0.35rem;
  }
}

@media (max-width: 767.98px) {
  .full-view-layout .full-view-table tr.full-view-row {
    display: block;
    margin-bottom: 0.75rem;
    border: 1px solid #dfe5ee;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 2px 7px rgba(17, 28, 43, 0.08);
    overflow: hidden;
    padding: 0.35rem 0.55rem;
  }

  .full-view-layout .full-view-table tr.full-view-row td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    width: 100% !important;
    border: 0;
    border-bottom: 1px dashed #e6ebf2;
    padding: 0.35rem 0 !important;
    white-space: normal !important;
  }

  .full-view-layout .full-view-table tr.full-view-row td:last-child {
    border-bottom: 0;
  }

  .full-view-layout .full-view-table tr.full-view-row td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #4c5868;
    line-height: 1.25;
  }

  .full-view-layout .full-view-table tr.full-view-row td[data-label="Photo"]::before {
    content: "";
    flex-basis: 0;
  }

  .full-view-layout .full-view-table tr.full-view-row td[data-label="Photo"] img {
    width: 42px !important;
    height: 42px !important;
    border-radius: 6px;
    object-fit: cover;
  }

  .full-view-layout .full-view-table tr.full-view-row td[data-label="Style"] > div {
    width: auto !important;
    float: none !important;
    margin-right: 0.3rem;
    display: inline-block;
  }

  .full-view-layout .full-view-table tr.full-view-row h6 {
    margin-bottom: 0 !important;
    font-size: 0.92rem !important;
    line-height: 1.3 !important;
  }

  .grades-view-layout .grades-view-table thead {
    display: none;
  }

  .grades-view-layout .grades-view-table tr.grades-view-row {
    display: block;
    margin-bottom: 0.75rem;
    border: 1px solid #dfe5ee;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 2px 7px rgba(17, 28, 43, 0.08);
    overflow: hidden;
    padding: 0.4rem 0.55rem;
  }

  .grades-view-layout .grades-view-table tr.grades-view-row td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    width: 100% !important;
    border: 0;
    border-bottom: 1px dashed #e6ebf2;
    padding: 0.38rem 0 !important;
    white-space: normal !important;
  }

  .grades-view-layout .grades-view-table tr.grades-view-row td:last-child {
    border-bottom: 0;
  }

  .grades-view-layout .grades-view-table tr.grades-view-row td::before {
    content: attr(data-label);
    flex: 0 0 40%;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #4c5868;
    line-height: 1.25;
  }

  .grades-view-layout .grades-view-table tr.grades-view-row td[data-label="Tips"] table {
    width: auto !important;
    display: inline-table;
    overflow: visible;
  }

  .grades-view-layout .grades-view-table tr.grades-view-row td[data-label="Tips"] td {
    display: table-cell;
    border-bottom: 0;
    padding: 0.2rem 0.28rem !important;
  }

  .grades-view-layout .grades-view-table tr.grades-view-row td[data-label="Rank"] select {
    width: 100%;
    min-height: 36px;
  }
}

/* Final override: keep Student Form compact on all screen sizes */
body .student-form-layout,
body .student-form-layout table,
body .student-form-layout td,
body .student-form-layout th,
body .student-form-layout .display-4,
body .student-form-layout .display-5,
body .student-form-layout .card-subtitle.mbr-fonts-style.mb-3.display-4,
body .student-form-layout label,
body .student-form-layout strong {
  font-size: 0.94rem !important;
  line-height: 1.28 !important;
}

body .student-form-layout h3 {
  font-size: 1.15rem !important;
  line-height: 1.2 !important;
}

body .student-form-layout .student-form-row {
  grid-template-columns: 105px minmax(0, 1fr) !important;
  gap: 0.35rem !important;
}

body .student-form-layout input[type="text"],
body .student-form-layout input[type="email"],
body .student-form-layout input[type="tel"],
body .student-form-layout input[type="date"],
body .student-form-layout input[type="password"],
body .student-form-layout select,
body .student-form-layout textarea {
  font-size: 0.94rem !important;
  line-height: 1.25 !important;
  padding: 0.24rem 0.34rem !important;
}

body .student-form-layout .myButton,
body .student-form-layout .myButton_med,
body .student-form-layout .myButton_small {
  font-size: 0.88rem !important;
  padding: 0.28rem 0.5rem !important;
}

/* Keep each Student Form label + input on a single line */
body .student-form-layout .student-form-row {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
}

body .student-form-layout .student-form-label {
  flex: 0 0 110px !important;
  max-width: 110px !important;
  margin: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body .student-form-layout .student-form-control {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

body .student-form-layout .student-form-control input[type="text"],
body .student-form-layout .student-form-control input[type="email"],
body .student-form-layout .student-form-control input[type="tel"],
body .student-form-layout .student-form-control input[type="date"],
body .student-form-layout .student-form-control input[type="password"],
body .student-form-layout .student-form-control select,
body .student-form-layout .student-form-control textarea {
  width: 100% !important;
  max-width: 100% !important;
}

/* Message Centre modal mobile formatting */
@media (max-width: 767.98px) {
  #myModal .modal-dialog {
    width: calc(100vw - 0.8rem);
    max-width: calc(100vw - 0.8rem);
    margin: 0.4rem auto;
  }

  #myModal .modal-content {
    min-height: auto;
  }

  #myModal .modal-body {
    padding: 0.42rem 0.5rem;
  }

  #myModal .modal_menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: center;
    height: auto;
  }

  #myModal .modal_menu .myButton_med {
    font-size: 0.88rem;
    padding: 0.18rem 0.42rem;
    margin: 0;
  }

  #myModal #activity_comms {
    height: auto !important;
  }

  #myModal #activity_comms table {
    width: 100%;
    margin: 0 !important;
    display: table !important;
  }

  #myModal #activity_comms tr {
    display: table-row !important;
  }

  #myModal #activity_comms td {
    display: block;
    width: 100% !important;
    padding: 0.2rem 0 !important;
    white-space: normal;
  }

  #myModal .message-centre-label {
    font-size: 0.88rem;
    line-height: 1.2;
  }

  #myModal .message-centre-label strong {
    font-size: 0.92rem;
  }

  #myModal .message-centre-hint {
    font-size: 0.8rem;
  }

  #myModal .message-centre-radio-group {
    gap: 0.36rem 0.5rem;
  }

  #myModal .message-centre-radio-group label {
    font-size: 0.84rem;
    margin: 0;
  }

  #myModal #activity_comms input[type="text"],
  #myModal #activity_comms textarea {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 0.9rem;
    line-height: 1.2;
    padding: 0.22rem 0.32rem;
  }

  #myModal #activity_comms textarea {
    min-height: 88px;
  }

  #myModal .log-activity-menu {
    gap: 0.25rem;
    justify-content: flex-start;
    height: auto;
  }

  #myModal .log-activity-menu .myButton_med {
    font-size: 0.82rem;
    padding: 0.2rem 0.4rem;
    margin: 0;
  }

  #myModal .log-activity-panel,
  #myModal .log-activity-panel table,
  #myModal .log-activity-panel tbody,
  #myModal .log-activity-panel tr,
  #myModal .log-activity-panel td {
    display: block;
    width: 100% !important;
  }

  #myModal .log-activity-panel td {
    padding: 0.16rem 0 !important;
  }

  #myModal .log-activity-panel .card-subtitle {
    margin-bottom: 0.2rem !important;
    font-size: 0.84rem !important;
    line-height: 1.2 !important;
  }

  #myModal .log-activity-panel input[type="text"],
  #myModal .log-activity-panel input[type="date"],
  #myModal .log-activity-panel select,
  #myModal .log-activity-panel textarea {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 0.88rem;
    line-height: 1.2;
    padding: 0.22rem 0.32rem;
  }

  #myModal .log-activity-panel textarea {
    min-height: 88px;
  }
}
