/* AXIOMBYTE SMS final fit/alignment layer.
   Loaded after page-specific styles so text stays on one line, while wide
   tables and panels scroll instead of breaking layout alignment. */
*, *::before, *::after {
  box-sizing: border-box;
}

:where(
  body,
  .main,
  .content,
  main,
  section,
  article,
  .card,
  .panel,
  .modal,
  .modal__body,
  .card__body,
  .page-head,
  .toolbar,
  .form-grid,
  .grid,
  .mini-grid,
  .field,
  .table-tools,
  .users-tools,
  .legacy-filter
) {
  min-width: 0 !important;
  max-width: 100%;
}

:where(
  h1, h2, h3, h4, h5, h6,
  p, label, legend, small,
  span, strong, b, em,
  a, li, dd, dt,
  .card, .panel, .field,
  .page-head, .ph-actions,
  .modal__head, .modal__body,
  .staff-profile-identity,
  .clearance-form-tile,
  .student-clearance-summary,
  .privilege-user,
  .profile-mode-note
) {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  word-break: normal;
}

:where(
  .table-wrap,
  .table-scroll,
  .student-table-wrapper,
  .users-table-wrap,
  .legacy-table-wrap,
  .records-table-wrap,
  .score-table-wrap,
  .super-table-wrap,
  .clearance-table-wrap,
  .archive-table-wrap,
  .subject-assignment-scroll
) {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

:where(
  table,
  .tbl,
  .student-table,
  .users-table,
  .legacy-table,
  .records-table,
  .score-table,
  .super-table,
  .clearance-table,
  .archive-table,
  .subject-table
) {
  max-width: none;
  border-collapse: collapse;
}

:where(
  table,
  .tbl,
  .student-table,
  .users-table,
  .legacy-table,
  .records-table,
  .score-table,
  .super-table,
  .clearance-table,
  .archive-table
) :where(th, td) {
  vertical-align: middle !important;
  line-height: 1.32 !important;
}

:where(
  .tbl,
  .student-table,
  .users-table,
  .legacy-table,
  .records-table,
  .score-table,
  .super-table,
  .clearance-table,
  .archive-table
) :where(th, td):not(.action-column):not(.action-cell) {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  overflow-wrap: normal !important;
}

:where(
  .row-actions,
  .action-buttons,
  .review-actions,
  .ph-actions,
  .btn-row,
  .privilege-actions,
  .edit-actions
) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

:where(.action-column, .action-cell) {
  text-align: center;
  white-space: normal !important;
  overflow: visible !important;
}

.student-table .action-buttons {
  display: inline-flex !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  gap: 7px !important;
}

.student-table .action-btn {
  flex: 0 0 auto !important;
}

:where(
  button,
  .btn,
  .legacy-btn,
  .legacy-action,
  .footer-btn,
  .footer-action,
  .action-btn,
  .cass-blue-btn,
  .upload-btn,
  .filter-btn,
  .btn-refresh,
  .btn-update,
  .template-link,
  input[type="submit"],
  input[type="button"],
  input[type="reset"]
) {
  max-width: 100% !important;
  min-width: 0 !important;
  width: auto;
  height: auto !important;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.15 !important;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

:where(
  button,
  .btn,
  .legacy-btn,
  .legacy-action,
  .footer-btn,
  .footer-action,
  .action-btn,
  .cass-blue-btn,
  .upload-btn,
  .filter-btn
) > :where(span, strong, b) {
  min-width: 0;
  max-width: 100%;
  line-height: 1.15 !important;
}

:where(input, select, textarea, .input, .select, .multi-dropdown__trigger) {
  max-width: 100%;
  min-width: 0;
}

:where(.photo-box img, .student-photo img, .staff-profile-photo-view img, .edit-photo-preview img, .ts-passport img, .pdf-passport img) {
  max-width: 100%;
  max-height: 100%;
}

@media (max-width: 768px) {
  :where(.page-head, .toolbar, .table-tools, .users-tools, .legacy-filter, .student-footer-actions) {
    align-items: stretch !important;
  }

  :where(.ph-actions, .btn-row, .row-actions, .action-buttons, .review-actions) {
    justify-content: flex-start;
  }

  :where(.content, .clearance-wrap) {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}

/* Final requested color enforcement */
:root {
  --brand: #002B4C;
  --brand-dark: #001D33;
  --brand-soft: rgba(0, 43, 76, .12);
  --accent: #002B4C;
  --bg: #C0EBFF;
  --surface: #C0EBFF;
  --surface-2: rgba(255, 255, 255, .45);
  --border: #002B4C;
  --text: #002B4C;
  --text-soft: #002B4C;
  --text-faint: rgba(0, 43, 76, .72);
}

html,
body,
.main,
.content,
main,
section,
.page-shell,
.docs-layout,
.login-shell {
  background: #C0EBFF !important;
  color: #002B4C !important;
}

:where(body, body *) {
  color: #002B4C;
}

:where(.sidebar, .mobile-sidebar, .sidebar#sidebar) {
  background: #F59E71 !important;
  border-color: #002B4C !important;
}

:where(.sidebar *, .mobile-sidebar *, .nav__title, .nav__items a, .nav__items a i, .sidebar__brand, .sidebar__brand small) {
  color: #002B4C !important;
}

:where(.nav__items a:hover, .nav__items a.active, .nav__title:hover) {
  background: rgba(192, 235, 255, .65) !important;
  color: #002B4C !important;
}

:where(
  button,
  .btn,
  .legacy-btn,
  .legacy-action,
  .footer-btn,
  .footer-action,
  .action-btn,
  .qa-action-btn,
  .qa-save,
  .cass-blue-btn,
  .upload-btn,
  .filter-btn,
  .btn-refresh,
  .btn-update,
  .template-link,
  .signup-btn,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  a.btn
):not(.sidebar-close):not(.mobile-close-button):not(.modal__close) {
  background: #002B4C !important;
  border-color: #002B4C !important;
  color: #C0EBFF !important;
}

:where(
  button,
  .btn,
  .legacy-btn,
  .legacy-action,
  .footer-btn,
  .footer-action,
  .action-btn,
  .qa-action-btn,
  .qa-save,
  .cass-blue-btn,
  .upload-btn,
  .filter-btn,
  .btn-refresh,
  .btn-update,
  .template-link,
  .signup-btn,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  a.btn
) :where(i, span, strong, b) {
  color: #C0EBFF !important;
}

:where(
  .card,
  .panel,
  .modal,
  .modal__box,
  .legacy-panel,
  .records-card,
  .manage-card,
  .profile-card,
  .users-card,
  .score-panel,
  .clearance-card,
  .archive-card,
  .student-clearance-summary,
  .clearance-form-tile,
  .staff-profile-card,
  .quick,
  .tile,
  .stat,
  .mini,
  .profile-tile,
  .profile-mini,
  .topbar,
  .site-header,
  .usermenu__btn,
  .usermenu__list,
  .input,
  .select,
  .textarea,
  input,
  select,
  textarea,
  .search,
  .dropzone,
  .photo-box,
  .table-wrap,
  .student-table-wrapper,
  .users-table-wrap,
  .legacy-table-wrap,
  .records-table-shell,
  .records-table-wrap,
  .score-table-wrap,
  .super-table-wrap,
  .clearance-table-wrap,
  .archive-table-wrap,
  table,
  .tbl,
  th,
  td
) {
  border-color: #002B4C !important;
}

:where(.card, .panel, .modal, .legacy-panel, .topbar, .site-header, .usermenu__list, input, select, textarea, .input, .select, .textarea, .search) {
  background-color: rgba(255, 255, 255, .42) !important;
}

:where(table, .tbl, .student-table, .users-table, .legacy-table, .records-table, .score-table, .super-table, .clearance-table, .archive-table) {
  background: rgba(255, 255, 255, .38) !important;
}

:where(table, .tbl, .student-table, .users-table, .legacy-table, .records-table, .score-table, .super-table, .clearance-table, .archive-table) :where(th, td) {
  border-color: #002B4C !important;
  color: #002B4C !important;
}

:where(table, .tbl, .student-table, .users-table, .legacy-table, .records-table, .score-table, .super-table, .clearance-table, .archive-table) thead :where(th, td),
.card__head,
.modal__head,
.panel__head {
  background: rgba(245, 158, 113, .55) !important;
  color: #002B4C !important;
  border-color: #002B4C !important;
}
