/*
 * PlanMockup modern-theme pilot.
 *
 * The theme is deliberately scoped to body.pm-modern-theme so it can be
 * removed from a page without altering its routes, markup, calculations,
 * tabs, or fixed-height scrolling behavior.
 */

body.pm-modern-theme {
  --pm-canvas: #f4f7fa;
  --pm-surface: #ffffff;
  --pm-surface-subtle: #f8fafc;
  --pm-navy: #173a5e;
  --pm-brand: #2563a6;
  --pm-brand-hover: #1e538d;
  --pm-text: #172b3a;
  --pm-text-secondary: #64748b;
  --pm-border: #d8e1ea;
  --pm-border-soft: #e7edf2;
  --pm-success: #16865c;
  --pm-success-surface: #dff3e9;
  --pm-danger: #c2414b;
  --pm-warning: #b7791f;
  --pm-radius-sm: 7px;
  --pm-radius-md: 10px;
  --pm-shadow-sm: 0 2px 8px rgba(23, 43, 58, 0.06);
  --pm-shadow-menu: 0 2px 10px rgba(9, 30, 51, 0.18);

  background: var(--pm-canvas);
  color: var(--pm-text);
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
  font-variant-numeric: tabular-nums;
}

body.pm-modern-theme .plan-shell-header {
  border-bottom: 0;
  background: var(--pm-navy);
  box-shadow: var(--pm-shadow-menu);
}

body.pm-modern-theme .main-shell-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  border-bottom: 0;
  background: var(--pm-navy);
  box-shadow: var(--pm-shadow-menu);
}

body.pm-modern-theme .main-shell-nav {
  min-height: 60px;
  background: var(--pm-navy);
}

body.pm-modern-theme .main-shell-brand {
  border-radius: var(--pm-radius-sm);
  background: #ffffff;
  color: var(--pm-navy);
}

body.pm-modern-theme .main-shell-link {
  padding: 0.42rem 0.62rem;
  border-radius: var(--pm-radius-sm);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.96rem;
  font-weight: 600;
}

body.pm-modern-theme .main-shell-link:hover,
body.pm-modern-theme .main-shell-link:focus {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

body.pm-modern-theme .main-shell-link.active {
  background: var(--pm-brand);
  color: #ffffff;
}

body.pm-modern-theme .card {
  border-color: var(--pm-border);
  border-radius: var(--pm-radius-md);
  background: var(--pm-surface);
  box-shadow: var(--pm-shadow-sm);
}

body.pm-modern-theme .card-header {
  border-bottom-color: var(--pm-border-soft);
  background: var(--pm-surface-subtle);
}

body.pm-modern-theme .page-title,
body.pm-modern-theme h1 {
  color: var(--pm-text);
  letter-spacing: -0.02em;
}

body.pm-modern-theme .nav-tabs {
  border-bottom-color: var(--pm-border);
}

body.pm-modern-theme .nav-tabs .nav-link {
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: var(--pm-text-secondary);
  font-weight: 600;
}

body.pm-modern-theme .nav-tabs .nav-link:hover,
body.pm-modern-theme .nav-tabs .nav-link:focus {
  border-bottom-color: #a9c4dd;
  color: var(--pm-navy);
}

body.pm-modern-theme .nav-tabs .nav-link.active {
  border-bottom-color: var(--pm-brand);
  background: #eaf2fb;
  color: var(--pm-navy);
  font-weight: 750;
}

body.pm-modern-theme .alert,
body.pm-modern-theme .modal-content {
  border-color: var(--pm-border);
  border-radius: var(--pm-radius-md);
}

body.pm-modern-theme .pm-settings-nav {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-md);
  background: var(--pm-surface);
  box-shadow: var(--pm-shadow-sm);
}

