:root {
  --staff-sidebar-width: 240px;
  --staff-topbar-height: 56px;
  --staff-navy: #203864;
  --staff-navy-dark: #182a4a;
  --staff-pink: #d966ba;
  --staff-pink-dark: #c857ab;
  --staff-purple: #6b4bae;
  --staff-brand: var(--staff-pink);
  --staff-sidebar-text: rgba(255, 255, 255, 0.92);
  --staff-sidebar-muted: rgba(255, 255, 255, 0.55);
  --staff-content-bg: #f4f5f7;
}

body.staff-portal {
  margin: 0;
  min-height: 100vh;
  background: var(--staff-content-bg);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.staff-shell {
  display: flex;
  min-height: 100vh;
}

.staff-sidebar {
  width: var(--staff-sidebar-width);
  flex-shrink: 0;
  background: var(--staff-navy);
  color: var(--staff-sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  align-self: flex-start;
  min-height: 100vh;
}

.staff-sidebar-brand {
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.staff-sidebar-logo-wrap {
  width: 100%;
  min-height: 3rem;
  max-height: 4rem;
  padding: 0.4rem 0.6rem;
  background: #fff;
  border-radius: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.staff-sidebar-logo {
  max-width: 100%;
  max-height: 3.2rem;
  width: auto;
  height: auto;
  object-fit: contain;
}

.staff-sidebar-brand-fallback {
  text-align: center;
}

.staff-sidebar-brand .branch-name {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}

.staff-sidebar-brand .branch-tag {
  font-size: 0.75rem;
  color: var(--staff-sidebar-muted);
  margin: 0.2rem 0 0;
}

.staff-sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
}

.staff-sidebar-nav .nav-link {
  color: var(--staff-sidebar-text);
  padding: 0.65rem 1.25rem;
  border-radius: 0;
  border-left: 3px solid transparent;
  font-weight: 500;
}

.staff-sidebar-nav .nav-link:hover,
.staff-sidebar-nav .nav-link:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.staff-sidebar-nav .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-left-color: var(--staff-pink);
}

.staff-sidebar-footer {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.875rem;
}

.staff-sidebar-footer a {
  color: var(--staff-sidebar-muted);
  text-decoration: none;
  display: block;
  padding: 0.35rem 0;
}

.staff-sidebar-footer a:hover {
  color: #fff;
}

.staff-sidebar-footer form {
  margin: 0;
}

.staff-sidebar-footer .btn-link {
  color: var(--staff-sidebar-muted);
  padding: 0.35rem 0;
  text-decoration: none;
}

.staff-sidebar-footer .btn-link:hover {
  color: #fff;
}

.staff-sidebar-version {
  color: var(--staff-sidebar-muted);
  font-size: 0.75rem;
  margin-top: 0.75rem;
  opacity: 0.85;
}

.staff-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.staff-topbar {
  height: var(--staff-topbar-height);
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.staff-topbar-search {
  flex: 1;
  max-width: 420px;
  display: flex;
  gap: 0.5rem;
}

.staff-topbar-search input {
  flex: 1;
}

.staff-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.staff-notification-btn {
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid #dee2e6;
  color: #495057;
  text-decoration: none;
  background: #fff;
}

.staff-notification-btn:hover {
  background: #f8f9fa;
  color: #212529;
}

.staff-notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  font-size: 0.65rem;
  min-width: 1.1rem;
  height: 1.1rem;
  line-height: 1.1rem;
  padding: 0 0.2rem;
}

.staff-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #dee2e6;
  border-radius: 2rem;
  padding: 0.2rem 0.75rem 0.2rem 0.2rem;
  background: #fff;
}

.staff-user-initials {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--staff-brand, var(--staff-navy));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.staff-content {
  flex: 1;
  padding: 1.5rem;
}

@media (max-width: 991.98px) {
  .staff-shell {
    flex-direction: column;
  }

  .staff-sidebar {
    width: 100%;
    min-height: auto;
    position: static;
  }

  .staff-sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    padding: 0.5rem;
  }

  .staff-sidebar-nav .nav-link {
    padding: 0.5rem 0.75rem;
    border-left: none;
    border-radius: 0.25rem;
  }

  .staff-sidebar-footer {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
  }
}

