/*
 * NSPS Portal responsive Bootstrap enhancement layer
 * Loaded last so it can provide one predictable mobile and accessibility pass
 * over legacy pages without changing their business logic.
 */

:root {
  --portal-mobile-header-height: 64px;
  --portal-mobile-dock-height: 72px;
  --portal-content-max: 1600px;
  --portal-touch-target: 44px;
  --portal-fluid-gutter: clamp(12px, 2.25vw, 32px);
  --portal-glass: rgba(255, 255, 255, .88);
  --portal-glass-line: rgba(255, 255, 255, .62);
  --portal-focus-ring: 0 0 0 4px rgba(var(--portal-primary-rgb, 8, 117, 80), .18);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.portal-shell,
body.portal-auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: auto;
}

body.portal-shell :where(a, button, input, select, textarea, [tabindex]):focus-visible,
body.portal-auth-page :where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid rgba(var(--portal-primary-rgb, 8, 117, 80), .42) !important;
  outline-offset: 3px;
  box-shadow: var(--portal-focus-ring) !important;
}

body.portal-shell :where(img, svg, video, canvas, iframe),
body.portal-auth-page :where(img, svg, video, canvas, iframe) {
  max-width: 100%;
}

/* A calmer, more dimensional Bootstrap surface system. */
body.portal-shell .content-wrapper {
  background:
    radial-gradient(circle at 94% 4%, rgba(var(--portal-primary-rgb, 8, 117, 80), .07), transparent 32rem),
    linear-gradient(180deg, rgba(255, 255, 255, .72), var(--portal-bg, #f5f9f7));
}

body.portal-shell .content-wrapper > .content,
body.portal-shell .content-wrapper > .portal-content-section,
body.portal-shell .content-wrapper > .container-fluid,
body.portal-shell .content > .container-fluid {
  width: 100%;
  max-width: var(--portal-content-max);
  margin-inline: auto;
}

body.portal-shell .card,
body.portal-shell .portal-card,
body.portal-shell .modal-content,
body.portal-shell .dropdown-menu {
  border: 1px solid rgba(15, 23, 42, .08) !important;
  box-shadow: 0 14px 40px rgba(15, 23, 42, .09) !important;
}

@media (hover: hover) and (pointer: fine) {
  body.portal-shell .card,
  body.portal-shell .portal-card,
  body.portal-shell .portal-dashboard-jump a,
  body.portal-shell .portal-dashboard-mini-card {
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  }

  body.portal-shell .card:hover,
  body.portal-shell .portal-card:hover,
  body.portal-shell .portal-dashboard-jump a:hover,
  body.portal-shell .portal-dashboard-mini-card:hover {
    transform: translateY(-3px);
    border-color: rgba(var(--portal-primary-rgb, 8, 117, 80), .18) !important;
    box-shadow: 0 22px 56px rgba(15, 23, 42, .13) !important;
  }
}

/* Bootstrap form controls: larger targets, clearer hierarchy, no iOS zoom. */
body.portal-shell .form-group > label,
body.portal-auth-page .form-group > label {
  margin-bottom: 8px;
  color: var(--portal-ink, #12211b);
  font-size: .82rem;
  font-weight: 850;
  letter-spacing: .015em;
}

body.portal-shell :where(.form-control, .custom-select, .select2-selection),
body.portal-auth-page :where(.form-control, .custom-select) {
  min-height: 50px;
  border: 1px solid rgba(15, 23, 42, .13) !important;
  border-radius: 15px !important;
  background-color: #fff !important;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

body.portal-shell :where(.form-control, .custom-select):focus,
body.portal-auth-page :where(.form-control, .custom-select):focus {
  border-color: rgba(var(--portal-primary-rgb, 8, 117, 80), .58) !important;
  box-shadow: var(--portal-focus-ring) !important;
}

body.portal-shell .input-group-text,
body.portal-auth-page .input-group-text {
  min-width: 50px;
  justify-content: center;
  border-color: rgba(15, 23, 42, .12) !important;
  color: var(--portal-primary, #087550);
  background: rgba(var(--portal-primary-rgb, 8, 117, 80), .065) !important;
}

body.portal-shell .input-group-prepend .input-group-text,
body.portal-auth-page .input-group-prepend .input-group-text {
  border-radius: 15px 0 0 15px !important;
}

body.portal-shell .input-group > :where(.form-control, .custom-select):not(:first-child),
body.portal-auth-page .input-group > :where(.form-control, .custom-select):not(:first-child) {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

body.portal-shell .input-group > :where(.form-control, .custom-select):not(:last-child),
body.portal-auth-page .input-group > :where(.form-control, .custom-select):not(:last-child) {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

body.portal-shell .input-group-append .btn,
body.portal-auth-page .input-group-append .btn {
  border-radius: 0 15px 15px 0 !important;
}

body.portal-shell .custom-control-label,
body.portal-auth-page .custom-control-label {
  min-height: 24px;
  line-height: 1.5;
}

/* Advanced Bootstrap button treatment with a restrained press response. */
body.portal-shell .btn,
body.portal-auth-page .btn {
  position: relative;
  min-height: var(--portal-touch-target);
  align-items: center;
  justify-content: center;
  gap: 7px;
  overflow: hidden;
  border-radius: 14px !important;
  font-weight: 800;
  touch-action: manipulation;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

body.portal-shell .btn:active,
body.portal-auth-page .btn:active {
  transform: translateY(1px) scale(.985) !important;
}

.portal-ui-ripple {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  pointer-events: none;
  background: currentColor;
  opacity: .18;
  transform: translate(-50%, -50%) scale(0);
  animation: portal-ui-ripple .58s ease-out forwards;
}

@keyframes portal-ui-ripple {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(18);
  }
}

/* Tables remain legible and scroll as a single touch surface. */
body.portal-shell .portal-table-scroll,
body.portal-shell .table-responsive {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .055);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--portal-primary-rgb, 8, 117, 80), .42) transparent;
}

body.portal-shell .portal-table-scroll > table,
body.portal-shell .table-responsive > table {
  margin-bottom: 0 !important;
}

body.portal-shell .table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
  color: var(--portal-primary-dark, #03261d);
  background: #f4faf7;
  border-bottom-width: 1px;
}

body.portal-shell .table tbody tr {
  transition: background-color .16s ease;
}

body.portal-shell .table tbody tr:hover {
  background: rgba(var(--portal-primary-rgb, 8, 117, 80), .035);
}

/* Tabs, pills and pagination become horizontally scrollable on narrow screens. */
body.portal-shell :where(.nav-tabs, .nav-pills:not(.nav-sidebar)) {
  max-width: 100%;
  flex-wrap: nowrap;
  gap: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

body.portal-shell :where(.nav-tabs, .nav-pills:not(.nav-sidebar))::-webkit-scrollbar {
  display: none;
}

body.portal-shell :where(.nav-tabs, .nav-pills:not(.nav-sidebar)) .nav-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 13px;
  font-weight: 750;
}

body.portal-shell .pagination {
  flex-wrap: wrap;
  gap: 5px;
}

body.portal-shell .page-link {
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px !important;
}

/* Fixed mobile navigation: fast access without reopening the sidebar. */
.portal-mobile-dock {
  display: none;
}

@media (max-width: 991.98px) {
  body.portal-shell:not(.nspsconnect-app-body) .main-header.navbar {
    min-height: var(--portal-mobile-header-height) !important;
    height: calc(var(--portal-mobile-header-height) + env(safe-area-inset-top, 0px)) !important;
    max-height: none !important;
    padding: env(safe-area-inset-top, 0px) max(10px, env(safe-area-inset-right, 0px)) 0 max(10px, env(safe-area-inset-left, 0px)) !important;
    border-bottom: 1px solid rgba(255, 255, 255, .16) !important;
    box-shadow: 0 12px 34px rgba(15, 23, 42, .18) !important;
  }

  body.portal-shell:not(.nspsconnect-app-body) .content-wrapper {
    padding-top: calc(var(--portal-mobile-header-height) + env(safe-area-inset-top, 0px) + 10px) !important;
    padding-bottom: calc(var(--portal-mobile-dock-height) + env(safe-area-inset-bottom, 0px) + 22px) !important;
  }

  body.portal-shell:not(.nspsconnect-app-body) .portal-mobile-dock {
    position: fixed;
    right: max(10px, env(safe-area-inset-right, 0px));
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    left: max(10px, env(safe-area-inset-left, 0px));
    z-index: 1038;
    min-height: var(--portal-mobile-dock-height);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    gap: 4px;
    padding: 7px;
    border: 1px solid var(--portal-glass-line);
    border-radius: 24px;
    background: var(--portal-glass);
    box-shadow: 0 18px 52px rgba(15, 23, 42, .22);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    transform: translateZ(0);
  }

  body.portal-shell:not(.nspsconnect-app-body) .portal-mobile-dock-item {
    position: relative;
    min-width: 0;
    min-height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 3px;
    border: 0;
    border-radius: 18px;
    color: #64748b !important;
    background: transparent;
    font-family: inherit;
    text-decoration: none !important;
    cursor: pointer;
    touch-action: manipulation;
  }

  body.portal-shell:not(.nspsconnect-app-body) .portal-mobile-dock-item i {
    font-size: 1.05rem;
    line-height: 1;
  }

  body.portal-shell:not(.nspsconnect-app-body) .portal-mobile-dock-item span {
    max-width: 100%;
    overflow: hidden;
    font-size: .66rem;
    font-weight: 850;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.portal-shell:not(.nspsconnect-app-body) .portal-mobile-dock-item.is-active,
  body.portal-shell:not(.nspsconnect-app-body) .portal-mobile-dock-item[aria-current="page"] {
    color: var(--portal-primary, #087550) !important;
    background: rgba(var(--portal-primary-rgb, 8, 117, 80), .10);
  }

  body.portal-shell:not(.nspsconnect-app-body) .portal-mobile-dock-item.is-active::before,
  body.portal-shell:not(.nspsconnect-app-body) .portal-mobile-dock-item[aria-current="page"]::before {
    content: "";
    position: absolute;
    top: 4px;
    width: 22px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--portal-primary, #087550), var(--portal-primary-2, #14b8a6));
  }

  body.portal-shell.portal-keyboard-open .portal-mobile-dock {
    opacity: 0;
    pointer-events: none;
    transform: translateY(120%);
  }

  body.portal-shell .main-sidebar {
    border-radius: 0 26px 26px 0;
    box-shadow: 22px 0 70px rgba(15, 23, 42, .28) !important;
  }

  body.portal-shell .portal-sidebar-backdrop {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }

  body.portal-shell .content,
  body.portal-shell .portal-content-section,
  body.portal-shell .container-fluid {
    padding-inline: var(--portal-fluid-gutter) !important;
  }

  body.portal-shell .row {
    margin-inline: calc(var(--portal-fluid-gutter) * -.28) !important;
  }

  body.portal-shell .row > [class*="col-"] {
    padding-inline: calc(var(--portal-fluid-gutter) * .28) !important;
  }

  body.portal-shell .modal-dialog,
  body.portal-shell .modal-lg,
  body.portal-shell .modal-xl {
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
    margin: 10px auto !important;
  }

  body.portal-shell .modal-content {
    max-height: calc(100dvh - 20px);
    overflow: hidden;
    border-radius: 24px !important;
  }

  body.portal-shell .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 767.98px) {
  body.portal-shell .card-header,
  body.portal-shell .card-footer,
  body.portal-shell .card-body {
    padding: 15px !important;
  }

  body.portal-shell .card-header {
    align-items: flex-start !important;
  }

  body.portal-shell .card-title {
    float: none !important;
    max-width: 100%;
    margin-bottom: 0;
    font-size: 1.02rem;
    overflow-wrap: anywhere;
  }

  body.portal-shell .card-tools,
  body.portal-shell .float-right,
  body.portal-shell .pull-right {
    float: none !important;
  }

  body.portal-shell .btn-group,
  body.portal-shell .btn-toolbar {
    max-width: 100%;
    flex-wrap: wrap;
    gap: 6px;
  }

  body.portal-shell .alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 0;
    border-radius: 17px !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
  }

  body.portal-shell .table {
    min-width: 680px;
    font-size: .86rem;
  }

  body.portal-shell .table.table-sm {
    min-width: 560px;
  }

  body.portal-shell .dataTables_wrapper .dataTables_filter input,
  body.portal-shell .dataTables_wrapper .dataTables_length select {
    min-height: 44px;
    margin: 5px 0 !important;
  }

  body.portal-shell :where(input, select, textarea, .form-control, .custom-select) {
    font-size: 16px !important;
  }
}

@media (max-width: 575.98px) {
  :root {
    --portal-fluid-gutter: 10px;
  }

  body.portal-shell .portal-page-hero,
  body.portal-shell .content-header,
  body.portal-shell .portal-dashboard-hero {
    margin-inline: 10px !important;
    padding: 18px !important;
    border-radius: 22px !important;
  }

  body.portal-shell .portal-page-hero h1,
  body.portal-shell .content-header h1,
  body.portal-shell .portal-dashboard-hero h1 {
    font-size: clamp(1.45rem, 8vw, 2rem) !important;
    line-height: 1.08 !important;
  }

  body.portal-shell .modal {
    align-items: flex-end;
  }

  body.portal-shell .modal-dialog:not(.modal-dialog-centered) {
    margin: auto 8px 8px !important;
    width: calc(100% - 16px) !important;
    max-width: calc(100% - 16px) !important;
  }

  body.portal-shell .modal-dialog:not(.modal-dialog-centered) .modal-content {
    border-radius: 26px 26px 20px 20px !important;
  }
}

@media (max-width: 380px) {
  body.portal-shell:not(.nspsconnect-app-body) .portal-mobile-dock {
    right: 6px;
    bottom: max(5px, env(safe-area-inset-bottom, 0px));
    left: 6px;
    gap: 1px;
    padding: 5px;
    border-radius: 21px;
  }

  body.portal-shell:not(.nspsconnect-app-body) .portal-mobile-dock-item span {
    font-size: .60rem;
  }
}

@media (max-width: 991.98px) and (orientation: landscape) and (max-height: 520px) {
  :root {
    --portal-mobile-header-height: 56px;
    --portal-mobile-dock-height: 62px;
  }

  body.portal-shell:not(.nspsconnect-app-body) .portal-mobile-dock {
    min-height: 62px;
  }

  body.portal-shell:not(.nspsconnect-app-body) .portal-mobile-dock-item {
    min-height: 48px;
  }
}

/* Login experience: Bootstrap card polish and better small-screen ordering. */
body.portal-auth-page .portal-auth-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, .76) !important;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .14) !important;
}

body.portal-auth-page .portal-auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--portal-primary, #087550), var(--portal-accent, #d8a72d), var(--portal-primary-2, #14b8a6));
}

body.portal-auth-page .portal-auth-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 22px;
}

