:root {
  --app-bg: #f5f7fb;
  --app-border: rgba(98, 105, 118, .18);
  --app-shadow: 0 10px 30px rgba(15, 23, 42, .05);
  --app-radius: 8px;
}

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  max-width: 100%;
}

body.antialiased {
  background: var(--app-bg) !important;
  color: #172033;
  max-width: 100%;
  overflow-x: hidden;
}

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

.page,
.wrapper,
.page-wrapper,
.page-body,
.container-xl,
.card,
.alert,
.modal-content {
  min-width: 0;
}

.container-xl {
  max-width: 1280px;
}

.sticky-top {
  z-index: 1030;
  box-shadow: 0 1px 0 var(--app-border);
}

.navbar {
  min-height: 64px;
}

.navbar-brand-image {
  max-height: 52px;
  width: auto;
  object-fit: contain;
}

.navbar .container-xl {
  gap: 12px;
}

.navbar-nav {
  gap: 4px;
  min-width: 0;
}

.nav-link {
  border-radius: 6px;
}

.nav-link-title,
.dropdown-item,
.btn,
.form-label,
.table th {
  letter-spacing: 0;
}

.page-wrapper {
  background: transparent;
}

.page-header {
  margin: 0;
  padding: 24px 0 12px;
}

.page-title {
  line-height: 1.25;
}

.page-body {
  margin-top: 0;
  padding: 12px 0 28px;
}

.card {
  border-color: var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
}