/* Staff login (DS-0005) — single centred column */
.staff-login-page {
  --staff-login-brand: #d966ba;
  --staff-login-navy: #203864;
  min-height: 100vh;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  background-color: #f4f5f7;
}

.staff-login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
}

.staff-login-card {
  width: 100%;
  max-width: 32rem;
}

.staff-login-header {
  margin-bottom: 2rem;
}

.staff-login-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 6.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem 1rem 0;
}

.staff-login-brand-logo {
  display: block;
  max-height: 5.5rem;
  max-width: 18rem;
  width: auto;
  height: auto;
  object-fit: contain;
}

.staff-login-brand-eyebrow {
  letter-spacing: 0.06em;
  color: #5c6670;
  font-weight: 600;
}

.staff-login-brand-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--staff-login-navy);
  letter-spacing: -0.02em;
}

.staff-login-brand-site {
  font-family: Tahoma, "Segoe UI", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--staff-login-navy);
}

.staff-login-brand-tagline {
  color: #5c6670;
  margin-left: auto;
  margin-right: auto;
  max-width: 24rem;
}

.staff-login-content {
  background: #fff;
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 4px 24px rgba(32, 56, 100, 0.08);
  padding: 2rem 1.75rem;
}

.staff-login-content .nav-tabs {
  border-bottom-color: #dde1e6;
}

.staff-login-content .nav-tabs .nav-link {
  color: #0d6efd;
  font-weight: 500;
}

.staff-login-content .nav-tabs .nav-link:hover,
.staff-login-content .nav-tabs .nav-link:focus {
  color: #0a58ca;
}

.staff-login-content .nav-tabs .nav-link.active {
  color: var(--staff-login-brand);
  border-color: #dde1e6 #dde1e6 #fff;
  font-weight: 600;
}

.staff-login-content .nav-tabs .nav-link.active:hover,
.staff-login-content .nav-tabs .nav-link.active:focus {
  color: var(--staff-login-brand);
}

.staff-login-content .btn-primary {
  background-color: var(--staff-login-brand);
  border-color: var(--staff-login-brand);
  font-weight: 500;
  border-radius: 0.35rem;
}

.staff-login-content .btn-primary:hover,
.staff-login-content .btn-primary:focus {
  background-color: #c857ab;
  border-color: #c857ab;
}

.staff-login-content .btn-outline-primary {
  color: var(--staff-login-brand);
  border-color: var(--staff-login-brand);
  font-weight: 500;
  border-radius: 0.35rem;
}

.staff-login-content .btn-outline-primary:hover,
.staff-login-content .btn-outline-primary:focus {
  background-color: rgba(217, 102, 186, 0.08);
  border-color: var(--staff-login-brand);
  color: var(--staff-login-brand);
}

.staff-login-content .btn-link,
.staff-login-content a:not(.btn) {
  color: var(--staff-login-brand);
  text-decoration: none;
}

.staff-login-content .btn-link:hover,
.staff-login-content a:not(.btn):hover {
  color: #c857ab;
  text-decoration: underline;
}

/* Cases KPI cards (DS-0101) */
.staff-kpi-row .col {
  min-width: 9rem;
}

.staff-kpi-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: inherit;
  height: 100%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

a.staff-kpi-card:hover {
  border-color: var(--staff-brand, var(--staff-navy));
  color: inherit;
}

.staff-kpi-card--amber {
  border-left: 4px solid #f0ad4e;
}

.staff-kpi-card--red {
  border-left: 4px solid #dc3545;
}

.staff-kpi-label {
  font-size: 0.8rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.staff-kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--staff-navy);
}

.staff-cases-filters .form-label {
  margin-bottom: 0.375rem;
}

.staff-cases-filters .staff-cases-filter-select {
  width: 100%;
}