body.portal-auth-page .portal-auth-trust span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid rgba(var(--portal-primary-rgb, 8, 117, 80), .12);
  border-radius: 999px;
  color: var(--portal-primary-dark, #03261d);
  background: rgba(var(--portal-primary-rgb, 8, 117, 80), .06);
  font-size: .72rem;
  font-weight: 850;
}

body.portal-auth-page .portal-password-toggle {
  width: 50px;
  min-width: 50px;
  min-height: 52px;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, .12);
  border-left: 0;
  border-radius: 0 15px 15px 0;
  color: var(--portal-primary, #087550);
  background: rgba(var(--portal-primary-rgb, 8, 117, 80), .055);
  cursor: pointer;
}

@media (max-width: 991.98px) {
  body.portal-auth-page .portal-auth-shell {
    width: min(760px, calc(100% - 24px));
    padding-top: max(14px, env(safe-area-inset-top, 0px));
    padding-bottom: max(22px, env(safe-area-inset-bottom, 0px));
  }

  body.portal-auth-page .portal-auth-hero {
    min-height: auto;
  }

  body.portal-auth-page .portal-auth-panel {
    order: -1;
  }

  body.portal-auth-page .portal-auth-hero h1 {
    font-size: clamp(2rem, 10vw, 3.5rem);
  }
}

