@import url('mcg-theme-tokens.css');

/*
 * Shared admin design system.
 *
 * Extracted from vrs-admin-dashboard.html so that surface and the customer CRM
 * record page render from one set of tokens and components instead of two
 * drifting copies. What lives here is the foundation — tokens, reset, buttons,
 * tables, badges, forms, modals, sections — plus size variants of those same
 * components. Page chrome (header, nav tabs, stat cards, the Jobs composer)
 * stays with the page that owns it.
 *
 * Linked BEFORE each page's own styles, so a page can still override.
 */

/*
 * The admin palette (redesign 2026-11-22, the "11-12 design"). The one place
 * that sets the admin values of the shared tokens: Malka dark and light, Maple
 * dark and light. Every admin and staff page reads its colours from here.
 */
:root {
    --color-surface-bg: #0a0a1a;
    --color-surface-1: #17192c;
    --color-surface-2: #22253a;
    --color-text-1: #f4f4f7;
    --color-text-2: #a6a9ba;
    --color-text-3: #a6a9ba;
    --color-border: #2b2e45;
    --color-control-border: #5f6485;
    --color-field: #0a0a1a;
    --color-row-hover: #1d2036;
    --color-row-selected: #22253a;
    --color-focus: #7fb2ff;
    --color-link: #7fb2ff;
    --color-action-primary: #f47d22;
    --color-action-primary-hover: #ff9547;
    --color-action-primary-text: #0d1a38;
    --color-action-danger-soft: #3a1c1f;
    --color-action-danger-text: #ff6b6b;
    --color-action-danger-border: #6b2a30;
    --status-neutral: #a6a9ba;
    --status-neutral-text: #a6a9ba;
    --status-neutral-soft: #22253a;
    --status-info: #7fb2ff;
    --status-info-text: #7fb2ff;
    --status-info-soft: #172742;
    --status-success: #8fd14f;
    --status-success-text: #8fd14f;
    --status-success-soft: #1d2b1a;
    --status-warning: #f4b740;
    --status-warning-text: #f4b740;
    --status-warning-soft: #33290f;
    --status-danger: #ff6b6b;
    --status-danger-text: #ff6b6b;
    --status-danger-soft: #3a1c1f;
    --status-purple-soft: #2a2145;
    --status-indigo-soft: #22224a;
    --status-yellow-soft: #332c12;
    /* The rail's active icon: the brand colour. */
    --admin-brand: #f47d22;
}
[data-theme="light"] {
    --color-surface-bg: #f7f7fa;
    --color-surface-1: #ffffff;
    --color-surface-2: #e9ebf1;
    --color-text-1: #0d1a38;
    --color-text-2: #5b6078;
    --color-text-3: #5b6078;
    --color-border: #dde0e8;
    --color-control-border: #8a90a6;
    --color-field: #ffffff;
    --color-row-hover: #f3f4f8;
    --color-row-selected: #e9ebf1;
    --color-focus: #185fa5;
    --color-link: #185fa5;
    --color-action-primary: #f47d22;
    --color-action-primary-hover: #e06a10;
    --color-action-primary-text: #0d1a38;
    --color-action-danger-soft: #fbe4e4;
    --color-action-danger-text: #c62828;
    --color-action-danger-border: #e5a3a3;
    --status-neutral: #5b6078;
    --status-neutral-text: #5b6078;
    --status-neutral-soft: #e9ebf1;
    --status-info: #185fa5;
    --status-info-text: #185fa5;
    --status-info-soft: #e3eefa;
    --status-success: #2e7d32;
    --status-success-text: #2e7d32;
    --status-success-soft: #e5f2e6;
    --status-warning: #9a6100;
    --status-warning-text: #9a6100;
    --status-warning-soft: #fbefd5;
    --status-danger: #c62828;
    --status-danger-text: #c62828;
    --status-danger-soft: #fbe4e4;
    --status-purple-soft: #f1eafa;
    --status-indigo-soft: #eceefd;
    --status-yellow-soft: #fff5d6;
}
[data-admin-brand="maple"] {
    --color-surface-bg: #0b0b0b;
    --color-surface-1: #1b1b1b;
    --color-surface-2: #2a2a2a;
    --color-text-1: #f5f5f5;
    --color-text-2: #b3b3b3;
    --color-text-3: #b3b3b3;
    --color-border: #303030;
    --color-control-border: #6a6a6a;
    --color-field: #0b0b0b;
    --color-row-hover: #222222;
    --color-row-selected: #2a2a2a;
    --color-action-primary: #ffffff;
    --color-action-primary-hover: #e0e0e0;
    --color-action-primary-text: #0b0b0b;
    --status-neutral: #b3b3b3;
    --status-neutral-text: #b3b3b3;
    --status-neutral-soft: #2a2a2a;
    --admin-brand: var(--admin-brand-maple);
}
[data-admin-brand="maple"][data-theme="light"] {
    --color-surface-bg: #ffffff;
    --color-surface-1: #f3f3f3;
    --color-surface-2: #e4e4e4;
    --color-text-1: #0b0b0b;
    --color-text-2: #5e5e5e;
    --color-text-3: #5e5e5e;
    --color-border: #e0e0e0;
    --color-control-border: #8a8a8a;
    --color-field: #ffffff;
    --color-row-hover: #ececec;
    --color-row-selected: #e4e4e4;
    --color-action-primary: #0b0b0b;
    --color-action-primary-hover: #333333;
    --color-action-primary-text: #ffffff;
    --status-neutral: #5e5e5e;
    --status-neutral-text: #5e5e5e;
    --status-neutral-soft: #e4e4e4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.hidden,
[hidden]:not([hidden="until-found"]) {
    display: none !important;
}
.organization-access-identity { overflow-wrap: anywhere; }
:root {
    /* MCG administrative palettes: semantic roles, no organization color overrides. */

    /* Compatibility aliases keep existing consumers on the same theme. */
    --bg-primary: var(--color-surface-bg);
    --bg-secondary: var(--color-surface-1);
    --bg-tertiary: var(--color-surface-2);
    --border-color: var(--color-border);
    --text-primary: var(--color-text-1);
    --text-secondary: var(--color-text-2);
    --text-muted: var(--color-text-3);
    --text-success: var(--status-success-text);
    --text-danger: var(--status-danger-text);
    --accent: var(--color-link);
    --accent-blue: var(--color-link);
    --accent-green: var(--status-success-text);
    --accent-red: var(--status-danger-text);
    --accent-orange: var(--status-warning-text);
    --accent-yellow: var(--status-yellow-text);
    --accent-purple: var(--status-purple-text);
    --accent-indigo: var(--status-indigo-text);
    --accent-grey: var(--status-neutral-text);
    --status-orange: var(--status-warning);
    --status-orange-text: var(--status-warning-text);
    --status-orange-soft: var(--status-warning-soft);
    --status-blue: var(--status-info);
    --status-blue-text: var(--status-info-text);
    --status-blue-soft: var(--status-info-soft);
    --status-green: var(--status-success);
    --status-green-text: var(--status-success-text);
    --status-green-soft: var(--status-success-soft);
    --status-grey: var(--status-neutral);
    --status-grey-text: var(--status-neutral-text);
    --status-grey-soft: var(--status-neutral-soft);
    --status-red: var(--status-danger);
    --status-red-text: var(--status-danger-text);
    --status-red-soft: var(--status-danger-soft);

    /* Canonical responsive breakpoints (docs/ui-design-tokens.md §2).
       Bucket STARTS: xs 0 | sm 480 | md 768 | lg 1024 | xl 1280.
       Custom properties cannot drive @media boundaries, so these are the
       documented/runtime canonical values only; the actual @media rules at the
       bottom of this file author the boundaries literally. */
    --bp-xs: 0px;
    --bp-sm: 480px;
    --bp-md: 768px;
    --bp-lg: 1024px;
    --bp-xl: 1280px;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.4;
    min-height: 100vh;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}
.section-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.section-toolbar {
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    padding: 12px 16px;
}
/* Heights 34 (default) and 28 (.btn-sm). Primary = the action colour. */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--color-surface-1);
    color: var(--text-primary);
    font: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.btn:hover {
    background: var(--color-surface-2);
}
.btn:disabled,
.btn[aria-disabled="true"] {
    cursor: default;
    opacity: 0.45;
}
.btn-primary {
    background: var(--color-action-primary);
    border-color: var(--color-action-primary);
    color: var(--color-action-primary-text);
    font-weight: 600;
}
.btn-primary:hover {
    background: var(--color-action-primary-hover);
    border-color: var(--color-action-primary-hover);
}
.btn-secondary {
    background: var(--color-surface-1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: var(--color-surface-2);
}
.btn-danger:hover {
    background: var(--color-action-danger-soft);
    border-color: var(--color-action-danger-text);
}
.btn-danger {
    /* An ACTION, not a status: destructive actions use action-danger semantics,
       never --status-danger (action != status, P1-9). */
    background: var(--color-action-danger-soft);
    color: var(--color-action-danger-text);
    border: 1px solid var(--color-action-danger-border);
}
.modal-panel.job-datetime-modal-panel {
    width: min(680px, 100%);
}
.modal-panel.billing-invoice-workspace-panel {
    width: min(1180px, 100%);
}
.modal-panel.billing-payment-modal-panel {
    width: min(680px, 100%);
}
.modal-panel.billing-receipt-modal-panel {
    width: min(1120px, 100%);
}
table {
    width: 100%;
    border-collapse: collapse;
}
/* One compact row height for every admin table: staff read these during live
   calls. Headers are small, muted and in sentence case. */
th {
    text-align: left;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}
td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    vertical-align: middle;
}
tr:last-child td {
    border-bottom: none;
}
tr:hover {
    background: var(--color-row-hover);
}
thead tr:hover {
    background: none;
}
tr.selected-row,
tr.selected-row:hover {
    background: var(--color-row-selected);
}
.empty-state-icon {
    font-size: 24px;
    margin-bottom: 8px;
}
.modal-backdrop.active {
    display: flex;
}
/* The header and the footer stay in view; only the body scrolls. */
.modal-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(980px, 100%);
    max-height: 88vh;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 16px 40px var(--color-shadow, rgba(0, 0, 0, 0.35));
}
.modal-header,
.modal-footer {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h2 {
    font-size: 16px;
    font-weight: 600;
}
.modal-header {
    cursor: grab;
    user-select: none;
}
.modal-header:active {
    cursor: grabbing;
}
.modal-footer {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
    border-bottom: none;
}
.modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
}
.modal-close {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
}
.modal-close:hover {
    background: var(--color-surface-2);
    color: var(--text-primary);
}
/* Shared dialog controls retain usable targets across admin workflows. */
.modal-footer .btn { min-height: 44px; }
.modal-panel button:focus-visible,
.modal-panel a:focus-visible,
.form-field.checkbox-field input:focus-visible {
    outline: 2px solid var(--color-action-primary);
    outline-offset: 2px;
}
.form-field.checkbox-field {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    min-height: 48px;
    padding-block: 12px;
    line-height: 1.5;
    cursor: pointer;
}
.form-field.checkbox-field input {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-block-start: 2px;
    padding: 0;
    accent-color: var(--color-action-primary);
}
.form-field.checkbox-field span { min-width: 0; }
.onb-delivery > p { margin-block-end: 16px; line-height: 1.5; }
.crm-section { min-width: 0; overflow-wrap: anywhere; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.form-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.form-field.full {
    grid-column: 1 / -1;
}
.form-field.actions-row {
    align-self: end;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}
/* One rule for form labels: sentence case. Table headers stay uppercase. */
.form-field label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
}
.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--color-field);
    color: var(--text-primary);
    font: inherit;
}
.form-field textarea {
    min-height: 92px;
    resize: vertical;
}
.admin-dark-selects select {
    color-scheme: inherit;
}
.admin-dark-selects select option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}
.help-text {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
}