body.pm-modern-theme .pm-settings-nav a {
  padding: 0.5rem 0.9rem;
  border-radius: var(--pm-radius-sm);
  color: var(--pm-text-secondary);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

body.pm-modern-theme .pm-settings-nav a:hover,
body.pm-modern-theme .pm-settings-nav a:focus,
body.pm-modern-theme .pm-settings-nav a.active {
  background: #eaf2fb;
  color: var(--pm-brand);
}

body.pm-modern-theme .pm-page-eyebrow,
body.pm-modern-theme .pm-section-label {
  color: var(--pm-brand);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Preserve the statutory product spelling inside visually uppercase labels. */
.pm-lowercase-k {
  text-transform: lowercase;
}

body.pm-modern-theme .pm-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.24rem 0.58rem;
  border: 1px solid #cad6e1;
  border-radius: 999px;
  background: #f4f7fa;
  color: #526477;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

body.pm-modern-theme .pm-status-preview {
  border-color: #e3c47b;
  background: #fff7df;
  color: #8a6418;
}

body.pm-modern-theme .pm-status-included {
  border-color: #a6d5c2;
  background: var(--pm-success-surface);
  color: #116b4a;
}

body.pm-modern-theme .pm-billing-preview {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #bad3ea;
  border-radius: var(--pm-radius-md);
  background: #edf6ff;
  color: #244b70;
}

body.pm-modern-theme .pm-billing-preview span {
  margin-left: 0.25rem;
  color: #4e6c88;
  font-size: 0.9rem;
}

body.pm-modern-theme .pm-billing-preview-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: var(--pm-brand);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}

body.pm-modern-theme .pm-subscription-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 1rem;
}

body.pm-modern-theme .pm-subscription-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-md);
  background: var(--pm-surface);
  box-shadow: var(--pm-shadow-sm);
}

body.pm-modern-theme .pm-subscription-summary > div {
  display: grid;
  gap: 0.15rem;
  padding: 0.65rem 0.85rem;
  border-right: 1px solid var(--pm-border-soft);
}

body.pm-modern-theme .pm-subscription-summary > div:last-child {
  border-right: 0;
}

body.pm-modern-theme .pm-subscription-summary span {
  color: var(--pm-text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
}

body.pm-modern-theme .pm-subscription-summary strong {
  overflow: hidden;
  color: var(--pm-navy);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.pm-modern-theme .pm-subscription-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-md);
  background: var(--pm-surface);
  box-shadow: var(--pm-shadow-sm);
}

body.pm-modern-theme .pm-subscription-tab {
  padding: 0.52rem 1rem;
  border: 0;
  border-radius: var(--pm-radius-sm);
  background: transparent;
  color: var(--pm-text-secondary);
  font-size: 0.9rem;
  font-weight: 750;
}

body.pm-modern-theme .pm-subscription-tab:hover,
body.pm-modern-theme .pm-subscription-tab:focus-visible,
body.pm-modern-theme .pm-subscription-tab.active {
  background: #eaf2fb;
  color: var(--pm-brand);
}

body.pm-modern-theme .pm-subscription-tab:focus-visible {
  outline: 3px solid rgba(47, 127, 189, 0.24);
  outline-offset: 1px;
}

body.pm-modern-theme .pm-subscription-panel[hidden] {
  display: none;
}

body.pm-modern-theme .pm-billing-rules {
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--pm-border-soft);
  border-radius: var(--pm-radius-md);
  background: var(--pm-surface);
}

body.pm-modern-theme .pm-billing-rules summary {
  color: var(--pm-brand);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 750;
}

body.pm-modern-theme .pm-current-plan-card {
  overflow: hidden;
  background: linear-gradient(130deg, #ffffff 0%, #edf6ff 100%);
}

body.pm-modern-theme .pm-current-plan-card::before {
  display: block;
  height: 4px;
  background: var(--pm-brand);
  content: "";
}

body.pm-modern-theme .pm-core-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

body.pm-modern-theme .pm-core-features span {
  padding: 0.35rem 0.62rem;
  border: 1px solid #cddfee;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: #365d7d;
  font-size: 0.78rem;
  font-weight: 700;
}

body.pm-modern-theme .pm-summary-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--pm-border-soft);
}

body.pm-modern-theme .pm-summary-list > div:last-child {
  border-bottom: 0;
}

body.pm-modern-theme .pm-summary-list dt,
body.pm-modern-theme .pm-summary-list dd {
  margin: 0;
  font-size: 0.88rem;
}

body.pm-modern-theme .pm-summary-list dt {
  color: var(--pm-text-secondary);
  font-weight: 600;
}

body.pm-modern-theme .pm-summary-list dd {
  color: var(--pm-text);
  font-weight: 700;
  text-align: right;
}

body.pm-modern-theme .pm-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

body.pm-modern-theme .pm-subscription-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

body.pm-modern-theme .pm-module-card {
  border-top: 3px solid #aac4dc !important;
}

body.pm-modern-theme .pm-module-card[data-module="full-compliance"] {
  border-top-color: var(--pm-success) !important;
}

