@import url("rank-insignia.css");

/* Shared patterns for authenticated management pages. */

.scheduled-flights-page__header { margin: 18px 0 20px; }
.scheduled-flights-page__header h1, .scheduled-flights-page__header p { margin-top: 0; }
.scheduled-flights-page__header p { max-width: 760px; margin-bottom: 14px; }
.scheduled-flights-page__actions { display: flex; align-items: center; gap: 10px; }
.scheduled-flights-notice { display: grid; gap: 3px; margin-bottom: 18px; padding: 14px 18px; border-radius: 10px; }
.scheduled-flights-filter { display: grid; grid-template-columns: minmax(240px, 2fr) minmax(150px, .7fr) auto; gap: 10px; align-items: center; margin-bottom: 18px; }
.scheduled-flights-bulk { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; padding: 14px 18px; border: 1px solid #bfdbfe; border-radius: 12px; background: #eff6ff; }
.scheduled-flights-bulk__select { margin-right: auto; color: #172033; font-weight: 700; }
.scheduled-flights-bulk__select span { color: #64748b; font-weight: 500; }
.scheduled-flights-bulk__reason { display: flex; align-items: center; gap: 8px; }
.scheduled-flights-bulk__reason textarea { min-height: 42px; }
.scheduled-flight-list { display: grid; gap: 8px; }
.scheduled-flight-list__head, .scheduled-flight-row { display: grid; grid-template-columns: 32px minmax(76px, .65fr) minmax(130px, 1fr) minmax(110px, .9fr) minmax(125px, .9fr) minmax(160px, 1.35fr) minmax(105px, .7fr) 64px; gap: 14px; align-items: center; }
.scheduled-flight-list__head { padding: 0 18px 7px; color: #64748b; font-size: .72rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.scheduled-flight-row { min-width: 0; padding: 18px; border: 1px solid #dbe3ed; border-radius: 12px; background: #fff; color: #334155; box-shadow: 0 4px 12px #1720330a; transition: border-color 150ms ease, box-shadow 150ms ease; }
.scheduled-flight-row:hover, .scheduled-flight-row:focus-within { border-color: #93c5fd; box-shadow: 0 8px 20px #17203312; }
.scheduled-flight-row > div { min-width: 0; }
.scheduled-flight-row__label { display: none; color: #64748b; font-size: .7rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.scheduled-flight-row__flight strong { color: #172033; font-size: 1.05rem; }
.scheduled-flight-row__route strong { display: block; color: #172033; white-space: nowrap; }
.scheduled-flight-row__route small { display: flex; gap: 5px; min-width: 0; margin-top: 3px; overflow: hidden; color: #64748b; white-space: nowrap; }
.scheduled-flight-row__route small span:not([aria-hidden]) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.scheduled-flight-row__route small span[aria-hidden] { flex: 0 0 auto; }
.scheduled-flight-row__times { font-variant-numeric: tabular-nums; white-space: nowrap; }
.scheduled-flight-status { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .04em; }
.scheduled-flight-status--draft { background: #fef3c7; color: #92400e; }
.scheduled-flight-status--published { background: #dcfce7; color: #166534; }
.scheduled-flight-status--suspended, .scheduled-flight-status--retired { background: #e2e8f0; color: #475569; }
.scheduled-flight-row__actions .button { min-height: 36px; padding: 7px 12px; }
.scheduled-flights-fallback { margin-top: 28px; padding: 20px 24px; }
.scheduled-flights-fallback h2, .scheduled-flights-fallback p { margin-top: 0; }
.scheduled-flight-summary { padding: 24px; }
.scheduled-flight-summary h2, .scheduled-flight-summary > p { margin-top: 0; }
.scheduled-flight-summary [data-flight-summary] { margin-top: 18px; padding: 20px; border-left: 4px solid #2563eb; border-radius: 8px; background: #f8fafc; color: #172033; font-size: 1rem; font-weight: 600; line-height: 1.75; white-space: pre-line; }
.pirep-review-list { display: grid; gap: 8px; }
.pirep-review-list__head, .pirep-review-row { display: grid; grid-template-columns: 76px minmax(100px, .8fr) minmax(115px, .8fr) minmax(110px, .8fr) minmax(130px, 1fr) minmax(170px, 1.25fr) 66px 110px 72px; gap: 12px; align-items: center; }
.pirep-review-list__head { padding: 0 14px 7px; color: #64748b; font-size: .7rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.pirep-review-row { min-width: 0; padding: 14px; border: 1px solid #dbe3ed; border-radius: 10px; background: #fff; color: #334155; }
.pirep-review-row > div { min-width: 0; overflow-wrap: anywhere; }
.pirep-review-row small { display: block; margin-top: 3px; color: #64748b; }
.pirep-review-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.pirep-review-detail .management-card, .pirep-review-decision { padding: 20px; }
.pirep-review-detail h2, .pirep-review-decision h2 { margin-top: 0; }
.pirep-review-detail dl { display: grid; gap: 9px; margin: 0; }
.pirep-review-detail dl div { display: grid; grid-template-columns: minmax(120px, .7fr) minmax(0, 1fr); gap: 12px; }
.pirep-review-detail dt { color: #64748b; font-weight: 700; }
.pirep-review-detail dd { margin: 0; overflow-wrap: anywhere; }
.pirep-review-decision form { display: grid; gap: 10px; max-width: 680px; }
.pirep-review-decision label { display: grid; gap: 3px; font-weight: 700; }
.pirep-review-decision label span { color: #64748b; font-size: .8rem; font-weight: 500; }
.pirep-review-decision textarea { min-height: 110px; }
.pirep-review-decision form > div { display: flex; gap: 10px; }
.management-tabs { display: flex; gap: 8px; margin-bottom: 18px; border-bottom: 1px solid #dbe3ed; }
.management-tabs a { padding: 9px 12px; color: #475569; text-decoration: none; }
.management-tabs a[aria-current="page"] { border-bottom: 2px solid #2563eb; color: #1e40af; font-weight: 750; }
.management-filter { display: flex; align-items: end; gap: 10px; margin-bottom: 18px; }
.management-filter label { display: grid; gap: 4px; font-weight: 700; }
.pirep-reviewed-list { display: grid; gap: 8px; }
.pirep-reviewed-list__head, .pirep-reviewed-row { display: grid; grid-template-columns: 76px minmax(110px, .9fr) minmax(115px, .9fr) 110px 90px minmax(140px, 1fr) 135px 64px; gap: 12px; align-items: center; }
.pirep-reviewed-list__head { padding: 0 14px 7px; color: #64748b; font-size: .7rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.pirep-reviewed-row { min-width: 0; padding: 14px; border: 1px solid #dbe3ed; border-radius: 10px; background: #fff; color: #334155; }
.pirep-reviewed-row > div { min-width: 0; overflow-wrap: anywhere; }
.pirep-reviewed-row small { display: block; margin-top: 3px; color: #64748b; }

@media (max-width: 900px) {
  .scheduled-flight-list__head { display: none; }
  .scheduled-flight-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 14px; }
  .scheduled-flight-row { grid-template-columns: 28px 1fr auto; gap: 15px 12px; align-items: start; }
  .scheduled-flight-row__select { grid-column: 1; grid-row: 1; }
  .scheduled-flight-row__flight { grid-column: 2; grid-row: 1; }
  .scheduled-flight-row__status { grid-column: 3; grid-row: 1; text-align: right; }
  .scheduled-flight-row__route, .scheduled-flight-row__operates, .scheduled-flight-row__times, .scheduled-flight-row__aircraft, .scheduled-flight-row__actions { grid-column: 2 / 4; }
  .scheduled-flight-row__label { display: block; margin-bottom: 3px; }
  .scheduled-flight-row__actions { margin-top: 2px; }
  .pirep-review-list__head, .pirep-reviewed-list__head { display: none; }
  .pirep-review-row, .pirep-reviewed-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .scheduled-flights-filter { grid-template-columns: 1fr; }
  .scheduled-flights-bulk { align-items: stretch; flex-direction: column; }
  .scheduled-flights-bulk__select { margin-right: 0; }
  .pirep-review-detail, .pirep-review-row, .pirep-reviewed-row { grid-template-columns: 1fr; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.management-page {
  width: min(1180px, 100%);
  min-width: 0;
  max-width: 100%;
  margin: 0 auto;
}

.management-context-nav {
  margin-bottom: 16px;
  color: #475569;
  font-size: 0.875rem;
}

.management-context-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.management-context-nav__list li + li::before {
  margin-right: 8px;
  color: #94a3b8;
  content: "/";
}

.management-context-nav__list [aria-current="page"] {
  color: #172033;
  font-weight: 650;
}

.management-context-nav a,
.management-table__primary-link {
  color: #1d4ed8;
  font-weight: 650;
  text-decoration: none;
}

.management-context-nav a:hover,
.management-table__primary-link:hover {
  text-decoration: underline;
}

.management-page-header {
  margin-bottom: 28px;
  padding-left: 18px;
  border-left: 4px solid #2563eb;
}

.management-page-header__main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.management-page-header > .management-context-nav {
  margin-bottom: 14px;
}

.management-page-header__content {
  max-width: 720px;
}

.management-page-header__eyebrow {
  margin: 0 0 8px;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.management-page-header h1 {
  margin: 0;
  color: #172033;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.management-page-header__description {
  margin: 12px 0 0;
  color: #526070;
  font-size: 1rem;
  line-height: 1.6;
}

.management-page-actions {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
}

.management-button {
  display: inline-flex;
  min-height: 44px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition:
    background-color var(--app-motion-standard) var(--app-motion-easing),
    border-color var(--app-motion-standard) var(--app-motion-easing),
    box-shadow var(--app-motion-standard) var(--app-motion-easing),
    color var(--app-motion-fast) var(--app-motion-easing),
    transform var(--app-motion-fast) var(--app-motion-easing);
}

.management-button:active {
  transform: translateY(1px);
}

.management-button--primary {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 58%, #1e40af 100%);
  color: #fff;
  box-shadow: 0 7px 18px #1d4ed82e;
}

.management-button--primary:hover {
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 58%, #1e3a8a 100%);
}

.management-button--secondary {
  border-color: #cbd5e1;
  background: #fff;
  color: #172033;
}

.management-button--secondary:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.management-button--compact {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.management-button:focus-visible,
.management-context-nav a:focus-visible,
.management-table__primary-link:focus-visible,
.management-table-wrapper:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
}

.management-alert {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin-bottom: 24px;
  padding: 14px 16px;
  border: 1px solid;
  border-radius: 10px;
  line-height: 1.45;
}

.management-alert--success {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.management-alert--error {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
}

.management-alert--info {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e40af;
}

.management-card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--app-surface-border);
  border-radius: 14px;
  background: var(--app-surface-background);
  box-shadow: var(--app-surface-shadow);
}

.management-card--spaced {
  margin-top: 24px;
}

.management-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  border-bottom: 1px solid #dbe3ed;
  background: linear-gradient(100deg, #f8fafc 0%, #f2f6fb 100%);
}

.management-card__header h2 {
  margin: 0;
  color: #172033;
  font-size: 1.25rem;
}

.management-card__header p {
  margin: 6px 0 0;
  color: #64748b;
  line-height: 1.45;
}

.management-result-count {
  flex-shrink: 0;
  color: #526070;
  font-size: 0.875rem;
  font-weight: 650;
}

.management-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 24px;
}

.management-card__body {
  padding: 20px 24px;
  color: #334155;
  line-height: 1.55;
}

.management-card__body > :first-child {
  margin-top: 0;
}

.management-card__body > :last-child {
  margin-bottom: 0;
}

.member-lifecycle-owner-notice {
  margin-right: 24px;
  margin-left: 24px;
}

.member-roles-card > .management-form {
  max-width: none;
}

.management-next-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 20px 0 24px;
  padding: 18px 20px;
  border: 1px solid #93c5fd;
  border-radius: 12px;
  background: #eff6ff;
  color: #172033;
}

.management-next-step span {
  display: block;
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.management-next-step strong {
  display: block;
  margin-top: 4px;
}

.management-next-step p {
  margin: 5px 0 0;
  color: #475569;
}

.management-next-step__actions,
.schedule-workspace__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.schedule-workspace {
  gap: 0;
}

.schedule-workspace__actions {
  margin-top: 24px;
}

.schedule-publish-dialog {
  width: min(520px, calc(100% - 32px));
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 24px 60px #0f172a40;
}

.schedule-publish-dialog::backdrop {
  background: #0f172a80;
}

.schedule-publish-dialog [data-publish-summary] {
  padding: 14px;
  border-radius: 9px;
  background: #f8fafc;
  line-height: 1.6;
  white-space: pre-line;
}

@media (max-width: 680px) {
  .management-next-step {
    align-items: stretch;
    flex-direction: column;
  }
}

.management-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 24px;
}

.management-definition-list {
  margin: 0;
}

.management-definition-list__row {
  display: grid;
  grid-template-columns: minmax(140px, 0.4fr) minmax(0, 1fr);
  gap: 24px;
  padding: 16px 24px;
  border-bottom: 1px solid #e2e8f0;
}

.management-definition-list__row:last-child {
  border-bottom: 0;
}

.management-definition-list dt {
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 650;
}

.management-definition-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #172033;
}

.management-definition-list code {
  white-space: normal;
}

.management-table-wrapper {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
}

.management-table {
  width: 100%;
  border-collapse: collapse;
  color: #334155;
  font-size: 0.925rem;
}

.management-table th,
.management-table td {
  padding: 18px 24px;
  border-bottom: 1px solid #edf3f9;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.management-table--commercial {
  min-width: 48rem;
  table-layout: fixed;
}

.management-table--commercial th,
.management-table--commercial td {
  overflow-wrap: anywhere;
  white-space: normal;
}

.management-table thead th {
  padding-top: 14px;
  padding-bottom: 14px;
  border-bottom-color: #dbe3ed;
  background: #edf3f9;
  color: #526070;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.management-table tbody th {
  font-weight: 650;
}

.management-table__primary-value {
  color: #172033;
}

.management-table__secondary-value {
  display: block;
  margin-top: 4px;
  color: #5d6b7c;
  font-size: 0.875rem;
  font-weight: 500;
}

.management-history-change {
  min-width: 14rem;
  overflow-wrap: anywhere;
}

.management-history-evidence {
  margin-top: 0.45rem;
  max-width: 32rem;
}

.management-history-evidence summary {
  cursor: pointer;
}

.management-history-evidence__business {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.65rem;
}

.management-history-evidence__business h3 {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
}

.management-history-evidence__business dl,
.management-history-evidence__business dl div {
  display: grid;
  gap: 0.2rem 0.65rem;
  margin: 0;
}

.management-history-evidence__business dl div {
  grid-template-columns: minmax(6rem, auto) minmax(0, 1fr);
}

.management-history-evidence__business dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.management-history-evidence__technical {
  margin-top: 0.75rem;
}

.management-history-evidence pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.management-table__action-cell {
  width: 1%;
}

.management-inline-action {
  display: inline;
  margin: 0;
}

.management-inline-confirmation[open] {
  width: min(360px, 70vw);
}

.management-inline-confirmation[open] > summary {
  display: none;
}

.management-inline-confirmation .management-form-section__body {
  gap: 14px;
  padding: 16px;
}

.management-inline-confirmation .management-form-section__body > p {
  margin: 0;
  white-space: normal;
}

.management-inline-confirmation .management-form-actions {
  padding: 14px 16px;
}

.management-history-detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
  white-space: normal;
}

.management-history-detail-list div {
  display: grid;
  gap: 2px;
}

.management-history-detail-list dt {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.management-history-detail-list dd {
  margin: 0;
  color: #172033;
  overflow-wrap: anywhere;
}

.management-table__no-action {
  color: #64748b;
  font-size: 0.85rem;
}

.management-table tbody tr:last-child > * {
  border-bottom: 0;
}

.management-table tbody tr:hover {
  background: #f4f8fc;
}

.management-table tbody tr {
  transition: background-color var(--app-motion-fast) var(--app-motion-easing);
}

.management-table tbody tr:focus-within,
.management-table tbody tr[aria-selected="true"] {
  background: #edf3f9;
}

.membership-lifecycle-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid #dbe3ed;
}

.membership-lifecycle-actions .management-form + .management-form {
  border-left: 1px solid #dbe3ed;
}

.membership-lifecycle-actions .management-form-section__body {
  padding-bottom: 12px;
}

.membership-lifecycle-actions textarea {
  min-height: 6rem;
  resize: vertical;
}

.membership-lifecycle-actions .management-form-hint {
  margin: 0;
  color: #64748b;
  font-size: 0.85rem;
  line-height: 1.45;
}

.management-button--danger {
  border-color: #b91c1c;
  background: #b91c1c;
  color: #fff;
}

.management-button--danger:hover {
  border-color: #991b1b;
  background: #991b1b;
}

@media (max-width: 680px) {
  .membership-lifecycle-actions {
    grid-template-columns: 1fr;
  }

  .membership-lifecycle-actions .management-form + .management-form {
    border-top: 1px solid #dbe3ed;
    border-left: 0;
  }
}

.member-roster-wrapper {
  container-type: inline-size;
}

.training-status-form,
.training-status-form .management-form-field,
.training-status-form .management-form-control {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.training-history-wrapper {
  container-type: inline-size;
}

.member-rank-card .management-card__body {
  display: grid;
  gap: 16px;
}

.member-rank-card .management-card__body > * {
  min-width: 0;
  margin: 0;
}

.member-rank-card .management-form {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.member-rank-card .management-form-actions {
  padding: 0;
  border: 0;
  background: transparent;
}

.member-rank-history-wrapper {
  container-type: inline-size;
}

.member-rank-history-table th,
.member-rank-history-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.training-history-table th,
.training-history-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.training-history-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.member-roster-table {
  table-layout: fixed;
}

.member-roster-table th,
.member-roster-table td {
  padding-inline: 12px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.member-roster-table__action {
  position: sticky;
  right: 0;
  z-index: 1;
  width: 7.5rem;
  min-width: 7.5rem;
  background: #fff;
  box-shadow: -1px 0 0 #dbe3ed;
  white-space: nowrap;
}

.member-roster-table thead .member-roster-table__action {
  z-index: 2;
  background: #edf3f9;
}

.member-roster-table tbody tr:hover .member-roster-table__action {
  background: #f4f8fc;
}

.member-roster-table tbody tr:focus-within .member-roster-table__action,
.member-roster-table tbody tr[aria-selected="true"] .member-roster-table__action {
  background: #edf3f9;
}

@container (max-width: 760px) {
  .member-roster-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .member-roster-table,
  .member-roster-table tbody,
  .member-roster-table tr,
  .member-roster-table th,
  .member-roster-table td {
    display: block;
    width: 100%;
  }

  .member-roster-table tr {
    padding: 14px 16px;
    border-bottom: 1px solid #dbe3ed;
  }

  .member-roster-table th,
  .member-roster-table td {
    padding: 5px 0;
    border: 0;
  }

  .member-roster-table__action {
    position: static;
    min-width: 0;
    margin-top: 8px;
    background: transparent;
    box-shadow: none;
  }

  .member-roster-table__action .management-button {
    width: 100%;
  }
}

.management-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
  text-transform: capitalize;
}

.management-status-badge--active,
.management-status-badge--approved {
  background: #dcfce7;
  color: #166534;
}

.management-status-badge--pending,
.management-status-badge--warning {
  background: #fef3c7;
  color: #92400e;
}

.management-status-badge--inactive,
.management-status-badge--suspended,
.management-status-badge--rejected,
.management-status-badge--failed {
  background: #fee2e2;
  color: #991b1b;
}

.management-status-badge--retired {
  background: #e2e8f0;
  color: #475569;
}

/* Pilot profile and PIREP review presentation. */
.pilot-profile__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 24px;
  align-items: start;
}

.pilot-profile__pilot-details {
  grid-row: span 2;
}

.pilot-profile__hub {
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.pilot-profile__hub h3 {
  margin-bottom: 6px;
  color: #172033;
}

.pilot-profile__hub form,
.pilot-profile__action form {
  display: grid;
  gap: 10px;
}

.pilot-profile__hub form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-top: 14px;
}

.pilot-profile__hub label {
  grid-column: 1 / -1;
  color: #475569;
  font-size: .82rem;
  font-weight: 700;
}

.pilot-profile select,
.pilot-profile input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  box-sizing: border-box;
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: #172033;
  font: inherit;
}

.pilot-profile__account-card .management-definition-list dd {
  font-weight: 650;
}

.pilot-profile__action {
  border-top: 1px solid #e2e8f0;
}

.pilot-profile__action summary {
  margin: 16px 24px;
  cursor: pointer;
  list-style: none;
}

.pilot-profile__action summary::-webkit-details-marker {
  display: none;
}

.pilot-profile__action[open] summary {
  margin-bottom: 0;
}

.pilot-profile__action form {
  max-width: 520px;
  padding: 20px 24px 24px;
}

.pilot-profile__action label {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: .82rem;
  font-weight: 700;
}

.pirep-review-tabs {
  width: fit-content;
  max-width: 100%;
  gap: 6px;
  padding: 5px;
  border: 1px solid #dbe3ed;
  border-radius: 12px;
  background: #f8fafc;
}

.pirep-review-tabs a {
  min-height: 40px;
  box-sizing: border-box;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  font-weight: 700;
}

.pirep-review-tabs a[aria-current="page"] {
  border: 0;
  background: #fff;
  box-shadow: 0 2px 8px rgb(15 23 42 / 10%);
}

.pirep-review-row > div:last-child .button,
.pirep-reviewed-row > div:last-child .button {
  display: inline-flex;
  min-width: max-content;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
}

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

  .pilot-profile__pilot-details {
    grid-row: auto;
  }

  .pirep-review-row > div:last-child,
  .pirep-reviewed-row > div:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .pilot-profile__layout {
    gap: 16px;
  }

  .pilot-profile__hub form {
    grid-template-columns: 1fr;
  }

  .pilot-profile__hub label {
    grid-column: auto;
  }

  .pilot-profile__hub button,
  .pilot-profile__action summary,
  .pilot-profile__action button,
  .pirep-review-row > div:last-child .button,
  .pirep-reviewed-row > div:last-child .button {
    width: 100%;
  }

  .pirep-review-tabs {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pilot-profile__action summary {
    width: calc(100% - 48px);
  }

  .pilot-profile__action .management-button {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .pirep-review-tabs a {
    text-align: center;
  }
}

.management-filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.35fr) auto auto;
  gap: 14px;
  align-items: end;
  padding: 20px 24px;
  border-bottom: 1px solid #dbe3ed;
  background: #f8fafc;
}

.management-status-badge--unknown {
  background: #e2e8f0;
  color: #334155;
}

.management-empty-state {
  padding: clamp(40px, 8vw, 72px) 24px;
  text-align: center;
}

.management-empty-state h3 {
  margin: 0;
  color: #172033;
  font-size: 1.1rem;
}

.management-empty-state p {
  margin: 8px auto 20px;
  color: #64748b;
}

.management-form {
  margin: 0;
}

.management-form input[name="trial_override_days"] {
  width: min(100%, 28rem);
  box-sizing: border-box;
}

.management-form-section__header {
  padding: 22px 24px;
  border-bottom: 1px solid #dbe3ed;
  background: linear-gradient(100deg, #f8fafc 0%, #f2f6fb 100%);
}

.management-form-section__header h2 {
  margin: 0;
  color: #172033;
  font-size: 1.25rem;
}

.management-form-section__header p {
  margin: 6px 0 0;
  color: #64748b;
  line-height: 1.45;
}

.management-form-section__body {
  display: grid;
  gap: 24px;
  max-width: 720px;
  padding: 24px;
}

.management-form-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.management-form-field--compact {
  max-width: 360px;
}

.management-form-label {
  color: #172033;
  font-size: 0.925rem;
  font-weight: 700;
}

.management-required-indicator {
  color: #b91c1c;
  font-weight: 750;
}

.management-form-control {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  font: inherit;
  line-height: 1.4;
  box-shadow: inset 0 1px #ffffff;
  transition:
    border-color var(--app-motion-fast) var(--app-motion-easing),
    box-shadow var(--app-motion-fast) var(--app-motion-easing),
    outline-color var(--app-motion-fast) var(--app-motion-easing);
}

.management-form-control:is(select),
.management-form-control:is(input[type="checkbox"], input[type="radio"]) {
  cursor: pointer;
}

.management-form-control:hover {
  border-color: #64748b;
}

.management-form-control:focus-visible {
  border-color: #2563eb;
  outline: 2px solid #bfdbfe;
  outline-offset: 2px;
  box-shadow:
    0 0 0 1px #ffffff,
    inset 0 1px #ffffff;
}

.management-form-control:disabled,
.management-form-control[readonly] {
  border-color: #d9e3ee;
  background: #f4f7fb;
  box-shadow: inset 0 1px #ffffff;
  color: #64748b;
  opacity: 1;
}

.management-form-control:disabled {
  cursor: not-allowed;
}

.management-form-control[aria-invalid="true"] {
  border-color: #b91c1c;
}

.management-form-help,
.management-form-error {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
}

.management-form-help {
  color: #64748b;
}

.management-form-error {
  color: #b91c1c;
  font-weight: 650;
}

.management-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 24px;
  border-top: 1px solid #e2e8f0;
  background: #f2f6fb;
}

.management-dashboard-section + .management-dashboard-section {
  margin-top: 24px;
}

.management-dashboard {
  --management-dashboard-border: #dbe3ed;
  --management-dashboard-muted: #64748b;
  --management-dashboard-accent: #2563eb;

  box-sizing: border-box;
}

.management-dashboard .management-context-nav {
  margin-bottom: 14px;
}

.management-dashboard > .management-page-header {
  margin-bottom: 16px;
  padding-left: 16px;
  border-left-color: #1d4ed8;
}

.management-dashboard > .management-page-header .management-page-header__content {
  max-width: 800px;
}

.management-dashboard > .management-page-header h1 {
  font-size: clamp(2.35rem, 4.5vw, 3.25rem);
  line-height: 0.98;
}

.management-dashboard > .management-page-header .management-page-header__description {
  max-width: 760px;
  margin-top: 10px;
  color: #475569;
  font-size: 1rem;
  line-height: 1.5;
}

.management-dashboard-section__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #cbdbea;
}

.management-dashboard-section__header h2 {
  margin: 0;
  color: #172033;
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  letter-spacing: -0.025em;
}

.management-dashboard-section__header .management-page-header__eyebrow {
  margin-bottom: 5px;
}

.management-dashboard-section__header > p {
  max-width: 480px;
  margin: 0;
  color: var(--management-dashboard-muted);
  line-height: 1.45;
  text-align: right;
}

.management-widget-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.management-widget {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 200px;
  overflow: hidden;
  flex-direction: column;
  border-color: #cddae7;
  background:
    radial-gradient(circle at 100% 0%, #eaf2ff 0, transparent 42%),
    linear-gradient(160deg, #ffffff 46%, #f4f7fb 100%);
  box-shadow:
    0 16px 36px #17203317,
    inset 0 1px #ffffff;
}

.management-widget .management-card__body {
  flex: 1;
  padding: 20px 22px 14px;
}

.management-widget h3 {
  margin: 0;
  color: #526070;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.management-widget__value {
  margin: 12px 0 10px;
  color: #10233f;
  font-size: clamp(3.55rem, 5.7vw, 4.85rem);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.07em;
  line-height: 0.84;
  text-shadow: 0 1px #ffffff;
}

.management-widget .management-card__body > p:last-child {
  color: #64748b;
  font-size: 0.85rem;
  line-height: 1.45;
}

.management-widget .management-card__actions {
  padding: 10px 22px 16px;
}

.management-widget .management-button--secondary {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1d4ed8;
  font-size: 0.85rem;
}

.management-widget .management-button--secondary:hover {
  background: transparent;
  color: #1e40af;
  text-decoration: underline;
}

.management-statistic-tile {
  position: relative;
  border-top-width: 4px;
}

.management-statistic-tile--blue {
  border-top-color: #70a7ff;
}

.management-statistic-tile--cyan {
  border-top-color: #58c6d8;
}

.management-statistic-tile--violet {
  border-top-color: #9b8af7;
}

.management-statistic-tile--slate {
  border-top-color: #9db0c7;
}

.management-statistic-tile--blue,
.management-statistic-tile--cyan {
  background:
    radial-gradient(circle at 100% 0%, #dbeafe99 0, transparent 46%),
    linear-gradient(160deg, #ffffff 46%, #f4f7fb 100%);
}

.management-statistic-tile--violet,
.management-statistic-tile--slate {
  background:
    radial-gradient(circle at 100% 0%, #e8e5ff70 0, transparent 46%),
    linear-gradient(160deg, #ffffff 46%, #f4f7fb 100%);
}

.management-quick-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.management-dashboard-action-panel {
  min-width: 0;
}

.management-quick-action {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 106px;
  overflow: hidden;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 18px 22px;
  border: 1px solid #cddae7;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 50%, #f1f6fc 100%);
  box-shadow:
    0 10px 24px #17203312,
    inset 0 1px #ffffff;
  color: #172033;
  text-decoration: none;
  transition:
    border-color var(--app-motion-standard) var(--app-motion-easing),
    box-shadow var(--app-motion-standard) var(--app-motion-easing),
    transform var(--app-motion-standard) var(--app-motion-easing);
}

.management-quick-action::before {
  position: absolute;
  inset: 14px auto 14px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #335f8d;
  content: "";
}

.management-quick-action--primary {
  border-color: #91a9c2;
  box-shadow:
    0 10px 24px #17203312,
    inset 3px 0 #335f8d,
    inset 0 1px #ffffff;
}

.management-quick-action__content {
  display: grid;
  gap: 7px;
}

.management-quick-action__content strong {
  color: #10233f;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.management-quick-action__content > span {
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.45;
}

.management-quick-action__indicator {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 1.05rem;
  transition:
    border-color var(--app-motion-standard) var(--app-motion-easing),
    background-color var(--app-motion-standard) var(--app-motion-easing),
    transform var(--app-motion-standard) var(--app-motion-easing);
}

.management-quick-action:hover {
  border-color: #8fb8e6;
  box-shadow: 0 15px 32px #1d4ed81c;
  transform: translateY(-3px);
}

.management-quick-action:hover .management-quick-action__indicator {
  border-color: #60a5fa;
  background: #dbeafe;
  transform: translateX(2px);
}

.management-quick-action:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
}

/* Role Permission Management Styles */

.role-permission-group {
  min-width: 0;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
}

.role-permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 14px;
  min-width: 0;
}

.role-permission-groups {
  min-width: 0;
}

.role-permission-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.role-permission-group h3 {
  margin: 0 0 16px;
  color: #172033;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.role-permission-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #dbe3ed;
  border-radius: 9px;
  background: #f8fafc;
  transition:
    border-color var(--app-motion-fast) var(--app-motion-easing),
    background-color var(--app-motion-fast) var(--app-motion-easing);
}

.role-permission-item:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}

.role-permission-header {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  min-width: 0;
  margin-bottom: 8px;
}

.role-permission-label {
  min-width: 0;
  color: #172033;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.role-permission-code {
  max-width: 100%;
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  background: #e2e8f0;
  color: #334155;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.025em;
  text-transform: lowercase;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.role-permission-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 700;
}

.role-permission-description {
  margin: 0 0 10px;
  color: #526070;
  font-size: 0.9rem;
  line-height: 1.5;
}

.role-permission-item .management-inline-confirmation {
  margin-top: auto;
}

.role-permission-item .management-inline-confirmation[open] {
  width: 100%;
}

.role-permission-item .management-inline-confirmation .management-form {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin-top: 10px;
}

.role-permission-item .management-form-field,
.role-permission-item .management-form-control,
.role-permission-item .management-form-actions {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
}

.role-permission-item .management-form-actions {
  padding-right: 0;
  padding-left: 0;
}

.role-permission-item .management-form-help {
  margin-bottom: 0;
}

.role-permission-action {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.role-management-table {
  table-layout: fixed;
}

.role-management-table th,
.role-management-table td {
  min-width: 0;
  padding-right: clamp(10px, 1.5vw, 24px);
  padding-left: clamp(10px, 1.5vw, 24px);
  overflow-wrap: anywhere;
  white-space: normal;
}

.role-management-table th:first-child {
  width: 27%;
}

.role-management-table th:last-child {
  width: 10%;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-badge--active {
  background: #dcfce7;
  color: #166534;
}

.status-badge--inactive {
  background: #fee2e2;
  color: #991b1b;
}

.status-badge--protected {
  background: #fef3c7;
  color: #92400e;
}


.management-quick-action:active {
  border-color: #60a5fa;
  background: #eff6ff;
  box-shadow: 0 4px 12px #1d4ed814;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .management-widget-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .management-page-header__main,
  .management-filter-form {
    grid-template-columns: 1fr;
  }

  .management-page-header__main {
    display: grid;
  }

  .management-page-header {
    align-items: stretch;
    flex-direction: column;
    gap: 20px;
  }

  .management-page-actions,
  .management-page-actions > .management-button {
    width: 100%;
  }

  .management-card__header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
  }

  .management-card__actions {
    padding: 20px;
  }

  .management-card__body {
    padding: 20px;
  }

  .member-lifecycle-owner-notice {
    margin-right: 20px;
    margin-left: 20px;
  }

  .management-form-section__header,
  .management-form-section__body,
  .management-form-actions {
    padding-right: 20px;
    padding-left: 20px;
  }

  .management-definition-list__row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 14px 20px;
  }

  .management-table th,
  .management-table td {
    padding: 16px 20px;
  }

  .management-table thead th {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .management-dashboard-section__header {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .management-dashboard-section__header > p {
    text-align: left;
  }

  .management-quick-action-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .management-alert {
    grid-template-columns: 1fr;
  }

  .management-form-actions,
  .management-form-actions > .management-button {
    width: 100%;
  }

}

@media (prefers-reduced-motion: reduce) {
  .management-form-control,
  .management-quick-action,
  .management-quick-action__indicator {
    transition: none;
  }

  .management-quick-action:hover,
  .management-quick-action:hover .management-quick-action__indicator {
    transform: none;
  }
}
.management-input-prefix {
  display: flex;
  align-items: stretch;
  max-width: 22rem;
}

.management-input-prefix strong {
  display: flex;
  align-items: center;
  padding: 0 0.8rem;
  border: 1px solid var(--app-surface-border);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: var(--app-surface-muted);
}

.management-input-prefix input {
  min-width: 0;
  border-radius: 0 8px 8px 0;
}

/* CP4 Profile career presentation; operational and account forms stay separate. */
.pilot-profile__rank {
  margin-bottom: 1.25rem;
  padding: 1.25rem;
  min-width: 0;
  overflow-wrap: anywhere;
}
.pilot-profile__rank p {
  line-height: 1.6;
}
.pilot-profile__rank-identity {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.pilot-profile__rank-identity > div {
  min-width: 0;
}
.pilot-profile__insignia {
  flex: 0 0 7rem;
}
.pilot-profile__rank progress {
  display: block;
  width: 100%;
  margin: 0.75rem 0;
}
.pilot-profile__rank-structure {
  margin-top: 1.25rem;
  border-top: 1px solid var(--border-color, #cbd5e1);
  padding-top: 0.5rem;
}
.pilot-profile__rank-structure > summary {
  cursor: pointer;
  min-height: 44px;
  padding: 0.75rem 0.25rem;
  font-weight: 650;
}
.pilot-profile__rank-structure > summary:focus-visible,
.pilot-profile__history-scroll:focus-visible {
  outline: 3px solid var(--focus-color, #2563eb);
  outline-offset: 3px;
}
.pilot-profile__training {
  min-width: 0;
  margin-bottom: 1.25rem;
  overflow-wrap: anywhere;
}
.pilot-profile__training-history {
  max-width: 100%;
  overflow-x: auto;
}
.pilot-profile__training-history:focus-visible {
  outline: 3px solid var(--focus-color, #2563eb);
  outline-offset: 3px;
}
.pilot-profile__training-table {
  width: 100%;
  border-collapse: collapse;
}
.pilot-profile__training-table th,
.pilot-profile__training-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color, #cbd5e1);
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}
.pilot-profile__ladder {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.pilot-profile__rank-reference {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.pilot-profile__rank-reference > span:last-child {
  min-width: 0;
}
.pilot-profile__small-insignia {
  flex: 0 0 2.5rem;
}
.pilot-profile__history-scroll {
  max-width: 100%;
  overflow-x: auto;
}
.pilot-profile__history {
  width: 100%;
  border-collapse: collapse;
}
.pilot-profile__history-label {
  display: none;
}
.pilot-profile__history th,
.pilot-profile__history td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color, #cbd5e1);
}
@media (max-width: 520px) {
  .pilot-profile__insignia {
    flex-basis: 5.5rem;
  }
  .pilot-profile__rank {
    padding: 0.75rem;
  }
}

@media (max-width: 760px) {
  .pilot-profile__training-table,
  .pilot-profile__training-table tbody,
  .pilot-profile__training-table tr,
  .pilot-profile__training-table td,
  .pilot-profile__history,
  .pilot-profile__history tbody,
  .pilot-profile__history tr,
  .pilot-profile__history td {
    display: block;
  }
  .pilot-profile__history thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .pilot-profile__training-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .pilot-profile__training-table tr {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color, #cbd5e1);
  }
  .pilot-profile__training-table td {
    padding: 0.5rem 0;
    border: 0;
  }
  .pilot-profile__training-table td::before {
    display: block;
    margin-bottom: 0.25rem;
    content: attr(data-label);
    font-weight: 650;
  }
  .pilot-profile__history tr {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color, #cbd5e1);
  }
  .pilot-profile__history td {
    padding: 0.5rem 0;
    border: 0;
  }
  .pilot-profile__history-label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 650;
  }
}

.pilot-profile__rank {
  --profile-rank-text: #172033;
  --profile-rank-muted: #475569;
  --profile-rank-surface: #fff;
  color: var(--profile-rank-text);
  background: var(--profile-rank-surface);
}
.pilot-profile__rank h2,
.pilot-profile__rank h3,
.pilot-profile__rank dd {
  color: var(--profile-rank-text);
}
.pilot-profile__rank dt {
  color: var(--profile-rank-muted);
}
@media (prefers-color-scheme: dark) {
  .pilot-profile__rank {
    --profile-rank-text: #f1f5f9;
    --profile-rank-muted: #cbd5e1;
    --profile-rank-surface: #172033;
    --focus-color: #93c5fd;
  }
}
[data-theme="dark"] .pilot-profile__rank {
  --profile-rank-text: #f1f5f9;
  --profile-rank-muted: #cbd5e1;
  --profile-rank-surface: #172033;
  --focus-color: #93c5fd;
}
[data-theme="light"] .pilot-profile__rank {
  --profile-rank-text: #172033;
  --profile-rank-muted: #475569;
  --profile-rank-surface: #fff;
  --focus-color: #2563eb;
}

/* Member Details: include footer padding in narrow full-width sizing. */
.member-details-page .management-form-actions,
.member-details-page .management-form-actions > .management-button {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.member-roles-wrapper,
.member-lifecycle-history-wrapper {
  container-type: inline-size;
}

.member-lifecycle-history-table th,
.member-lifecycle-history-table td,
.member-roles-table th,
.member-roles-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.member-roles-table form,
.member-roles-table textarea {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Keep stacked cell sizing after the shared mobile table padding rules. */
@container (max-width: 760px) {
  .member-lifecycle-history-table thead,
  .member-roles-table thead,
  .member-rank-history-table thead,
  .training-history-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .member-lifecycle-history-table,
  .member-lifecycle-history-table tbody,
  .member-lifecycle-history-table tr,
  .member-lifecycle-history-table th,
  .member-lifecycle-history-table td,
  .member-roles-table,
  .member-roles-table tbody,
  .member-roles-table tr,
  .member-roles-table th,
  .member-roles-table td,
  .member-rank-history-table,
  .member-rank-history-table tbody,
  .member-rank-history-table tr,
  .member-rank-history-table td,
  .training-history-table,
  .training-history-table tbody,
  .training-history-table tr,
  .training-history-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .member-lifecycle-history-table tr,
  .member-roles-table tr,
  .member-rank-history-table tr,
  .training-history-table tr {
    padding: 12px 0;
    border-bottom: 1px solid #dbe3ed;
  }

  .member-lifecycle-history-table th,
  .member-lifecycle-history-table td,
  .member-roles-table th,
  .member-roles-table td,
  .member-rank-history-table td,
  .training-history-table td {
    padding: 5px 0;
    border: 0;
  }

  .member-roles-table th:first-child,
  .member-roles-table th:last-child {
    width: 100%;
  }

  .member-lifecycle-history-table tr,
  .member-roles-table tr {
    padding-inline: 20px;
  }

  .member-lifecycle-history-table th::before,
  .member-lifecycle-history-table td::before,
  .member-roles-table th::before,
  .member-roles-table td::before,
  .member-rank-history-table td::before,
  .training-history-table td::before {
    content: attr(data-label) ": ";
    font-weight: 700;
  }
}