/* Secondary tab strip, used by the dashboard's Captioning/Jobs sub-views and by
   the Customer Records page. */
.sub-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    max-width: 100%;
    margin-bottom: 16px;
    padding: 2px;
    border-radius: 8px;
    background: var(--color-surface-2);
}

.sub-tab {
    padding: 6px 12px;
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    font: inherit;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    border-radius: 6px;
    white-space: nowrap;
}

.sub-tab:hover {
    color: var(--text-primary);
}

.sub-tab.active {
    background: var(--color-surface-bg);
    color: var(--text-primary);
    font-weight: 600;
}

.sub-tab-panel { display: none; }
.sub-tab-panel.active { display: block; }

/* Transient status message, raised by admin-shell.js on any surface. */
/* Above the dialogs (1000, 1010), so a result is in view over an open editor. */
.admin-toast-stack {
    position: fixed;
    bottom: 24px;
    left: 50%;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: max-content;
    max-width: min(90vw, 520px);
    transform: translateX(-50%);
    pointer-events: none;
}
.admin-toast {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    box-shadow: 0 16px 40px var(--color-shadow, rgba(0, 0, 0, 0.35));
    color: var(--text-primary);
    font-size: 14px;
    overflow-wrap: anywhere;
    white-space: pre-line;
    cursor: pointer;
    pointer-events: auto;
}

/* An error: the danger surface, a danger border and a mark before the text. */
.admin-toast.is-error {
    border-color: var(--status-danger);
    background: var(--status-danger-soft);
}
.admin-toast.is-error::before {
    content: '!';
    flex: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--status-danger);
    color: var(--color-surface-bg);
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
}

/* Compact action button. Used by dashboard row actions and Atlas record
   headers; the class was already applied in markup but never defined. */
.btn-sm {
    min-height: 28px;
    padding: 0 8px;
    font-size: 13px;
}

/* Admin header, tab strip and user menu. Shared once Atlas began carrying the
   same chrome, so moving between the surfaces is not a change of application. */
