.impersonation-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 11000;
  background: #fff3cd;
  color: #533f03;
  border-top: 2px solid #d39e00;
  padding: 14px 20px;
  box-shadow: 0 -3px 16px #0002;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
body.is-impersonating { padding-bottom: 150px; }
.impersonation-context { min-width: 0; max-width: min(850px, 100%); overflow-wrap: anywhere; }
.impersonation-reason { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-action-notice {
  position: fixed;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11001;
  width: min(620px, calc(100% - 30px));
  padding: 18px 22px;
  background: #fff3cd;
  color: #533f03;
  border: 1px solid #d39e00;
  border-radius: 8px;
  box-shadow: 0 4px 20px #0002;
}
.portal-pending-panel { padding: 24px; border: 1px solid #f0d69a; background: linear-gradient(135deg, #fffdf7, #fff9e9); border-radius: 16px; margin-bottom: 24px; box-shadow: 0 8px 24px rgba(32, 56, 85, .06); }
.portal-pending-panel td { vertical-align: middle; }
.portal-simulate-form { min-width: 170px; padding-top: 10px; }
.portal-review-shortcut { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; margin: 8px; color: #333; }
.portal-review-count { display: inline-flex; align-items: center; justify-content: center; background: #d62839; color: #fff; border: 2px solid #fff; border-radius: 999px; min-width: 22px; height: 22px; text-align: center; padding: 0 5px; font-size: 11px; font-weight: 700; line-height: 1; box-shadow: 0 2px 7px rgba(214,40,57,.3); vertical-align: middle; }
.portal-review-count[hidden] { display: none; }
.admin-sidebar-nav .portal-review-count { margin-left: auto; }
.portal-review-menu-item { background: #fff8f8; }
.portal-review-menu-item .nav-link { color: #8f1d2c !important; }
#personal, #clubs, #permissions, #pending-permissions-title { scroll-margin-top: 150px; }

.portal-page { background: #f5f7fa; }
.portal-hero { margin-top: 100px; padding: 38px 0; color: #fff; background: linear-gradient(125deg, #143d63 0%, #1f6682 62%, #2d8794 100%); }
.portal-hero h1 { color: #fff; font-weight: 650; margin-bottom: 8px; }
.portal-hero p { margin: 0; color: rgba(255,255,255,.82); }
.portal-shell { padding-top: 32px; padding-bottom: 48px; }
.portal-card { border: 1px solid #e5ebf1; border-radius: 16px; box-shadow: 0 8px 28px rgba(32,56,85,.07); overflow: hidden; background: #fff; }
.portal-card + .portal-card { margin-top: 22px; }
.portal-card .card-body { padding: 26px; }
.portal-card-title { display: flex; align-items: center; gap: 10px; color: #183b5b; font-size: 1.15rem; font-weight: 650; margin-bottom: 20px; }
.portal-card-title i { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; color: #176a7b; background: #eaf6f7; }
.portal-status-list { display: grid; gap: 10px; }
.portal-status-item { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 17px; border: 1px solid #e8edf2; border-radius: 12px; background: #fbfcfd; }
.portal-status-meta { color: #6b7785; font-size: 13px; }
.portal-choice-card { height: 100%; padding: 28px; border: 1px solid #e3eaf0; border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(32,56,85,.06); }
.portal-choice-icon { width: 50px; height: 50px; display: inline-flex; align-items: center; justify-content: center; border-radius: 14px; color: #176a7b; background: #e9f6f7; font-size: 22px; margin-bottom: 18px; }
.portal-section-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.portal-section-nav a { padding: 9px 15px; color: #31546f; background: #fff; border: 1px solid #dce5ec; border-radius: 999px; }
.portal-section-nav a:hover { color: #fff; background: #176a7b; text-decoration: none; }
.portal-empty { padding: 22px; text-align: center; color: #788693; background: #f8fafc; border: 1px dashed #ccd7e0; border-radius: 12px; }
.portal-table thead th { border-top: 0; background: #f3f7fa; color: #40566a; font-size: 13px; white-space: nowrap; }
.portal-table td { vertical-align: middle; }
.portal-pill { display: inline-flex; padding: 4px 10px; border-radius: 999px; color: #1c6170; background: #e9f6f7; font-size: 12px; font-weight: 600; }
.portal-pill.is-pending { color: #7c5700; background: #fff3cf; }
.portal-pill.is-muted { color: #5d6874; background: #eef1f4; }

/* Administration and permission pages share one readable visual rhythm. */
body.admin-layout { color: #263f53; }
body.admin-layout .admin-sidebar-nav { border: 1px solid #dfe8ef; border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(32,56,85,.06); overflow: hidden; }
body.admin-layout .admin-sidebar-nav .list-group-item { border: 0; border-left: 3px solid transparent; padding: 11px 16px; font-size: .96rem; line-height: 1.5; }
body.admin-layout .admin-sidebar-nav .list-group-item:hover,
body.admin-layout .admin-sidebar-nav .list-group-item:focus-visible { color: #116c7b; background: #eef8f9; border-left-color: #147988; }
body.admin-layout .admin-nav-group { font-size: .88rem; letter-spacing: .02em; }
body.admin-layout .portal-card { border-color: #dce7ee; box-shadow: 0 12px 30px rgba(28,65,88,.075); }
body.admin-layout .portal-table { font-size: .95rem; line-height: 1.55; }
body.admin-layout .portal-table thead th { font-size: .9rem; font-weight: 700; }
body.admin-layout .portal-table td,
body.admin-layout .portal-table th { padding: 12px 14px; }
body.admin-layout .portal-table tbody tr:hover { background: #f6fafc; }
body.admin-layout .portal-pill { font-size: .85rem; }
body.admin-layout .form-control { font-size: 1rem; min-height: 40px; }
body.admin-layout .portal-empty { font-size: .97rem; }
.role-scope-card { background: #f8fbfc; transition: border-color .15s, box-shadow .15s; }
.role-scope-card:hover { border-color: #9ecbd1; box-shadow: 0 6px 18px rgba(28,65,88,.08); }
.search-select { position: relative; margin-bottom: 20px; }
.search-select-native { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 1px !important; padding: 0 !important; margin: 0 !important; opacity: 0; pointer-events: none; }
.portal-card:has(.search-select) { overflow: visible; }
.search-select-trigger { text-align: left; white-space: normal; height: auto; padding-right: 32px; min-height: 42px; }
.search-select-trigger::after { content: '\25BE'; position: absolute; right: 12px; top: 10px; }
.search-select-popup { position: absolute; top: 100%; left: 0; right: 0; z-index: 1050; padding: 10px; background: #fff; border: 1px solid #b6cdd8; border-radius: 8px; box-shadow: 0 8px 24px #183b5b26; }
.search-select-popup[hidden] { display: none; }
.search-select-results { max-height: 230px; overflow-y: auto; overscroll-behavior: contain; margin-top: 8px; }
.search-select-option { padding: 10px 12px; cursor: pointer; color: #263f53; overflow-wrap: anywhere; }
.search-select-option:hover, .search-select-option.is-active { background: #eaf6f7; }
.search-select-option[aria-selected="true"] { color: #116c7b; font-weight: 700; }
.search-select-status { padding: 8px 4px 0; font-size: 14px; color: #617587; }
body.admin-layout section.container,
body.admin-layout main.container {
  max-width: 1440px;
  width: calc(100% - 48px);
}

body.admin-layout .admin-sidebar-nav {
  position: sticky;
  top: 118px;
}

body.portal-admin-page .portal-admin-heading > .container {
  max-width: 1440px;
  width: calc(100% - 48px);
}

body.portal-admin-page main#main-content,
body.portal-admin-page #contacts-section,
body.portal-admin-page footer {
  clear: both;
  position: relative;
}

@media (min-width: 992px) {
  body.admin-layout section.container > .row > .col-lg-3:first-child,
  body.admin-layout main.container > .row > aside.col-lg-3:first-child {
    flex: 0 0 235px;
    max-width: 235px;
  }

  body.admin-layout section.container > .row > .col-lg-3:first-child + div,
  body.admin-layout main.container > .row > aside.col-lg-3:first-child + div {
    flex: 1 1 0;
    max-width: calc(100% - 235px);
  }
}

@media (max-width: 991px) {
  .portal-hero { margin-top: 0; }
  #js-header .js-mega-menu > .container > .navbar-brand { order: 1; }
  #js-header .portal-review-shortcut { order: 2; margin: 8px 0; }
  #js-header .js-mega-menu > .container > .col { order: 3; flex: 0 0 100%; max-width: 100%; }
  body.portal-admin-page main > .row > aside { order: 2; }
  body.portal-admin-page main > .row > aside + div { order: 1; }
  body.admin-layout section.container,
  body.admin-layout main.container {
    width: calc(100% - 30px);
  }

  body.portal-admin-page .portal-admin-heading > .container {
    width: calc(100% - 30px);
  }

  body.admin-layout .admin-sidebar-nav {
    position: static;
  }
}
@media (max-width: 575px) {
  .portal-hero { padding: 28px 0; }
  .portal-card .card-body, .portal-choice-card { padding: 20px; }
  .portal-status-item { align-items: flex-start; flex-direction: column; gap: 8px; }
  .portal-section-nav a { flex: 1 1 auto; text-align: center; }
}
