:root {
  --dashboard-frame: 1380px;
}

.dashboard-role-nav {
  --dashboard-accent: #1268c4;
  --dashboard-accent-soft: #edf5ff;
  position: relative;
  z-index: 40;
  border-bottom: 1px solid #dbe4f5;
  color: #10245c;
  background: #fff;
  box-shadow: 0 7px 25px rgba(19, 42, 86, .055);
}

.office-workspace-header.dashboard-role-nav,
.fees-workspace-header.dashboard-role-nav,
.author-header.dashboard-role-nav {
  display: block;
  min-height: 0;
  padding: 0;
}

.dashboard-role-nav--member {
  --dashboard-accent: #1268c4;
  --dashboard-accent-soft: #edf5ff;
}

.dashboard-role-nav--admin {
  --dashboard-accent: #c83d46;
  --dashboard-accent-soft: #fff0f1;
}

.dashboard-role-nav--office,
.dashboard-role-nav--fees {
  --dashboard-accent: #278f58;
  --dashboard-accent-soft: #eaf7ef;
}

.dashboard-role-nav--author {
  --dashboard-accent: #7550b7;
  --dashboard-accent-soft: #f2ecfb;
}

.dashboard-role-nav-inner {
  display: flex;
  width: min(calc(100% - 48px), var(--dashboard-frame));
  min-height: 76px;
  align-items: stretch;
  justify-content: space-between;
  gap: clamp(24px, 4vw, 56px);
  margin-inline: auto;
}

.dashboard-role-title {
  display: grid;
  min-width: max-content;
  grid-template-columns: 42px auto;
  align-items: center;
  align-self: center;
  gap: 12px;
  color: #10245c;
  text-decoration: none;
}

.dashboard-role-title-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--dashboard-accent) 34%, #dbe4f5);
  border-radius: 14px;
  color: #fff;
  background: var(--dashboard-accent);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--dashboard-accent) 20%, transparent);
  font: 900 15px/1 'Changa', Arial, sans-serif;
  letter-spacing: -.02em;
}

.dashboard-role-title .dashboard-role-title-mark {
  padding: 0;
  color: #fff;
  background: var(--dashboard-accent);
  font-size: 15px;
  letter-spacing: -.02em;
  text-transform: none;
}

.dashboard-role-title-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}

.dashboard-role-title .dashboard-role-title-copy {
  padding: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  letter-spacing: 0;
  text-transform: none;
}

.dashboard-role-title-copy strong {
  color: #10245c;
  font: 800 21px/1.1 'Changa', Arial, sans-serif;
  letter-spacing: -.025em;
}

.dashboard-role-title .dashboard-role-title-copy strong {
  display: block;
  color: #10245c;
  font-size: 21px;
}

.dashboard-role-title-copy small {
  margin-top: 4px;
  color: #65718a;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .115em;
  text-transform: uppercase;
}

.dashboard-role-links {
  display: flex;
  min-width: 0;
  align-items: stretch;
  align-self: stretch;
  gap: 2px;
}

.dashboard-role-nav .dashboard-role-links {
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dashboard-role-nav .dashboard-role-links > a,
.dashboard-role-nav .dashboard-role-links > .admin-nav-group > summary {
  position: relative;
  display: inline-flex;
  min-width: max-content;
  min-height: 76px;
  align-items: center;
  border: 0;
  border-bottom: 4px solid transparent;
  border-radius: 0;
  padding: 4px 12px 0;
  color: #596583;
  background: transparent;
  font: 800 16px/1 'Changa', Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.dashboard-role-nav .dashboard-role-links > a:hover,
.dashboard-role-nav .dashboard-role-links > a.is-current,
.dashboard-role-nav .dashboard-role-links > a[aria-current='page'],
.dashboard-role-nav .dashboard-role-links > .admin-nav-group:hover > summary,
.dashboard-role-nav .dashboard-role-links > .admin-nav-group.is-current > summary,
.dashboard-role-nav .dashboard-role-links > .admin-nav-group[open] > summary {
  color: #10245c;
  border-bottom-color: var(--dashboard-accent);
  background: linear-gradient(to top, var(--dashboard-accent-soft), transparent 62%);
}

.dashboard-role-nav .dashboard-role-links > a:focus-visible,
.dashboard-role-nav .dashboard-role-links > .admin-nav-group > summary:focus-visible,
.dashboard-role-title:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--dashboard-accent) 35%, transparent);
  outline-offset: -3px;
}