.header-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.logo h1 {
    font-size: 20px;
    font-weight: 600;
}
.logo-badge {
    background: var(--color-action-primary);
    color: var(--color-action-primary-text);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
/* Keyboard focus must be visible on every admin, CRM and Atlas control. */
:focus-visible { outline: 3px solid var(--accent-blue, #6fc7ff); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.nav-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    width: 100%;
}
.nav-tab {
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    line-height: 1;
    white-space: nowrap;
    flex: 0 0 auto;
    text-decoration: none;
}
.nav-tab:hover {
    color: var(--text-primary);
    background: var(--color-hover);
}
.nav-tab.active {
    background: var(--color-surface-2);
    color: var(--text-primary);
    font-weight: 600;
}

/* Phone-width admin drawer (P1-11). The horizontal strip becomes an off-canvas
   drawer below the md breakpoint; the toggle is shown only there, and the
   scrim (created by admin-shell.js) dims the page while it is open. Desktop
   keeps the inline strip exactly as before. */
.admin-nav-toggle {
    align-items: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    cursor: pointer;
    display: none;
    font-size: 20px;
    height: 40px;
    justify-content: center;
    line-height: 1;
    margin-left: auto;
    width: 40px;
}

.admin-nav-toggle:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.admin-nav-scrim {
    background: rgba(0, 0, 0, 0.5);
    bottom: 0;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 940;
}

@media (max-width: 767.98px) {
    .admin-nav-toggle {
        display: inline-flex;
    }

    .nav-tabs {
        align-items: stretch;
        background: var(--bg-secondary);
        bottom: 0;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 4px;
        left: 0;
        padding: 16px;
        position: fixed;
        top: 0;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        width: 264px;
        z-index: 950;
    }

    .nav-tabs.is-open {
        transform: translateX(0);
    }

    .nav-tab {
        justify-content: flex-start;
        width: 100%;
    }
}

/* ---------------------------------------------------------------------------
   Dashboard shell (redesign 2026-10-29): top bar with the logo, the
   organization scope and the account menu; the area rail with badges; the
   drawer with area names and counts; area tabs; the "source · age" marks.
   The standalone Atlas pages keep the strip and drawer above.
   --------------------------------------------------------------------------- */
/* The Maple mark's colour is Maple's theme.primary (dark) and theme.primaryDark
   (light) in whitelabel/maple.json (web-brand.test.js keeps them equal). */
:root {
    --admin-rail-width: 88px;
    --admin-brand-maple: #e00000;
}
[data-theme="light"] {
    --admin-brand-maple: #a90000;
}
.sr-only {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}
/* Two classes: these must win over the page and phone .header rules. The
   top bar stays sticky at every width (it is one row of 56 px). */
.header.admin-topbar {
    gap: 0;
    padding: 0 16px;
    position: sticky;
    top: 0;
}
.admin-topbar .header-main {
    flex-wrap: nowrap;
    gap: 12px;
    min-height: 52px;
}
.admin-topbar .header-live {
    flex: none;
}
#adminScopeLabel {
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 479.98px) {
    .header.admin-topbar {
        padding: 0 8px;
    }
    .admin-topbar .header-main {
        gap: 4px;
    }
    .header-live-age {
        display: none;
    }
    .admin-scope-chip {
        max-width: 132px;
    }
}
.admin-brand {
    align-items: center;
    color: var(--text-primary);
    display: inline-flex;
    flex: none;
    gap: 6px;
    min-height: 44px;
    text-decoration: none;
}
/* The mark follows data-admin-brand, which shared/web-brand.js sets in <head>
   from the tenant config (brand.mark), so the first paint shows the right
   logo. No mark without it. */
.admin-brand-mark {
    background: var(--text-primary);
    display: none;
    flex: none;
    height: 30px;
    -webkit-mask: no-repeat left center / contain;
    mask: no-repeat left center / contain;
    width: 64px;
}
[data-admin-brand="malka"] .admin-brand-mark {
    display: block;
    -webkit-mask-image: url('../images/malka-logo-white.png');
    mask-image: url('../images/malka-logo-white.png');
}
/* A tenant's own logo (brand.mark not set), from --brand-logo-mask. */
[data-admin-brand="image"] .admin-brand-mark {
    display: block;
    -webkit-mask-image: var(--brand-logo-mask);
    mask-image: var(--brand-logo-mask);
}
/* The brand name is for screen readers; the logo shows it. */
.admin-brand h1 {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}
.admin-brand-word {
    display: none;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.12em;
}
[data-admin-brand="maple"] .admin-brand-mark {
    background: var(--admin-brand-maple);
    display: block;
    height: 24px;
    -webkit-mask-image: url('../images/maple-icon-white.png');
    mask-image: url('../images/maple-icon-white.png');
    -webkit-mask-position: center;
    mask-position: center;
    width: 26px;
}
[data-admin-brand="maple"] .admin-brand-word {
    display: inline;
}
.admin-scope {
    position: relative;
}
.admin-scope-chip,
.admin-chip {
    align-items: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    display: inline-flex;
    font: inherit;
    font-size: 14px;
    gap: 6px;
    min-height: 32px;
    padding: 0 12px;
    white-space: nowrap;
}
/* One platform is chosen: the chip says so with the action colour. */
.admin-scope-chip[data-scoped="true"] {
    border-color: var(--color-action-primary);
}
button.admin-scope-chip::after {
    content: '';
    width: 6px;
    height: 6px;
    margin: -3px 2px 0 2px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
}
button.admin-scope-chip:disabled::after {
    display: none;
}
button.admin-scope-chip {
    cursor: pointer;
}
.admin-scope-chip:disabled {
    cursor: default;
    opacity: 1;
}
.admin-topbar-spacer {
    flex: 1 1 auto;
    min-width: 0;
}
.header-live-age {
    color: var(--text-muted);
    font-weight: 400;
}
.admin-account {
    flex: none;
    position: relative;
}
/* A 32 px circle inside a 44 px target. */
.admin-avatar {
    align-items: center;
    background: var(--color-surface-2) content-box;
    border: 0;
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    height: 44px;
    justify-content: center;
    padding: 6px;
    width: 44px;
}
.admin-popover {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 16px 40px var(--color-shadow, rgba(0, 0, 0, 0.35));
    min-width: 260px;
    overflow: hidden;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 120;
}
.admin-scope .admin-popover {
    left: 0;
    min-width: 220px;
    right: auto;
}
.admin-menu-item {
    align-items: center;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: 14px;
    gap: 10px;
    min-height: 44px;
    padding: 8px 14px;
    text-align: left;
    text-decoration: none;
    width: 100%;
}
.admin-menu-item:last-child {
    border-bottom: 0;
}
button.admin-menu-item:hover,
a.admin-menu-item:hover {
    background: var(--color-hover);
}
.admin-menu-item[aria-checked="true"] {
    font-weight: 600;
}
.admin-menu-value {
    color: var(--text-muted);
    font-size: 12px;
    margin-left: auto;
}
.admin-menu-identity {
    cursor: default;
}
.admin-menu-identity .user-info {
    display: block;
}
.admin-menu-identity .user-avatar {
    flex: none;
}
.admin-menu-identity .user-name {
    font-weight: 600;
}
.admin-menu-identity .user-role,
.admin-menu-identity .user-org {
    color: var(--text-muted);
    font-size: 12px;
}
.admin-menu-item .admin-appearance select {
    background: var(--color-field);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font: inherit;
    font-size: 13px;
    min-height: 32px;
    padding: 2px 8px;
}
.admin-menu-item .admin-appearance {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    width: 100%;
}
/* ---------------------------------------------------------------------------
   Staff bar (redesign 2026-10-29): the same top bar on every staff tool. The
   apps button and menu, the logo (.admin-brand), the tool name, the live
   marker, the bell and the account menu (.admin-account). staff-bar.js fills
   the apps menu, the identity and the live marker.
   --------------------------------------------------------------------------- */
.staff-icon {
    display: inline-flex;
    flex: none;
    line-height: 0;
}
.staff-icon-btn {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    flex: none;
    height: 44px;
    justify-content: center;
    padding: 0;
    width: 44px;
}
.staff-icon-btn:hover,
.staff-icon-btn[aria-expanded="true"] {
    background: var(--color-hover);
    color: var(--text-primary);
}
.staff-apps {
    flex: none;
    position: relative;
}
.staff-apps .admin-popover {
    left: 0;
    min-width: 300px;
    right: auto;
}
.staff-tool-name {
    color: var(--text-secondary);
    flex: none;
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
}
.staff-app .staff-app-icon {
    color: var(--color-action-primary);
}
.staff-app-label {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.staff-app-host {
    color: var(--text-muted);
    font-size: 12px;
}
.staff-app[aria-current="page"] {
    font-weight: 600;
}
.staff-app-current {
    color: var(--color-action-primary);
    margin-left: auto;
}
.staff-chip {
    align-items: center;
    border-radius: 6px;
    display: inline-flex;
    flex: none;
    font-size: 12px;
    font-weight: 400;
    gap: 5px;
    margin-left: auto;
    min-height: 22px;
    padding: 0 8px;
    white-space: nowrap;
}
.staff-chip::before {
    background: currentColor;
    border-radius: 50%;
    content: '';
    height: 7px;
    width: 7px;
}
.staff-chip[data-tone="bad"] { background: var(--status-danger-soft); color: var(--status-danger-text); }
.staff-chip[data-tone="warn"] { background: var(--status-warning-soft); color: var(--status-warning-text); }
.staff-chip[data-tone="ok"] { background: var(--status-success-soft); color: var(--status-success-text); }
.staff-chip[data-tone="live"] { background: var(--status-purple-soft); color: var(--status-purple-text); }
.staff-chip[data-tone="neutral"] { background: var(--color-surface-2); color: var(--text-muted); }
.staff-apps-note {
    color: var(--text-muted);
    font-size: 12px;
    padding: 8px 14px;
}
/* "Live · 2 s ago". A button where a click reads again (the old Refresh). */
.staff-live {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-secondary);
    display: inline-flex;
    flex: none;
    font: inherit;
    font-size: 12px;
    font-weight: 400;
    gap: 6px;
    min-height: 32px;
    padding: 0 8px;
    white-space: nowrap;
}
button.staff-live {
    cursor: pointer;
    min-height: 44px;
}
button.staff-live:hover {
    background: var(--color-hover);
    color: var(--text-primary);
}
button.staff-live:disabled {
    cursor: progress;
    opacity: 0.7;
}
.staff-live-dot {
    background: var(--status-purple);
    border-radius: 50%;
    flex: none;
    height: 8px;
    width: 8px;
}
.staff-live[data-state="connecting"] .staff-live-dot,
.staff-live[data-state="reconnecting"] .staff-live-dot {
    background: var(--text-muted);
}
.staff-live[data-state="offline"] {
    border-color: currentColor;
    color: var(--status-warning-text);
}
.staff-live[data-state="offline"] .staff-live-dot {
    background: currentColor;
}
.staff-live-age {
    color: var(--text-muted);
    font-weight: 400;
}
.staff-live .staff-icon svg {
    height: 16px;
    width: 16px;
}
.staff-guest [data-staff-apps-button],
.staff-guest .staff-tool-name {
    display: none;
}
@media (max-width: 479.98px) {
    .staff-tool-name,
    .staff-live-age {
        display: none;
    }
}
/* A back link in a tool's own row ("Live calls", "All documents"). */
.staff-back {
    align-items: center;
    color: var(--color-action-primary);
    display: inline-flex;
    font-size: 13px;
    gap: 2px;
    min-height: 44px;
    text-decoration: none;
    white-space: nowrap;
}
.staff-back .staff-icon svg {
    height: 18px;
    width: 18px;
}
/* A state chip ("Receive-only", "Your mic: off"). */
.staff-state-chip {
    align-items: center;
    background: var(--color-surface-2);
    border-radius: 6px;
    color: var(--text-primary);
    display: inline-flex;
    font-size: 12px;
    gap: 5px;
    min-height: 24px;
    padding: 0 9px;
    white-space: nowrap;
}
.staff-state-chip .staff-icon svg {
    height: 14px;
    width: 14px;
}
.staff-state-chip[data-tone="ok"] {
    background: var(--status-success-soft);
    color: var(--status-success-text);
}
.admin-app {
    display: grid;
    grid-template-columns: var(--admin-rail-width) minmax(0, 1fr);
    min-height: calc(100vh - var(--admin-header-height, 61px));
}
/* The rail: the icon above the name of each area, its count as a badge. */
.admin-rail {
    align-items: center;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 2px;
    height: calc(100vh - var(--admin-header-height, 53px));
    overflow-y: auto;
    padding: 8px 4px;
    position: sticky;
    scrollbar-width: none;
    top: var(--admin-header-height, 53px);
}
.admin-rail::-webkit-scrollbar {
    display: none;
}
/* The rail items are .nav-tab (the router's hook); `.admin-rail` keeps the
   page's and the phone's .nav-tab rules off them. */
.admin-rail .admin-rail-menu,
.admin-rail .admin-rail-item {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    flex: none;
    flex-direction: column;
    font: inherit;
    gap: 2px;
    justify-content: center;
    min-height: 56px;
    padding: 8px 0;
    position: relative;
    text-decoration: none;
    width: 80px;
}
.admin-rail .admin-rail-menu {
    display: none;
}
.admin-rail .admin-rail-item:hover,
.admin-rail .admin-rail-menu:hover {
    background: var(--color-surface-1);
    color: var(--text-primary);
}
.admin-rail .admin-rail-item.active {
    background: var(--color-surface-1);
    color: var(--text-primary);
    font-weight: 400;
}
.admin-rail .admin-rail-item.active .admin-nav-icon {
    color: var(--admin-brand);
}
.admin-rail-label {
    display: block;
    font-size: 11px;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-rail-spacer {
    flex: 1 1 auto;
    min-height: 12px;
}
.admin-nav-icon {
    display: inline-flex;
    line-height: 0;
}
/* The external-link mark: the item opens another site in a new tab (Wavilu). */
.admin-nav-external svg {
    height: 12px;
    width: 12px;
}
.admin-rail .admin-rail-item .admin-nav-external {
    position: absolute;
    right: 14px;
    top: 4px;
}
/* The count of an area: a solid badge at the icon. Red = act now; the other
   tones = waiting. Two classes, so the page's .nav-tab-badge rules do not win. */
.admin-rail .admin-rail-item .nav-tab-badge {
    background: var(--status-warning);
    border: 0;
    border-radius: 9px;
    color: var(--color-surface-bg);
    font-size: 11px;
    font-weight: 600;
    height: 18px;
    line-height: 18px;
    margin: 0;
    min-width: 18px;
    padding: 0 5px;
    position: absolute;
    right: 16px;
    text-align: center;
    top: 4px;
}
.admin-rail .admin-rail-item .nav-tab-badge.status-tone-red {
    background: var(--status-danger);
}
.admin-rail .admin-rail-item .nav-tab-badge.status-tone-indigo {
    background: var(--status-indigo);
}
.admin-rail .admin-rail-item .nav-tab-badge.status-tone-grey {
    background: var(--status-neutral);
}
.admin-nav-drawer {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    bottom: 0;
    box-shadow: 4px 0 24px var(--color-shadow, rgba(0, 0, 0, 0.4));
    left: 0;
    overflow-y: auto;
    padding: 8px;
    position: fixed;
    top: 0;
    width: 260px;
    z-index: 950;
}
.admin-nav-drawer-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.admin-nav-drawer-item {
    align-items: center;
    border-radius: 8px;
    color: var(--text-primary);
    display: flex;
    font-size: 14px;
    gap: 12px;
    min-height: 44px;
    padding: 0 10px;
    text-decoration: none;
}
.admin-nav-drawer-item:hover {
    background: var(--color-hover);
}
.admin-nav-drawer-item.active {
    background: var(--color-surface-2);
    font-weight: 600;
}
.admin-nav-drawer-item .admin-nav-icon {
    color: var(--text-secondary);
}
.admin-nav-drawer-item.active .admin-nav-icon {
    color: var(--admin-brand);
}
.admin-nav-drawer-count {
    font-size: 12px;
    font-weight: 600;
    margin-left: auto;
}
.admin-nav-drawer-separator {
    background: var(--border-color);
    height: 1px;
    margin: 6px 4px;
}
.admin-area-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 8px;
    min-height: 32px;
}
.admin-area-title {
    font-size: 20px;
    font-weight: 600;
}
/* The view tabs: one line from edge to edge of the page, the open view
   underlined in the action colour. The strip scrolls when it is too wide. */
.admin-area-tabs {
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 24px;
    margin: 0 -24px 16px;
    overflow-x: auto;
    padding: 0 24px;
    scrollbar-width: none;
}
.admin-area-tabs::-webkit-scrollbar {
    display: none;
}
.admin-area-tab {
    align-items: center;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    display: inline-flex;
    flex: none;
    font-size: 14px;
    gap: 4px;
    min-height: 44px;
    padding: 0;
    text-decoration: none;
    white-space: nowrap;
}
.admin-area-tab:hover {
    color: var(--text-primary);
}
.admin-area-tab[aria-current="page"] {
    border-bottom-color: var(--color-action-primary);
    color: var(--text-primary);
    font-weight: 600;
}
.admin-area-tab-count {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
}
.admin-area-tab-count[data-tone="red"] { color: var(--status-red-text); }
.admin-area-tab-count[data-tone="orange"] { color: var(--status-orange-text); }
.admin-area-tab-count[data-tone="indigo"] { color: var(--status-indigo-text); }
/* A section that belongs to another view of the same area. */
.is-view-hidden {
    display: none !important;
}
.view-empty {
    color: var(--text-muted);
    font-size: 14px;
    padding: 12px 0;
}
/* "Source · 12 s ago" in a panel head. Amber after two missed refreshes. */
.panel-age {
    align-items: center;
    color: var(--text-muted);
    display: inline-flex;
    font-size: 12px;
    font-weight: 400;
    gap: 6px;
    white-space: nowrap;
}
.panel-age[data-state="stale"] {
    color: var(--status-warning-text);
}
.panel-age[data-state="failed"] {
    color: var(--status-warning-text);
}
.panel-age-retry {
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 6px;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    min-height: 28px;
    padding: 0 8px;
}
.section-header .panel-age {
    margin-left: auto;
}
.section-header .panel-age + .section-actions {
    margin-left: 0;
}

/* The Atlas tabs under the staff bar (Customers, Prospects, Documents), with
   the count of the open tab and the page's own actions on the right. */
.atlas-workspace-nav {
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 2px;
    padding: 0 24px;
}

.atlas-workspace-nav a {
    align-items: center;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    display: inline-flex;
    font-size: 14px;
    font-weight: 400;
    gap: 6px;
    min-height: 44px;
    padding: 0 12px;
    text-decoration: none;
    white-space: nowrap;
}

.atlas-workspace-nav a:hover {
    color: var(--text-primary);
}

.atlas-workspace-nav a.active {
    border-bottom-color: var(--color-action-primary);
    color: var(--text-primary);
    font-weight: 600;
}

.atlas-tab-count {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
}

.atlas-workspace-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
    padding: 6px 0;
}