.staff-report-filter-summary {
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
}

.staff-report-filter-summary .text-muted {
  display: block;
  margin-bottom: 0.125rem;
}

.staff-budget-report-wrap {
  overflow-x: auto;
}

.staff-budget-report {
  min-width: 1040px;
}

.staff-budget-report th,
.staff-budget-report td {
  white-space: nowrap;
}

.staff-budget-report-indent {
  padding-left: 1.75rem !important;
  font-weight: 400;
}

.staff-budget-report-fund th,
.staff-budget-report-fund td {
  background: #f8f9fa;
}

.staff-budget-report-total th,
.staff-budget-report-total td {
  background: #e9ecef;
  font-weight: 600;
}

.staff-budget-report-year-total {
  font-weight: 600;
  background: #e9ecef;
}

.staff-excel-preset-row {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.staff-excel-preset {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  background: #fff;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.staff-excel-preset:hover,
.staff-excel-preset.is-active {
  border-color: var(--staff-brand, var(--staff-navy));
  box-shadow: 0 0 0 1px var(--staff-brand, var(--staff-navy));
}

.staff-excel-preset__title {
  font-weight: 600;
  color: var(--staff-navy);
}

.staff-excel-preset__text {
  font-size: 0.875rem;
  color: #6c757d;
}

.staff-excel-sheet-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  height: 100%;
  padding: 0.875rem 1rem 0.875rem 2.5rem;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  background: #fff;
  cursor: pointer;
  position: relative;
}

.staff-excel-sheet-card.is-selected {
  border-color: var(--staff-brand, var(--staff-navy));
  background: #f8f9ff;
}

.staff-excel-sheet-card .form-check-input {
  position: absolute;
  top: 1rem;
  left: 1rem;
}

.staff-excel-sheet-card__title {
  font-weight: 600;
}

.staff-excel-sheet-card__text {
  font-size: 0.875rem;
  color: #6c757d;
}

.staff-excel-export-summary {
  padding: 0.875rem 1rem;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  background: #f8f9fa;
}

/* Breadcrumbs (DS-0105) */
.staff-breadcrumbs .breadcrumb-item a {
  color: var(--staff-purple);
  text-decoration: none;
}

/* Review stepper + sticky summary (DS-0108) */
.staff-review-stepper-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.staff-review-step a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid #dee2e6;
  border-radius: 2rem;
  text-decoration: none;
  color: #495057;
  background: #fff;
  font-size: 0.875rem;
}

.staff-review-step.active a {
  background: var(--staff-brand, var(--staff-navy));
  border-color: var(--staff-brand, var(--staff-navy));
  color: #fff;
}

.staff-review-summary-sticky {
  position: sticky;
  top: calc(var(--staff-topbar-height) + 1rem);
}

.staff-summary-dl dt {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 0.5rem;
}

.staff-summary-dl dt:first-child {
  margin-top: 0;
}

.staff-summary-dl dd {
  margin-bottom: 0;
}

.staff-note-initials,
.staff-beneficiary-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--staff-brand, var(--staff-navy));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

.staff-beneficiary-avatar {
  width: 4rem;
  height: 4rem;
  font-size: 1.25rem;
}

.staff-beneficiary-hero .staff-beneficiary-grid dt {
  font-size: 0.8rem;
  color: #6c757d;
}

/* Phase 2: decision, history, communications, approvals */
.staff-decision-outcome-sidebar .staff-decision-checklist li {
  margin-bottom: 0.35rem;
}

.staff-not-paid-by-aspire-banner {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: 0.25rem;
  background-color: #dc3545;
  color: #fff;
  font-weight: 600;
  line-height: 1.3;
}

.staff-decision-outcome-sidebar .staff-not-paid-by-aspire-banner {
  display: block;
  margin-top: 0.75rem;
  text-align: center;
}

.staff-history-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.staff-history-timeline-item {
  display: flex;
  gap: 1rem;
  padding-bottom: 1.25rem;
  position: relative;
}