body.pm-modern-theme .pm-module-card[data-module="api-mcp"] {
  border-top-color: #7966ae !important;
}

body.pm-modern-theme .pm-module-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 9px;
  background: #eaf2f9;
  color: var(--pm-navy);
  font-size: 0.74rem;
  font-weight: 900;
}

body.pm-modern-theme .pm-module-card[data-module="full-compliance"] .pm-module-icon {
  background: var(--pm-success-surface);
  color: #116b4a;
}

body.pm-modern-theme .pm-module-card[data-module="api-mcp"] .pm-module-icon {
  background: #eeeafd;
  color: #5d4995;
}

body.pm-modern-theme .pm-feature-list {
  display: grid;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

body.pm-modern-theme .pm-feature-list li {
  position: relative;
  padding-left: 1.15rem;
  color: #47596b;
  font-size: 0.86rem;
}

body.pm-modern-theme .pm-feature-list li::before {
  position: absolute;
  top: 0.12rem;
  left: 0;
  color: var(--pm-success);
  font-weight: 900;
  content: "✓";
}

body.pm-modern-theme .pm-module-feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

body.pm-modern-theme .pm-module-feature-tags span {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--pm-border-soft);
  border-radius: 999px;
  background: var(--pm-surface-subtle);
  color: var(--pm-text-secondary);
  font-size: 0.72rem;
  line-height: 1.2;
}

body.pm-modern-theme .pm-usage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

body.pm-modern-theme .pm-usage-value {
  margin-right: 0.35rem;
  color: var(--pm-navy);
  font-size: 2rem;
  line-height: 1;
}

body.pm-modern-theme .pm-meter {
  height: 0.48rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf3;
}

body.pm-modern-theme .pm-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--pm-brand);
}

body.pm-modern-theme .pm-policy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

body.pm-modern-theme .pm-policy-grid > div {
  display: grid;
  gap: 0.18rem;
  padding: 0.8rem;
  border: 1px solid var(--pm-border-soft);
  border-radius: var(--pm-radius-sm);
  background: var(--pm-surface-subtle);
}

body.pm-modern-theme .pm-policy-grid strong {
  color: var(--pm-navy);
  font-size: 0.86rem;
}

body.pm-modern-theme .pm-policy-grid span {
  color: var(--pm-text-secondary);
  font-size: 0.8rem;
}

@media (max-width: 991.98px) {
  body.pm-modern-theme .pm-subscription-grid {
    grid-template-columns: 1fr;
  }

  body.pm-modern-theme .pm-policy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  body.pm-modern-theme .pm-subscription-overview,
  body.pm-modern-theme .pm-usage-grid,
  body.pm-modern-theme .pm-policy-grid {
    grid-template-columns: 1fr;
  }

  body.pm-modern-theme .pm-subscription-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.pm-modern-theme .pm-subscription-summary > div:nth-child(2) {
    border-right: 0;
  }

  body.pm-modern-theme .pm-subscription-summary > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--pm-border-soft);
  }

  body.pm-modern-theme .pm-subscription-tabs {
    overflow-x: auto;
  }
}

/* Authentication and organization user management */
body.pm-modern-theme .pm-account-page,
body.pm-modern-theme .pm-users-page,
body.pm-modern-theme .pm-subscription-page {
  max-width: 1120px;
}

body.pm-modern-theme .pm-section-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-md);
  background: var(--pm-surface);
  box-shadow: var(--pm-shadow-sm);
}

body.pm-modern-theme .pm-section-tab {
  padding: 0.52rem 1rem;
  border: 0;
  border-radius: var(--pm-radius-sm);
  background: transparent;
  color: var(--pm-text-secondary);
  font-size: 0.9rem;
  font-weight: 750;
}

body.pm-modern-theme .pm-section-tab:hover,
body.pm-modern-theme .pm-section-tab:focus-visible,
body.pm-modern-theme .pm-section-tab.active {
  background: #eaf2fb;
  color: var(--pm-brand);
}

body.pm-modern-theme .pm-section-tab.active {
  box-shadow: inset 0 -3px 0 var(--pm-brand);
}

body.pm-modern-theme .pm-section-tab:focus-visible {
  outline: 3px solid rgba(47, 127, 189, 0.24);
  outline-offset: 1px;
}

body.pm-modern-theme .pm-section-panel[hidden] {
  display: none;
}

body.pm-modern-theme .pm-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  margin-left: 0.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #dbeafa;
  font-size: 0.7rem;
}