@media (max-width: 575.98px) {
  body.portal-auth-page .portal-auth-shell {
    width: calc(100% - 16px);
    gap: 12px;
  }

  body.portal-auth-page .portal-auth-card,
  body.portal-auth-page .portal-auth-hero,
  body.portal-auth-page .portal-auth-mini-card {
    border-radius: 22px;
  }

  body.portal-auth-page .portal-auth-card,
  body.portal-auth-page .portal-auth-hero {
    padding: 20px;
  }

  body.portal-auth-page .portal-auth-card h2 {
    font-size: 1.65rem;
  }

  body.portal-auth-page .portal-auth-actions .btn,
  body.portal-auth-page .portal-auth-options a,
  body.portal-auth-page .portal-auth-main-button {
    width: 100%;
  }

  body.portal-auth-page .portal-auth-feature {
    min-height: 70px;
  }
}

/* Keep the specialist NSPSConnect chat UI in control of its own navigation. */
body.nspsconnect-app-body .portal-mobile-dock {
  display: none !important;
}

/*
 * Mobile page-scroll contract
 * ---------------------------
 * Setting only overflow-x on several nested containers makes browsers compute
 * overflow-y as auto. On touch devices those invisible nested scroll regions
 * can capture the swipe and stop the document from moving. Keep one vertical
 * scroll owner (the document) and let horizontal widgets accept both pan axes.
 */