.atlas-workspace-actions .btn {
    min-height: 36px;
}
.header-right {
    display: flex;
    flex-wrap: wrap;
    min-width: 0;
    align-items: center;
    gap: 16px;
    flex-shrink: 1;
}
.atlas-live-status {
    align-items: center;
    color: var(--text-muted);
    display: inline-flex;
    font-size: 11px;
    font-weight: 600;
    gap: 6px;
    white-space: nowrap;
}
.atlas-live-status::before {
    background: currentColor;
    border-radius: 50%;
    content: '';
    height: 7px;
    width: 7px;
}
.atlas-live-status.is-connected {
    color: var(--status-success-text);
}
.atlas-live-status.is-reconnecting,
.atlas-live-status.is-connecting {
    color: var(--status-warning-text);
}
.refresh-btn {
    padding: 10px 16px;
    background: var(--color-hover);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.refresh-btn:hover {
    background: var(--color-hover-strong);
    color: var(--text-primary);
}
.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 8px 8px;
    background: var(--color-hover);
    border-radius: 30px;
    cursor: pointer;
}
.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--color-surface-2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}
.user-info {
    text-align: left;
}
.user-name {
    font-size: 14px;
    font-weight: 400;
}
.user-role {
    font-size: 11px;
    color: var(--text-muted);
}
.logout-btn:hover {
    background: var(--color-action-danger);
    color: #ffffff;
}

/* Handed-over scope from Atlas: a narrowed list must announce itself, or an
   operator reads an empty Jobs tab as "no jobs" rather than "no jobs here". */
.atlas-scope-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--status-info);
    background: var(--status-info-soft);
    font-size: 13px;
}

/* Shared rules whose leading comment hid them from the first passes. */
/* Header */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    position: sticky;
    top: 0;
    z-index: 100;
}
/* Main Content */
.main-content {
    padding: 16px 24px 48px;
    max-width: 1600px;
    margin: 0 auto;
    min-width: 0;
    width: 100%;
}
/* Dashboard Sections */
/* A card: radius 12, its head a row with the title and the actions. */
.section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}
/* Table Styles */
.table-container {
    overflow-x: auto;
}

/* --- Sticky table headers (opt-in, P1-T1) ---
   For long, page-scrolled desktop tables whose column labels must stay visible
   while the page scrolls. Opt in by adding .table-sticky to the <table> (and
   .section--sticky-table to its section). Native <table>/<thead>/<th> semantics
   are preserved — no JS cloning, no duplicated/floating header. The top offset
   is the measured admin header height (--admin-header-height, set by
   admin-shell.js) so the sticky header sits below the admin header, not under
   it. */
.table-sticky thead th {
    position: sticky;
    top: var(--admin-header-height, 0px);
    z-index: 3; /* above body rows, below the admin header (z-index 100) */
    background: var(--color-surface-1); /* opaque — body rows scroll beneath it */
}

/* A sticky header must not sit inside a scroll/clip ancestor, or it pins to
   that ancestor instead of the page viewport. The .section's overflow:hidden
   (corner clipping) and .table-container's overflow-x:auto both disable
   page-level sticky, so the opt-in section relaxes both. The proving tables
   (Client Error Reports, Client Telemetry Events) fit at desktop widths and do
   not need horizontal scrolling there; at a narrower width a horizontal-scroll
   wrapper may take precedence and sticky-top simply disengages. */
.section--sticky-table {
    overflow: visible;
}
.section--sticky-table .table-container {
    overflow: visible;
}

/* Status Badges */
/* A chip: radius 6, a soft background and the text in the tone's colour. A
   badge with no tone class is the neutral chip. */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--status-neutral-soft);
    color: var(--status-neutral-text);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
}
/* The soft background carries the tone, so a chip needs no dot. */
.status-badge > .status-dot {
    display: none;
}

/* Decorative status dot. It reinforces the adjacent label, which is always
   rendered too, so the dot carries no meaning on its own (aria-hidden in the
   markup). */
.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Status tooltip (IV106 Rev 4): lifecycle, sign-in and provisioning facts from
   the row, plus the latest invitation and delivery state fetched on demand. */