body.pm-modern-theme .pm-users-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-md);
  background: var(--pm-surface);
  box-shadow: var(--pm-shadow-sm);
}

body.pm-modern-theme .pm-users-summary > div {
  display: grid;
  gap: 0.12rem;
  padding: 0.62rem 0.85rem;
  border-right: 1px solid var(--pm-border-soft);
}

body.pm-modern-theme .pm-users-summary > div:last-child {
  border-right: 0;
}

body.pm-modern-theme .pm-users-summary span {
  color: var(--pm-text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
}

body.pm-modern-theme .pm-users-summary strong {
  color: var(--pm-navy);
  font-size: 0.9rem;
}

body.pm-modern-theme .pm-invitation-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
  gap: 1rem;
}

body.pm-modern-theme .pm-user-table-wrap {
  max-height: min(56vh, 620px);
  overflow: auto;
}

body.pm-modern-theme .pm-pending-invitations {
  max-height: min(42vh, 430px);
  overflow: auto;
}

body.pm-modern-theme .pm-empty-state {
  display: grid;
  min-height: 10rem;
  place-items: center;
  padding: 1.5rem;
  border: 1px dashed var(--pm-border);
  border-radius: var(--pm-radius-md);
  background: var(--pm-surface-subtle);
  color: var(--pm-text-secondary);
  font-size: 0.9rem;
  text-align: center;
}

.pm-auth-page {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 10%, rgba(47, 127, 189, 0.16), transparent 32rem),
    #f4f7fa;
  color: #17324d;
}

.pm-auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 2rem 1rem;
}

.pm-auth-card {
  width: min(100%, 440px);
  padding: 2rem;
  border: 1px solid #dfe6ed;
  border-radius: 0.9rem;
  background: #fff;
  box-shadow: 0 18px 45px rgba(23, 50, 77, 0.12);
}

.pm-auth-card-wide {
  width: min(100%, 620px);
}

.pm-auth-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
  background: #17324d;
  color: #fff;
  font-size: 1.45rem;
  font-weight: 800;
  text-decoration: none;
}

.pm-auth-support {
  margin-top: 1.5rem;
  color: #6b7280;
  font-size: 0.82rem;
  line-height: 1.5;
  text-align: center;
}

.pm-password-field {
  position: relative;
}

.pm-password-field .form-control {
  padding-right: 3rem;
}

.pm-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: #667788;
  transform: translateY(-50%);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pm-password-toggle:hover {
  background: #edf3f7;
  color: #17324d;
}

.pm-password-toggle:focus-visible {
  outline: 3px solid rgba(47, 127, 189, 0.28);
  outline-offset: 1px;
}

.pm-password-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.pm-password-toggle svg[hidden] {
  display: none;
}

.pm-one-time-link {
  padding: 1rem;
  border: 1px solid #99c3a7;
  border-radius: 0.65rem;
  background: #f0faf3;
}

.pm-user-table th,
.pm-user-table td {
  padding: 1rem;
  vertical-align: middle;
}

.pm-user-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom-color: #dfe6ed;
  background: #f7f9fb;
  color: #526171;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pm-user-table .form-select {
  min-width: 11rem;
}

@media (max-width: 767.98px) {
  .pm-auth-card {
    padding: 1.35rem;
  }

  body.pm-modern-theme .pm-invitation-layout {
    grid-template-columns: 1fr;
  }

  body.pm-modern-theme .pm-users-summary > div {
    padding-right: 0.55rem;
    padding-left: 0.55rem;
  }

  body.pm-modern-theme .pm-users-summary strong {
    font-size: 0.8rem;
  }
}

body.pm-modern-theme .table-responsive {
  scrollbar-color: #aebdca transparent;
}