.staff-history-timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 0.45rem;
  top: 1.25rem;
  bottom: 0;
  width: 2px;
  background: #dee2e6;
}

.staff-history-timeline-marker {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--staff-brand, var(--staff-navy));
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.staff-communications-layout .card {
  height: fit-content;
}

.staff-communications-table tbody tr.table-active {
  --bs-table-bg-state: rgba(13, 110, 253, 0.08);
}

.staff-message-preview-frame {
  width: 100%;
  min-height: 320px;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  background: #f8fafc;
}

.staff-message-preview-plain {
  white-space: pre-wrap;
}

.staff-communication-detail .staff-note-body {
  white-space: pre-wrap;
}

/* Phase 3 — My User, notifications, password, team (DS-0301–0306) */
.staff-my-user-hero {
  border-left: 4px solid var(--staff-brand, var(--staff-navy));
}

.staff-my-user-task-card {
  border: 1px solid #dee2e6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.staff-my-user-recent-cases .table thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6c757d;
}

.staff-notifications-list .staff-notification-item--unread {
  background: #fff8e6;
}

.staff-notification-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: #e9ecef center/1.25rem no-repeat;
}

.staff-notification-icon--approval {
  background-color: #cfe2ff;
}

.staff-notification-icon--returned {
  background-color: #ffe5d0;
}

.staff-notification-icon--withdrawn {
  background-color: #f8d7da;
}

.staff-notification-icon--more-info {
  background-color: #d1e7dd;
}

.staff-password-strength {
  height: 0.5rem;
}

.staff-password-strength .progress-bar {
  transition: width 0.2s ease;
  font-size: 0.65rem;
  line-height: 0.5rem;
}

.staff-password-requirements .staff-password-req-icon {
  display: inline-block;
  width: 1rem;
  font-weight: 700;
}

.staff-email-body {
  white-space: pre-wrap;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.95rem;
}

.staff-email-preview-frame {
  width: 100%;
  min-height: 640px;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  background: #f8fafc;
}

.staff-answer-row {
  display: grid;
  grid-template-columns: minmax(12rem, 35%) 1fr;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eef1f4;
}

.staff-answer-row--alt {
  background: #f8fafc;
}

.staff-answer-question {
  font-weight: 600;
}

.staff-answer-value {
  white-space: pre-wrap;
}

.staff-answer-line + .staff-answer-line {
  margin-top: 0.25rem;
}