.status-tooltip-host {
    position: relative;
    display: inline-flex;
    cursor: help;
    outline: none;
}
.status-tooltip-host:focus-visible .status-badge {
    outline: 2px solid var(--accent, #0b72d9);
    outline-offset: 2px;
}
.status-tooltip {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 30;
    min-width: 220px;
    max-width: 320px;
    padding: 12px 14px;
    background: #DCEEFF;
    color: #14283E;
    border: 1px solid #A7CDEB;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(20, 40, 62, 0.16);
    font-size: 13px;
    font-weight: 400;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 120ms ease, transform 120ms ease, visibility 120ms;
    pointer-events: none;
}
.status-tooltip.is-open {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.status-tooltip-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}
.status-tooltip-list li {
    display: grid;
    grid-template-columns: minmax(96px, auto) 1fr;
    gap: 8px;
}
.status-tooltip-label {
    color: #42566A;
    font-weight: 400;
    margin-right: 0.4em;
}
.status-tooltip .ops-info {
    color: #42566A;
}
/* Consolidated account-details tooltip structure (IV107 Rev 1). */
.status-tooltip-body {
    display: grid;
    gap: 8px;
}
.status-tooltip-header {
    display: grid;
    gap: 2px;
    padding-bottom: 6px;
    border-bottom: 1px solid #A7CDEB;
}
.status-tooltip-account {
    font-weight: 600;
}
.status-tooltip-role {
    display: grid;
    gap: 2px;
    padding: 2px 0;
}
.status-tooltip-role-name {
    font-weight: 600;
}
.status-tooltip-detail {
    color: #42566A;
}
.status-tooltip-status {
    color: #14283E;
    font-weight: 600;
}
.status-tooltip-last-login {
    margin-top: 2px;
    padding-top: 6px;
    border-top: 1px solid #A7CDEB;
}

/* Consolidated multi-role cell + three-dot actions menu (IV107 Rev 1). */
.account-role-line {
    line-height: 1.35;
    white-space: nowrap;
}
.account-role-line + .account-role-line {
    margin-top: 2px;
}
.account-actions-menu {
    position: relative;
    display: inline-flex;
}
.account-actions-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    background: var(--bg-secondary, #ffffff);
    color: var(--text-primary, #1a1a1a);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.account-actions-toggle:hover,
.account-actions-toggle:focus-visible {
    border-color: var(--accent, #0b72d9);
}
.account-actions-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 40;
    min-width: 180px;
    padding: 4px;
    background: var(--bg-secondary, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 120ms ease, transform 120ms ease, visibility 120ms;
}
.account-actions-dropdown.is-open {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.account-actions-item {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-primary, #1a1a1a);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}
.account-actions-item:hover,
.account-actions-item:focus-visible {
    background: var(--bg-tertiary, #f3f4f6);
}

/* --- Shared status tones (see vrs-status-tokens.js + docs/status-colour-sop.md)
   One status, one colour, everywhere. The SEVEN work-state tones describe a
   piece of work (jobs/invoices/payouts); the FIVE generic tones carry generic
   feedback (QA results, transient feedback). The two vocabularies are
   deliberately separate and do not collapse into each other. */

/* Work-state tones (domain). */
.status-tone-orange { background: var(--status-orange-soft); color: var(--status-orange-text); }
.status-tone-blue { background: var(--status-blue-soft); color: var(--status-blue-text); }
.status-tone-purple { background: var(--status-purple-soft); color: var(--status-purple-text); }
.status-tone-green { background: var(--status-green-soft); color: var(--status-green-text); }
.status-tone-indigo { background: var(--status-indigo-soft); color: var(--status-indigo-text); }
.status-tone-grey { background: var(--status-grey-soft); color: var(--status-grey-text); }
.status-tone-red { background: var(--status-red-soft); color: var(--status-red-text); }

.status-tone-orange .status-dot { background: var(--status-orange); }
.status-tone-blue .status-dot { background: var(--status-blue); }
.status-tone-purple .status-dot { background: var(--status-purple); }
.status-tone-green .status-dot { background: var(--status-green); }
.status-tone-indigo .status-dot { background: var(--status-indigo); }
.status-tone-grey .status-dot { background: var(--status-grey); }
.status-tone-red .status-dot { background: var(--status-red); }

/* Generic feedback tones (neutral/info/success/warning/danger). */
.status-tone-neutral { background: var(--status-neutral-soft); color: var(--status-neutral-text); }
.status-tone-info { background: var(--status-info-soft); color: var(--status-info-text); }
.status-tone-success { background: var(--status-success-soft); color: var(--status-success-text); }
.status-tone-warning { background: var(--status-warning-soft); color: var(--status-warning-text); }
.status-tone-danger { background: var(--status-danger-soft); color: var(--status-danger-text); }

.status-tone-neutral .status-dot { background: var(--status-neutral); }
.status-tone-info .status-dot { background: var(--status-info); }
.status-tone-success .status-dot { background: var(--status-success); }
.status-tone-warning .status-dot { background: var(--status-warning); }
.status-tone-danger .status-dot { background: var(--status-danger); }

/* Yellow: the "cooling" health band of Atlas (HEALTH_BAND_TONES in
   vrs-status-tokens.js). The tokens give Light and Dark their own values. */
.status-tone-yellow { background: var(--status-yellow-soft); color: var(--status-yellow-text); }
.status-tone-yellow .status-dot { background: var(--status-yellow); }

/* Empty State */
.empty-state {
    line-height: 1.5;
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
}
.empty-state p + p {
    margin-top: 16px;
}
/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--color-overlay, rgba(0, 0, 0, 0.68));
}
/* Logout Button */
.logout-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--accent-red);
    color: var(--text-danger);
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

/* Wrapping the header must not leave a tall sticky obstruction on a phone. */
@media (max-width: 600px) {
    .header { position: static; padding: 16px; }
    .header-main, .header-right { gap: 12px; }
    .header-right { width: 100%; }
    .atlas-workspace-nav { padding: 0 16px; }
}

/* Data failures must remain visible beside operational counts and lists. */
.dashboard-load-status {
    border: 1px solid var(--text-danger);
    border-radius: 10px;
    color: var(--text-danger);
    line-height: 1.5;
    margin: 0 0 20px;
    padding: 14px 16px;
}

/* Matching paused for everyone: visible on every dashboard tab until resumed.
   Empty while running, but kept in the layout so it stays a live region. */
.queue-paused-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 16px;
    padding: 10px 14px;
    border: 1px solid var(--status-warning-text);
    border-radius: 6px;
    background: var(--status-warning-soft);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.queue-paused-banner:empty {
    margin: 0;
    padding: 0;
    border: 0;
}

.table-container[tabindex]:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}
/* --- Responsive utilities (minimal, canonical scale) ---
   Boundary values mirror --bp-*: sm 480, md 768, lg 1024, xl 1280.
   Max-width boundaries use the epsilon convention (N - 0.02) so a
   hide-below / hide-above pair never both apply at the exact boundary. */

/* Hide below a breakpoint (visible only at/above it). */
@media (max-width: 767.98px) { .hide-below-md { display: none !important; } }
@media (max-width: 1023.98px) { .hide-below-lg { display: none !important; } }

/* Hide at/above a breakpoint (visible only below it). */
@media (min-width: 768px) { .hide-above-md { display: none !important; } }
@media (min-width: 1024px) { .hide-above-lg { display: none !important; } }

/* Stack children vertically below a breakpoint. */
@media (max-width: 767.98px) { .stack-below-md { flex-direction: column !important; align-items: stretch !important; } }

/* Shared responsive action row: wraps, and stacks below md. */
.action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
@media (max-width: 767.98px) {
    .action-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* --- Modal responsive ladder (canonical breakpoints) ---
   Near-full-screen on xs; constrained on sm; centered md+. */
@media (max-width: 479.98px) {
    .modal-backdrop { padding: 8px; }
    .modal-panel { width: 100%; max-height: 100vh; border-radius: 12px; }
}
@media (min-width: 480px) and (max-width: 767.98px) {
    .modal-panel { width: min(560px, 100%); }
}

/* Complete light values behind the same semantic roles as dark. */

/* --- Canonical numbered pagination (P1-8) ---
   One set of styles for the client-side numbered-pagination bars shared by the
   Surface Map and the dashboard (Accounts + Live Ops). Consolidated from the
   dashboard's inline stylesheet and css/surface-map.css so the two screens
   cannot drift. Uses the shared semantic administration tokens in both modes.

   Layout follows the Plesk split: above the rows a status line you read
   (`--summary`: row count + page indicator), below the rows the controls you
   act on (`--controls`: paging + page size). Controls wrap rather than forcing
   page-level horizontal scroll, and get ≥44px touch targets on xs. */
.ops-pagination {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 16px;
}

.ops-pagination--summary {
    border-bottom: 1px solid var(--border-color);
    justify-content: space-between;
}

.ops-pagination--controls {
    border-top: 1px solid var(--border-color);
    justify-content: space-between;
}

.ops-pagination .page-info {
    color: var(--text-secondary);
    font-size: 13px;
}

.ops-pagination button[disabled] {
    cursor: not-allowed;
    opacity: 0.45;
}

/* Page size as a row of choices rather than a <select>: the options are few,
   short, and worth seeing without opening anything. */
.page-size-chips {
    align-items: center;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
}

.page-size-caption {
    color: var(--text-secondary);
    font-size: 13px;
    margin-right: 4px;
}

.page-size-chip {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--accent-blue, #2563eb);
    cursor: pointer;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    height: 26px;
    padding: 0 8px;
}

.page-size-chip:hover {
    border-color: var(--border-color);
}

/* The selected size is the one you cannot click, so it reads as state rather
   than as another link. */
.page-size-chip[aria-pressed="true"] {
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.06));
    color: var(--text-primary);
    cursor: default;
    font-weight: 600;
}

.ops-pagination .page-nav {
    align-items: center;
    display: inline-flex;
    gap: 4px;
}

/* The buttons must not move when the indicator text changes width, or you keep
   missing the one you were aiming at. Both indicators are tabular-nums so the
   digits do not change width as they change value, and both reserve room for
   the widest realistic value rather than sizing to their content. */
.ops-pagination .page-nav-label {
    color: var(--text-secondary);
    flex: 0 0 auto;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    text-align: right;
    min-width: 15ch;
    white-space: nowrap;
}

/* How many pages there are, e.g. "of 6". Placed after the last button rather
   than beside the page box so that its width — "of 6" against "of 1000" —
   cannot push a button sideways as you page. */
.ops-pagination .page-nav-total {
    color: var(--text-secondary);
    flex: 0 0 auto;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    margin-left: 4px;
    white-space: nowrap;
}

.ops-pagination .page-nav-btn {
    align-items: center;
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.06));
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    height: 30px;
    justify-content: center;
    padding: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
    width: 30px;
}

.ops-pagination .page-nav-btn:hover:not([disabled]) {
    background: var(--color-surface-2);
    border-color: var(--color-control-border);
}

.ops-pagination .page-nav-btn svg {
    fill: none;
    height: 16px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
    width: 16px;
}

/* Visible focus for the icon buttons and chips: keyboard focus is never
   communicated by colour alone (WCAG 2.2 AA, P1-7 baseline). */
