body.app-layout-bg {
    background: #f7f8fa;
}

body.app-layout-bg .app-layout-content {
    background: #f7f8fa;
}

.offcanvas-body .navbar-nav-font-bottom .nav-item{
    width: 100% !important;
    border-bottom:1px solid #242e5c;
}

/* Apply Source Sans 3 to all heading elements */
h1, h2, h3, h4, h5, h6 {
    font-family: "Source Sans 3", sans-serif !important;
    color: var(--bs-primary-dark);
}

/* Apply Source Sans 3 to elements with Bootstrap heading classes */
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: "Source Sans 3", sans-serif !important;
    color: var(--bs-primary-dark);
}

.dashboard-card-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 0.75rem;
  margin: 0;
  width: 100%;
}

.dashboard-card-tabs .nav-item {
  min-width: 0;
}

.dashboard-card-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 7.5rem;
  padding: 1rem;
  border: 1px solid var(--bs-light-50) !important;
  border-radius: 8px !important;
  background: var(--bs-body-bg);
  box-shadow: 0 1px 4px var(--bs-primary-25);
  color: var(--bs-primary-dark) !important;
  font-family: "Source Sans 3", sans-serif !important;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.dashboard-card-tab:hover,
.dashboard-card-tab:focus {
  border-color: var(--bs-primary-50) !important;
  box-shadow: 0 4px 12px var(--bs-primary-25);
  color: var(--bs-primary) !important;
}

.dashboard-card-tab.active {
  border-color: var(--bs-primary) !important;
  background: var(--bs-light-25);
  color: var(--bs-primary) !important;
  box-shadow: 0 5px 16px var(--bs-primary-25);
}

.dashboard-card-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  background: var(--bs-light-75);
  color: var(--bs-primary);
  font-size: 1rem;
}

.dashboard-card-tab-label {
  overflow-wrap: anywhere;
}

.tab-content#dashboardTabsContent {
  margin-top: 1rem;
  max-height: calc(100vh - 10rem);
  overflow-y: auto;
  padding: 1rem;
  border: 1px solid var(--bs-light-50);
  border-radius: 8px;
  background: var(--bs-body-bg);
  -webkit-overflow-scrolling: touch;
}

.profile-overview {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--bs-light-50);
  border-radius: 8px;
  background: var(--bs-light-25);
}

.profile-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: 8px;
  background: var(--bs-primary);
  color: var(--bs-white);
  font-family: "Source Sans 3", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  text-transform: uppercase;
}

.profile-overview-main {
  min-width: 0;
  flex: 1 1 auto;
}

.profile-overview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  color: var(--bs-secondary-color);
  font-size: 0.95rem;
}

.profile-overview-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-edit-action {
  flex: 0 0 auto;
}

.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.profile-info-section {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--bs-light-50);
  border-radius: 8px;
  background: var(--bs-body-bg);
}

.profile-info-section-wide {
  grid-column: 1 / -1;
}

.profile-section-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.profile-section-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--bs-primary-25);
  color: var(--bs-primary);
}

.profile-detail-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.profile-detail-list-wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.25rem;
}

.profile-detail-list div {
  min-width: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--bs-light-50);
}

.profile-detail-list dt {
  margin-bottom: 0.2rem;
  color: var(--bs-secondary-color);
  font-size: 0.85rem;
  font-weight: 700;
}

.profile-detail-list dd {
  margin-bottom: 0;
  color: var(--bs-body-color);
  overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
  .profile-overview {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-edit-action {
    width: 100%;
  }

  .profile-info-grid,
  .profile-detail-list-wide {
    grid-template-columns: 1fr;
  }
}

/* Box styling (you already have similar via border/rounded utilities) */
.profile-section {
  /* optional extra tweaks */
  margin-bottom: 1.5rem;
}

.openings-table-wrapper {
    overflow-x: auto;
}

.openings-table th,
.openings-table td {
    vertical-align: middle;
    white-space: normal;
    overflow-wrap: anywhere;
}
@media (max-width: 767.98px) {
    .openings-table {
        width: 100%;
        border: 0;
    }
    .openings-table thead {
        display: none;
    }
    .openings-table tbody {
        display: block;
    }
    .openings-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--bs-light-50);
        border-radius: 0.75rem;
        background: var(--bs-body-bg);
        box-shadow: 0 0 0.35rem rgba(0,0,0,0.08);
        overflow: hidden;
    }
    .openings-table tbody tr td {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 0.75rem;
        align-items: center;
        padding: 0.85rem;
        border-top: 1px solid var(--bs-light-50);
    }
    .openings-table tbody tr td:first-child {
        border-top: 0;
    }
    .openings-table tbody tr td::before {
        content: attr(data-label);
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--bs-secondary);
        white-space: nowrap;
    }
    .openings-table tbody tr td .openings-cell-body {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        min-height: calc(2 * 1.15em);
    }
    .openings-table tbody tr td:last-child {
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }
    .openings-table tbody tr td:last-child::before {
        display: none;
    }
    .openings-table tbody tr td .btn {
        width: 100%;
        min-width: 0;
    }
}

