:root {
  --brand-primary: #0d6efd;
  --brand-on-primary: #fff;
  --portal-ink: #19263b;
  --portal-muted: #667085;
  --portal-border: #e3e8ef;
}

html { font-size: 16px; min-height: 100%; }
body { min-height: 100vh; display: flex; flex-direction: column; background: #f7f9fc; color: var(--portal-ink); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2, h3 { letter-spacing: -.035em; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.8rem, 3vw, 2.35rem); font-weight: 700; }
h2 { font-size: 1.18rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 650; }
a { color: #185abc; }
.text-secondary { color: var(--portal-muted) !important; }
.btn { border-radius: .5rem; font-weight: 600; padding: .6rem 1rem; }
.btn-sm { padding: .35rem .65rem; font-size: .84rem; }
.btn-lg { font-size: 1rem; padding: .8rem 1.25rem; }
.btn-primary { --bs-btn-bg: var(--brand-primary); --bs-btn-border-color: var(--brand-primary); --bs-btn-color: var(--brand-on-primary); --bs-btn-hover-bg: var(--brand-primary); --bs-btn-hover-border-color: var(--brand-primary); --bs-btn-hover-color: var(--brand-on-primary); --bs-btn-active-bg: var(--brand-primary); --bs-btn-active-border-color: var(--brand-primary); --bs-btn-active-color: var(--brand-on-primary); --bs-btn-disabled-bg: var(--brand-primary); --bs-btn-disabled-border-color: var(--brand-primary); --bs-btn-disabled-color: var(--brand-on-primary); }
.btn-primary:hover { filter: brightness(.95); }
.btn-outline-primary { --bs-btn-color: var(--portal-ink); --bs-btn-border-color: #bdc9d9; --bs-btn-hover-bg: var(--brand-primary); --bs-btn-hover-border-color: var(--brand-primary); --bs-btn-hover-color: var(--brand-on-primary); --bs-btn-active-bg: var(--brand-primary); --bs-btn-active-border-color: var(--brand-primary); --bs-btn-active-color: var(--brand-on-primary); }
.btn:focus-visible, a:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus { outline: 2px solid #175cd3; outline-offset: 3px; box-shadow: none; }
.form-label { font-size: .88rem; font-weight: 600; }
.form-control, .form-select { border-color: #cdd5df; border-radius: .45rem; }
.form-control-color { height: 2.375rem; }
.form-text { color: var(--portal-muted); }
.alert { border-radius: .65rem; }
.portal-content { flex: 1; padding-top: 2.4rem; padding-bottom: 3.5rem; }
.portal-nav { min-height: 82px; }
.navbar-brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--portal-ink); font-weight: 750; font-size: 1.1rem; letter-spacing: -.025em; margin-right: 2.5rem; }
.brand-mark { display: inline-block; flex: 0 0 10px; width: 10px; height: 26px; border-radius: 3px; background: var(--brand-primary); }
.brand-logo { max-width: 240px; max-height: 42px; object-fit: contain; }
.portal-nav .nav-link { color: #576277; font-size: .9rem; font-weight: 500; padding-left: .8rem; padding-right: .8rem; }
.portal-nav .nav-link.active { color: var(--portal-ink); font-weight: 700; }
.account-link { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-footer { background: #fff; padding: 1.35rem 0; font-size: .78rem; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-bottom: 2rem; }
.page-heading > div { min-width: 0; max-width: 100%; }
.eyebrow { font-size: .69rem; letter-spacing: .15em; font-weight: 750; text-transform: uppercase; color: var(--portal-muted); margin-bottom: .65rem; }
.portal-card { padding: 1.65rem; background: #fff; border: 1px solid var(--portal-border); border-radius: .9rem; box-shadow: 0 3px 10px rgb(25 38 59 / 2%); }
.metric-card { display: flex; flex-direction: column; gap: .45rem; border: 1px solid var(--portal-border); border-radius: .75rem; padding: 1.25rem 1.5rem; background: #fff; }
.metric-card > span { font-size: .8rem; color: var(--portal-muted); font-weight: 500; }
.metric-card > strong { font-size: 1.9rem; font-weight: 650; line-height: 1.2; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.9rem 0 1rem; }
.section-heading h2 { margin-bottom: 0; }
.empty-state { text-align: center; padding: 3.5rem 1.75rem; }
.empty-state p { max-width: 560px; margin-left: auto; margin-right: auto; }
.empty-symbol { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 1rem; background: #f0f4f9; border-radius: 14px; color: #7c8b9e; font-size: 1.6rem; font-weight: 300; }
.company-card { display: flex; flex-direction: column; }
.company-card h3 { overflow-wrap: anywhere; }
.company-avatar { width: 40px; height: 40px; display: inline-grid; place-items: center; background: #f0f4f9; color: #455b79; font-weight: 650; border-radius: 10px; }
.status-badge, .role-label, .count-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: .35rem .65rem; font-size: .72rem; line-height: 1.2; font-weight: 650; white-space: nowrap; }
.status-active { background: #eaf7ef; color: #247145; }
.status-pending { background: #fff6df; color: #845609; }
.status-suspended { background: #fff0ed; color: #a03d2b; }
.status-muted, .role-label, .count-badge { background: #f0f3f8; color: #536075; }
.back-link { display: inline-block; color: #59687d; font-size: .82rem; text-decoration: none; margin-bottom: 1.5rem; }
.back-link:hover, .table-link:hover { text-decoration: underline; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.5rem; border-bottom: 1px solid var(--portal-border); }
.card-heading h2 { margin: 0; }
.card-heading p { margin-top: .4rem; }
.member-row { padding: 1.15rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid #edf0f4; }
.member-row:last-child { border-bottom: 0; }
.member-identity { min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.member-identity strong { font-size: .85rem; overflow-wrap: anywhere; font-weight: 600; }
.member-form { display: flex; align-items: center; gap: .5rem; }
.member-form select { min-width: 95px; }
.member-form select[name="Role"] { min-width: 132px; }
.card-footnote { padding: 1rem 1.5rem; background: #fbfcfe; border-top: 1px solid var(--portal-border); font-size: .75rem; }
.portal-table > :not(caption) > * > * { padding: 1.05rem 1.5rem; border-bottom-color: #edf0f4; }
.portal-table thead th { background: #fbfcfe; color: var(--portal-muted); font-size: .73rem; font-weight: 600; white-space: nowrap; }
.portal-table tbody th { font-weight: 600; font-size: .88rem; min-width: 160px; }
.status-form { min-width: 220px; max-width: 260px; }
.table-link { white-space: nowrap; font-size: .8rem; text-decoration: none; font-weight: 600; }
.invitation-card { max-width: 600px; margin-top: 2rem; padding: 2.25rem; }
.invitation-card h1 { font-size: 1.8rem; overflow-wrap: anywhere; }
.invitation-details { display: grid; grid-template-columns: 1fr 1.4fr; gap: .7rem 1rem; padding: 1.25rem 0; margin: 1.5rem 0; border-block: 1px solid var(--portal-border); font-size: .85rem; }
.invitation-details dt { font-weight: 500; color: var(--portal-muted); }
.invitation-details dd { margin: 0; overflow-wrap: anywhere; }
.welcome-section { padding: 3.8rem 0 3rem; }
.welcome-title { font-size: clamp(2.2rem, 3.9vw, 3.35rem); line-height: 1.13; letter-spacing: -.05em; }
.brand-accent { color: #536c91; }
.welcome-description { font-size: 1.1rem; line-height: 1.7; max-width: 540px; margin-top: 1.5rem; }
.welcome-guide { border-top: 3px solid var(--brand-primary); padding: 2rem; }
.steps-list { list-style: none; padding: 0; margin: 1.8rem 0 0; }
.steps-list li { display: flex; gap: 1rem; margin-bottom: 1.65rem; }
.step-number { color: #8f9db1; font-size: .78rem; padding-top: .2rem; font-weight: 600; }
.steps-list h3 { font-size: .9rem; letter-spacing: -.01em; margin-bottom: .45rem; }
.steps-list p { color: var(--portal-muted); font-size: .82rem; line-height: 1.65; margin: 0; }
.release-note { border-top: 1px solid var(--portal-border); padding-top: 1.1rem; font-size: .75rem; line-height: 1.65; color: var(--portal-muted); }
.validation-summary-valid { display: none; }

@media (max-width: 1199.98px) {
  .member-form { flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 991.98px) {
  .portal-nav { min-height: 72px; }
  .navbar-brand { margin-right: .5rem; max-width: calc(100% - 65px); font-size: 1rem; }
  .navbar-brand > span:last-child { overflow-wrap: anywhere; white-space: normal; }
  .navbar-collapse { padding-top: 1rem; padding-bottom: 1rem; }
  .portal-nav .nav-link { padding-left: 0; }
  .account-navigation { border-top: 1px solid var(--portal-border); padding-top: .7rem; margin-top: .7rem; }
  .account-navigation .btn { align-self: start; margin-top: .3rem; }
  .welcome-section { padding-top: 1.5rem; }
}
@media (max-width: 575.98px) {
  .portal-content { padding-top: 1.6rem; padding-bottom: 2rem; }
  .page-heading, .section-heading { align-items: flex-start; flex-direction: column; gap: .8rem; }
  .metric-card { flex-direction: row; align-items: center; justify-content: space-between; padding: .8rem 1.15rem; }
  .metric-card > strong { font-size: 1.6rem; }
  .portal-card { padding: 1.25rem; }
  .member-row { align-items: flex-start; flex-direction: column; padding: 1rem; }
  .member-form { width: 100%; flex-wrap: wrap; justify-content: flex-start; }
  .member-form select { width: auto; flex: 1; }
  .card-heading { padding: 1.1rem; }
  .card-footnote { padding: 1rem; }
  .invitation-card { margin-top: .5rem; }
  .invitation-details { grid-template-columns: 1fr; gap: .3rem; }
  .invitation-details dd { margin-bottom: .6rem; }
  .welcome-title { font-size: 2.3rem; }
  .welcome-section { padding: 1rem 0; }
  .welcome-guide { padding: 1.5rem; }
  .brand-logo { max-width: 220px; }
}