@media (max-width: 991.98px) {
  html {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: clip !important;
    overflow-y: auto !important;
    overscroll-behavior-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  body.portal-shell:not(.nspsconnect-app-body):not(.modal-open):not(.sidebar-open),
  body.portal-auth-page:not(.modal-open) {
    position: relative !important;
    height: auto !important;
    max-height: none !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    overflow-x: clip !important;
    overflow-y: visible !important;
    overscroll-behavior-y: auto !important;
    touch-action: pan-y pinch-zoom !important;
  }

  body.portal-shell:not(.nspsconnect-app-body) :where(
    .wrapper,
    .content-wrapper,
    .content,
    .container,
    .container-fluid,
    .row,
    .portal-dashboard-modern,
    .portal-dashboard-page,
    .portal-content-section
  ) {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    overscroll-behavior-y: auto !important;
  }

  body.portal-shell:not(.nspsconnect-app-body) :where(
    .card,
    .portal-card,
    .portal-page-hero,
    .content-header,
    .portal-dashboard-hero
  ) {
    touch-action: pan-y pinch-zoom !important;
    overscroll-behavior-y: auto !important;
  }

  body.portal-shell .portal-table-scroll,
  body.portal-shell .table-responsive,
  body.portal-shell :where(.nav-tabs, .nav-pills:not(.nav-sidebar)) {
    overflow-y: auto !important;
    touch-action: pan-x pan-y pinch-zoom !important;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto !important;
  }

  body.portal-shell.sidebar-open,
  body.portal-shell.modal-open,
  body.portal-auth-page.modal-open {
    overflow: hidden !important;
    touch-action: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .portal-ui-ripple {
    display: none !important;
  }
}

@media print {
  .portal-mobile-dock {
    display: none !important;
  }
}

/*
 * Modern GUI visual refresh
 * -------------------------
 * Presentation-only polish for the shared portal shell. The page markup,
 * PHP handlers, forms, URLs, and existing component behaviours are unchanged.
 */
html body.portal-shell:not(.nspsconnect-app-body) {
  --portal-surface: #ffffff;
  --portal-surface-soft: rgba(255, 255, 255, .78);
  --portal-line-soft: rgba(15, 23, 42, .09);
  --portal-shadow-premium: 0 24px 70px rgba(15, 23, 42, .12);
  --portal-shadow-float: 0 14px 34px rgba(15, 23, 42, .10);
  color: var(--portal-ink, #12211b);
  background:
    radial-gradient(circle at 96% 2%, rgba(var(--portal-primary-rgb), .12), transparent 30rem),
    radial-gradient(circle at 3% 38%, rgba(var(--portal-accent-rgb), .08), transparent 26rem),
    linear-gradient(180deg, #f8fbfa 0%, #f3f7f5 56%, #edf4f1 100%) !important;
}

html body.portal-shell:not(.nspsconnect-app-body) .main-header {
  background:
    radial-gradient(circle at 9% -30%, rgba(var(--portal-accent-rgb), .42), transparent 20rem),
    linear-gradient(115deg, var(--portal-primary-dark), var(--portal-primary) 58%, var(--portal-primary-2)) !important;
  border-bottom: 1px solid rgba(255, 255, 255, .18) !important;
  box-shadow: 0 14px 34px rgba(var(--portal-primary-rgb), .20) !important;
  backdrop-filter: blur(18px) saturate(1.2);
}

html body.portal-shell:not(.nspsconnect-app-body) .main-header::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: -1px;
  left: 18px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--portal-accent), transparent);
  opacity: .82;
  pointer-events: none;
}

html body.portal-shell:not(.nspsconnect-app-body) .main-header .nav-link,
html body.portal-shell:not(.nspsconnect-app-body) .main-header .btn,
html body.portal-shell:not(.nspsconnect-app-body) .main-header .portal-sidebar-toggle {
  border: 1px solid rgba(255, 255, 255, .16) !important;
  background: rgba(255, 255, 255, .10) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .08) !important;
  backdrop-filter: blur(10px);
}

