/* The shared Manage users workspace (2.5 R2). Every rule is under the library-owned mu- prefix, and .mu-workspace defines
   every token the rules read, so a host that links this sheet needs no other library's stylesheet. The root sets no
   typography: the workspace takes the host page's font and text colour. The values are NM CIP's 1.4.17 look, resolved. */
.mu-workspace {
    --mu-border: #d9dde3;
    --mu-accent: #0f6cbd;
    --mu-surface: #fff;
    --mu-subtle: #fafafa;
    --mu-divider: #e4e4e7;
    --mu-line: #d4d4d8;
    --mu-muted: #71717a;
    --mu-strong: #18181b;
    --mu-link: #0d4f8a;
    --mu-ring: rgba(9, 9, 11, 0.10);
    --mu-radius: 8px;
    --mu-radius-lg: 12px;
    --mu-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    --mu-error-fg: #991b1b;
    --mu-error-bg: #fef2f2;
    --mu-error-border: #fecaca;
    --mu-text-body: 14px;
    --mu-text-help: 13px;
    --mu-text-min: 12px;
    min-width: 0;
}

/* The switch: grey track when off, accent when on (R12). */
.mu-switch { position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; cursor: pointer; }
.mu-switch input {
    position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
    opacity: 0; cursor: inherit; z-index: 1;
}
.mu-switch-track {
    position: relative; width: 2.65rem; height: 1.45rem; border-radius: 999px;
    background: var(--mu-border); transition: background .15s ease;
}
.mu-switch-thumb {
    position: absolute; width: 1.05rem; height: 1.05rem; top: .2rem; left: .2rem;
    border-radius: 50%; background: white; box-shadow: 0 1px 3px rgb(0 0 0 / 25%);
    transition: transform .15s ease;
}
.mu-switch input:checked + .mu-switch-track { background: var(--mu-accent); }
.mu-switch input:checked + .mu-switch-track .mu-switch-thumb { transform: translateX(1.2rem); }
.mu-switch input:focus-visible + .mu-switch-track { outline: 3px solid var(--mu-accent); outline-offset: 2px; }
.mu-switch input:disabled + .mu-switch-track { opacity: .5; cursor: not-allowed; }

/* The person panel. */
.mu-panel {
    margin: 0 0 18px;
    padding: 14px;
    background: var(--mu-surface);
    border: 1px solid var(--mu-ring);
    border-radius: var(--mu-radius-lg);
    box-shadow: var(--mu-shadow);
}
.mu-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mu-panel h2 { margin: 0; font-size: 17px; }
.mu-panel h3 { margin: 16px 0 6px; font-size: var(--mu-text-body); }
.mu-subtext { color: var(--mu-muted); font-size: var(--mu-text-help); font-weight: 400; }
.mu-help { margin: 4px 0 0; color: var(--mu-muted); font-size: var(--mu-text-help); }
.mu-button {
    display: inline-flex; align-items: center; gap: 8px; min-height: 36px; max-width: 100%;
    padding: 8px 12px; border: 1px solid var(--mu-line); border-radius: var(--mu-radius);
    color: var(--mu-strong); background: var(--mu-surface); box-shadow: var(--mu-shadow);
    font: inherit; font-weight: 600; cursor: pointer;
}
.mu-button:hover:not(:disabled) { background: var(--mu-subtle); }
.mu-error {
    margin: 0 0 10px; padding: 8px 12px; color: var(--mu-error-fg); background: var(--mu-error-bg);
    border: 1px solid var(--mu-error-border); border-radius: var(--mu-radius);
}
.mu-notice {
    margin: 0 0 10px; padding: 8px 12px; background: var(--mu-subtle); border: 1px solid var(--mu-ring);
    border-radius: var(--mu-radius); font-size: var(--mu-text-body);
}
.mu-change { display: grid; gap: 4px; max-width: 34rem; margin: 0 0 8px; }
.mu-change label { font-size: var(--mu-text-help); font-weight: 600; }
.mu-change input {
    min-height: 36px; padding: 6px 10px; color: var(--mu-strong); background: var(--mu-surface);
    border: 1px solid var(--mu-line); border-radius: var(--mu-radius); font: inherit; font-size: 16px;
}
.mu-change input:disabled { color: var(--mu-muted); background: var(--mu-subtle); cursor: not-allowed; }

/* A switch this caller cannot use is greyed out, and why is written on the page, not only in a tooltip. */
.mu-gated {
    margin: 0 0 8px; padding: 8px 12px; color: var(--mu-strong); background: var(--mu-subtle);
    border: 1px solid var(--mu-line); border-radius: var(--mu-radius); font-size: var(--mu-text-help);
}
.mu-gated.mu-is-hidden { display: none; }
.mu-is-gated strong, .mu-is-gated label { color: var(--mu-muted); }
.mu-is-gated .mu-switch { cursor: not-allowed; }
.mu-gated-reason { display: block; margin-top: 2px; color: var(--mu-strong); font-size: var(--mu-text-help); font-style: italic; }
.mu-roles, .mu-modules { margin: 0; padding: 0; list-style: none; }
.mu-roles > li, .mu-readonly {
    display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--mu-divider);
}
.mu-roles > li:last-child { border-bottom: 0; }
.mu-roles strong, .mu-readonly strong { display: inline-block; font-size: var(--mu-text-body); }
.mu-roles .mu-subtext, .mu-readonly .mu-subtext { display: block; }
.mu-pill {
    display: inline-block; margin-inline-start: 6px; padding: 2px 8px; border: 1px solid var(--mu-divider);
    border-radius: var(--mu-radius); background: var(--mu-subtle); font-size: var(--mu-text-min); line-height: 1.5;
    font-weight: 500;
}
.mu-modules > li {
    display: grid; grid-template-columns: 1.2rem 12rem minmax(0, 1fr); gap: 8px; padding: 4px 0; color: var(--mu-muted);
}
.mu-modules > li.mu-is-open { color: var(--mu-strong); }

/* People with portal access. */
.mu-section { margin-top: 22px; }
.mu-section > h2 { font-size: 16px; margin: 0 0 6px; }
.mu-loading { margin: 8px 0; color: var(--mu-muted); }
.mu-empty { color: var(--mu-muted); }
.mu-table { width: 100%; border-collapse: collapse; font-size: var(--mu-text-body); line-height: 1.5; text-align: left; }
.mu-table th, .mu-table td { padding: 10px 12px; border-bottom: 1px solid var(--mu-divider); vertical-align: top; overflow-wrap: anywhere; }
.mu-table thead th { background: var(--mu-subtle); color: var(--mu-strong); border-bottom-color: var(--mu-line); font-weight: 600; }
.mu-table .mu-subtext { display: block; }
.mu-link { padding: 0; color: var(--mu-link); background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.mu-link:hover { text-decoration: underline; }

.mu-spinner {
    display: inline-block; flex: 0 0 auto; width: 1rem; height: 1rem; border: 2px solid currentColor;
    border-right-color: transparent; border-radius: 50%; animation: mu-spin .8s linear infinite;
}
@keyframes mu-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .mu-spinner { animation: none; }
}
.mu-visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}
@media (max-width: 640px) {
    .mu-modules > li { grid-template-columns: 1.2rem minmax(0, 1fr); }
    .mu-modules > li > .mu-subtext { grid-column: 2; }
    .mu-table th, .mu-table td { padding: 8px 6px; }
}