.dashboard-role-links .admin-nav-group {
  position: relative;
}

.dashboard-role-links .admin-nav-menu {
  top: calc(100% + 1px);
  width: 230px;
  border-radius: 0 0 14px 14px;
  border-top: 4px solid var(--dashboard-accent);
  padding: 9px;
}

.dashboard-role-links .admin-nav-menu a {
  border-radius: 9px;
  padding: 10px 11px;
  font-family: 'Changa', Arial, sans-serif;
  font-size: 14px;
}

.dashboard-role-links .admin-nav-menu a:hover,
.dashboard-role-links .admin-nav-menu a[aria-current='page'] {
  color: #10245c;
  background: var(--dashboard-accent-soft);
}

.role-dashboard-intro {
  --dashboard-accent: #1268c4;
  --dashboard-accent-soft: #edf5ff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(24px, 5vw, 68px);
  margin: 0 0 24px;
  border: 1px solid #dbe4f5;
  border-left: 6px solid var(--dashboard-accent);
  border-radius: 20px;
  padding: clamp(25px, 3.5vw, 38px);
  color: #10245c;
  background:
    linear-gradient(115deg, color-mix(in srgb, var(--dashboard-accent-soft) 72%, #fff), #fff 58%);
  box-shadow: 0 14px 38px rgba(20, 43, 92, .075);
}

.role-dashboard-intro--member {
  --dashboard-accent: #1268c4;
  --dashboard-accent-soft: #edf5ff;
}

.role-dashboard-intro--admin {
  --dashboard-accent: #c83d46;
  --dashboard-accent-soft: #fff0f1;
}

.role-dashboard-intro--office,
.role-dashboard-intro--fees {
  --dashboard-accent: #278f58;
  --dashboard-accent-soft: #eaf7ef;
}

.role-dashboard-intro--author {
  --dashboard-accent: #7550b7;
  --dashboard-accent-soft: #f2ecfb;
}

.role-dashboard-intro-copy {
  max-width: 850px;
}

.role-dashboard-intro .role-dashboard-kicker {
  margin: 0 0 7px;
  color: var(--dashboard-accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.role-dashboard-intro h1 {
  max-width: 880px;
  margin: 0;
  color: #10245c;
  font: 800 clamp(34px, 4.2vw, 52px)/1.02 'Changa', Arial, sans-serif;
  letter-spacing: -.04em;
}

.role-dashboard-intro-copy > p:last-of-type {
  max-width: 760px;
  margin: 12px 0 0;
  color: #65718a;
  font-size: 16px;
  line-height: 1.62;
}

.role-dashboard-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.role-dashboard-actions a,
.role-dashboard-actions button {
  min-width: max-content;
}

.dashboard-page-frame {
  width: min(calc(100% - 48px), var(--dashboard-frame));
  margin-inline: auto;
}

.theme-member .member-site > .role-dashboard-intro {
  margin-top: 42px;
}

.admin-workspace {
  --dashboard-accent: #c83d46;
  --dashboard-accent-soft: #fff0f1;
  --brand: #c83d46;
  --brand-dark: #962832;
  --accent: #c83d46;
}

.admin-page > .admin-dashboard,
.admin-page-content,
.page-shell > .admin-main,
.admin-page > .admin-main,
.finance-shell {
  max-width: var(--dashboard-frame);
}

.admin-page > .page-heading,
.admin-page > .metric-strip,
.admin-page > .filter-bar,
.admin-page > .alert,
.admin-page > .admin-section {
  max-width: var(--dashboard-frame);
}

.admin-dashboard .admin-section {
  border-top-color: #c83d46;
}

.office-workspace {
  --dashboard-accent: #278f58;
  --dashboard-accent-soft: #eaf7ef;
  --office-blue: #278f58;
  --office-green: #278f58;
}

.role-dashboard-intro--office .office-action {
  color: #145333;
  border-color: #badfca;
  background: #fff;
  box-shadow: 0 8px 20px rgba(39, 143, 88, .08);
}

.role-dashboard-intro--office .office-action.primary {
  color: #fff;
  border-color: #278f58;
  background: #278f58;
}

.fees-workspace {
  --dashboard-accent: #278f58;
  --dashboard-accent-soft: #eaf7ef;
  --brand: #278f58;
  --brand-dark: #17663d;
  --accent: #278f58;
}

.fees-workspace .admin-section {
  border-top-color: #278f58;
}

.author-studio {
  --dashboard-accent: #7550b7;
  --dashboard-accent-soft: #f2ecfb;
  --studio-blue: #7550b7;
  --studio-purple: #6840a4;
}

.author-studio .studio-button.secondary,
.author-studio .author-row-actions a,
.author-studio .studio-role,
.author-studio .studio-status,
.author-studio .author-action-panel > header > span,
.author-studio .author-action-type {
  color: #6840a4;
  background: #f2ecfb;
}

/* Connected-page polish shared by every protected role workspace. */
.admin-workspace .admin-page > .page-heading:not(.role-dashboard-intro),
.admin-workspace .admin-page-content > .page-heading:not(.role-dashboard-intro),
.office-workspace .office-section-heading,
.author-studio .studio-heading {
  --role-interior-accent: #c83d46;
  --role-interior-soft: #fff0f1;
  width: 100%;
  max-width: var(--dashboard-frame);
  box-sizing: border-box;
  align-items: center;
  margin: 0 auto 24px;
  border: 1px solid #dbe4f0;
  border-left: 5px solid var(--role-interior-accent);
  border-radius: 18px;
  padding: clamp(22px, 3vw, 30px);
  background: linear-gradient(115deg, var(--role-interior-soft), #fff 55%);
  box-shadow: 0 12px 32px rgba(20, 43, 92, .06);
}

.office-workspace .office-section-heading {
  --role-interior-accent: #278f58;
  --role-interior-soft: #eaf7ef;
}

.author-studio .studio-heading {
  --role-interior-accent: #7550b7;
  --role-interior-soft: #f2ecfb;
}

.admin-workspace .page-heading:not(.role-dashboard-intro) .eyebrow,
.office-workspace .office-section-heading .eyebrow,
.author-studio .studio-heading .studio-eyebrow {
  color: var(--role-interior-accent);
}

.admin-workspace .metric-strip,
.fees-workspace .metric-strip {
  overflow: hidden;
  border: 1px solid #dbe4f0;
  border-top: 4px solid var(--dashboard-accent, var(--brand));
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(20, 43, 92, .045);
}

.admin-workspace .table-wrap,
.fees-workspace .table-wrap,
.author-studio .table-wrap {
  overflow: auto;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  background: #fff;
  scrollbar-color: #bcc9da #f4f7fb;
  scrollbar-width: thin;
}

.admin-workspace .table-wrap table,
.fees-workspace .table-wrap table,
.author-studio .table-wrap table {
  margin: 0;
}

.admin-workspace .table-wrap th,
.fees-workspace .table-wrap th,
.author-studio .table-wrap th {
  padding-top: 13px;
  padding-bottom: 13px;
  color: #526078;
  background: #f4f7fb;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .055em;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-workspace .table-wrap td,
.fees-workspace .table-wrap td,
.author-studio .table-wrap td {
  min-width: 110px;
  padding-top: 14px;
  padding-bottom: 14px;
  vertical-align: top;
}

.admin-workspace .table-wrap tbody tr:hover,
.fees-workspace .table-wrap tbody tr:hover,
.author-studio .table-wrap tbody tr:hover {
  background: color-mix(in srgb, var(--dashboard-accent-soft, #edf5ff) 55%, #fff);
}

.admin-workspace .table-wrap tbody tr:last-child td,
.fees-workspace .table-wrap tbody tr:last-child td,
.author-studio .table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.admin-workspace .table-wrap td[colspan],
.fees-workspace .table-wrap td[colspan],
.author-studio .table-wrap td[colspan] {
  min-height: 96px;
  padding: 30px 22px;
  color: #65718a;
  text-align: center;
}

.admin-workspace .form-stack,
.fees-workspace .finance-filter,
.office-workspace .office-workspace-form,
.author-studio .chapter-editor {
  min-width: 0;
}

.admin-workspace input:focus-visible,
.admin-workspace select:focus-visible,
.admin-workspace textarea:focus-visible,
.fees-workspace input:focus-visible,
.fees-workspace select:focus-visible,
.fees-workspace textarea:focus-visible,
.office-workspace input:focus-visible,
.office-workspace select:focus-visible,
.office-workspace textarea:focus-visible,
.author-studio input:focus-visible,
.author-studio select:focus-visible,
.author-studio textarea:focus-visible {
  border-color: var(--dashboard-accent, var(--brand));
  outline-color: color-mix(in srgb, var(--dashboard-accent, var(--brand)) 38%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dashboard-accent, var(--brand)) 12%, transparent);
}

.office-workspace .office-workspace-empty,
.author-studio .studio-empty,
.admin-workspace .admin-empty-state {
  border: 1px dashed color-mix(in srgb, var(--dashboard-accent, #65718a) 35%, #dbe4f0);
  border-radius: 14px;
  background: color-mix(in srgb, var(--dashboard-accent-soft, #f4f7fb) 55%, #fff);
}

.admin-workspace .section-heading,
.fees-workspace .section-heading,
.author-studio .studio-panel > header,
.theme-member .member-section-heading,
.theme-member .member-connected-page .section-heading {
  min-width: 0;
  align-items: center;
  gap: 18px;
}

.admin-workspace .section-heading > div,
.fees-workspace .section-heading > div,
.author-studio .studio-panel > header > div,
.theme-member .member-section-heading > div,
.theme-member .member-connected-page .section-heading > div {
  min-width: 0;
}

.admin-workspace .section-heading h2,
.fees-workspace .section-heading h2,
.author-studio .studio-panel > header h2,
.theme-member .member-section-heading h2,
.theme-member .member-connected-page .section-heading h2 {
  overflow-wrap: anywhere;
}

.admin-workspace .section-heading p,
.fees-workspace .section-heading p,
.author-studio .studio-panel > header p,
.theme-member .member-section-heading p,
.theme-member .member-connected-page .section-heading p {
  max-width: 760px;
}

.dashboard-connected-actions,
.admin-workspace .admin-heading-actions,
.fees-workspace .admin-heading-actions,
.author-studio .author-row-actions,
.theme-member .member-purchase-actions,
.theme-member .member-site .role-dashboard-actions {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard-connected-actions > *,
.admin-workspace .admin-heading-actions > *,
.fees-workspace .admin-heading-actions > *,
.author-studio .author-row-actions > *,
.theme-member .member-purchase-actions > *,
.theme-member .member-site .role-dashboard-actions > * {
  min-width: max-content;
}

.dashboard-connected-card-grid,
.admin-workspace .admin-workspace-grid,
.fees-workspace .finance-workspace-grid,
.author-studio .author-readiness-grid,
.theme-member .member-access-grid {
  min-width: 0;
}

.dashboard-connected-card-grid > *,
.admin-workspace .admin-workspace-card,
.admin-workspace .admin-overview-card,
.fees-workspace .finance-panel,
.author-studio .studio-panel,
.theme-member .member-access-card,
.theme-member .member-connected-page .fa-card,
.theme-member .member-connected-page .fa-panel {
  min-width: 0;
}

.dashboard-connected-section-note,
.admin-workspace .admin-section > .alert,
.fees-workspace .finance-workbench-note,
.fees-workspace .finance-reconciliation-guide,
.author-studio .author-preview-status,
.theme-member .member-library-note,
.theme-member .member-connected-page .alert {
  box-sizing: border-box;
}

.admin-workspace .admin-empty-state,
.fees-workspace .finance-empty,
.author-studio .studio-empty,
.theme-member .member-download-empty,
.theme-member .member-access-empty,
.theme-member .member-connected-page td[colspan] {
  overflow-wrap: anywhere;
}

.admin-workspace .admin-code-stack,
.fees-workspace .finance-code-stack,
.author-studio .author-code-stack,
.theme-member .member-connected-page .member-code-stack {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.admin-workspace .admin-code-stack code,
.fees-workspace .finance-code-stack code,
.author-studio .author-code-stack code,
.theme-member .member-connected-page .member-code-stack code {
  max-width: 100%;
}

/* Admin account workflow: identity, access, and security in one workbench. */
.admin-account-workspace { gap: 24px; }
.admin-account-overview { margin: 0; }
.admin-account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .65fr);
  gap: 24px;
  align-items: start;
}
.admin-account-layout > .admin-section,
.admin-account-context > .admin-section,
.admin-account-security-grid > .admin-section {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  margin: 0;
}
.admin-account-primary { border-top-color: #c83d46 !important; }
.admin-account-context { position: sticky; top: 20px; display: grid; gap: 18px; }
.admin-account-context .admin-section { padding: 24px; }
.admin-account-context h2 { margin: 4px 0 16px; font-size: 23px; line-height: 1.15; }
.admin-account-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.admin-account-form label { min-width: 0; }
.admin-form-submit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 4px;
  border-top: 1px solid #dbe4f0;
  padding-top: 20px;
}
.admin-form-submit-bar span { max-width: 420px; color: #65718a; font-size: 12px; line-height: 1.45; text-align: right; }
.admin-account-role-guide { display: grid; gap: 7px; }
.admin-account-role-guide > div {
  border: 1px solid #dbe4f0;
  border-radius: 11px;
  padding: 12px 13px;
  background: #fff;
}
.admin-account-role-guide > div.is-current { border-color: #c83d46; background: #fff0f1; box-shadow: inset 3px 0 #c83d46; }
.admin-account-role-guide strong, .admin-account-role-guide span { display: block; }
.admin-account-role-guide strong { color: #10245c; font-size: 14px; }
.admin-account-role-guide span { margin-top: 3px; color: #65718a; font-size: 12px; line-height: 1.4; }
.admin-account-audit dl { margin: 0; }
.admin-account-audit dl > div { padding: 11px 0; border-bottom: 1px solid #dbe4f0; }
.admin-account-audit dl > div:last-child { padding-bottom: 0; border-bottom: 0; }
.admin-account-audit dt { color: #65718a; font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.admin-account-audit dd { margin: 4px 0 0; overflow-wrap: anywhere; color: #10245c; font-weight: 800; }
.admin-account-security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.admin-account-security-grid .admin-section { border-top-color: #c83d46; }
.admin-account-security-note { min-height: 48px; margin: 0; color: #65718a; line-height: 1.6; }

@media (max-width: 1100px) {
  .dashboard-role-nav-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding-top: 14px;
  }

  .dashboard-role-links {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .dashboard-role-nav .dashboard-role-links > a,
  .dashboard-role-nav .dashboard-role-links > .admin-nav-group > summary {
    min-height: 52px;
  }

  .dashboard-role-nav--admin .dashboard-role-links {
    flex-wrap: wrap;
    overflow: visible;
  }

  .admin-account-layout { grid-template-columns: 1fr; }
  .admin-account-context { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .dashboard-role-nav-inner,
  .dashboard-page-frame {
    width: min(calc(100% - 28px), var(--dashboard-frame));
  }

  .dashboard-role-title {
    grid-template-columns: 36px auto;
  }

  .dashboard-role-title-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    font-size: 13px;
  }

  .dashboard-role-title-copy strong {
    font-size: 19px;
  }

  .dashboard-role-nav .dashboard-role-links > a,
  .dashboard-role-nav .dashboard-role-links > .admin-nav-group > summary {
    min-height: 48px;
    padding-right: 10px;
    padding-left: 10px;
    font-size: 15px;
  }

  .dashboard-role-nav--admin .dashboard-role-links {
    align-items: stretch;
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .dashboard-role-nav--admin .dashboard-role-links > a,
  .dashboard-role-nav--admin .dashboard-role-links > .admin-nav-group > summary {
    width: 100%;
    justify-content: space-between;
  }

  .dashboard-role-nav--admin .admin-nav-menu {
    position: static;
    width: 100%;
    margin-top: 0;
    border-radius: 0 0 12px 12px;
    box-shadow: none;
  }

  .role-dashboard-intro {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 16px;
    padding: 24px 21px;
  }

  .role-dashboard-actions {
    justify-content: flex-start;
  }

  .admin-workspace .admin-page > .page-heading:not(.role-dashboard-intro),
  .admin-workspace .admin-page-content > .page-heading:not(.role-dashboard-intro),
  .office-workspace .office-section-heading,
  .author-studio .studio-heading {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 15px;
    padding: 22px 20px;
  }

  .admin-workspace .table-wrap,
  .fees-workspace .table-wrap,
  .author-studio .table-wrap {
    margin-right: -4px;
    margin-left: -4px;
    border-radius: 11px;
  }

  .admin-workspace .table-wrap th,
  .admin-workspace .table-wrap td,
  .fees-workspace .table-wrap th,
  .fees-workspace .table-wrap td,
  .author-studio .table-wrap th,
  .author-studio .table-wrap td {
    padding-right: 11px;
    padding-left: 11px;
  }

  .admin-account-field-grid,
  .admin-account-context,
  .admin-account-security-grid { grid-template-columns: 1fr; }
  .admin-form-submit-bar { align-items: flex-start; flex-direction: column; }
  .admin-form-submit-bar span { text-align: left; }
}