html body.portal-shell:not(.nspsconnect-app-body) .main-header .nav-link:hover,
html body.portal-shell:not(.nspsconnect-app-body) .main-header .btn:hover,
html body.portal-shell:not(.nspsconnect-app-body) .main-header .portal-sidebar-toggle:hover {
  background: rgba(255, 255, 255, .20) !important;
  border-color: rgba(255, 255, 255, .30) !important;
  transform: translateY(-1px);
}

html body.portal-shell:not(.nspsconnect-app-body) .main-sidebar {
  border-right: 1px solid rgba(255, 255, 255, .16) !important;
  box-shadow: 22px 0 64px rgba(var(--portal-primary-rgb), .24) !important;
}

html body.portal-shell:not(.nspsconnect-app-body) .brand-link {
  background: linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03)) !important;
  border-bottom-color: rgba(255, 255, 255, .16) !important;
}

html body.portal-shell:not(.nspsconnect-app-body) .portal-user-card {
  border-color: rgba(255, 255, 255, .20) !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .07)) !important;
  box-shadow: 0 18px 36px rgba(0, 0, 0, .12) !important;
  backdrop-filter: blur(14px);
}

html body.portal-shell:not(.nspsconnect-app-body) .nav-sidebar .nav-link {
  position: relative;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}