body.pm-modern-dashboard {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

body.pm-modern-dashboard .dashboard-shell {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

/* Shared identity and spacing across the Plan Design wizard. */
body.pm-modern-theme .pm-wizard-heading h1 {
  margin: 0 0 0.25rem;
  color: var(--pm-text);
  font-size: 1.35rem;
  line-height: 1.25;
  font-weight: 600;
}

body.pm-modern-theme .employer-header,
body.pm-modern-theme .census-header {
  padding: 1rem 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

body.pm-modern-theme .employer-header .btn-group {
  gap: 0.5rem;
  flex-wrap: wrap;
}

body.pm-modern-theme .employer-header .btn-group .btn {
  border-radius: var(--pm-radius-sm);
  margin-left: 0;
}

body.pm-modern-dashboard .dashboard-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.15rem 1.5rem 1rem;
  border-bottom: 1px solid var(--pm-border);
  background: var(--pm-surface);
}

body.pm-modern-dashboard .dashboard-heading h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
}

body.pm-modern-dashboard .dashboard-heading p {
  margin: 0.2rem 0 0;
  color: var(--pm-text-secondary);
}

body.pm-modern-dashboard .dashboard-eyebrow,
body.pm-modern-dashboard .dashboard-section-label {
  color: var(--pm-brand);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

body.pm-modern-dashboard .dashboard-heading-actions {
  display: flex;
  gap: 0.55rem;
}

body.pm-modern-dashboard .dashboard-content {
  flex: 1 1 auto;
  min-height: 0;
  padding: 1.25rem 1.5rem 2rem;
  overflow: auto;
}

body.pm-modern-dashboard .dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

body.pm-modern-dashboard .dashboard-metric {
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--pm-border);
  border-left: 4px solid var(--pm-brand);
  border-radius: var(--pm-radius-md);
  background: var(--pm-surface);
  box-shadow: var(--pm-shadow-sm);
}

body.pm-modern-dashboard .dashboard-metric-success {
  border-left-color: var(--pm-success);
}

body.pm-modern-dashboard .dashboard-metric-warning {
  border-left-color: var(--pm-warning);
}

body.pm-modern-dashboard .dashboard-metric-label,
body.pm-modern-dashboard .dashboard-metric small {
  display: block;
  color: var(--pm-text-secondary);
}

body.pm-modern-dashboard .dashboard-metric-label {
  font-size: 0.82rem;
  font-weight: 600;
}

body.pm-modern-dashboard .dashboard-metric strong {
  display: block;
  margin: 0.1rem 0;
  color: var(--pm-navy);
  font-size: 1.4rem;
  line-height: 1.1;
}

body.pm-modern-dashboard .dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 0.9rem;
  margin-top: 0.9rem;
}

body.pm-modern-dashboard .dashboard-action-card {
  background: linear-gradient(125deg, #ffffff 0%, #edf5fc 100%);
}

body.pm-modern-dashboard .dashboard-action-card .card-body,
body.pm-modern-dashboard .dashboard-shortcuts .card-body {
  padding: 1.2rem;
}

body.pm-modern-dashboard .dashboard-action-card h2,
body.pm-modern-dashboard .dashboard-shortcuts h2,
body.pm-modern-dashboard .dashboard-plans-card h2 {
  margin: 0.2rem 0 0.35rem;
  color: var(--pm-navy);
  font-size: 1.05rem;
  font-weight: 700;
}

body.pm-modern-dashboard .dashboard-action-card p {
  max-width: 700px;
  color: var(--pm-text-secondary);
}

body.pm-modern-dashboard .dashboard-shortcut-list {
  display: grid;
  gap: 0.35rem;
}

body.pm-modern-dashboard .dashboard-shortcut-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.48rem 0;
  border-bottom: 1px solid var(--pm-border-soft);
  color: var(--pm-navy);
  font-weight: 600;
  text-decoration: none;
}

body.pm-modern-dashboard .dashboard-shortcut-list a:last-child {
  border-bottom: 0;
}

body.pm-modern-dashboard .dashboard-shortcut-list small {
  color: var(--pm-text-secondary);
  font-weight: 400;
  text-align: right;
}

body.pm-modern-dashboard .dashboard-plans-card {
  margin-top: 0.9rem;
  overflow: hidden;
}

body.pm-modern-dashboard .dashboard-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--pm-surface);
}

body.pm-modern-dashboard .dashboard-card-header a,
body.pm-modern-dashboard .dashboard-row-actions a {
  color: var(--pm-brand);
  font-weight: 600;
  text-decoration: none;
}

body.pm-modern-dashboard .dashboard-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  white-space: nowrap;
}

body.pm-modern-dashboard .dashboard-empty {
  padding: 2rem;
  color: var(--pm-text-secondary);
  text-align: center;
}

@media (max-width: 900px) {
  body.pm-modern-dashboard .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.pm-modern-dashboard .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body.pm-modern-dashboard .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  body.pm-modern-dashboard .dashboard-content,
  body.pm-modern-dashboard .dashboard-heading {
    padding-right: 0.9rem;
    padding-left: 0.9rem;
  }
}