/* Narrower preference column on large screens, but keep selects usable */
.subject-pref-select {
  min-width: 220px;
}

.availability-table-wrap {
  margin-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
}

.availability-table {
  min-width: 980px;
  margin-bottom: 0;
}

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

.availability-table thead th:first-child,
.availability-table tbody th[scope="row"] {
  position: sticky;
  left: 0;
  z-index: 4;
  min-width: 7rem;
  background: var(--bs-body-bg);
}

.availability-table thead th:first-child {
  z-index: 5;
}

.availability-table .pref-select {
  min-width: 7.5rem;
}

@media (max-width: 575.98px) {
  .availability-table {
    min-width: 760px;
  }

  .availability-table thead th,
  .availability-table tbody th,
  .availability-table td {
    padding: 0.4rem;
  }

  .availability-table thead th:first-child,
  .availability-table tbody th[scope="row"] {
    min-width: 3.5rem;
  }

  .availability-table .pref-select {
    min-width: 2.5rem;
  }
}

@media (max-width: 575.98px) {
  /* Hide table header on very small screens */
  .pref-table thead {
    display: none;
  }

  /* Make each row a block with some spacing */
  .pref-table tr {
    display: block;
    margin-bottom: 0.75rem;
  }

  /* Stack the cells vertically */
  .pref-table td {
    display: block;
    width: 100%;
  }

  /* Optional: adjust padding for a tighter layout */
  .pref-table td:first-child {
    padding-bottom: 0.25rem;
  }
}

/* Scrollable form area */
.form-scroll {
  max-height: 60vh;      /* adjust as needed */
  overflow-y: auto;
}

/* Nice scroll behaviour on touch devices */
.form-scroll {
  -webkit-overflow-scrolling: touch;
}

/* Ensure inner content does not stick to the right edge */
.form-scroll {
  padding-right: 0.5rem;
}


/* Make the primary button text a bit more prominent */
button[type="button"].btn-primary {
  font-weight: 600;
}

/* Grey rectangular header background for the subject preferences page */
.page-header-box {
  background-color: #f1f3f5;           /* light grey */
  border: 1px solid var(--bs-light-50);
  border-radius: 0.75rem;
  padding: 1rem;
  width: 100%;
}

/* Make the section heading (legend) look like text-primary */
.profile-section legend {
  color: var(--bs-primary) !important; /* same as .text-primary */
  font-weight: 600;                    /* optional: emphasise */
  font-size: 1.5rem;                     /* optional */
}

.profile-section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.profile-section-title i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--bs-primary-25);
  color: var(--bs-primary);
  font-size: 0.95rem;
}

.profile-section > .row + .row {
  margin-top: 0.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bs-light-50);
}

.profile-required-note {
  margin: 0 0 1rem;
  color: var(--bs-secondary-color);
  font-size: 0.95rem;
}

.profile-note {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.8rem;
  border-left: 4px solid var(--bs-info);
  border-radius: 0 8px 8px 0;
  background: var(--bs-light-25);
  color: var(--bs-secondary-color);
  font-size: 0.95rem;
  line-height: 1.35;
}

.profile-note b {
  color: var(--bs-primary-dark);
}

.profile-current-file {
  margin-top: 1.8rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--bs-light-50);
  border-radius: 8px;
  background: var(--bs-light-25);
}

.profile-current-file-label {
  margin-bottom: 0.25rem;
  color: var(--bs-secondary-color);
  font-size: 0.85rem;
  font-weight: 700;
}

.profile-current-file-link {
  display: inline-block;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.profile-current-file-help {
  margin-top: 0.35rem;
  color: var(--bs-secondary-color);
  font-size: 0.9rem;
}

.app-review-scroll {
  max-height: 55vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.profile-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin: 1.5rem -1.5rem -1.5rem;
  padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--bs-light-50);
  border-radius: 0 0 12px 12px;
  background: var(--bs-body-bg);
  /* box-shadow: 0 -4px 12px var(--bs-primary-25); */
  box-shadow: 0 1px 8px var(--bs-primary-25);
}

.profile-sticky-actions .btn {
  min-width: 9rem;
  font-weight: 600;
}

.profile-leave-modal .modal-content {
  border: 1px solid var(--bs-light-50);
  border-radius: 12px;
  /* Glowing too much */
  /* box-shadow: 0 12px 32px var(--bs-primary-25); */
}

.profile-leave-modal-header {
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 0;
}

.profile-leave-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.profile-leave-modal-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  background: var(--bs-warning-bg-subtle);
  color: var(--bs-warning-dark);
  font-size: 1.1rem;
}

.profile-leave-modal-body {
  padding: 0 1.25rem 1rem 4.6rem;
  font-size: 1rem;
}

.profile-leave-modal-footer {
  gap: 0.75rem;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--bs-light-50);
}

.profile-leave-modal-footer .btn {
  font-weight: 600;
}