.staff-answer-group-heading {
  margin: 0;
  padding: 0.75rem 1rem;
  border-left: 2px solid var(--staff-brand, #0d3b66);
  font-weight: 600;
  color: var(--staff-navy, #0d3b66);
  background: #f8f9fa;
}

.staff-note-body {
  white-space: pre-wrap;
}

.staff-decision-fields--disabled {
  opacity: 0.55;
}

/* Aspire brand — buttons, links, and Bootstrap accents in staff content */
.staff-main .staff-content h1,
.staff-main .staff-content h2,
.staff-main .staff-content h3,
.staff-main .staff-content h4 {
  color: var(--staff-navy);
}

.staff-main .btn-primary {
  background-color: var(--staff-pink);
  border-color: var(--staff-pink);
  font-weight: 500;
  border-radius: 0.35rem;
}

.staff-main .btn-primary:hover,
.staff-main .btn-primary:focus,
.staff-main .btn-primary:active {
  background-color: var(--staff-pink-dark);
  border-color: var(--staff-pink-dark);
}

.staff-main .btn-outline-primary {
  color: var(--staff-pink);
  border-color: var(--staff-pink);
  font-weight: 500;
  border-radius: 0.35rem;
}

.staff-main .btn-outline-primary:hover,
.staff-main .btn-outline-primary:focus,
.staff-main .btn-outline-primary:active {
  background-color: rgba(217, 102, 186, 0.08);
  border-color: var(--staff-pink);
  color: var(--staff-pink);
}

.staff-main .btn-link {
  color: var(--staff-purple);
  text-decoration: none;
}

.staff-main .btn-link:hover,
.staff-main .btn-link:focus {
  color: var(--staff-navy);
  text-decoration: underline;
}

.staff-main .text-primary,
.staff-main .staff-text-link {
  color: var(--staff-purple) !important;
}

.staff-main .staff-text-link:hover {
  color: var(--staff-navy);
}

.staff-main thead a,
.staff-main .table thead a {
  color: var(--staff-purple);
  font-weight: 600;
}

.staff-main thead a:hover,
.staff-main .table thead a:hover {
  color: var(--staff-navy);
}

.staff-main a:not(.btn):not(.nav-link):not(.page-link):not(.staff-kpi-card):not(.staff-review-step a):not(.staff-notification-btn):not(.staff-user-chip) {
  color: var(--staff-purple);
}

.staff-main a:not(.btn):not(.nav-link):not(.page-link):not(.staff-kpi-card):not(.staff-review-step a):not(.staff-notification-btn):not(.staff-user-chip):hover {
  color: var(--staff-navy);
}

body.staff-portal .staff-main .nav-tabs {
  border-bottom-color: #dee2e6;
}

body.staff-portal .staff-main .nav-tabs .nav-link {
  color: var(--staff-purple);
  font-weight: 500;
}

body.staff-portal .staff-main .nav-tabs .nav-link:hover,
body.staff-portal .staff-main .nav-tabs .nav-link:focus {
  color: var(--staff-navy);
}

body.staff-portal .staff-main .nav-tabs .nav-link.active,
body.staff-portal .staff-main .nav-tabs .nav-item.show .nav-link {
  color: var(--staff-pink);
  border-color: #dee2e6 #dee2e6 #fff;
  font-weight: 600;
}

body.staff-portal .staff-main .nav-tabs .nav-link.active:hover,
body.staff-portal .staff-main .nav-tabs .nav-link.active:focus {
  color: var(--staff-pink);
}

body.staff-portal .staff-main .nav-pills .nav-link {
  color: var(--staff-purple);
  font-weight: 500;
}

body.staff-portal .staff-main .nav-pills .nav-link:hover,
body.staff-portal .staff-main .nav-pills .nav-link:focus {
  color: var(--staff-navy);
}

body.staff-portal .staff-main .nav-pills .nav-link.active,
body.staff-portal .staff-main .nav-pills .show > .nav-link {
  background-color: var(--staff-pink);
  border-color: var(--staff-pink);
  color: #fff;
}

body.staff-portal .staff-main .nav-pills .nav-link.active:hover,
body.staff-portal .staff-main .nav-pills .nav-link.active:focus {
  background-color: var(--staff-pink-dark);
  border-color: var(--staff-pink-dark);
  color: #fff;
}

.staff-main .page-link {
  color: var(--staff-purple);
}

.staff-main .page-item.active .page-link {
  background-color: var(--staff-pink);
  border-color: var(--staff-pink);
  color: #fff;
}

.staff-main .page-link:hover {
  color: var(--staff-pink-dark);
}

.staff-main .form-check-input:checked {
  background-color: var(--staff-pink);
  border-color: var(--staff-pink);
}

.staff-main .form-check-input:focus {
  border-color: var(--staff-pink);
  box-shadow: 0 0 0 0.25rem rgba(217, 102, 186, 0.25);
}

.staff-main .form-control:focus,
.staff-main .form-select:focus {
  border-color: var(--staff-pink);
  box-shadow: 0 0 0 0.25rem rgba(217, 102, 186, 0.25);
}

body.staff-portal .help-page-body-editor {
  min-height: 28rem;
}

body.staff-portal .tox-tinymce {
  border-color: #dee2e6;
  border-radius: 0.375rem;
}

body.staff-portal .tox .tox-edit-area__iframe {
  background: #fff;
}

body.staff-portal .role-permission-grid th[scope="row"] {
  min-width: 14rem;
  font-weight: 600;
}

body.staff-portal .role-permission-grid thead th {
  white-space: nowrap;
}