body.pm-modern-theme .plan-shell-navbar {
  min-height: 58px;
  background: var(--pm-navy);
}

body.pm-modern-theme .plan-shell-brand {
  border-radius: var(--pm-radius-sm);
  background: #ffffff;
  color: var(--pm-navy);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

body.pm-modern-theme .plan-shell-brand:hover,
body.pm-modern-theme .plan-shell-brand:focus {
  color: var(--pm-brand);
}

body.pm-modern-theme .plan-workspace-link {
  border-radius: var(--pm-radius-sm);
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

body.pm-modern-theme .plan-workspace-link:hover,
body.pm-modern-theme .plan-workspace-link:focus {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

body.pm-modern-theme .plan-shell-navbar .navbar-nav .plan-workspace-link.active,
body.pm-modern-theme .plan-shell-navbar .navbar-nav .plan-workspace-link.active:hover,
body.pm-modern-theme .plan-shell-navbar .navbar-nav .plan-workspace-link.active:focus,
body.pm-modern-theme .plan-shell-navbar .navbar-nav .plan-workspace-link.active.show {
  background: var(--pm-brand);
  color: #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

body.pm-modern-theme .plan-shell-utility-nav {
  border-left-color: rgba(255, 255, 255, 0.2);
}

body.pm-modern-theme .plan-shell-utility-link,
body.pm-modern-theme .plan-shell-account {
  color: rgba(255, 255, 255, 0.78);
}

body.pm-modern-theme .plan-shell-utility-link:hover,
body.pm-modern-theme .plan-shell-utility-link:focus {
  color: #ffffff;
}

body.pm-modern-theme .plan-shell-navbar .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.92);
}

body.pm-modern-theme .plan-shell-navbar .dropdown-menu {
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-md);
  box-shadow: 0 14px 30px rgba(23, 43, 58, 0.16);
}

body.pm-modern-theme .plan-shell-navbar .dropdown-item {
  color: var(--pm-text);
}

body.pm-modern-theme .plan-shell-navbar .dropdown-item:hover,
body.pm-modern-theme .plan-shell-navbar .dropdown-item:focus {
  background: #edf4fb;
  color: var(--pm-navy);
}

body.pm-modern-theme .btn {
  border-radius: var(--pm-radius-sm);
  font-weight: 600;
  box-shadow: none;
}

body.pm-modern-theme .btn-primary,
body.pm-modern-theme .btn-info {
  border-color: var(--pm-brand);
  background: var(--pm-brand);
  color: #ffffff;
}

body.pm-modern-theme .btn-primary:hover,
body.pm-modern-theme .btn-primary:focus,
body.pm-modern-theme .btn-info:hover,
body.pm-modern-theme .btn-info:focus {
  border-color: var(--pm-brand-hover);
  background: var(--pm-brand-hover);
  color: #ffffff;
}

body.pm-modern-theme .btn-outline-primary {
  border-color: var(--pm-brand);
  color: var(--pm-brand);
}

body.pm-modern-theme .btn-outline-primary:hover,
body.pm-modern-theme .btn-outline-primary:focus {
  background: var(--pm-brand);
  color: #ffffff;
}

body.pm-modern-theme .form-control,
body.pm-modern-theme .form-select {
  border-color: #c8d3dd;
  border-radius: var(--pm-radius-sm);
  color: var(--pm-text);
}

body.pm-modern-theme .form-control:focus,
body.pm-modern-theme .form-select:focus {
  border-color: var(--pm-brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 166, 0.14);
}

body.pm-modern-theme .form-label {
  color: #294154;
  font-weight: 600;
}

body.pm-modern-theme .badge {
  border-radius: 999px;
  font-weight: 600;
}

body.pm-modern-theme .text-bg-success {
  background: var(--pm-success-surface) !important;
  color: #126446 !important;
}

body.pm-modern-theme .text-bg-danger {
  background: #f9e3e6 !important;
  color: #a8313c !important;
}

body.pm-modern-theme .text-bg-warning {
  background: #f9edd3 !important;
  color: #895910 !important;
}

body.pm-modern-theme .table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: #f3f7fb;
  --bs-table-striped-bg: #f8fafc;
  margin-bottom: 0;
  color: var(--pm-text);
}

body.pm-modern-theme .table > :not(caption) > * > * {
  border-bottom-color: var(--pm-border-soft);
}

