/* Shared account and staff UI, using the public news/events design tokens.
   Keep this scoped: public articles, invoices and LMS supply their own layouts. */
body.workspace-shell {
    --workspace-navy: color-mix(in srgb, var(--brand-primary) 78%, #09283d);
    --workspace-deep: color-mix(in srgb, var(--brand-primary) 58%, #071d2b);
    --workspace-ink: #132d3d;
    --workspace-muted: #506673;
    --workspace-paper: #f1f5f3;
    --workspace-line: #c8d4d8;
    --workspace-body: "IBM Plex Sans", "Segoe UI", sans-serif;
    --workspace-display: "Newsreader", Georgia, serif;
    --workspace-mono: "IBM Plex Mono", Consolas, monospace;
    --bg: var(--workspace-paper);
    --text: var(--workspace-ink);
    --muted: var(--workspace-muted);
    --border: var(--workspace-line);
    --radius: 2px;
    --shadow: none;
    color: var(--workspace-ink);
    background: var(--workspace-paper);
    font-family: var(--workspace-body);
    line-height: 1.6;
}

body.workspace-shell main:is(.page-shell, .page-shell-wide) {
    margin-top: 2rem !important;
    margin-bottom: 4rem !important;
}

body.workspace-shell .page-header {
    min-height: 190px;
    padding: clamp(1.4rem, 3vw, 2.5rem) !important;
    border: 1px solid var(--workspace-navy);
    border-bottom: 6px solid var(--brand-accent);
    border-radius: 2px;
    color: #fff;
    background: var(--workspace-deep);
    box-shadow: none;
}

body.workspace-shell .page-header > .d-flex { min-height: 110px; }
body.workspace-shell .page-header > .d-flex > .d-flex { min-width: 0; }
body.workspace-shell .page-header h1 {
    margin: .55rem 0 .5rem;
    color: #fff;
    font-family: var(--workspace-display);
    font-size: clamp(2.5rem, 4.5vw, 4rem);
    font-weight: 500 !important;
    letter-spacing: -.04em;
    line-height: 1.03;
    overflow-wrap: anywhere;
}

body.workspace-shell .page-header p.text-secondary {
    max-width: 72ch;
    margin-bottom: 0;
    color: rgba(255, 255, 255, .76) !important;
    font-size: .97rem;
}

body.workspace-shell .breadcrumb-wrap { padding: 0; border: 0; border-radius: 0; background: none; }
body.workspace-shell .breadcrumb { gap: .15rem; flex-wrap: wrap; }
body.workspace-shell .breadcrumb :is(a, .active) {
    color: rgba(255, 255, 255, .8);
    font-family: var(--workspace-mono);
    font-size: .65rem;
    font-weight: 400;
    letter-spacing: .045em;
    text-transform: uppercase;
}
body.workspace-shell .breadcrumb a:hover { color: var(--brand-accent); text-decoration: underline; }
body.workspace-shell .breadcrumb-item + .breadcrumb-item::before { color: rgba(255, 255, 255, .4); }

body.workspace-shell :is(.content-card, .card, .section-card, .review-card, .batch-card, .forum-panel) {
    border: 1px solid var(--workspace-line);
    border-radius: 2px;
    background: #fff;
    box-shadow: none;
}

/* Bootstrap utilities on legacy cards otherwise retain the old elevation. */
body.workspace-shell #main-content :is(.card, .content-card, .section-card, .review-card).border-0 { border: 1px solid var(--workspace-line) !important; }
body.workspace-shell #main-content :is(.shadow, .shadow-sm, .shadow-lg) { box-shadow: none !important; }
body.workspace-shell #main-content :is(.rounded, .rounded-3, .rounded-4) { border-radius: 2px !important; }
body.workspace-shell .content-card.workspace-frame {
    padding: 0 !important;
    border: 0;
    background: transparent;
    box-shadow: none;
}
body.workspace-shell .workspace-frame > div > form:not(.row) {
    padding: clamp(1rem, 2.5vw, 2rem);
    border: 1px solid var(--workspace-line);
    background: #fff;
}
body.workspace-shell .card-header { padding: 1rem 1.25rem; border-bottom-color: var(--workspace-line); background: var(--workspace-paper); }
body.workspace-shell .card-footer { border-top-color: var(--workspace-line); background: var(--workspace-paper); }
body.workspace-shell :where(#main-content) :is(h2, h3, .section-title, .review-section-title, .user-title) {
    color: var(--workspace-ink);
    font-family: var(--workspace-display);
    font-weight: 500;
    letter-spacing: -.025em;
    line-height: 1.15;
}
body.workspace-shell :where(#main-content) h2 { font-size: clamp(1.65rem, 2.5vw, 2.1rem); }
body.workspace-shell :where(#main-content) h3 { font-size: 1.55rem; }
body.workspace-shell :where(#main-content) :is(h2, h3).fw-bold { font-weight: 500 !important; }
body.workspace-shell :where(#main-content) :is(.text-secondary, .text-muted) { color: var(--workspace-muted) !important; }
body.workspace-shell #main-content .text-primary { color: var(--workspace-navy) !important; }

body.workspace-shell :is(.btn, .btn-group, .form-control, .form-select, .input-group-text, .page-link, .dropdown-menu, .alert, .modal-content, .accordion-item, .list-group) { border-radius: 2px; }
body.workspace-shell .btn {
    --bs-btn-font-weight: 500;
    min-height: 42px;
    padding: .6rem 1rem;
    font-size: .87rem;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: none;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
body.workspace-shell .btn:hover { transform: none; }
body.workspace-shell .btn-sm { min-height: 34px; padding: .4rem .75rem; font-size: .79rem; }
body.workspace-shell .btn-lg { padding: .8rem 1.4rem; font-size: 1rem; }
body.workspace-shell .btn-primary { border-color: var(--workspace-navy); color: #fff; background: var(--workspace-navy); }
body.workspace-shell .btn-primary:is(:hover, :focus-visible, :active) { border-color: var(--workspace-deep); color: #fff; background: var(--workspace-deep); }
body.workspace-shell :is(.btn-outline-primary, .btn-outline-secondary) { border-color: var(--workspace-line); color: var(--workspace-navy); background: #fff; }
body.workspace-shell :is(.btn-outline-primary, .btn-outline-secondary):hover { border-color: var(--workspace-navy); color: #fff; background: var(--workspace-navy); }
body.workspace-shell .page-header :is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-dark) { border-color: rgba(255, 255, 255, .5); color: #fff; background: transparent; }
body.workspace-shell .page-header :is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-dark):hover { border-color: #fff; background: rgba(255, 255, 255, .12); }
body.workspace-shell .page-header .btn-primary { border-color: var(--brand-accent); color: var(--workspace-ink); background: var(--brand-accent); }
body.workspace-shell :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 3px; box-shadow: none; }
body.workspace-shell :is(.form-control, .form-select, .input-group-text) { min-height: 44px; border-color: var(--workspace-line); font-size: .93rem; }
body.workspace-shell :is(.form-control, .form-select):focus { border-color: var(--workspace-navy); box-shadow: 0 0 0 2px rgba(0, 58, 117, .12); }
body.workspace-shell :is(.form-control, .form-select):disabled { background-color: var(--workspace-paper); }
body.workspace-shell .form-control::placeholder { color: #697c86; }
body.workspace-shell .form-control::file-selector-button { background: var(--workspace-paper); }
body.workspace-shell :is(.form-label, .review-label, .batch-label, .summary-label, .info-label) {
    color: var(--workspace-muted);
    font-family: var(--workspace-mono);
    font-size: .69rem;
    font-weight: 500;
    letter-spacing: .045em;
    line-height: 1.6;
    text-transform: uppercase;
}
body.workspace-shell .form-text { color: var(--workspace-muted); font-size: .82rem; }
body.workspace-shell .form-check-input { border-color: #8a9da6; }
body.workspace-shell .form-check-input:checked { border-color: var(--workspace-navy); background-color: var(--workspace-navy); }
body.workspace-shell :is(.is-invalid, .was-validated :invalid) { border-color: var(--bs-form-invalid-border-color); }

body.workspace-shell .table {
    --bs-table-color: var(--workspace-ink);
    --bs-table-bg: #fff;
    --bs-table-border-color: var(--workspace-line);
    --bs-table-striped-bg: #f6f8f7;
    --bs-table-hover-bg: #eef3f3;
    font-size: .9rem;
}
body.workspace-shell .table > :not(caption) > * > * { padding: .85rem .9rem; }
body.workspace-shell .table > thead > tr > th {
    border-bottom: 2px solid var(--workspace-navy);
    color: var(--workspace-muted);
    background: var(--workspace-paper);
    font-family: var(--workspace-mono);
    font-size: .65rem;
    font-weight: 500;
    letter-spacing: .035em;
    line-height: 1.6;
    text-transform: uppercase;
}
body.workspace-shell .table-responsive { max-width: 100%; border-radius: 0; }
body.workspace-shell .workspace-frame .d-grid > * { min-width: 0; }
body.workspace-shell .table :is(.btn-group, .d-flex) { flex-wrap: wrap; }
body.workspace-shell .badge { padding: .4em .65em; border-radius: 2px; font-size: .7rem; font-weight: 500; letter-spacing: .01em; line-height: 1.4; white-space: normal; }
body.workspace-shell #main-content .badge.rounded-pill { border-radius: 2px !important; }
body.workspace-shell .pagination { --bs-pagination-border-radius: 2px; gap: .25rem; flex-wrap: wrap; }
body.workspace-shell .page-link { color: var(--workspace-navy); border-color: var(--workspace-line); }
body.workspace-shell .active > .page-link { color: #fff; border-color: var(--workspace-navy); background: var(--workspace-navy); }
body.workspace-shell :is(.nav-tabs, .nav-pills) { gap: .2rem 1rem; border-bottom: 1px solid var(--workspace-line); border-radius: 0; }
body.workspace-shell :is(.nav-tabs, .nav-pills) .nav-link { padding: .8rem .25rem; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: var(--workspace-muted); font-size: .88rem; background: transparent; }
body.workspace-shell :is(.nav-tabs, .nav-pills) .nav-link.active { border-bottom-color: var(--workspace-navy); color: var(--workspace-navy); background: transparent; }
body.workspace-shell .modal-content { border: 1px solid var(--workspace-line); box-shadow: 0 12px 50px rgba(7, 29, 43, .18); }
body.workspace-shell .modal-header { border-bottom: 3px solid var(--brand-accent); }
body.workspace-shell .modal-title { font-family: var(--workspace-display); font-size: 1.8rem; font-weight: 500; }
body.workspace-shell .modal-footer { border-color: var(--workspace-line); background: var(--workspace-paper); }
body.workspace-shell .alert { border-width: 0 0 0 3px; font-size: .91rem; }
body.workspace-shell .accordion-button { color: var(--workspace-ink); background: var(--workspace-paper); box-shadow: none; }

/* Existing user, membership, licence and CPD review detail components. */
body.workspace-shell .user-hero { border: 1px solid var(--workspace-line); border-top: 3px solid var(--workspace-navy); border-radius: 2px; background: #fff; box-shadow: none; }
body.workspace-shell .user-avatar { border: 1px solid var(--workspace-line); border-radius: 2px; box-shadow: none; }
body.workspace-shell :is(.info-panel, .review-subcard, .note-box, .notes-box, .role-box, .summary-metric, .apps-note, .review-form, .action-group) { border: 1px solid var(--workspace-line); border-radius: 2px; background: var(--workspace-paper); box-shadow: none; }
body.workspace-shell :is(.note-box, .notes-box) { border-left: 3px solid var(--brand-accent); }
body.workspace-shell :is(.review-value, .batch-value) { padding: .45rem 0 .7rem; border: 0; border-bottom: 1px solid var(--workspace-line); border-radius: 0; background: transparent; color: var(--workspace-ink); overflow-wrap: anywhere; }
body.workspace-shell :is(.review-subtitle, .section-title) { color: var(--workspace-ink); }
body.workspace-shell .summary-value { color: var(--workspace-navy); font-family: var(--workspace-display); font-size: 2rem; font-weight: 500; }
body.workspace-shell :is(.status-pill, .apps-status) { border-radius: 2px; font-weight: 500; }
body.workspace-shell :is(.signature-box, .signature-preview, .signature-pad) { border-color: var(--workspace-line); border-radius: 2px; background: #fff; }
body.workspace-shell .signature-box img { max-width: 100%; height: auto; }

/* Library and publication editors keep their existing composition and controls. */
body.workspace-shell .library-page { grid-template-columns: minmax(0, 1fr); }
body.workspace-shell .library-page > * { min-width: 0; }
body.workspace-shell :is(.library-page__intro, .library-page__intro-icon, .library-page__directory-card, .library-page__file-card, .library-page__file-icon, .library-page__empty, .library-admin__root, .library-admin__child, .library-admin__form-section, .library-admin__membership-levels, .library-admin__membership-options) { border-radius: 2px; border-color: var(--workspace-line); box-shadow: none; }
body.workspace-shell :is(.library-page__intro, .library-page__empty, .library-admin__child, .library-admin__form-section, .library-admin__membership-options) { background: var(--workspace-paper); }
body.workspace-shell .library-page__intro { border-left: 3px solid var(--workspace-navy); }
body.workspace-shell .library-admin__root { background: #fff; }
body.workspace-shell .library-page__directory-card:hover { transform: none; border-color: var(--workspace-navy); box-shadow: none; }
body.workspace-shell :is(.library-page__file-card, .library-page__directory-card) { min-width: 0; overflow-wrap: anywhere; }
body.workspace-shell .admin-editor { --editor-border: var(--workspace-line); --editor-muted: var(--workspace-muted); --editor-soft: var(--workspace-paper); --editor-radius: 2px; }
body.workspace-shell :is(.admin-editor__hero, .admin-editor__media-card, .admin-editor__person-card, .admin-editor__empty, .admin-editor__price-card, .admin-editor__modal-preview, .admin-editor__block, .admin-editor__gallery-list-item, .admin-editor__sticky-actions, .lms-rich-editor-shell, .organization-location-map) { border-radius: 2px; box-shadow: none; }
body.workspace-shell .admin-editor__hero { background: var(--workspace-paper); }
body.workspace-shell .admin-editor__sticky-actions { border-top: 3px solid var(--workspace-navy); background: #fff; }
body.workspace-shell :is(.site-page__contents a, .site-page__document-icon, .site-page__document-cover, .site-page__editable, .site-page__person-card) { border-radius: 2px; box-shadow: none; }

@media (max-width: 767.98px) {
    body.workspace-shell main:is(.page-shell, .page-shell-wide) { margin-top: 1rem !important; margin-bottom: 2rem !important; }
    body.workspace-shell .page-header { min-height: 170px; padding: 1.35rem !important; }
    body.workspace-shell .page-header > .d-flex > .d-flex:last-child { flex-wrap: wrap; }
    body.workspace-shell .page-header h1 { font-size: clamp(2.15rem, 9vw, 3.1rem); }
    body.workspace-shell .page-header p.text-secondary { font-size: .88rem; }
    body.workspace-shell .workspace-frame { min-width: 0; }
    body.workspace-shell #main-content .row > * { min-width: 0; }
    body.workspace-shell .info-row { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
    body.workspace-shell .action-group { flex-wrap: wrap; }
    body.workspace-shell .table { font-size: .83rem; }
    body.workspace-shell .table > :not(caption) > * > * { padding: .75rem; }
    body.workspace-shell .library-admin__child { margin-left: .75rem; }
    body.workspace-shell .library-admin__root > .d-flex { flex-wrap: wrap; }
    body.workspace-shell .library-admin__root > .d-flex > .flex-grow-1 { flex: 1 1 180px; min-width: 0; }
    body.workspace-shell .library-admin__root .btn-group { flex-shrink: 0; margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
    body.workspace-shell :is(.btn, .library-page__directory-card) { transition: none; }
}
