/* Shared frame for every internal page; preserve existing page components.
   Customer portal and light mode do not opt into this dark shell. */
[data-bs-theme="dark"] body.staff-shell {
    --workspace-page: #20252b;
    --workspace-page-rgb: 32, 37, 43;
    --workspace-surface: #292f36;
    --workspace-header: #2f363e;
    --workspace-header-rgb: 47, 54, 62;
    --workspace-border: #46505b;
    --workspace-input: #242a31;
    --workspace-control: #7d8997;
    --workspace-text: #e8ecf0;
    --workspace-text-rgb: 232, 236, 240;
    --workspace-muted: #b5bdc7;
    --workspace-muted-rgb: 181, 189, 199;
    --workspace-link: #89bfff;
    --workspace-link-rgb: 137, 191, 255;
    background-color: var(--workspace-page);
}
[data-bs-theme="dark"][data-dark-palette="charcoal"] body.staff-shell {
    --workspace-page: #252422;
    --workspace-page-rgb: 37, 36, 34;
    --workspace-surface: #302f2c;
    --workspace-header: #373632;
    --workspace-header-rgb: 55, 54, 50;
    --workspace-border: #514f49;
    --workspace-input: #292825;
    --workspace-control: #958f82;
    --workspace-text: #eeede9;
    --workspace-text-rgb: 238, 237, 233;
    --workspace-muted: #c3bfb5;
    --workspace-muted-rgb: 195, 191, 181;
    --workspace-link: #a5caff;
    --workspace-link-rgb: 165, 202, 255;
}
[data-bs-theme="dark"][data-dark-palette="slate"] body.staff-shell {
    --workspace-page: #1b2532;
    --workspace-page-rgb: 27, 37, 50;
    --workspace-surface: #243244;
    --workspace-header: #2b3c50;
    --workspace-header-rgb: 43, 60, 80;
    --workspace-border: #3b4c60;
    --workspace-input: #1d2a3a;
    --workspace-control: #8296ac;
    --workspace-text: #e6edf5;
    --workspace-text-rgb: 230, 237, 245;
    --workspace-muted: #b2c1d1;
    --workspace-muted-rgb: 178, 193, 209;
    --workspace-link: #81bfff;
    --workspace-link-rgb: 129, 191, 255;
}
[data-bs-theme="dark"] .staff-shell > #app > .navbar {
    /* Bootstrap's bg-white and the legacy dark override both use !important. */
    background-color: var(--workspace-page) !important;
    border-bottom-color: var(--workspace-border);
    --bs-navbar-color: var(--workspace-text);
    --bs-navbar-hover-color: #fff;
    --bs-navbar-active-color: #fff;
}
[data-bs-theme="dark"] .staff-shell > #app > .navbar .navbar-brand {
    color: var(--workspace-text);
}

/* Shared count badges must not compound Bootstrap's small badge text sizes. */
.staff-shell .checklist-count-indicator {
    font-size: .8125rem;
}

/* Native controls keep the personal appearance chooser keyboard accessible. */
.staff-shell .appearance-menu {
    width: 17rem;
    max-width: calc(100vw - 2rem);
}
.staff-shell .appearance-legend {
    font-size: .875rem;
    font-weight: 600;
    margin-bottom: .5rem;
}
.staff-shell .appearance-option {
    display: flex;
    align-items: center;
    gap: .625rem;
    min-height: 44px;
    cursor: pointer;
}
.staff-shell .appearance-option .form-check-input {
    flex-shrink: 0;
}
.staff-shell .appearance-option:has(:focus-visible) {
    outline: 2px solid var(--bs-link-color);
    outline-offset: 2px;
    border-radius: .25rem;
}
.staff-shell .appearance-option:has(:checked) {
    font-weight: 700;
}
.staff-shell fieldset:disabled .appearance-option {
    cursor: default;
}
.staff-shell .appearance-swatch {
    width: 1rem;
    height: 1rem;
    border-radius: .2rem;
    border: 1px solid #95a1af;
    flex-shrink: 0;
}
.staff-shell .appearance-swatch-graphite { background-color: #292f36; }
.staff-shell .appearance-swatch-charcoal { background-color: #373632; }
.staff-shell .appearance-swatch-slate { background-color: #2b3c50; }
[data-bs-theme="dark"] .staff-shell .appearance-menu {
    --bs-body-bg: var(--workspace-surface);
    --bs-body-color: var(--workspace-text);
    --bs-secondary-color: var(--workspace-muted);
    --bs-secondary-color-rgb: var(--workspace-muted-rgb);
    --bs-link-color: var(--workspace-link);
    --bs-dropdown-bg: var(--workspace-surface);
    --bs-dropdown-color: var(--workspace-text);
    --bs-dropdown-border-color: var(--workspace-border);
    color: var(--workspace-text);
}
[data-bs-theme="dark"] .staff-shell .appearance-menu .form-select {
    background-color: var(--workspace-input);
    border-color: var(--workspace-control);
    color: var(--workspace-text);
}
[data-bs-theme="dark"] .staff-shell .appearance-menu .form-check-input:not(:checked):not(:disabled) {
    border-color: var(--workspace-control);
}