body.pm-modern-theme .table thead th,
body.pm-modern-theme .table .table-light th {
  background: var(--pm-surface-subtle);
  color: #42566a;
  font-weight: 600;
}

body.pm-modern-modeling {
  background: var(--pm-canvas);
}

body.pm-modern-modeling .sticky-actions {
  background: var(--pm-canvas);
}

body.pm-modern-modeling .page-title {
  color: var(--pm-text);
  font-size: 1.35rem;
  font-weight: 600;
}

body.pm-modern-modeling .badge-soft {
  border-color: var(--pm-border);
  background: var(--pm-surface-subtle);
  color: var(--pm-text-secondary);
}

body.pm-modern-modeling .section-card {
  overflow: hidden;
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-md);
  box-shadow: var(--pm-shadow-sm);
}

body.pm-modern-modeling .section-card > .card-header {
  border-bottom: 0;
  background: var(--pm-surface) !important;
}

body.pm-modern-modeling .modeling-tabs {
  border-bottom: 1px solid var(--pm-border);
  background: var(--pm-surface);
}

body.pm-modern-modeling .modeling-tabs .nav-link {
  margin-bottom: 0;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--pm-text-secondary);
  font-weight: 600;
}

body.pm-modern-modeling .modeling-tabs .nav-link:hover,
body.pm-modern-modeling .modeling-tabs .nav-link:focus {
  border-bottom-color: #a9c4dd;
  color: var(--pm-navy);
}

body.pm-modern-modeling .modeling-tabs .nav-link.active {
  border-bottom-color: var(--pm-brand);
  background: transparent;
  color: var(--pm-navy);
}

body.pm-modern-modeling .tab-content,
body.pm-modern-modeling .tab-pane,
body.pm-modern-modeling .card-body {
  background: var(--pm-surface);
}

body.pm-modern-modeling .metric-card,
body.pm-modern-modeling .compliance-panel {
  border-color: var(--pm-border);
  border-radius: var(--pm-radius-md);
  background: var(--pm-surface);
  box-shadow: none;
}

body.pm-modern-modeling .metric-label {
  color: var(--pm-text-secondary);
  letter-spacing: 0;
  text-transform: none;
}

body.pm-modern-modeling .compliance-panel-header {
  border-bottom-color: var(--pm-border-soft);
  border-radius: var(--pm-radius-md) var(--pm-radius-md) 0 0;
  background: var(--pm-surface-subtle);
}

body.pm-modern-employer {
  background: var(--pm-canvas);
  color: var(--pm-text);
}

body.pm-modern-employer .employer-header,
body.pm-modern-employer .employer-footer {
  border-color: var(--pm-border);
  background: var(--pm-surface);
}

body.pm-modern-employer .employer-footer {
  padding-right: 5.25rem;
}

body.pm-modern-employer .employer-title {
  color: var(--pm-text);
  font-weight: 600;
}

body.pm-modern-employer .employer-subtitle,
body.pm-modern-employer .employer-section-help {
  color: var(--pm-text-secondary);
}

body.pm-modern-employer .employer-form-scroll {
  background: var(--pm-canvas);
}

body.pm-modern-employer .employer-card {
  overflow: hidden;
  border-color: var(--pm-border);
  border-radius: var(--pm-radius-md);
  background: var(--pm-surface);
  box-shadow: var(--pm-shadow-sm);
}

body.pm-modern-employer .employer-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--pm-border-soft);
  background: var(--pm-surface-subtle);
}

body.pm-modern-employer .employer-profile-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--pm-border);
  background: var(--pm-surface);
  color: var(--pm-text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
}

body.pm-modern-employer .employer-card .card-body {
  background: var(--pm-surface);
}

@media (max-width: 1199.98px) {
  body.pm-modern-theme .plan-shell-navbar .navbar-collapse {
    background: var(--pm-navy);
  }

  body.pm-modern-theme .plan-shell-utility-nav {
    border-top-color: rgba(255, 255, 255, 0.2);
  }
}