html body.portal-shell:not(.nspsconnect-app-body) .nav-sidebar .nav-link::before {
  content: "";
  width: 3px;
  height: 22px;
  position: absolute;
  left: 4px;
  top: 50%;
  border-radius: 99px;
  background: var(--portal-accent);
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity .18s ease;
}

html body.portal-shell:not(.nspsconnect-app-body) .nav-sidebar .nav-link:hover::before,
html body.portal-shell:not(.nspsconnect-app-body) .nav-sidebar .nav-link.active::before {
  opacity: 1;
}

html body.portal-shell:not(.nspsconnect-app-body) .content-wrapper {
  background:
    radial-gradient(circle at 92% 2%, rgba(var(--portal-primary-rgb), .09), transparent 32rem),
    linear-gradient(180deg, rgba(255, 255, 255, .52), rgba(238, 246, 242, .52)) !important;
}

html body.portal-shell:not(.nspsconnect-app-body) .portal-page-hero,
html body.portal-shell:not(.nspsconnect-app-body) .content-header,
html body.portal-shell:not(.nspsconnect-app-body) .portal-dashboard-hero {
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, .23) !important;
  box-shadow: var(--portal-shadow-premium) !important;
  background:
    radial-gradient(circle at 90% 12%, rgba(255, 255, 255, .19), transparent 18rem),
    radial-gradient(circle at 8% 8%, rgba(var(--portal-accent-rgb), .34), transparent 23rem),
    linear-gradient(135deg, var(--portal-primary-dark), var(--portal-primary) 58%, var(--portal-primary-2)) !important;
}