.ops-pagination .page-nav-btn:focus-visible,
.ops-pagination .page-size-chip:focus-visible {
    outline: 2px solid var(--accent-blue, #4a9eff);
    outline-offset: 2px;
}

.ops-pagination .page-jump-input {
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.06));
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    height: 30px;
    padding: 0 6px;
    text-align: center;
    width: 52px;
}

.ops-pagination .page-jump-input:focus {
    border-color: var(--accent-blue, #2563eb);
}

/* The spinners are redundant next to prev/next and cost input width. */
.ops-pagination .page-jump-input::-webkit-outer-spin-button,
.ops-pagination .page-jump-input::-webkit-inner-spin-button {
    appearance: none;
    margin: 0;
}

.ops-pagination .page-jump-input {
    appearance: textfield;
}

/* Narrow screens: the control bar already wraps, but the individual controls
   need touch-sized hit targets (≥44px) so they stay usable without a mouse. */
@media (max-width: 479.98px) {
    .ops-pagination .page-nav-btn {
        height: 44px;
        width: 44px;
    }
    .ops-pagination .page-size-chip {
        height: 44px;
        padding: 0 14px;
    }
    .ops-pagination .page-jump-input {
        height: 44px;
    }
}

/* Shared appearance control; present on admin and standalone workspace pages. */
.admin-appearance-slot { min-width: 0; }
.admin-appearance { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.admin-appearance select { background: var(--color-field); border: 1px solid var(--color-control-border); border-radius: 8px; color: var(--text-primary); font: inherit; min-height: 44px; min-width: 112px; max-width: 100%; padding: 8px 10px; }
.admin-appearance select:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
.form-field input, .form-field select, .form-field textarea { border-color: var(--color-control-border); }
@media (max-width: 479.98px) {
    .admin-appearance-slot { flex: 1 1 100%; }
    .admin-appearance { justify-content: space-between; }
    .admin-appearance select { flex: 1; max-width: 200px; }
}

/* Organization setup keeps essentials readable and optional billing details discoverable. */
.billing-organization-form { display: grid; gap: 28px; }
.billing-organization-section { min-width: 0; margin: 0; padding: 0; border: 0; }
.billing-organization-section legend { width: 100%; padding: 0 0 16px; color: var(--text-primary); font-size: 18px; font-weight: 600; }
.billing-organization-form .form-field label { font-size: 14px; }
.billing-organization-form .help-text { font-size: 14px; line-height: 1.5; }
.billing-organization-form input:not([type="checkbox"]), .billing-organization-form select,
.billing-organization-form textarea { min-height: 44px; font-size: 16px; }
.billing-organization-options { min-width: 0; border-top: 1px solid var(--border-color); padding-top: 8px; }
.billing-organization-options summary { min-height: 44px; padding-block: 12px; cursor: pointer; color: var(--text-primary); font-size: 16px; font-weight: 600; }
.billing-organization-options summary:focus-visible { outline: 2px solid var(--color-action-primary); outline-offset: 2px; }
.billing-organization-options > .help-text { margin-block: 8px 20px; }
.billing-organization-status { margin-block: 20px 0; padding: 16px; border: 1px solid var(--text-danger); border-radius: 10px; color: var(--text-primary); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.modal-panel:has(#billingOrganizationForm) .modal-footer { position: sticky; bottom: 0; background: var(--bg-secondary); }
@media (max-width: 640px) { .billing-organization-form .form-grid { grid-template-columns: minmax(0, 1fr); } }

/* Active account dialogs reuse the shared form and modal foundation. */
.admin-account-form { min-width: 0; }
.admin-account-form .form-field label { font-size: 14px; }
.admin-account-form .help-text { font-size: 14px; line-height: 1.5; }
.admin-account-form input:not([type="checkbox"]), .admin-account-form select,
.admin-account-form textarea { min-height: 44px; font-size: 16px; }
/* WebKit native selects do not consistently honor min-height. Keep the native arrow. */
.admin-account-form select { height: 44px; }
.admin-account-form .btn { min-height: 44px; }
.account-form-status { margin: 0; padding: 16px; border: 1px solid var(--color-control-border); border-radius: 10px; color: var(--text-primary); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.account-form-status[data-error="true"] { border-color: var(--text-danger); }
@media (max-width: 767.98px) { .admin-account-form.form-grid { grid-template-columns: minmax(0, 1fr); } }

.account-form-status[hidden] { display: none; }
.account-history-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 16px; }
.account-history-list > li { padding: 16px; border: 1px solid var(--color-control-border); border-radius: 12px; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.account-history-list p { margin: 8px 0; }
.account-history-review button { min-height: 44px; }

.modal-panel:has(.admin-account-form) { display: flex; flex-direction: column; overflow: hidden; }
.modal-panel:has(.admin-account-form) .modal-header,
.modal-panel:has(.admin-account-form) .modal-footer { flex-shrink: 0; }
.modal-panel:has(.admin-account-form) .modal-body { min-height: 0; overflow-y: auto; }
.modal-panel:has(.admin-account-form) .modal-footer { flex-wrap: wrap; gap: 12px; }

.admin-account-form .checkbox-list label { display: inline-flex; align-items: center; min-height: 44px; gap: 6px; }

/* Admin editors (vrs-admin-dashboard.js editorSection): sections in a fixed
   order, every row label-left/control-right on one column line, state
   disclosures for rarely used controls, the Danger zone last. A wrapper of
   rows (.editor-rows, e.g. role-driven language groups) lays out as if its
   rows were the section's own. */
.account-editor { display: grid; gap: 24px; min-width: 0; }
/* Row labels read like .field-label wherever an editor sits (not only inside .admin-account-form). */
.account-editor .form-field label { font-size: 14px; }
.editor-section { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
.editor-rows { display: contents; }
.editor-section > legend { width: 100%; margin-bottom: 4px; padding: 0 0 8px; border-bottom: 1px solid var(--border-color); color: var(--text-primary); font-size: 16px; font-weight: 600; }
:is(.editor-section, .editor-rows) > .form-field { display: grid; grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr); gap: 6px 16px; align-items: start; }
:is(.editor-section, .editor-rows) > .form-field > label,
:is(.editor-section, .editor-rows) > .form-field > .field-label { grid-column: 1; padding-top: 12px; }
:is(.editor-section, .editor-rows) > .form-field > :not(label):not(.field-label) { grid-column: 2; min-width: 0; }
.form-field .field-label { color: var(--text-secondary); font-size: 14px; font-weight: 600; }
.editor-section .field-readonly { padding-top: 12px; }
.editor-control { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 44px; }
.editor-control > .editor-disclosure { flex: 1 1 100%; }
.editor-disclosure > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--text-primary); }
.editor-disclosure > summary:focus-visible { outline: 2px solid var(--color-action-primary); outline-offset: 2px; }
.editor-inline-confirm { display: grid; gap: 8px; width: 100%; padding: 12px; border: 1px solid var(--color-control-border); border-radius: 10px; }
.editor-inline-confirm p { margin: 0; }
.editor-danger { margin-top: 24px; padding: 16px; border: 1px solid var(--text-danger); border-radius: 12px; }
.editor-danger h3 { margin: 0 0 8px; color: var(--text-primary); font-size: 16px; font-weight: 600; }
.editor-danger-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 44px; }
.editor-danger-state { color: var(--text-secondary); font-size: 14px; }
.editor-danger .btn { min-height: 44px; }
/* A disclosure that holds whole sections (Billing Profile payment settings)
   or loose rows (a tax registration). */
.editor-disclosure > .editor-section { margin-top: 16px; }
.editor-disclosure > .editor-rows > .form-field { margin-top: 12px; }
/* Billing step forms (credit notes, legacy payments, notices, update recovery)
   keep their own markup; their rows align like the editors'. */
:is(#billingCreditForm, #billingLegacyForm, [data-notice-form], #billingUpdateRecoveryForm) { display: grid; gap: 12px; }
:is(#billingCreditForm, #billingLegacyForm, [data-notice-form], #billingUpdateRecoveryForm) > :is(p, fieldset) { margin: 0; }
:is(#billingCreditForm, #billingLegacyForm, [data-notice-form], #billingUpdateRecoveryForm) > :is(.btn, .billing-update-actions, .billing-notice-ack) { justify-self: start; }
:is(#billingCreditForm, #billingLegacyForm, [data-notice-form], #billingUpdateRecoveryForm) > .form-field { display: grid; grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr); gap: 6px 16px; align-items: start; }
:is(#billingCreditForm, #billingLegacyForm, [data-notice-form], #billingUpdateRecoveryForm) > .form-field > label { grid-column: 1; padding-top: 12px; }
:is(#billingCreditForm, #billingLegacyForm, [data-notice-form], #billingUpdateRecoveryForm) > .form-field > :not(label) { grid-column: 2; min-width: 0; }
@media (max-width: 640px) {
    :is(#billingCreditForm, #billingLegacyForm, [data-notice-form], #billingUpdateRecoveryForm) > .form-field { grid-template-columns: minmax(0, 1fr); }
    :is(#billingCreditForm, #billingLegacyForm, [data-notice-form], #billingUpdateRecoveryForm) > .form-field > label,
    :is(#billingCreditForm, #billingLegacyForm, [data-notice-form], #billingUpdateRecoveryForm) > .form-field > :not(label) { grid-column: 1; padding-top: 0; }
}
/* Page forms in narrow panels (Jobs → Create Job, Onboarding → Create account):
   rows stack by the panel's width, not the viewport's. */
.jobs-panel, .onb-box { container-type: inline-size; }
.job-create-form .editor-section > .editor-disclosure > summary { font-size: 14px; }
.job-create-form .job-time-segments { max-width: 16rem; }
.onb-box.account-editor .form-field > label { margin: 0; }
@container (max-width: 460px) {
    :is(.job-create-form, .onb-box.account-editor) :is(.editor-section, .editor-rows) > .form-field { grid-template-columns: minmax(0, 1fr); }
    :is(.job-create-form, .onb-box.account-editor) :is(.editor-section, .editor-rows) > .form-field > label,
    :is(.job-create-form, .onb-box.account-editor) :is(.editor-section, .editor-rows) > .form-field > .field-label,
    :is(.job-create-form, .onb-box.account-editor) :is(.editor-section, .editor-rows) > .form-field > :not(label):not(.field-label) { grid-column: 1; padding-top: 0; }
}
/* Tab pages (phase 4). Counted Filters: a bar's selects fold into one
   disclosure whose summary says how many differ from their defaults. */
.filter-disclosure { display: flex; flex-direction: column; min-width: 0; }
.filter-disclosure[open] { flex: 1 1 100%; }
.filter-disclosure > summary { display: inline-flex; align-items: center; align-self: flex-start; min-height: 34px; padding: 0 12px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-secondary); color: var(--text-primary); font-size: 14px; font-weight: 400; cursor: pointer; white-space: nowrap; }
.filter-disclosure > summary:focus-visible { outline: 2px solid var(--color-action-primary); outline-offset: 2px; }
.filter-disclosure.has-active-filters > summary { border-color: var(--color-action-primary); }
.filter-disclosure-body { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 12px; }
/* The header's facts line: a count beside the title, hidden while empty. */
.section-facts { color: var(--text-secondary); font-size: 14px; font-weight: 400; }
.section-facts:empty { display: none; }
.client-trash-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.client-trash-list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 16px; border: 1px solid var(--color-control-border); border-radius: 10px; overflow-wrap: anywhere; }
.client-trash-list .btn { min-height: 44px; }
@media (max-width: 640px) {
    :is(.editor-section, .editor-rows) > .form-field { grid-template-columns: minmax(0, 1fr); }
    :is(.editor-section, .editor-rows) > .form-field > label,
    :is(.editor-section, .editor-rows) > .form-field > .field-label,
    :is(.editor-section, .editor-rows) > .form-field > :not(label):not(.field-label) { grid-column: 1; padding-top: 0; }
}

/* Account Requests stay readable and actionable on narrow admin screens. */
.account-requests-section td { overflow-wrap: anywhere; }
.account-requests-section .section-help { margin: 16px; color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.account-requests-section > .account-form-status { margin: 16px; }
.account-requests-section td:last-child .btn { min-height: 44px; margin: 4px; }
#accountRequestReviewForm p { overflow-wrap: anywhere; }
@media (max-width: 767.98px) {
    .account-requests-section table, .account-requests-section tbody,
    .account-requests-section tr, .account-requests-section td { display: block; width: 100%; min-width: 0; }
    .account-requests-section thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .account-requests-section tr { padding: 12px; border-bottom: 1px solid var(--color-control-border); }
    .account-requests-section td { position: static; white-space: normal; padding: 8px 0; border: 0; }
    .account-requests-section td[data-label]::before { content: attr(data-label); display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
}

/* Provider records are distinct from live queue presence. */
.provider-networks-section td, .provider-dialog { overflow-wrap: anywhere; }
.provider-networks-section .section-help { margin: 16px; color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.provider-networks-section > .account-form-status { margin: 16px; }
.provider-networks-section td:last-child .btn, .provider-networks-section td:last-child select { min-height: 44px; margin: 4px; }
.provider-dialog .account-form-status { margin-top: 16px; }
.provider-dialog .checkbox-label { display: inline-flex; align-items: center; min-height: 44px; gap: 8px; }
.provider-dialog .table-container { max-width: 100%; overflow-x: auto; }
.provider-import-paging { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 767.98px) {
    .provider-networks-section table, .provider-networks-section tbody,
    .provider-networks-section tr, .provider-networks-section td { display: block; width: 100%; min-width: 0; }
    .provider-networks-section thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .provider-networks-section tr { padding: 12px; border-bottom: 1px solid var(--color-control-border); }
    .provider-networks-section td { position: static; white-space: normal; padding: 8px 0; border: 0; }
    .provider-networks-section td[data-label]::before { content: attr(data-label); display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
    .provider-dialog .form-grid { grid-template-columns: minmax(0, 1fr); }
}

.provider-profile-actions { margin-bottom: 20px; }
.provider-profile-actions summary, .provider-photo-links summary { min-height: 44px; padding: 12px 0; cursor: pointer; font-size: 15px; font-weight: 600; }
.provider-profile-action-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.provider-related { margin-top: 24px; }
.provider-related-empty { grid-column: 1 / -1; margin: 0; }

/* Job eligibility remains readable without horizontal scrolling on phones. */
.job-outreach-preview h3 { margin: 24px 0 12px; }
.job-outreach-preview p, #jobOutreachPlanForm p { line-height: 1.6; margin-bottom: 16px; }
.job-outreach-preview td .btn { min-height: 44px; margin: 4px; }
.job-outreach-preview .provider-import-paging { align-items: center; margin-top: 20px; }
@media (max-width: 767.98px) {
    .job-outreach-preview table, .job-outreach-preview tbody, .job-outreach-preview tr, .job-outreach-preview td { display: block; width: 100%; min-width: 0; }
    .job-outreach-preview thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .job-outreach-preview tr { padding: 12px; border-bottom: 1px solid var(--color-control-border); }
    .job-outreach-preview td { white-space: normal; padding: 8px 0; border: 0; }
    .job-outreach-preview td[data-label]::before { content: attr(data-label); display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
}

/* Team oversight and its owned dialogs. */
#managerOversightSection td, .manager-dialog { overflow-wrap: anywhere; }
#managerOversightSection td .btn { min-height: 44px; }
.manager-dialog p { line-height: 1.6; margin-bottom: 16px; }
.manager-dialog h3 { margin: 24px 0 12px; }
.manager-dialog .manager-history-item { border-bottom: 1px solid var(--color-control-border); padding: 12px 0; }
.manager-dialog .manager-history-item p { white-space: pre-wrap; margin: 8px 0; }
.manager-dialog fieldset { min-width: 0; border: 1px solid var(--color-control-border); border-radius: 10px; padding: 12px; margin: 16px 0; }
.manager-dialog legend { padding: 0 8px; font-weight: 600; }
.manager-dialog fieldset.editor-section { margin: 0; padding: 0; border: 0; border-radius: 0; }
.manager-dialog .editor-section > legend { padding: 0 0 8px; font-weight: 600; }
.manager-dialog .manager-choice-search { display: block; margin-bottom: 12px; }
.manager-dialog .manager-choice-list { max-height: 240px; overflow-y: auto; }
.manager-dialog .checkbox-label { display: flex; align-items: center; min-height: 44px; gap: 10px; padding: 6px 0; }
.manager-dialog .checkbox-label[hidden] { display: none; }
.manager-dialog .checkbox-label input { flex: 0 0 auto; width: auto; }
.manager-dialog .checkbox-label small { display: block; color: var(--text-secondary); }
@media (max-width: 767.98px) {
    #managerOversightSection .form-grid, .manager-dialog .form-grid { grid-template-columns: minmax(0, 1fr); }
    #managerOversightSection table, #managerOversightSection tbody, #managerOversightSection tr, #managerOversightSection td { display: block; width: 100%; min-width: 0; }
    #managerOversightSection thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    #managerOversightSection tr { padding: 12px; border-bottom: 1px solid var(--color-control-border); }
    #managerOversightSection td { padding: 8px 0; border: 0; white-space: normal; }
    #managerOversightSection td[data-label]::before { content: attr(data-label); display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
}

#managerOversightSection > .form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 16px; }
#managerOversightSection .form-group { min-width: 0; }
#managerOversightSection .form-group > label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
#managerOversightSection .form-group select, #managerRosterSearch { width: 100%; min-width: 0; max-width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--color-control-border); border-radius: 8px; background: var(--color-field); color: var(--text-primary); font: inherit; font-size: 16px; }
#managerOversightSection .form-group select:focus-visible, #managerRosterSearch:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
#managerOversightSection .section-actions .btn { min-height: 44px; }
#managerRosterSummary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 16px; }
#managerRosterSummary .stat-card { min-width: 0; }
#managerRosterSummary .stat-value { font-size: 26px; line-height: 1.2; margin-bottom: 4px; }
#managerRosterSummary .stat-label { font-size: 13px; }
#managerRosterStatus { margin: 16px; }
@media (max-width: 767.98px) {
    #managerOversightSection > .form-grid { grid-template-columns: minmax(0, 1fr); }
    #managerRosterSummary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* A rejected team save keeps its draft visible beside a readable saved-state review. */
.manager-dialog [data-manager-conflict] { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border-color); overflow-wrap: anywhere; }
.manager-dialog [data-manager-conflict] dt { font-weight: 600; margin-top: 12px; }
.manager-dialog [data-manager-conflict] dd { margin: 4px 0 12px; }
.manager-dialog [data-manager-conflict] button { min-height: 44px; white-space: normal; max-width: 100%; }

/* Staffing evidence stays legible in both themes and on narrow screens. */
#staffingChartWrap .staffing-chart-scroll { overflow-x: auto; }
#staffingChartWrap svg { display: block; width: 100%; min-width: 1180px; }
.staffing-axis-label { fill: var(--text-secondary); font-size: 13px; }
.staffing-grid-line { stroke: var(--border-color); }
.staffing-line { fill: none; stroke-width: 2.5; }
.staffing-calls { stroke: #2672cc; }
.staffing-concurrency { stroke: #d44b55; stroke-dasharray: 16 5; }
.staffing-activity { stroke: #26856b; stroke-dasharray: 8 4; }
.staffing-painted { stroke: #9361bc; stroke-dasharray: 2 4; }
.staffing-chart-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 12px 20px; font-size: 14px; }
#scheduleReviewStatus { margin-bottom: 12px; }
.schedule-week-review { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-color); overflow-wrap: anywhere; }
.schedule-week-review p { line-height: 1.6; }
.schedule-week-review button, #scheduleReviewBody button { min-height: 44px; white-space: normal; }
.schedule-review-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.schedule-week-table { margin-bottom: 16px; width: 100%; }
@media (max-width: 767.98px) {
    .schedule-review-table thead, .schedule-week-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .schedule-review-table tr, .schedule-week-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--border-color); }
    .schedule-review-table td[data-label], .schedule-week-table td[data-label] { display: grid; grid-template-columns: 92px minmax(0,1fr); gap: 10px; padding: 8px; border: 0; }
    .schedule-review-table td[data-label]::before, .schedule-week-table td[data-label]::before { content: attr(data-label); font-weight: 600; color: var(--text-secondary); }
}

#staffingRecommendation, #scheduleReviewStatus { padding: 16px 24px; font-size: 14px; line-height: 1.6; }
#staffingRecommendation p + p { margin-top: 8px; }
#staffingWindow, #scheduleReviewWeek { min-height: 44px; padding: 8px 12px; font-size: 16px; border-radius: 8px; background: var(--color-control-bg); color: var(--color-control-text); border: 1px solid var(--color-control-border); max-width: 100%; }
#staffingViewToggle { min-height: 44px; }
#schedulePolicyFields input, #schedulePolicyFields select { min-height: 44px; font-size: 16px; }
#schedulePolicyFields input[type=checkbox] { min-height: auto; }
#schedulePolicyFields + div { flex-wrap: wrap; }
#schedulePolicyFields + div button { min-height: 44px; }

.schedule-policy-conflict { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--color-control-border); overflow-wrap: anywhere; }
.schedule-policy-conflict p { margin: 12px 0; line-height: 1.6; }
.schedule-policy-conflict button, #schedulePolicyStatus button { min-height: 44px; white-space: normal; }
#schedulePolicyStatus button { display: block; margin-top: 12px; }

.profile-panels > .schedule-policy-conflict, .profile-panels > .schedule-week-review { grid-column: 1 / -1; min-width: 0; }

/* Schedule email reviews share the admin controls and semantic colors. */
#scheduleDigestPanel .digest-review:empty { display: none; }
#scheduleDigestPanel .digest-review { margin-block: 16px; padding: 16px; border: 1px solid var(--border-color); border-radius: 8px; }
#scheduleDigestPanel .digest-review .btn { margin: 8px 8px 0 0; min-height: 44px; }
#scheduleDigestPanel .digest-sample-text { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.6; }
#scheduleDigestPanel .digest-comparison dt { font-weight: 600; margin-top: 12px; }
#scheduleDigestPanel .digest-comparison dd { margin: 4px 0 0; overflow-wrap: anywhere; }
#scheduleDigestPanel .help-text { line-height: 1.5; }
#scheduleDigestPanel .form-group { min-width: 0; }
@media (max-width: 479px) {
    #scheduleDigestPanel .form-grid { grid-template-columns: minmax(0, 1fr); }
    #scheduleDigestPanel .section-actions { width: 100%; flex-wrap: wrap; }
    #scheduleDigestPanel .section-actions .btn { flex: 1 1 100%; min-height: 44px; }
}

#scheduleDigestPanel .digest-body { padding: 16px; }
#scheduleDigestPanel .digest-body > h3 { margin-top: 24px; margin-bottom: 8px; }
#scheduleDigestPanel .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
#scheduleDigestPanel .form-group { display: flex; flex-direction: column; gap: 8px; }
#scheduleDigestPanel .form-group > label { font-weight: 600; }
#scheduleDigestPanel .form-input, #scheduleDigestPanel .form-select {
    width: 100%; box-sizing: border-box; min-height: 44px; padding: 10px 12px; font: inherit;
    color: var(--text-primary); background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 8px;
}
#scheduleDigestPanel .checkbox-label { display: flex; align-items: center; gap: 10px; min-height: 44px; }
#scheduleDigestPanel input[type=checkbox] { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--accent-primary); }
#scheduleDigestPanel .digest-review h4 { margin: 0 0 12px; }
#scheduleDigestPanel .digest-review p { margin: 8px 0; }
#scheduleDigestPanel .digest-review pre { margin: 16px 0; }
#scheduleDigestPanel .digest-review .btn { white-space: normal; }
@media (max-width: 767px) {
    #scheduleDigestPanel .form-grid { grid-template-columns: minmax(0, 1fr); }
    #scheduleDigestPanel .digest-table thead { display: none; }
    #scheduleDigestPanel .digest-table, #scheduleDigestPanel .digest-table tbody { display: block; width: 100%; min-width: 0; }
    #scheduleDigestPanel .digest-table tr { display: block; padding-block: 8px; border-bottom: 1px solid var(--border-color); }
    #scheduleDigestPanel .digest-table td { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; padding: 8px 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
    #scheduleDigestPanel .digest-table td[data-label]::before { content: attr(data-label); font-weight: 600; }
    #scheduleDigestPanel .digest-table td[colspan] { display: block; }
}

#scheduleDigestPanel button { min-height: 44px; }

/* ---------------------------------------------------------------------------
   Redesign 2026-11-22 (the "11-12 design"): the confirmation dialog and the
   rules for smaller screens. The look of the shared classes is set where
   each class is defined, above.
   --------------------------------------------------------------------------- */

/* A confirmation opens OVER the page and over an open editor (z-index 1000).
   The editor stays as it is below it. */
.admin-confirm {
    position: fixed;
    inset: 0;
    z-index: 1010;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--color-overlay, rgba(0, 0, 0, 0.68));
}
.admin-confirm.active {
    display: flex;
}
.modal-panel.admin-confirm-panel {
    width: min(460px, 100%);
}
.admin-confirm-panel .modal-header {
    border-bottom: 0;
    cursor: default;
    padding: 16px 16px 8px;
    user-select: auto;
}
.admin-confirm-panel .modal-header h2 {
    overflow-wrap: anywhere;
}
.admin-confirm-panel .modal-body {
    display: grid;
    gap: 12px;
    padding: 4px 16px 16px;
}
.admin-confirm-message {
    color: var(--text-secondary);
    line-height: 1.5;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

/* Below 1100 px: grids stack, and a wide table scrolls inside its section
   with cells that do not wrap. The tables that turn into stacked rows on a
   phone set their own wrapping after this. */
@media (max-width: 1100px) {
    .section {
        overflow-x: auto;
    }
    .section--sticky-table {
        overflow-x: auto;
    }
    .section th,
    .section td {
        white-space: nowrap;
    }
    /* A message or a detail row across the table is prose: it wraps. */
    .section td[colspan] {
        white-space: normal;
    }
    .section th,
    .section td {
        padding-left: 12px;
        padding-right: 12px;
    }
    .form-grid.three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* A table that turns into stacked rows on a phone: its values wrap. */
@media (max-width: 767.98px) {
    .section td[data-label] {
        white-space: normal;
    }
}

/* Below 820 px: the rail shows icons only, the page padding is 14 px. */
@media (max-width: 820px) {
    :root {
        --admin-rail-width: 60px;
    }
    .admin-rail .admin-rail-menu {
        display: flex;
        min-height: 44px;
        width: 44px;
    }
    .admin-rail .admin-rail-item {
        min-height: 44px;
        padding: 0;
        width: 44px;
    }
    .admin-rail-label {
        display: none;
    }
    .admin-rail .admin-rail-item .nav-tab-badge,
    .admin-rail .admin-rail-item .admin-nav-external {
        right: 0;
        top: 0;
    }
    .main-content {
        padding: 14px 14px 48px;
    }
    .admin-area-tabs {
        gap: 16px;
        margin: 0 -14px 12px;
        padding: 0 14px;
    }
    .header.admin-topbar {
        padding: 0 8px;
    }
    .admin-topbar .header-main {
        gap: 8px;
    }
    .admin-topbar .staff-tool-name {
        display: none;
    }
    .admin-scope-chip {
        max-width: 160px;
    }
    .form-grid,
    .form-grid.three {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Below 560 px: the rail is a bar at the bottom of the screen. */
@media (max-width: 560px) {
    .admin-app {
        grid-template-columns: minmax(0, 1fr);
    }
    .admin-rail {
        border-right: 0;
        border-top: 1px solid var(--border-color);
        bottom: 0;
        flex-direction: row;
        height: 56px;
        left: 0;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 4px;
        position: fixed;
        right: 0;
        top: auto;
        z-index: 90;
    }
    .admin-rail-spacer {
        display: none;
    }
    .main-content {
        padding-bottom: 84px;
    }
    .admin-toast-stack {
        bottom: 68px;
    }
    .admin-confirm {
        padding: 8px;
    }
    .admin-topbar .header-live-age {
        display: none;
    }
}

/* "Admin on my phone" (admin-shell.js): the apps, then the QR code of the
   one-time link. Dark modules on white in every theme, so a camera reads it. */
.admin-phone-link-apps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-phone-link {
    display: grid;
    justify-items: center;
    gap: 12px;
}

.admin-phone-link-app {
    margin: 0;
}

.admin-phone-link-qr {
    width: 224px;
    height: 224px;
    padding: 8px;
    border-radius: 8px;
    background: #fff;
    color: #000;
}

.admin-phone-link-qr.is-expired {
    opacity: 0.2;
}

.admin-phone-link-time {
    font-variant-numeric: tabular-nums;
}

.admin-phone-link-actions {
    display: flex;
    gap: 8px;
}