.pm-401k-workspace-nav {
  flex: 0 0 auto;
  width: 100%;
  border-bottom: 1px solid var(--pm-border, #dfe3e8);
  background: var(--pm-surface, #fff);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.pm-401k-workspace-inner {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  min-height: 48px;
  padding: 0 1.5rem;
}

.pm-401k-workspace-label {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: var(--pm-navy, #17324d);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pm-401k-workspace-tabs {
  display: flex;
  align-items: stretch;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.pm-401k-workspace-tab {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0.72rem 0.9rem 0.58rem;
  border-bottom: 3px solid transparent;
  color: var(--pm-text-secondary, #5f6b7a);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.pm-401k-workspace-tab:hover,
.pm-401k-workspace-tab:focus {
  border-bottom-color: #a9c4dd;
  color: var(--pm-navy, #17324d);
}

.pm-401k-workspace-tab.active {
  border-bottom-color: var(--pm-brand, #2f7fbd);
  background: #eaf2fb;
  color: var(--pm-navy, #17324d);
  font-weight: 800;
}

.pm-workspace-identity {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex: 0 1 40%;
  min-width: 0;
  margin-left: auto;
  padding: 0.45rem 0;
  text-align: right;
  color: var(--pm-navy, #17324d);
}

.pm-workspace-employer {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.pm-identity-help {
  position: relative;
  flex: 0 0 auto;
}

.pm-identity-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  padding: 0;
  border: 1px solid #8ba8c0;
  border-radius: 50%;
  background: #fff;
  color: #355a7a;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.pm-identity-trigger:focus-visible {
  outline: 2px solid #2463a5;
  outline-offset: 2px;
}

.pm-plan-details {
  box-sizing: border-box;
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 2080;
  width: min(22rem, calc(100vw - 4rem));
  padding: 0.75rem;
  border: 1px solid #cad7e4;
  border-radius: 0.5rem;
  background: #fff;
  color: #17324d;
  box-shadow: 0 6px 20px rgba(16, 24, 40, 0.16);
  text-align: left;
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
  visibility: hidden;
}

.pm-plan-details > span { display: block; }
.pm-identity-help:not(.tooltip-dismissed):hover .pm-plan-details,
.pm-identity-help:not(.tooltip-dismissed):focus-within .pm-plan-details {
  visibility: visible;
}

body.pm-modern-theme .pm-guided-workflow {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 38px;
  padding: 0.25rem 1rem;
  border-bottom: 1px solid #d8e1ea;
  background: #fff;
  white-space: nowrap;
}

body.pm-modern-theme .pm-guided-workflow-links {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  gap: 0.75rem;
  overflow-x: auto;
}

body.pm-modern-theme .pm-guided-workflow-employer {
  position: relative;
  flex: 0 1 auto;
  max-width: 35%;
  margin-left: auto;
  color: var(--pm-text-secondary);
  font-size: 0.875rem;
  text-align: right;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  body.pm-modern-theme .pm-guided-workflow { flex-wrap: wrap; gap: 0.25rem; }
  body.pm-modern-theme .pm-guided-workflow-links { flex-basis: 100%; }
  body.pm-modern-theme .pm-guided-workflow-employer { max-width: 100%; padding-bottom: 0.25rem; }
}

body.pm-modern-theme .pm-guided-workflow-label {
  color: #66788a;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.pm-modern-theme .pm-guided-workflow-steps {
  display: flex;
  align-items: stretch;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.pm-modern-theme .pm-guided-workflow-step {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-bottom: 3px solid transparent;
  color: #526579;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

body.pm-modern-theme .pm-guided-workflow-step:hover,
body.pm-modern-theme .pm-guided-workflow-step:focus-visible {
  color: var(--pm-brand, #2f7fbd);
}

body.pm-modern-theme .pm-guided-workflow-step.active {
  border-bottom-color: var(--pm-brand, #2f7fbd);
  background: #eaf2fb;
  color: var(--pm-navy, #17324d);
}

body.pm-modern-theme .pm-guided-workflow-number {
  display: inline-grid;
  width: 1.25rem;
  height: 1.25rem;
  place-items: center;
  border-radius: 50%;
  background: #dfe7ef;
  color: #43576b;
  font-size: 0.7rem;
}

body.pm-modern-theme .pm-guided-workflow-step.active .pm-guided-workflow-number {
  background: var(--pm-brand, #2f7fbd);
  color: #fff;
}

@media (max-width: 767.98px) {
  .pm-401k-workspace-inner {
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0 0.75rem;
  }

  .pm-401k-workspace-label {
    display: none;
  }

  .pm-401k-workspace-tabs { flex: 1 1 100%; }
  .pm-401k-workspace-identity { flex: 1 1 100%; padding-top: 0; }

  .pm-401k-workspace-tab {
    padding-right: 0.7rem;
    padding-left: 0.7rem;
    font-size: 0.82rem;
  }
}