html body.portal-shell:not(.nspsconnect-app-body) .portal-page-hero::after,
html body.portal-shell:not(.nspsconnect-app-body) .content-header::after,
html body.portal-shell:not(.nspsconnect-app-body) .portal-dashboard-hero::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -115px;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 22px rgba(255, 255, 255, .035), 0 0 0 44px rgba(255, 255, 255, .025);
  pointer-events: none;
}

html body.portal-shell:not(.nspsconnect-app-body) .portal-breadcrumb,
html body.portal-shell:not(.nspsconnect-app-body) .content-header .breadcrumb {
  opacity: .9;
  letter-spacing: .01em;
}

html body.portal-shell:not(.nspsconnect-app-body) .portal-eyebrow {
  border: 1px solid rgba(255, 255, 255, .25) !important;
  background: rgba(255, 255, 255, .13) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .08);
  backdrop-filter: blur(10px);
}

html body.portal-shell:not(.nspsconnect-app-body) .portal-dashboard-hero-card {
  border: 1px solid rgba(255, 255, 255, .25) !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, .19), rgba(255, 255, 255, .08)) !important;
  box-shadow: 0 20px 42px rgba(0, 0, 0, .12) !important;
  backdrop-filter: blur(16px);
}

html body.portal-shell:not(.nspsconnect-app-body) .portal-dashboard-modern .portal-dashboard-jump a {
  position: relative;
  min-height: 84px;
  border-color: rgba(var(--portal-primary-rgb), .13) !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(248, 252, 250, .90)) !important;
  box-shadow: var(--portal-shadow-float) !important;
}

html body.portal-shell:not(.nspsconnect-app-body) .portal-dashboard-modern .portal-dashboard-jump a::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 14px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--portal-accent);
  opacity: .72;
}

html body.portal-shell:not(.nspsconnect-app-body) .portal-dashboard-modern .portal-dashboard-jump a:hover {
  box-shadow: 0 24px 48px rgba(var(--portal-primary-rgb), .18) !important;
}

html body.portal-shell:not(.nspsconnect-app-body) .portal-dashboard-modern .portal-dashboard-section {
  border-color: rgba(var(--portal-primary-rgb), .13) !important;
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--portal-primary-rgb), .055), transparent 20rem),
    rgba(255, 255, 255, .88) !important;
  box-shadow: 0 20px 54px rgba(15, 23, 42, .09) !important;
  backdrop-filter: blur(14px);
}

html body.portal-shell:not(.nspsconnect-app-body) .portal-section-heading {
  gap: 14px;
}

html body.portal-shell:not(.nspsconnect-app-body) .portal-section-heading h3,
html body.portal-shell:not(.nspsconnect-app-body) .card-title {
  letter-spacing: -.035em;
}

html body.portal-shell:not(.nspsconnect-app-body) .portal-icon-circle {
  border: 4px solid rgba(255, 255, 255, .64) !important;
  box-shadow: 0 12px 26px rgba(var(--portal-primary-rgb), .24) !important;
}

html body.portal-shell:not(.nspsconnect-app-body) .card,
html body.portal-shell:not(.nspsconnect-app-body) .portal-card,
html body.portal-shell:not(.nspsconnect-app-body) .info-box,
html body.portal-shell:not(.nspsconnect-app-body) .small-box {
  border-color: rgba(15, 23, 42, .085) !important;
  box-shadow: 0 16px 44px rgba(15, 23, 42, .085) !important;
}

html body.portal-shell:not(.nspsconnect-app-body) .card-header {
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(247, 250, 249, .88)) !important;
  border-bottom-color: rgba(var(--portal-primary-rgb), .10) !important;
}

html body.portal-shell:not(.nspsconnect-app-body) .table thead th,
html body.portal-shell:not(.nspsconnect-app-body) table.dataTable thead th {
  color: var(--portal-primary-dark) !important;
  background: linear-gradient(180deg, rgba(var(--portal-primary-rgb), .10), rgba(var(--portal-primary-rgb), .045)) !important;
  border-bottom-color: rgba(var(--portal-primary-rgb), .13) !important;
}

html body.portal-shell:not(.nspsconnect-app-body) .table tbody tr:hover {
  background: rgba(var(--portal-primary-rgb), .055) !important;
}

