.dashboard-shell { width: min(92rem, calc(100% - 2rem)); margin: 0 auto; padding: clamp(2rem, 5vw, 4.5rem) 0 5rem; }
.header-links { display: flex; gap: 1rem; color: var(--green); font-weight: 800; }
.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; }
.dashboard-heading h1 { margin: .3rem 0 .65rem; font-family: Georgia, serif; font-size: clamp(2.4rem, 5vw, 4.5rem); line-height: 1; letter-spacing: -.035em; }
.dashboard-heading p:not(.eyebrow) { max-width: 50rem; margin: 0; color: var(--muted); line-height: 1.6; }
.dashboard-heading .secondary-button { flex: none; }
.access-panel { max-width: 35rem; padding: 2rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--paper); }
.access-panel h2 { margin-top: 0; font-family: Georgia, serif; }
.access-panel p { margin-bottom: 1.5rem; color: var(--muted); line-height: 1.6; }
.dashboard-grid { display: grid; grid-template-columns: minmax(17rem, 24rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
.user-panel, .detail-panel { min-height: 34rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--paper); box-shadow: 0 .6rem 2rem rgba(23, 58, 47, .07); overflow: hidden; }
.add-learner-panel, .master-scope-panel { padding: 1.1rem; border-bottom: 1px solid var(--line); background: #f4fbf8; }
.add-learner-panel h2, .master-scope-panel h2 { margin: .2rem 0 .45rem; font-family: Georgia, serif; font-size: 1.35rem; }
.add-learner-panel > p, .master-scope-panel > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.add-learner-form { display: grid; gap: .42rem; margin-top: .9rem; }
.add-learner-form > label { color: #3f514b; font-size: .875rem; font-weight: 850; }
.add-learner-form > small { color: var(--muted); font-size: .875rem; line-height: 1.4; }
.add-learner-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
.add-learner-controls input { width: 100%; min-height: 2.8rem; padding: .58rem .68rem; border: 1px solid #aebfba; border-radius: .62rem; background: white; color: var(--ink); font: inherit; font-size: .88rem; }
.add-learner-controls input:focus { outline: 3px solid rgba(11, 102, 95, .16); border-color: var(--green); }
.add-learner-controls input[aria-invalid="true"] { border-color: #b43a33; }
.add-learner-controls .primary-button { display: inline-grid; min-height: 2.8rem; padding: .55rem .78rem; place-items: center; white-space: nowrap; }
.inline-status { min-height: 1.25rem; margin: .55rem 0 0 !important; color: var(--muted); font-size: .875rem !important; font-weight: 750; line-height: 1.4; }
.inline-status-success { color: #0b665f !important; }
.inline-status-error { color: #a92e28 !important; }
.panel-heading { padding: 1.1rem; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: .25rem 0 1rem; font-family: Georgia, serif; font-size: 1.55rem; }
.search-label input { width: 100%; min-height: 2.7rem; padding: .55rem .7rem; border: 1px solid #bdc9c5; border-radius: .62rem; }
.search-label input:focus { outline: 3px solid rgba(11, 102, 95, .16); border-color: var(--green); }
.user-list { max-height: 61vh; overflow: auto; }
.user-button { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: .7rem; width: 100%; padding: .85rem 1rem; border: 0; border-bottom: 1px solid #e6ece9; color: var(--ink); background: white; text-align: left; cursor: pointer; }
.user-button:hover, .user-button.selected { background: #edf8f4; }
.user-button.selected { box-shadow: inset .25rem 0 var(--green); }
.user-avatar { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; color: white; background: var(--green); font-weight: 900; }
.user-button strong, .user-button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-button strong { margin-top: .1rem; }
.user-button small { margin-top: .18rem; color: var(--muted); }
.user-button .user-id-line { color: #536660; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .875rem; }
.user-summary { min-width: 0; }
.user-name-row { display: flex; align-items: center; justify-content: space-between; gap: .55rem; }
.user-name-row strong { min-width: 0; }
.user-list-role { flex: none; padding: .18rem .38rem; border-radius: 999px; color: var(--green); background: var(--mint); font-size: .65rem; font-weight: 900; letter-spacing: .035em; text-transform: uppercase; }
.empty-state { display: grid; place-items: center; align-content: center; min-height: 34rem; padding: 2rem; text-align: center; }
.empty-state > span { color: var(--green); font-size: 2rem; }
.empty-state h2 { margin: .8rem 0 .3rem; font-family: Georgia, serif; }
.empty-state p { max-width: 28rem; margin: 0; color: var(--muted); line-height: 1.6; }
.detail-inner { padding: clamp(1rem, 3vw, 2rem); }
.user-title { display: flex; justify-content: space-between; gap: 1rem; align-items: start; margin-bottom: 1.5rem; }
.user-title h2 { margin: .2rem 0; font-family: Georgia, serif; font-size: 2rem; }
.user-title p { margin: 0; color: var(--muted); }
.role-chip { padding: .38rem .6rem; border-radius: 999px; color: var(--green); background: var(--mint); font-size: .75rem; font-weight: 900; text-transform: uppercase; }
.role-management { display: grid; justify-items: end; max-width: 24rem; gap: .45rem; text-align: right; }
.role-management-row { display: flex; align-items: center; justify-content: flex-end; gap: .55rem; }
.role-management p { font-size: .875rem; line-height: 1.4; }
.role-action-button { min-height: 2.35rem; padding: .45rem .68rem; border: 1px solid #9dbdb3; border-radius: .6rem; color: var(--green); background: white; font-size: .78rem; font-weight: 850; cursor: pointer; }
.role-action-button:hover { background: #edf8f4; }
.remove-learner-button { border-color: #d6aaa6; color: #9f302a; }
.remove-learner-button:hover { background: #fff2f1; }
.role-action-button:focus-visible { outline: 3px solid rgba(11, 102, 95, .18); outline-offset: 2px; }
.role-action-button:disabled { cursor: wait; opacity: .65; }
.role-action-status { min-height: 1.1rem; font-weight: 750; }
.role-action-success { color: #0b665f !important; }
.role-action-error { color: #a92e28 !important; }
.profile-user-id { margin-top: .45rem !important; color: #455a53 !important; font-size: .875rem; }
.profile-user-id span { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; margin: 1.2rem 0 1.8rem; }
.metric-card { padding: .9rem; border: 1px solid var(--line); border-radius: .75rem; background: #fbfcfb; }
.metric-card strong, .metric-card span { display: block; }
.metric-card strong { font-family: Georgia, serif; font-size: 1.65rem; }
.metric-card span { margin-top: .25rem; color: var(--muted); font-size: .78rem; line-height: 1.35; }
.detail-section { margin-top: 2rem; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.section-heading h3 { margin: 0; font-family: Georgia, serif; font-size: 1.35rem; }
.section-heading p { margin: 0; color: var(--muted); font-size: .8rem; }
.mastery-panel { padding: 1rem; border: 1px solid var(--line); border-radius: .85rem; background: #fbfcfb; }
.mastery-section-heading { align-items: end; margin-bottom: .4rem; }
.mastery-section-heading > div { min-width: 0; }
.mastery-section-heading p { margin-top: .3rem; line-height: 1.45; }
.mastery-search-label { flex: 0 1 20rem; display: grid; gap: .3rem; min-width: min(100%, 16rem); color: #4d5e58; font-size: .8rem; font-weight: 850; }
.mastery-search-label input { width: 100%; min-height: 2.75rem; padding: .55rem .7rem; border: 1px solid #bdc9c5; border-radius: .62rem; background: white; font: inherit; font-weight: 600; }
.mastery-search-label input:focus { outline: 3px solid rgba(11, 102, 95, .16); border-color: var(--green); }
.mastery-result-count { min-height: 1.2rem; margin: 0 0 .55rem; color: var(--muted); font-size: .78rem; font-weight: 750; text-align: right; }
.mastery-table-wrap { max-height: 24rem; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; background: white; }
.mastery-table-wrap thead th { position: sticky; top: 0; z-index: 2; }
.mastery-item-detail { display: block; max-width: 22rem; margin-top: .2rem; overflow: hidden; color: var(--muted); font-size: .72rem; font-weight: 600; text-overflow: ellipsis; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: .7rem; }
table { width: 100%; border-collapse: collapse; font-size: .84rem; }
th, td { padding: .65rem .7rem; border-bottom: 1px solid #e6ece9; text-align: left; white-space: nowrap; }
th { color: #4d5e58; background: #f2f6f4; font-size: .72rem; letter-spacing: .035em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.progress { width: 7rem; height: .55rem; border-radius: 999px; background: #e0e8e5; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); }
.progress-label { display: flex; align-items: center; gap: .55rem; font-weight: 800; }
.signal-note { margin: .7rem 0 0; padding: .75rem; border-radius: .65rem; color: #62501e; background: #fff5d8; font-size: .8rem; line-height: 1.5; }
.empty-row { padding: 1.5rem; color: var(--muted); text-align: center; }
.empty-row strong, .empty-row span { display: block; }
.empty-row span { margin-top: .35rem; font-size: .8rem; line-height: 1.45; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 940px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .user-list { max-height: 20rem; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .dashboard-heading { align-items: stretch; flex-direction: column; }
  .header-links { font-size: .82rem; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .user-title { flex-direction: column; }
  .role-management { justify-items: start; text-align: left; }
  .role-management-row { justify-content: flex-start; }
  .mastery-section-heading { align-items: stretch; flex-direction: column; }
  .mastery-search-label { width: 100%; min-width: 0; }
  .mastery-result-count { text-align: left; }
  .mastery-table-wrap { max-height: 22rem; }
  .add-learner-controls { grid-template-columns: 1fr; }
  .add-learner-controls .primary-button { width: 100%; }
}