@media (max-width: 575.98px) {
  .profile-sticky-actions {
    flex-direction: column-reverse;
  }

  .profile-sticky-actions .btn {
    width: 100%;
  }

  .profile-leave-modal-body {
    padding-left: 1.25rem;
  }

  .profile-leave-modal-footer {
    flex-direction: column;
  }

  .profile-leave-modal-footer .btn {
    width: 100%;
  }
}

.pref-1 {
  background-color: var(--bs-success);
  border-color: var(--bs-primary);
  color: var(--bs-primary); /* Bootstrap success */
}
.pref-2 {
  background-color: var(--bs-warning);
  border-color: var(--bs-primary);
  color: var(--bs-primary); /* Bootstrap success */
}
.pref-3 {
  background-color: var(--bs-danger-50);
  border-color: var(--bs-primary);
  color: var(--bs-primary); /* Bootstrap success */
}

.alert-error {
  --bs-alert-color: var(--bs-danger-text-emphasis);
  --bs-alert-bg: var(--bs-danger-bg-subtle);
  --bs-alert-border-color: var(--bs-danger-border-subtle);
  --bs-alert-link-color: var(--bs-danger-text-emphasis);
}

.withdraw_application {
  --bs-btn-color: var(--bs-danger-dark);
  --bs-btn-border-color: var(--bs-danger-dark);
  /* --bs-btn-hover-color: var(--bs-white);
  --bs-btn-hover-bg: var(--bs-danger-dark); */
  --bs-btn-hover-border-color: var(--bs-danger-dark);
  --bs-btn-focus-shadow-rgb: var(--bs-danger-dark-rgb);
  --bs-btn-active-color: var(--bs-white);
  --bs-btn-active-bg: var(--bs-danger-dark);
  --bs-btn-active-border-color: var(--bs-danger-dark);
}

.cancel-application.btn-outline-danger {
  --bs-btn-color: var(--bs-danger-dark);
  --bs-btn-border-color: var(--bs-danger-dark);
  --bs-btn-hover-color: var(--bs-white);
  --bs-btn-hover-bg: var(--bs-danger-dark);
  --bs-btn-hover-border-color: var(--bs-danger-dark);
  --bs-btn-focus-shadow-rgb: var(--bs-danger-dark-rgb);
  --bs-btn-active-color: var(--bs-white);
  --bs-btn-active-bg: var(--bs-danger-dark);
  --bs-btn-active-border-color: var(--bs-danger-dark);
}

.app-pretty-page-shell {
  --app-pretty-border: var(--bs-light-50);
  --app-pretty-surface: var(--bs-light-25);
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 1.5rem 1.5rem;
  background: var(--bs-body-bg);
  border: 1px solid var(--app-pretty-border);
  border-radius: 12px;
  /* box-shadow: 0 1px 8px var(--bs-primary-25); */
  box-shadow: 0 1px 20px var(--bs-primary-50);
} 

.app-pretty-page-shell-narrow {
  max-width: 950px;
  margin-top: 3rem; 
}

/* Login specific styles */
.login-card {
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 1px 20px var(--bs-primary-25);
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-light-50);
}

/* Move the login card further down from the top */
.login-card.app-pretty-page-shell {
    margin-top: 6rem; 
}

.login-card.app-pretty-page-shell-narrow h2 {
    margin-bottom: 0.35rem;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: "Source Sans 3", sans-serif !important;
    color: var(--bs-primary-dark) !important;
}

.login-card .form-control,
.login-card .form-select {
    border-radius: 8px;
    padding: 0.5rem;
}

/* .login-card .btn {
    font-weight: bold;
    text-decoration: none !important;
    padding: 0.4rem !important;
} */

.login-links { text-align: center; margin-top: 1rem; }

.login-page-layout.app-pretty-page-shell {
  max-width: 100%;
  margin-top: 1.5rem;
}

.boldtxt {
  font-weight: 700;
}

.login-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.login-page-layout .login-card {
  max-width: none;
  margin-top: 0;
}

.login-panel {
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--bs-light-50);
  border-radius: 12px;
  background: var(--bs-light-25);
}

.login-faculty-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.login-faculty-list li + li {
  margin-top: 0.35rem;
}

.login-faculty-list a {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  /* padding: 0.35rem 0; */
  font-weight: 600;
  text-decoration: none;
}

.login-faculty-list a span {
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--bs-primary);
}

.login-side-heading {
  margin-bottom: 0.85rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: "Source Sans 3", sans-serif;
  color: var(--bs-primary-dark);
}

.login-side-link {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.login-side-link i {
  margin-top: 0.2rem;
  color: var(--bs-primary);
}

.login-side-note {
  margin-top: 0.35rem;
  margin-bottom: 0.85rem;
  line-height: 1.55;
}

@media (max-width: 991.98px) {
  .login-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-columns > * {
    width: 100%;
    max-width: 100%;
  }

  .login-columns > .login-card {
    max-width: none;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

@media (max-width: 575.98px) {
  .login-card { padding: 1rem; margin: 0 0.5rem; }
  .login-page-layout .login-card { margin: 0; }
}

.card-text {
  max-height: 10rem;
  overflow-y: auto;
}