.card-header {
  min-height: 56px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.card-title {
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.btn {
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  white-space: normal;
}

.btn-sm {
  min-height: 34px;
}

.btn-list {
  gap: 8px;
}

.form-control,
.form-selectgroup-label,
.input-group .btn {
  border-radius: 6px;
}

.form-control {
  min-height: 42px;
}

textarea.form-control {
  min-height: 92px;
}

.table-responsive {
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.table-responsive > .table {
  margin-bottom: 0;
}

.table td,
.table th {
  vertical-align: middle;
}

.table .btn-list {
  flex-wrap: wrap;
  min-width: 150px;
}

.dataTables_wrapper {
  padding: 14px;
}

.dataTables_wrapper .row {
  row-gap: 10px;
}

.dataTables_filter,
.dataTables_length {
  text-align: left !important;
}

.dataTables_filter label,
.dataTables_length label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.dataTables_filter input,
.dataTables_length select {
  min-height: 38px;
}

.dataTables_wrapper .dataTables_paginate {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.modal-dialog {
  max-width: min(100% - 24px, var(--tblr-modal-width, 640px));
}

.dropdown-menu {
  max-width: min(92vw, 360px);
}

.destination-suggestions {
  display: grid;
  gap: 8px;
}

.destination-suggestion {
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
}

.portal-step-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.portal-step {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  padding: 14px;
  background: #fff;
  min-height: 118px;
}

.portal-step-number {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #206bc4;
  color: #fff;
  font-weight: 700;
  margin-bottom: 10px;
}

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

.portal-test-list {
  display: grid;
  gap: 12px;
}

.portal-test-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: #fff;
}

.portal-test-title,
.portal-history-title {
  margin: 0;
  color: #092049;
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.32;
}

.portal-test-meta,
.portal-test-status {
  margin-top: 4px;
  color: #56647a;
  font-size: .92rem;
  line-height: 1.45;
}

.portal-test-action {
  min-width: 136px;
}

.portal-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: normal;
}

.portal-chip-primary {
  background: #e8f1ff;
  color: #1557b0;
}

.portal-chip-info {
  background: #e8f7fb;
  color: #087489;
}

.portal-chip-success {
  background: #e9f8ef;
  color: #137333;
}

.portal-chip-warning {
  background: #fff4de;
  color: #9a5b00;
}

.portal-chip-danger {
  background: #fdecec;
  color: #b42318;
}

.portal-chip-muted {
  background: #eef1f5;
  color: #5d6675;
}

.portal-history-card .card-header {
  border-bottom: 1px solid var(--app-border);
}

.portal-history-responsive {
  overflow-x: auto;
  overflow-y: visible;
}

.portal-history-table {
  table-layout: fixed;
  width: 100%;
  min-width: 1120px;
}

.portal-history-table th {
  color: #5b6577;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  overflow-wrap: normal;
}

.portal-history-table td {
  color: #172033;
  font-size: .92rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.portal-history-table th:nth-child(1) {
  width: 15%;
}

.portal-history-table th:nth-child(2) {
  width: 11%;
}

.portal-history-table th:nth-child(3) {
  width: 6%;
}

.portal-history-table th:nth-child(4) {
  width: 15%;
}

.portal-history-table th:nth-child(5) {
  width: 14%;
}

.portal-history-table th:nth-child(6) {
  width: 15%;
}

.portal-history-table th:nth-child(7) {
  width: 13%;
}

.portal-history-table th:nth-child(8) {
  width: 11%;
}

.portal-history-score {
  font-size: 1.05rem !important;
  font-weight: 700;
  color: #092049 !important;
}

.portal-status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.portal-history-actions {
  min-width: 0;
  white-space: normal;
}

.portal-history-actions .btn,
.portal-history-actions .portal-chip,
.portal-history-actions form {
  display: inline-flex;
  align-items: center;
  margin: 0 .35rem .35rem 0;
  vertical-align: top;
  white-space: normal;
}

.portal-history-actions form {
  display: inline-block;
}

.portal-history-actions .text-muted.small {
  display: block;
  margin-top: .15rem;
}

@media (max-width: 991.98px) {
  .navbar-collapse .navbar {
    min-height: 0;
    padding: 8px 0 12px;
  }

  .navbar-collapse .container-xl {
    align-items: stretch;
  }

  .navbar-collapse .navbar-nav {
    width: 100%;
    gap: 6px;
  }

  .navbar-collapse .nav-link {
    padding: 12px;
    justify-content: flex-start;
    min-height: 44px;
  }

  .navbar .dropdown-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    border-radius: 6px;
  }

  .portal-step-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  body.antialiased {
    background: #f8fafc !important;
  }

  .container-xl {
    padding-left: 14px;
    padding-right: 14px;
  }

  .navbar {
    min-height: 58px;
  }

  .navbar-brand-image {
    max-width: 150px;
    max-height: 42px;
  }

  .page-header {
    padding-top: 18px;
    padding-bottom: 8px;
  }

  .page-header .row {
    row-gap: 12px;
  }

  .page-header .col-auto {
    width: 100%;
  }

  .page-header .col-auto .btn,
  .page-header .col-auto .btn-list,
  .app-mobile-actions,
  .card-footer .btn {
    width: 100%;
  }

  .navbar > .container-xl,
  .sticky-top > .navbar .container-xl {
    row-gap: 10px;
  }

  .navbar-brand {
    max-width: calc(100vw - 96px);
    min-width: 0;
  }

  .navbar-nav.flex-row.order-md-last {
    margin-left: auto;
  }

  .page-title {
    font-size: 1.25rem;
    overflow-wrap: anywhere;
  }

  .page-body {
    padding-bottom: 22px;
  }

  .card {
    box-shadow: none;
  }

  .card-body,
  .card-header,
  .card-footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .row-cards {
    --tblr-gutter-y: 14px;
  }

  .btn-list,
  .table .btn-list {
    width: 100%;
  }

  .btn-list .btn,
  .btn-list form,
  .table .btn,
  .table form {
    width: 100%;
  }

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

  .table-responsive > .table {
    min-width: 760px;
  }

  .portal-test-list {
    gap: 10px;
  }

  .portal-test-card {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px;
  }

  .portal-test-title,
  .portal-history-title {
    font-size: 1rem;
  }

  .portal-test-action {
    width: 100%;
    min-width: 0;
    justify-content: stretch;
  }

  .portal-test-action .btn {
    width: 100%;
  }

  .portal-history-responsive {
    overflow: visible;
  }

  .portal-history-responsive > .portal-history-table {
    min-width: 0;
    display: block;
  }

  .portal-history-table thead {
    display: none;
  }

  .portal-history-table tbody {
    display: grid;
    gap: 12px;
    padding: 12px;
  }

  .portal-history-table tr.portal-history-row {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: #fff;
    box-shadow: var(--app-shadow);
  }

  .portal-history-table td {
    display: grid;
    grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    width: 100%;
    padding: 0 !important;
    border: 0 !important;
    font-size: .92rem;
  }

  .portal-history-table td::before {
    content: attr(data-label);
    color: #667085;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.4;
    text-transform: uppercase;
  }

  .portal-history-table td.portal-history-test {
    display: block;
  }

  .portal-history-table td.portal-history-test::before {
    display: none;
  }

  .portal-history-actions .btn,
  .portal-history-actions form,
  .portal-history-primary-action .portal-chip {
    width: 100%;
    justify-content: center;
    margin-right: 0;
  }

  .portal-history-actions .portal-chip {
    width: auto;
  }

  .dataTables_wrapper {
    padding: 10px;
  }

  .dataTables_filter label {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .dataTables_filter input {
    width: 100% !important;
  }

  .dataTables_length label {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .dataTables_length select {
    width: 92px !important;
  }

  .form-selectgroup-label {
    min-height: 82px;
    align-items: flex-start !important;
  }

  .input-group {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .input-group > .form-control,
  .input-group > .btn,
  .input-group > .input-group-text {
    width: 100%;
    border-radius: 6px !important;
  }

  .portal-step-grid {
    grid-template-columns: 1fr;
  }

  .portal-step {
    min-height: auto;
  }

  .profile-photo-preview {
    margin-left: auto;
    margin-right: auto;
  }

  .modal-dialog {
    margin: 12px auto;
  }

  .modal-body {
    max-height: calc(100vh - 160px);
    overflow: auto;
  }
}

@media (max-width: 420px) {
  .container-xl {
    padding-left: 10px;
    padding-right: 10px;
  }

  .navbar-brand-image {
    max-width: 124px;
  }

  .page-title {
    font-size: 1.15rem;
  }

  .card-body,
  .card-header,
  .card-footer {
    padding-left: 12px;
    padding-right: 12px;
  }

  .portal-history-table tbody {
    padding: 10px;
  }

  .portal-history-table tr.portal-history-row {
    padding: 12px;
  }

  .portal-history-table td {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* Internal app polish: admin, operator, and private student portal only. */
.admin-app-shell,
.student-app-shell {
  --app-bg: #f4f6fa;
  --app-surface: #ffffff;
  --app-surface-soft: #f8fafc;
  --app-border: #dde4ee;
  --app-text: #111827;
  --app-muted: #64748b;
  --app-primary: #2563eb;
  --app-primary-soft: #eff6ff;
  --app-danger-soft: #fef2f2;
  --app-shadow: 0 1px 2px rgba(15, 23, 42, .06);
  background: var(--app-bg) !important;
  color: var(--app-text);
}

.admin-app-shell .sticky-top,
.student-app-shell .sticky-top {
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--app-border);
  box-shadow: none;
}

.admin-app-shell .sticky-top .navbar,
.student-app-shell .sticky-top .navbar {
  background: transparent;
}

.admin-app-shell .navbar-brand-image,
.student-app-shell .navbar-brand-image {
  max-height: 46px;
}

.admin-app-shell .navbar-nav,
.student-app-shell .navbar-nav {
  align-items: center;
}

.admin-app-shell .nav-link,
.student-app-shell .nav-link {
  min-height: 42px;
  color: #334155;
  font-weight: 600;
  line-height: 1.25;
}

.admin-app-shell .nav-link:hover,
.student-app-shell .nav-link:hover,
.admin-app-shell .nav-item.active > .nav-link,
.student-app-shell .nav-item.active > .nav-link {
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.admin-app-shell .dropdown-menu,
.student-app-shell .dropdown-menu {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: 0 16px 36px rgba(15, 23, 42, .12);
}

.admin-app-shell .dropdown-item,
.student-app-shell .dropdown-item {
  min-height: 40px;
  border-radius: 6px;
  color: #334155;
  font-weight: 500;
}

.admin-app-shell .page-wrapper,
.student-app-shell .page-wrapper {
  background: var(--app-bg);
}

.admin-app-shell .page-header,
.student-app-shell .page-header {
  padding-top: 28px;
  padding-bottom: 12px;
}

.admin-app-shell .page-pretitle,
.student-app-shell .page-pretitle {
  color: var(--app-muted);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.admin-app-shell .page-title,
.student-app-shell .page-title {
  color: var(--app-text);
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-weight: 750;
}

.admin-app-shell .card,
.student-app-shell .card,
.admin-app-shell .alert,
.student-app-shell .alert,
.admin-app-shell .modal-content,
.student-app-shell .modal-content {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
}

.admin-app-shell .card-header,
.student-app-shell .card-header {
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
}

.admin-app-shell .card-title,
.student-app-shell .card-title {
  color: var(--app-text);
  font-weight: 700;
}

.admin-app-shell .card-subtitle,
.student-app-shell .card-subtitle,
.admin-app-shell .text-muted,
.student-app-shell .text-muted {
  color: var(--app-muted) !important;
}

.admin-app-shell .btn,
.student-app-shell .btn {
  border-radius: 7px;
  font-weight: 650;
  gap: 6px;
}

.admin-app-shell .btn-primary,
.student-app-shell .btn-primary {
  background: var(--app-primary);
  border-color: var(--app-primary);
}

.admin-app-shell .btn-outline-primary,
.student-app-shell .btn-outline-primary,
.admin-app-shell .btn-outline-secondary,
.student-app-shell .btn-outline-secondary {
  background: #fff;
}

.admin-app-shell .form-label,
.student-app-shell .form-label {
  color: #1f2937;
  font-weight: 650;
}

.admin-app-shell .form-control,
.admin-app-shell .form-select,
.student-app-shell .form-control,
.student-app-shell .form-select {
  border-color: #cfd8e6;
  border-radius: 7px;
  color: var(--app-text);
}

.admin-app-shell .form-control:focus,
.admin-app-shell .form-select:focus,
.student-app-shell .form-control:focus,
.student-app-shell .form-select:focus {
  border-color: #93b4ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.admin-app-shell .table,
.student-app-shell .table {
  color: var(--app-text);
}

.admin-app-shell .table thead th,
.student-app-shell .table thead th {
  background: var(--app-surface-soft);
  color: #475569;
  font-size: .73rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-app-shell .table tbody tr:hover,
.student-app-shell .table tbody tr:hover {
  background: #fbfdff;
}

.admin-app-shell .dataTables_wrapper,
.student-app-shell .dataTables_wrapper {
  background: #fff;
  border-radius: var(--app-radius);
}

.tes247-admin .tes-list-table-card,
.tes247-operator .tes-list-table-card {
  max-width: 100%;
}

.tes247-admin .tes-list-table-card .card-body,
.tes247-operator .tes-list-table-card .card-body {
  overflow-x: hidden;
}

.tes247-admin .tes-list-table-card .dataTables_wrapper,
.tes247-operator .tes-list-table-card .dataTables_wrapper {
  max-width: 100%;
  overflow-x: visible;
}

.tes247-admin .tes-list-table,
.tes247-operator .tes-list-table {
  width: 100% !important;
  table-layout: fixed;
}

.tes247-admin .tes-list-table th,
.tes247-admin .tes-list-table td,
.tes247-operator .tes-list-table th,
.tes247-operator .tes-list-table td {
  white-space: nowrap;
}

.tes247-admin .tes-list-table th:nth-child(1),
.tes247-admin .tes-list-table td:nth-child(1),
.tes247-operator .tes-list-table th:nth-child(1),
.tes247-operator .tes-list-table td:nth-child(1) {
  width: 52px !important;
}

.tes247-admin .tes-list-table th:nth-child(2),
.tes247-admin .tes-list-table td:nth-child(2),
.tes247-operator .tes-list-table th:nth-child(2),
.tes247-operator .tes-list-table td:nth-child(2) {
  width: 33% !important;
  min-width: 260px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.tes247-admin .tes-list-table th:nth-child(3),
.tes247-admin .tes-list-table td:nth-child(3),
.tes247-operator .tes-list-table th:nth-child(3),
.tes247-operator .tes-list-table td:nth-child(3) {
  width: 9% !important;
}

.tes247-admin .tes-list-table th:nth-child(4),
.tes247-admin .tes-list-table td:nth-child(4),
.tes247-operator .tes-list-table th:nth-child(4),
.tes247-operator .tes-list-table td:nth-child(4) {
  width: 7% !important;
}

.tes247-admin .tes-list-table th:nth-child(5),
.tes247-admin .tes-list-table td:nth-child(5),
.tes247-operator .tes-list-table th:nth-child(5),
.tes247-operator .tes-list-table td:nth-child(5) {
  width: 19% !important;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.tes247-admin .tes-list-table th:nth-child(6),
.tes247-admin .tes-list-table td:nth-child(6),
.tes247-admin .tes-list-table th:nth-child(7),
.tes247-admin .tes-list-table td:nth-child(7),
.tes247-admin .tes-list-table th:nth-child(8),
.tes247-admin .tes-list-table td:nth-child(8),
.tes247-operator .tes-list-table th:nth-child(6),
.tes247-operator .tes-list-table td:nth-child(6),
.tes247-operator .tes-list-table th:nth-child(7),
.tes247-operator .tes-list-table td:nth-child(7),
.tes247-operator .tes-list-table th:nth-child(8),
.tes247-operator .tes-list-table td:nth-child(8) {
  width: 5% !important;
  text-align: center;
}

.tes247-admin .tes-list-table th:nth-child(9),
.tes247-admin .tes-list-table td:nth-child(9),
.tes247-operator .tes-list-table th:nth-child(9),
.tes247-operator .tes-list-table td:nth-child(9) {
  width: 7% !important;
  text-align: center;
}

.tes247-admin .tes-list-table th:nth-child(10),
.tes247-admin .tes-list-table td:nth-child(10),
.tes247-operator .tes-list-table th:nth-child(10),
.tes247-operator .tes-list-table td:nth-child(10) {
  width: 10% !important;
  min-width: 104px;
}

.tes247-admin .tes-list-table .dropdown-toggle,
.tes247-operator .tes-list-table .dropdown-toggle {
  width: 100%;
  min-width: 96px;
}

@media (min-width: 992px) and (max-width: 1399.98px) {
  .tes247-admin .tes-list-table-card .card-body,
  .tes247-operator .tes-list-table-card .card-body {
    overflow-x: auto;
  }

  .tes247-admin .tes-list-table,
  .tes247-operator .tes-list-table {
    min-width: 1000px;
  }
}

.admin-app-shell .badge,
.student-app-shell .badge,
.admin-app-shell .portal-chip,
.student-app-shell .portal-chip {
  border-radius: 6px;
  letter-spacing: 0;
}

.student-app-shell .portal-test-card,
.student-app-shell .portal-step,
.student-app-shell .portal-history-table tr.portal-history-row {
  border-color: var(--app-border);
  box-shadow: var(--app-shadow);
}

.student-app-shell .portal-test-title,
.student-app-shell .portal-history-title {
  color: var(--app-text);
}

.auth-app-shell {
  --app-border: #dde4ee;
  --app-primary: #2563eb;
  background: #f4f6fa !important;
}

.auth-app-shell.border-top-wide {
  border-top-width: 0 !important;
}

.auth-app-shell .page-center {
  min-height: 100vh;
  padding: 24px 0;
}

.auth-app-shell .container-tight {
  max-width: 440px;
}

.auth-app-shell .card {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}

.auth-app-shell .card-title {
  color: #111827;
  font-weight: 750;
}

.auth-app-shell .form-label {
  color: #1f2937;
  font-weight: 650;
}

.auth-app-shell .form-control {
  min-height: 44px;
  border-color: #cfd8e6;
  border-radius: 7px;
}

.auth-app-shell .form-control:focus {
  border-color: #93b4ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.auth-app-shell .btn {
  min-height: 44px;
  border-radius: 7px;
  font-weight: 650;
}

.student-system-shell {
  --app-bg: #f7f9fc;
  --app-surface: #ffffff;
  --app-border: #dde4ee;
  --app-primary: #2563eb;
  --app-primary-soft: #eff6ff;
  --app-text: #111827;
  background: var(--app-bg) !important;
  color: var(--app-text);
}

.student-system-shell .sticky-top {
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--app-border);
  box-shadow: none;
}

.student-system-shell .card,
.student-system-shell .alert,
.student-system-shell .modal-content {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}

.student-system-shell .card-header {
  background: #fff;
  border-bottom: 1px solid var(--app-border);
}

.student-system-shell .card-title {
  color: var(--app-text);
  font-weight: 750;
  line-height: 1.3;
}

.student-system-shell .btn {
  min-height: 44px;
  border-radius: 7px;
  font-weight: 650;
}

.student-system-shell .btn-primary {
  background: var(--app-primary);
  border-color: var(--app-primary);
}

.student-system-shell .form-control,
.student-system-shell .form-select,
.student-system-shell .input-group-text {
  min-height: 44px;
  border-color: #cfd8e6;
  border-radius: 7px;
}

.student-system-shell .form-check,
.student-system-shell .form-selectgroup-label {
  min-height: 44px;
}

.student-system-shell .test-timer-pill {
  border-radius: 999px;
  box-shadow: none;
}

.student-system-shell img,
.student-system-shell audio {
  max-width: 100%;
}

@media (min-width: 768px) {
  .admin-app-shell .sticky-top,
  .student-app-shell .sticky-top {
    position: sticky;
    top: 0;
  }

  .admin-app-shell .navbar-expand-md .navbar-nav,
  .student-app-shell .navbar-expand-md .navbar-nav {
    gap: 6px;
  }

  .admin-app-shell .navbar-expand-md .nav-link,
  .student-app-shell .navbar-expand-md .nav-link {
    padding: 10px 12px;
  }

  .admin-app-shell .page-body,
  .student-app-shell .page-body {
    padding-bottom: 38px;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .tes247-admin .navbar-expand-md,
  .tes247-operator .navbar-expand-md,
  .tes247-admin .navbar-collapse .navbar,
  .tes247-operator .navbar-collapse .navbar,
  .tes247-admin .navbar-collapse .container-xl,
  .tes247-operator .navbar-collapse .container-xl {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .tes247-admin .navbar-collapse .container-xl,
  .tes247-operator .navbar-collapse .container-xl {
    padding-left: 16px;
    padding-right: 16px;
  }

  .tes247-admin .navbar-collapse .navbar-nav,
  .tes247-operator .navbar-collapse .navbar-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  .tes247-admin .navbar-collapse .nav-item,
  .tes247-operator .navbar-collapse .nav-item,
  .tes247-admin .navbar-collapse .nav-link,
  .tes247-operator .navbar-collapse .nav-link {
    min-width: 0;
  }

  .tes247-admin .navbar-collapse .nav-link,
  .tes247-operator .navbar-collapse .nav-link {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
    justify-content: flex-start;
  }

  .tes247-admin .navbar-collapse .nav-link-title,
  .tes247-operator .navbar-collapse .nav-link-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tes247-admin .navbar-collapse .dropdown-menu,
  .tes247-operator .navbar-collapse .dropdown-menu {
    max-width: min(92vw, 320px);
  }
}

@media (min-width: 992px) {
  .tes247-admin .wrapper,
  .tes247-operator .wrapper {
    min-height: 100vh;
  }

  .tes247-admin .wrapper > .sticky-top,
  .tes247-operator .wrapper > .sticky-top {
    position: fixed;
    inset: 0 auto 0 0;
    width: 272px;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff;
    border-right: 1px solid var(--app-border);
    border-bottom: 0;
  }

  .tes247-admin .wrapper > .sticky-top > .navbar,
  .tes247-operator .wrapper > .sticky-top > .navbar {
    position: static !important;
    min-height: auto;
    border-bottom: 1px solid var(--app-border);
  }

  .tes247-admin .wrapper > .sticky-top > .navbar .container-xl,
  .tes247-operator .wrapper > .sticky-top > .navbar .container-xl {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px 18px;
  }

  .tes247-admin .navbar-toggler,
  .tes247-operator .navbar-toggler {
    display: none;
  }

  .tes247-admin .navbar-brand,
  .tes247-operator .navbar-brand {
    display: flex !important;
    justify-content: center;
    max-width: 100%;
    padding: 0 !important;
  }

  .tes247-admin .navbar-brand-image,
  .tes247-operator .navbar-brand-image {
    max-width: 168px;
    max-height: 58px;
  }

  .tes247-admin .navbar-nav.flex-row.order-md-last,
  .tes247-operator .navbar-nav.flex-row.order-md-last {
    width: 100%;
    margin: 0 !important;
    justify-content: center;
    padding-top: 12px;
    border-top: 1px solid var(--app-border);
  }

  .tes247-admin .navbar-expand-md,
  .tes247-operator .navbar-expand-md {
    width: 100%;
  }

  .tes247-admin .navbar-collapse,
  .tes247-operator .navbar-collapse {
    display: block !important;
    height: auto !important;
    visibility: visible !important;
  }

  .tes247-admin .navbar-collapse .navbar,
  .tes247-operator .navbar-collapse .navbar {
    padding: 14px 12px 18px;
  }

  .tes247-admin .navbar-collapse .container-xl,
  .tes247-operator .navbar-collapse .container-xl {
    display: block;
    padding-left: 0;
    padding-right: 0;
  }

  .tes247-admin .navbar-collapse .navbar-nav,
  .tes247-operator .navbar-collapse .navbar-nav {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .tes247-admin .navbar-collapse .nav-link,
  .tes247-operator .navbar-collapse .nav-link {
    width: 100%;
    min-height: 46px;
    justify-content: flex-start;
    padding: 12px 14px;
    border-radius: 8px;
  }

  .tes247-admin .navbar-collapse .nav-link-icon,
  .tes247-operator .navbar-collapse .nav-link-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 26px;
    margin-right: 10px;
  }

  .tes247-admin .navbar-collapse .nav-link-icon svg,
  .tes247-operator .navbar-collapse .nav-link-icon svg {
    margin-right: 0 !important;
  }

  .tes247-admin .navbar-collapse .dropdown-menu,
  .tes247-operator .navbar-collapse .dropdown-menu {
    position: static !important;
    width: 100%;
    margin-top: 6px;
    transform: none !important;
    box-shadow: none;
  }

  .tes247-admin .page-wrapper,
  .tes247-operator .page-wrapper {
    min-height: 100vh;
    margin-left: 272px;
  }

  .tes247-admin .page-wrapper > .container-xl,
  .tes247-admin .page-body > .container-xl,
  .tes247-operator .page-wrapper > .container-xl,
  .tes247-operator .page-body > .container-xl {
    max-width: 1320px;
  }
}

.tes247-student-bottom-nav {
  display: none;
}

@media (max-width: 767.98px) {
  .admin-app-shell,
  .student-app-shell {
    background: #f7f9fc !important;
  }

  .admin-app-shell .sticky-top,
  .student-app-shell .sticky-top {
    border-bottom: 1px solid var(--app-border);
  }

  .admin-app-shell .navbar > .container-xl,
  .student-app-shell .navbar > .container-xl {
    min-height: 60px;
  }

  .admin-app-shell .navbar-toggler,
  .student-app-shell .navbar-toggler {
    width: 42px;
    height: 42px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #fff;
  }

  .admin-app-shell .navbar-collapse .navbar,
  .student-app-shell .navbar-collapse .navbar {
    margin: 0 10px 12px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
  }

  .admin-app-shell .navbar-collapse .container-xl,
  .student-app-shell .navbar-collapse .container-xl {
    padding-left: 0;
    padding-right: 0;
  }

  .admin-app-shell .navbar-collapse .navbar-nav,
  .student-app-shell .navbar-collapse .navbar-nav {
    align-items: stretch;
    gap: 8px;
  }

  .admin-app-shell .navbar-collapse .nav-link,
  .student-app-shell .navbar-collapse .nav-link {
    min-height: 48px;
    padding: 12px;
    background: var(--app-surface-soft);
    border: 1px solid transparent;
    border-radius: 8px;
  }

  .admin-app-shell .navbar-collapse .nav-item.active > .nav-link,
  .student-app-shell .navbar-collapse .nav-item.active > .nav-link {
    background: var(--app-primary-soft);
    border-color: #bfdbfe;
  }

  .admin-app-shell .navbar-collapse .dropdown-menu,
  .student-app-shell .navbar-collapse .dropdown-menu {
    margin-top: 6px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--app-border);
  }

  .admin-app-shell .page-header,
  .student-app-shell .page-header {
    padding-top: 18px;
    padding-bottom: 10px;
  }

  .admin-app-shell .page-body,
  .student-app-shell .page-body {
    padding-top: 8px;
  }

  .admin-app-shell .card,
  .student-app-shell .card,
  .admin-app-shell .alert,
  .student-app-shell .alert {
    box-shadow: none;
  }

  .admin-app-shell .card-header,
  .admin-app-shell .card-body,
  .admin-app-shell .card-footer,
  .student-app-shell .card-header,
  .student-app-shell .card-body,
  .student-app-shell .card-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .admin-app-shell .btn,
  .student-app-shell .btn,
  .admin-app-shell .form-control,
  .admin-app-shell .form-select,
  .student-app-shell .form-control,
  .student-app-shell .form-select {
    min-height: 44px;
  }

  .admin-app-shell .table .btn,
  .student-app-shell .table .btn {
    min-height: 38px;
  }

  .tes247-student .page-wrapper {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .tes247-student-bottom-nav {
    position: fixed;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    z-index: 1040;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 8px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--app-border);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
    backdrop-filter: blur(12px);
  }

  .tes247-student-bottom-nav a {
    display: flex;
    min-width: 0;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    color: #64748b;
    border-radius: 12px;
    font-size: .68rem;
    font-weight: 750;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
  }

  .tes247-student-bottom-nav a.active,
  .tes247-student-bottom-nav a:hover,
  .tes247-student-bottom-nav a:focus {
    background: var(--app-primary-soft);
    color: var(--app-primary);
  }

  .tes247-student-bottom-nav svg {
    flex: 0 0 auto;
  }

  .student-system-shell .page-center {
    min-height: 100vh;
    padding: 16px 0;
  }

  .student-system-shell .container-xl,
  .student-system-shell .container-tight {
    padding-left: 14px;
    padding-right: 14px;
  }

  .student-system-shell .FieldContainer {
    --tblr-gutter-x: 0;
    --tblr-gutter-y: 12px;
  }

  .student-system-shell .card-header h3,
  .student-system-shell .card-title {
    font-size: 1rem;
  }

  .student-system-shell .form-floating,
  .student-system-shell .input-group,
  .student-system-shell .btn-list {
    width: 100%;
  }

  .student-system-shell .btn-list .btn,
  .student-system-shell .d-flex.justify-content-end .btn {
    width: 100%;
  }

  .tes247-admin .table-responsive,
  .tes247-operator .table-responsive {
    overflow: visible;
  }

  .tes247-admin .table-responsive > .table,
  .tes247-operator .table-responsive > .table {
    min-width: 0;
    display: block;
  }

  .tes247-admin .table-responsive > .table thead,
  .tes247-operator .table-responsive > .table thead {
    display: none;
  }

  .tes247-admin .table-responsive > .table tbody,
  .tes247-operator .table-responsive > .table tbody {
    display: grid;
    gap: 12px;
    padding: 12px;
  }

  .tes247-admin .table-responsive > .table tr,
  .tes247-operator .table-responsive > .table tr {
    display: grid;
    gap: 8px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: var(--app-shadow);
  }

  .tes247-admin .table-responsive > .table td,
  .tes247-operator .table-responsive > .table td {
    display: block;
    width: 100%;
    padding: 0 !important;
    border: 0 !important;
  }

  .tes247-admin .table-responsive > .table td .btn,
  .tes247-admin .table-responsive > .table td form,
  .tes247-operator .table-responsive > .table td .btn,
  .tes247-operator .table-responsive > .table td form {
    width: 100%;
  }
}