html body.portal-shell:not(.nspsconnect-app-body) .portal-action-bar .btn,
html body.portal-shell:not(.nspsconnect-app-body) .btn {
  min-height: 44px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .06) !important;
}

html body.portal-shell:not(.nspsconnect-app-body) .portal-action-bar .btn-primary,
html body.portal-shell:not(.nspsconnect-app-body) .portal-action-bar .btn-success {
  box-shadow: 0 14px 28px rgba(var(--portal-primary-rgb), .22) !important;
}

html body.portal-shell:not(.nspsconnect-app-body) .dropdown-menu {
  border: 1px solid rgba(var(--portal-primary-rgb), .13) !important;
  border-radius: 18px !important;
  padding: 8px !important;
  box-shadow: 0 22px 54px rgba(15, 23, 42, .15) !important;
  background: rgba(255, 255, 255, .96) !important;
  backdrop-filter: blur(18px);
}

html body.portal-shell:not(.nspsconnect-app-body) .dropdown-item {
  border-radius: 12px;
  font-weight: 700;
}

html body.portal-shell:not(.nspsconnect-app-body) .dropdown-item:hover,
html body.portal-shell:not(.nspsconnect-app-body) .dropdown-item:focus {
  color: var(--portal-primary-dark) !important;
  background: rgba(var(--portal-primary-rgb), .08) !important;
}

html body.portal-shell:not(.nspsconnect-app-body) .pagination .page-link {
  margin: 0 3px;
  border: 1px solid rgba(var(--portal-primary-rgb), .13) !important;
  border-radius: 11px !important;
  color: var(--portal-primary) !important;
  background: rgba(255, 255, 255, .86) !important;
  box-shadow: 0 6px 14px rgba(15, 23, 42, .05);
}

html body.portal-shell:not(.nspsconnect-app-body) .pagination .page-item.active .page-link,
html body.portal-shell:not(.nspsconnect-app-body) .pagination .page-link:hover {
  color: #fff !important;
  border-color: transparent !important;
  background: linear-gradient(135deg, var(--portal-primary), var(--portal-primary-2)) !important;
}

html body.portal-shell:not(.nspsconnect-app-body) .main-footer {
  border-top-color: rgba(var(--portal-primary-rgb), .10) !important;
  background: rgba(255, 255, 255, .72) !important;
  backdrop-filter: blur(12px);
}

/* Keep the refreshed login surface visually aligned with the portal shell. */
html body.portal-auth-page {
  background:
    radial-gradient(circle at 8% 10%, rgba(var(--portal-accent-rgb, 216, 167, 45), .24), transparent 28rem),
    radial-gradient(circle at 92% 4%, rgba(var(--portal-primary-rgb, 8, 117, 80), .20), transparent 34rem),
    linear-gradient(180deg, #ffffff 0%, var(--portal-bg, #f5f9f7) 52%, #edf7f2 100%) !important;
}

html body.portal-auth-page .portal-auth-hero {
  border-color: rgba(255, 255, 255, .32) !important;
  box-shadow: 0 28px 82px rgba(var(--portal-primary-rgb, 8, 117, 80), .22) !important;
}

html body.portal-auth-page .portal-auth-card,
html body.portal-auth-page .portal-auth-mini-card {
  border-color: rgba(var(--portal-primary-rgb, 8, 117, 80), .13) !important;
  box-shadow: 0 24px 68px rgba(15, 23, 42, .12) !important;
}

html body.portal-auth-page .portal-auth-main-button {
  box-shadow: 0 16px 30px rgba(var(--portal-primary-rgb, 8, 117, 80), .22) !important;
}

@media (max-width: 767.98px) {
  html body.portal-shell:not(.nspsconnect-app-body) .portal-dashboard-modern .portal-dashboard-section {
    border-radius: 23px !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .08) !important;
  }

  html body.portal-shell:not(.nspsconnect-app-body) .portal-page-hero::after,
  html body.portal-shell:not(.nspsconnect-app-body) .content-header::after,
  html body.portal-shell:not(.nspsconnect-app-body) .portal-dashboard-hero::after {
    right: -130px;
    bottom: -150px;
    width: 250px;
    height: 250px;
  }
}
