
.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0 .75rem;
}

.section-title-row h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.page-subtitle.small {
    font-size: .85rem;
    margin-top: .15rem;
}

.grid-action-row {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    align-items: center;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .18rem .55rem;
    font-size: .78rem;
    font-weight: 600;
    border: 1px solid rgba(15, 23, 42, .12);
    background: #f8fafc;
}

.status-pill.ok {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.status-pill.muted {
    background: #f1f5f9;
    color: #64748b;
    border-color: #cbd5e1;
}

@media (max-width: 700px) {
    .section-title-row {
        align-items: stretch;
        flex-direction: column;
    }
    .grid-action-row .dxbl-btn {
        min-height: 34px;
    }
}

.help-package-box {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 16px;
    margin: 14px 0;
    background: rgba(248, 250, 252, 0.75);
}

.help-package-box h3 {
    margin-top: 0;
    margin-bottom: 6px;
}

.status.subtle {
    margin-top: 10px;
    background: rgba(15, 118, 110, 0.08);
    border-color: rgba(15, 118, 110, 0.2);
}

.admin-settings-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.admin-settings-section {
    padding: 0;
    overflow: hidden;
}

.admin-settings-section > summary {
    cursor: pointer;
    font-weight: 700;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, .25);
}

.admin-settings-section[open] > summary {
    margin-bottom: 8px;
}

.settings-two-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    padding: 0 18px 14px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(148, 163, 184, .08);
}

.setting-row span {
    color: var(--muted-text, #64748b);
}

.setting-row b {
    text-align: right;
    overflow-wrap: anywhere;
}

.section-actions, .section-note {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0 18px 18px;
}

.section-note {
    color: var(--muted-text, #64748b);
}

@media (max-width: 800px) {
    .settings-two-columns { grid-template-columns: 1fr; }
    .setting-row { align-items: flex-start; flex-direction: column; }
    .setting-row b { text-align: left; }
}


/* Customer-isolated failed transaction workspace */
.transaction-overview-grid { margin-bottom: 1rem; }
.transaction-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
    gap: 1rem;
    align-items: start;
}
.transaction-list-card,
.transaction-editor-card { min-width: 0; }
.transaction-section-title,
.transaction-editor-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .85rem;
}
.transaction-section-title h2,
.transaction-editor-header h2 { margin: 0; }
.transaction-section-title p,
.transaction-editor-header p { margin: .25rem 0 0; color: var(--muted-text, #667085); }
.transaction-empty-editor {
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: .35rem;
    color: var(--muted-text, #667085);
}
.transaction-form { margin-top: .5rem; }
.transaction-json-editor textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.transaction-error-panel,
.transaction-response-panel {
    margin-top: .85rem;
    padding: .85rem;
    border: 1px solid var(--border-color, #e4e7ec);
    border-radius: .75rem;
    background: var(--surface-muted, #f8fafc);
}
.transaction-error-panel pre,
.transaction-response-panel pre {
    margin: .45rem 0 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-height: 220px;
    overflow: auto;
}
.transaction-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: 1rem;
}
.transaction-status-message { margin-bottom: 1rem; }
@media (max-width: 1100px) {
    .transaction-workspace { grid-template-columns: minmax(0, 1fr); }
}

/* V102M transaction repair workspace */
.transaction-workspace {
    grid-template-columns: minmax(390px, .78fr) minmax(0, 1.42fr);
}
.transaction-editor-card { overflow: hidden; }
.transaction-repair-tabs { margin-top: .25rem; }
.transaction-tab-content { padding: 1rem .15rem .25rem; }
.transaction-panel-heading,
.json-workbench-toolbar,
.allocation-editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: .85rem;
}
.transaction-panel-heading.compact { margin-bottom: .5rem; }
.transaction-panel-heading h3,
.json-workbench-toolbar h3,
.allocation-editor-toolbar strong { margin: 0; }
.transaction-panel-heading p,
.json-workbench-toolbar p,
.allocation-editor-toolbar span {
    display: block;
    margin: .2rem 0 0;
    color: var(--muted-text, #667085);
}
.payload-heading { margin-top: 1rem; }
.transaction-structure-pill {
    max-width: 260px;
    padding: .35rem .65rem;
    border: 1px solid var(--border-color, #dfe3ea);
    border-radius: 999px;
    background: var(--surface-muted, #f8fafc);
    color: var(--muted-text, #667085);
    font-size: .8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.payload-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem 1rem;
    align-items: start;
}
.payload-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.payload-field.wide { grid-column: 1 / -1; }
.payload-field > label {
    color: var(--muted-text, #475467);
    font-size: .82rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}
.transaction-line-workspace,
.allocation-editor-grid {
    display: grid;
    grid-template-columns: minmax(330px, .92fr) minmax(0, 1.08fr);
    gap: 1rem;
    align-items: start;
}
.transaction-selected-line,
.allocation-field-grid {
    min-width: 0;
    padding: .9rem;
    border: 1px solid var(--border-color, #e4e7ec);
    border-radius: .8rem;
    background: var(--surface-muted, #f8fafc);
    max-height: 610px;
    overflow: auto;
}
.line-field-grid,
.allocation-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.allocation-line-selector {
    display: grid;
    grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
    gap: .75rem;
    align-items: center;
    margin-bottom: .85rem;
    padding: .75rem;
    border: 1px solid var(--border-color, #e4e7ec);
    border-radius: .75rem;
    background: var(--surface-muted, #f8fafc);
}
.allocation-line-selector > span {
    color: var(--muted-text, #667085);
    overflow-wrap: anywhere;
}
.allocation-tabs { margin-top: .25rem; }
.allocation-editor { padding-top: .9rem; }
.allocation-editor-actions,
.json-workbench-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .45rem;
}
.allocation-empty {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    padding: 1rem;
    text-align: center;
    border: 1px dashed var(--border-color, #d0d5dd);
    border-radius: .8rem;
    color: var(--muted-text, #667085);
    background: var(--surface-muted, #f8fafc);
}
.allocation-empty strong { color: var(--body-color, inherit); }
.transaction-validation-banner {
    margin: .7rem 0;
    padding: .7rem .85rem;
    border: 1px solid var(--border-color, #d0d5dd);
    border-radius: .7rem;
    background: var(--surface-muted, #f8fafc);
}
.transaction-validation-banner.error,
.transaction-validation-item.error { border-left: 4px solid #b42318; }
.transaction-validation-banner.warning,
.transaction-validation-item.warning { border-left: 4px solid #b54708; }
.transaction-validation-banner.success { border-left: 4px solid #027a48; }
.transaction-validation-list {
    display: grid;
    gap: .55rem;
}
.transaction-validation-item {
    display: grid;
    gap: .2rem;
    padding: .7rem .8rem;
    border: 1px solid var(--border-color, #e4e7ec);
    border-radius: .65rem;
    background: var(--surface-muted, #f8fafc);
}
.transaction-validation-item span { color: var(--muted-text, #667085); }
.json-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}
.json-editor-pane,
.json-preview-pane {
    min-width: 0;
    border: 1px solid var(--border-color, #e4e7ec);
    border-radius: .8rem;
    overflow: hidden;
    background: var(--surface-color, #fff);
}
.json-pane-title {
    padding: .65rem .8rem;
    border-bottom: 1px solid var(--border-color, #e4e7ec);
    background: var(--surface-muted, #f8fafc);
    font-size: .82rem;
    font-weight: 700;
}
.json-editor-pane .transaction-json-editor { margin: .7rem; width: calc(100% - 1.4rem); }
.json-code-viewer {
    height: 565px;
    overflow: auto;
    padding: .55rem 0;
    background: #111827;
    color: #d1d5db;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .78rem;
    line-height: 1.55;
}
.json-code-line {
    display: grid;
    grid-template-columns: 52px minmax(max-content, 1fr);
    min-height: 1.45rem;
}
.json-code-line:hover { background: rgba(255,255,255,.045); }
.json-line-number {
    padding: 0 .75rem 0 .4rem;
    text-align: right;
    color: #6b7280;
    user-select: none;
    border-right: 1px solid rgba(255,255,255,.08);
}
.json-code-line code {
    display: block;
    padding: 0 .75rem;
    white-space: pre;
    color: inherit;
}
.json-key { color: #93c5fd; }
.json-string { color: #86efac; }
.json-number { color: #fdba74; }
.json-boolean { color: #c4b5fd; }
.json-null { color: #fca5a5; font-style: italic; }
.transaction-notes-form {
    margin-top: 1rem;
    padding-top: .9rem;
    border-top: 1px solid var(--border-color, #e4e7ec);
}
@media (max-width: 1450px) {
    .transaction-workspace { grid-template-columns: minmax(330px, .68fr) minmax(0, 1.32fr); }
    .transaction-line-workspace,
    .allocation-editor-grid,
    .json-workbench { grid-template-columns: minmax(0, 1fr); }
    .transaction-selected-line,
    .allocation-field-grid { max-height: none; }
}
@media (max-width: 1100px) {
    .transaction-workspace { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
    .payload-field-grid,
    .line-field-grid,
    .allocation-field-grid { grid-template-columns: minmax(0, 1fr); }
    .payload-field.wide { grid-column: auto; }
    .allocation-line-selector { grid-template-columns: minmax(0, 1fr); }
    .transaction-panel-heading,
    .json-workbench-toolbar,
    .allocation-editor-toolbar { flex-direction: column; }
    .json-workbench-actions,
    .allocation-editor-actions { justify-content: flex-start; }
}

/* Mobile App Settings parity editors */
.mobile-exact-setting-list {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    width: 100%;
}

/* A row is a line in a list, separated by a rule rather than drawn as its own rounded box. */
.mobile-exact-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .9rem;
    padding: .55rem .25rem;
    border: 0;
    border-bottom: 1px solid var(--b1go-border, #e2e8f0);
    border-radius: 0;
    background: none;
}

.mobile-exact-setting-list { gap: 0; }
.mobile-exact-setting-list > .mobile-exact-setting-row:last-child { border-bottom: 0; }

.mobile-exact-setting-block {
    display: grid;
    gap: .35rem;
    width: 100%;
}

.mobile-exact-setting-block > label,
.mobile-setting-row-title {
    font-weight: 600;
}

.mobile-exact-setting-actions,
.mobile-setting-order-actions {
    display: flex;
    justify-content: flex-end;
    gap: .4rem;
}

.mobile-setting-order {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 1.5rem;
    font-weight: 700;
    color: #5a6b85;
}

.mobile-setting-group-title {
    margin-top: .5rem;
    font-weight: 700;
    font-size: 1rem;
}

.mobile-variable-header,
.mobile-variable-row {
    display: grid;
    grid-template-columns: minmax(7rem, 1fr) repeat(3, minmax(3.2rem, .45fr));
    align-items: center;
    gap: .5rem;
    padding: .55rem .75rem;
}

.mobile-variable-header {
    border-bottom: 1px solid var(--b1go-border, #d9e1ea);
}

.mobile-variable-row {
    border-bottom: 1px solid var(--b1go-border, #e2e8f0);
}

.device-settings-copy-source {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    margin-bottom: .8rem;
}

.device-settings-copy-targets {
    max-height: 26rem;
    overflow: auto;
    margin-bottom: 1rem;
}

@media (max-width: 720px) {
    .mobile-exact-setting-row {
        align-items: flex-start;
    }

    .mobile-variable-header,
    .mobile-variable-row {
        grid-template-columns: minmax(5rem, 1fr) repeat(3, 3rem);
        padding-inline: .4rem;
    }
}

.mobile-setting-readonly-value {
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--border-color, #d7dce3);
    border-radius: 8px;
    background: var(--surface-muted, rgba(127, 127, 127, 0.06));
    overflow-wrap: anywhere;
}


/* Scan priority editor: on/off switches, item field rows and the add-field block */
.scan-priority-intro { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }
/* Fixed columns, so the step name, its switch and its arrows sit at the same x on every row —
   a row with a remove button no longer pushes its own switch out of line. */
.scan-priority-row {
    display: grid;
    grid-template-columns: 1.5rem minmax(0, 1fr) 5.5rem 7.5rem;
    align-items: center;
    gap: .5rem;
}
.scan-priority-row .mobile-setting-row-title { text-align: start; }
.scan-priority-row-off .mobile-setting-row-title { opacity: .5; }
.scan-priority-field-code { margin-left: .5rem; font-size: .8rem; opacity: .65; }
.scan-priority-switch { display: inline-flex; align-items: center; gap: .35rem; min-width: 4.5rem; }
.scan-priority-switch-label { font-size: .85rem; }
.scan-priority-add { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--b1go-border, #e2e8f0); display: grid; gap: .5rem; }

/* Device list, laid out like the old VIMS one: the row's own actions, then the device, then
   whether it holds a licence. */
.device-row-actions { display: flex; align-items: center; gap: .15rem; }
.device-row-action {
    appearance: none;
    background: none;
    border: 0;
    padding: .2rem .3rem;
    font-size: 1rem;
    line-height: 1;
    color: #41679b;
    cursor: pointer;
    border-radius: 4px;
}
.device-row-action:hover:not(:disabled) { background: #eef3fa; }
.device-row-action:disabled { opacity: .35; cursor: not-allowed; }
.device-row-action.danger { color: #c0392b; }
.device-row-action.danger:hover:not(:disabled) { background: #fdecea; }

/* The device name is the link into its settings; there is no Open button in the row. */
.device-name-link {
    appearance: none;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: #1e4e8c;
    text-align: start;
    cursor: pointer;
}
.device-name-link:hover { text-decoration: underline; }
.device-id-short { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .8rem; color: #5a6b85; }

/* The catalogue stock warehouses: a button that says what is picked, and a popup to change it. */
.warehouse-picker-body { display: grid; gap: .75rem; }
.warehouse-picker-state { font-size: .88rem; color: #6b7681; }
.warehouse-picker-list { max-height: 22rem; overflow: auto; }
.scan-priority-add-title { font-weight: 600; }
.scan-priority-add-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: center; }
.scan-priority-error { color: #b3261e; font-size: .85rem; }

/* Mobile settings page: search, setting source badges and the unsaved changes bar */
.settings-search { margin-bottom: .75rem; max-width: 32rem; }
.setting-source-line { display: flex; align-items: center; gap: .5rem; margin-top: .25rem; flex-wrap: wrap; }
.setting-source-badge { font-size: .72rem; padding: .1rem .5rem; border-radius: 999px; border: 1px solid transparent; }
.setting-source-device { background: #fff4e0; color: #8a5200; border-color: #f0c987; }
.setting-source-company { background: #e8f1ff; color: #1f4f99; border-color: #b8d1f5; }
.setting-source-default { background: #f1f3f5; color: #555; border-color: #d5d9de; }
.setting-source-reset { background: none; border: none; padding: 0; color: #1f4f99; cursor: pointer; font-size: .8rem; text-decoration: underline; }
.settings-unsaved-bar { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .6rem 1rem; margin-top: 1rem; background: #fff8e6; border: 1px solid #f0c987; border-radius: 10px; box-shadow: 0 -2px 10px rgba(0,0,0,.08); }
.settings-unsaved-actions { display: flex; gap: .5rem; }
@media (prefers-color-scheme: dark) {
    .setting-source-device { background: #3a2a10; color: #f6c36b; border-color: #6b4a14; }
    .setting-source-company { background: #14263f; color: #9ec3f7; border-color: #2b4a77; }
    .setting-source-default { background: #2a2d31; color: #bbb; border-color: #44484e; }
    .setting-source-reset { color: #9ec3f7; }
    .settings-unsaved-bar { background: #33290f; border-color: #6b4a14; }
}

/* A boolean setting keeps its name beside its checkbox, with the explanation on an info icon
   instead of a paragraph under every row. */
.setting-inline-row { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.settings-subsection-heading .setting-help-icon { font-size: .68rem; }
.setting-help-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.05rem; height: 1.05rem; flex: 0 0 auto;
    border: 1px solid #b8c0c8; border-radius: 999px;
    font-family: Georgia, "Times New Roman", serif; font-size: .72rem; font-style: italic; line-height: 1;
    color: #5a6670; background: #f6f8fa; text-decoration: none; cursor: help;
}
a.setting-help-icon { cursor: pointer; }
.setting-help-icon:hover { background: #e8f1ff; border-color: #b8d1f5; color: #1f4f99; }

@media (prefers-color-scheme: dark) {
    .setting-help-icon { background: #2a2d31; border-color: #44484e; color: #bbb; }
    .setting-help-icon:hover { background: #14263f; border-color: #2b4a77; color: #9ec3f7; }
}

/* The setting's name and its info icon share one line, above the control. */
.setting-caption-row { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-bottom: .25rem; }
.setting-caption-text { font-weight: 500; }

/* Devices: the licence state and its one action share a cell, and the facts the list no longer
   carries are a plain definition list on the device page. */
.device-license-cell { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.device-page-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.device-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .75rem 1.5rem; margin: 1rem 0; }
.device-facts div { min-width: 0; }
.device-facts dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: #6b7681; }
.device-facts dd { margin: .15rem 0 0; overflow-wrap: anywhere; }

@media (prefers-color-scheme: dark) {
    .device-facts dt { color: #9aa4ae; }
}

/* The SAP company picker and its two actions share one line. The name is short, so the
   picker is capped rather than stretched across the card. */
.sap-company-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.sap-company-row .dxbl-btn { flex: 0 0 auto; }
.sap-companies-grid { margin-bottom: .25rem; }

/* A subsection heading that carries its own info icon. */
.settings-subsection-heading { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }

/* ------------------------------------------------------------------ *
 * Mobile settings: one row per setting, name left and control right.
 * Sized to the container, not the window, because the content pane is
 * narrow whenever the sidebar is open.
 * ------------------------------------------------------------------ */
.mobile-settings-editor-shell { container-type: inline-size; }

/* Two columns: names in one, controls in the other. The control column is a
   real column, so every editor starts at the same place and gets usable
   width instead of being squeezed against the right edge. */
.mobile-setting-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 28rem);
    align-items: center;
    gap: .75rem 2rem;
    min-height: 2.5rem;
}
.mobile-setting-row-label { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.mobile-setting-row-label .setting-caption-text { overflow-wrap: anywhere; }
.mobile-setting-row-control { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.mobile-setting-row-control > * { min-width: 0; }
/* The editor fills the column; a checkbox stays its own size at its start. */
.mobile-setting-row-control .dxbl-edit,
.mobile-setting-row-control .mobile-setting-lookup-editor { flex: 1 1 auto; width: 100%; }
.mobile-setting-row-control .dxbl-checkbox { flex: 0 0 auto; width: auto; }
.mobile-setting-row-control .mobile-setting-number-editor { max-width: 12rem; }

/* A list editor owns the full width; its name goes above it. */
.mobile-setting-row.mobile-setting-row-wide { display: block; }
.mobile-setting-row-wide .mobile-setting-row-label { margin-bottom: .5rem; }
.mobile-setting-row-wide .mobile-setting-row-control { display: block; }

.mobile-setting-row-group { padding: .55rem 0; border-bottom: 1px solid #eceff3; }
.mobile-setting-row-group:last-child { border-bottom: 0; }

/* Narrow content pane: the control drops under its name rather than
   squeezing the name to one character per line. */
@container (max-width: 34rem) {
    .mobile-setting-row { display: block; }
    .mobile-setting-row .mobile-setting-row-label { margin-bottom: .35rem; }
}

.mobile-setting-lookup-editor { display: flex; align-items: center; gap: .5rem; }
.mobile-setting-lookup-busy { font-size: .8rem; color: #6b7681; white-space: nowrap; }

/* Settings groups as tabs instead of an accordion. */
.mobile-settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1rem;
}
.mobile-settings-tab {
    appearance: none;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: .6rem .9rem;
    font: inherit;
    font-weight: 500;
    color: #5c6b7f;
    cursor: pointer;
    min-height: 2.5rem;
}
.mobile-settings-tab:hover { color: #14365b; }
.mobile-settings-tab.selected { color: #14365b; font-weight: 600; border-bottom-color: var(--b1go-primary, #1e4e8c); }

/* Authorization levels as labelled choices, not unlabelled radios. */
.auth-level-picker { display: inline-flex; gap: 0; flex: 0 0 auto; }
.auth-level-choice {
    appearance: none;
    font: inherit;
    font-size: .82rem;
    padding: .3rem .7rem;
    min-height: 2rem;
    background: #fff;
    color: #40506a;
    border: 1px solid #d3dbe4;
    border-right-width: 0;
    cursor: pointer;
    white-space: nowrap;
}
.auth-level-choice:last-child { border-right-width: 1px; }
.auth-level-choice:hover:not(:disabled) { background: #f1f6fc; }
.auth-level-choice.selected { background: var(--b1go-primary, #1e4e8c); color: #fff; border-color: var(--b1go-primary, #1e4e8c); }
.auth-level-choice:disabled { opacity: .4; cursor: not-allowed; }

/* A group is a heading and the rows under it, not a floating rounded card. */
.mobile-auth-editor .mobile-auth-group,
.mobile-auth-editor .mobile-auth-group.expanded {
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    overflow: visible;
}

.mobile-auth-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    font-weight: 600;
    color: #14365b;
    padding: .5rem 0 .35rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: .25rem;
}

/* The group header and its module rows share one inset, so the Hidden / Read only / Full
   columns line up down the whole group instead of the header sitting 14px further right.
   A module row is laid out exactly like its group header — flex, name left, picker right, and
   the picker never shrinks — so the two cannot drift apart. The older grid rule capped that
   column at 240px, which the equal-width buttons overflowed. */
.mobile-auth-editor .mobile-auth-group-title,
.mobile-auth-editor .mobile-auth-module-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-inline: 14px;
    grid-template-columns: none;
}

.mobile-auth-editor .mobile-auth-module-title { flex: 1 1 auto; min-width: 0; }
.mobile-auth-editor .auth-level-picker { flex: 0 0 auto; }

/* On a phone the name and its three choices cannot share a line, so the choices drop below it
   and still line up with every other row's. */
@media (max-width: 640px) {
    .mobile-auth-editor .mobile-auth-group-title,
    .mobile-auth-editor .mobile-auth-module-row { flex-wrap: wrap; gap: .4rem 14px; }
    .auth-level-choice { width: 5.5rem; }
}

/* Every choice is exactly the same box wherever it appears — same width, same height, text
   centred — so Hidden, Read only and Full each form one column down the whole group instead
   of every row sizing its own buttons to its own text. */
.auth-level-choice {
    box-sizing: border-box;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 6rem;
    height: 2rem;
    min-height: 2rem;
    padding: 0 .4rem;
}
.mobile-auth-module-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .4rem 0;
    min-height: 2.4rem;
}
.mobile-auth-module-row .mobile-auth-module-title { min-width: 0; overflow-wrap: anywhere; }

/* Synchronized tables: a checkbox per table, grouped as in the app. */
.sync-endpoint-toolbar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.sync-endpoint-count { font-size: .82rem; color: #6b7681; margin-inline-start: auto; }
.sync-endpoint-group { margin-bottom: 1rem; }
.sync-endpoint-group-title {
    font-weight: 600;
    color: #14365b;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .3rem;
}

@media (prefers-color-scheme: dark) {
    .mobile-setting-row-group { border-bottom-color: #2f343a; }
    .mobile-settings-tabs { border-bottom-color: #2f343a; }
    .mobile-settings-tab { color: #9aa4ae; }
    .mobile-settings-tab:hover, .mobile-settings-tab.selected { color: #cfe0f0; }
    .auth-level-choice { background: #1d2024; color: #c3ccd6; border-color: #3a4048; }
    .auth-level-choice:hover:not(:disabled) { background: #22303f; }
    .mobile-auth-group-title, .sync-endpoint-group-title { color: #cfe0f0; border-bottom-color: #2f343a; }
}

/* Route scheduling: the company the page is scoped to sits in the title row, not in a card
   of its own, and the rarely used customer filters hide behind one link. */
.route-planner-hero {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.route-hero-company {
    min-width: 260px;
}

.route-filter-toggle {
    appearance: none;
    background: none;
    border: 0;
    padding: 0;
    justify-self: start;
    font: inherit;
    font-size: .85rem;
    color: #1e4e8c;
    cursor: pointer;
}

.route-filter-toggle:hover {
    text-decoration: underline;
}

/* Route scheduling: one action for the drawer, and one bar above the calendar. */
.route-unassigned-drawer {
    display: flex;
    flex-direction: column;
}

.route-scheduler-customer-card {
    cursor: pointer;
}

.route-scheduler-customer-card.selected {
    border-color: #1e4e8c;
    box-shadow: inset 0 0 0 1px #1e4e8c;
    background: #eef3fa;
}

.route-drawer-footer {
    display: grid;
    gap: .5rem;
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px solid var(--b1go-border, #e2e8f0);
}

.route-scheduler-toolbar-merged {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
}

.route-scheduler-toolbar-merged .route-scheduler-toolbar-title {
    display: flex;
    align-items: baseline;
    gap: .6rem;
    flex: 1 1 auto;
    min-width: 0;
}

.route-scheduler-toolbar-merged .route-scheduler-toolbar-title h2 {
    margin: 0;
}

.route-scheduler-toolbar-merged .route-drag-help {
    flex: 1 1 100%;
    order: 10;
}

@media (max-width: 760px) {
    .route-scheduler-toolbar-merged .route-scheduler-filter-row {
        flex: 1 1 100%;
    }
}

/* Route details carries its own salesperson selector and its own actions. */
.route-map-panel .route-scheduler-map-strip {
    margin-bottom: .85rem;
}

.route-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .85rem;
}

/* Record editor (b1go.recordeditor.layouts.json). The cell buttons mirror the mobile designer:
   one, two or three per row, each showing the field's caption over its SAP name. */
.record-editor-layouts, .record-editor-designer { display: flex; flex-direction: column; gap: .75rem; }
.record-editor-layout-list { border: 1px solid #e3e8ee; border-radius: .6rem; overflow: hidden; }
.record-editor-layout-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    justify-content: space-between;
    padding: .55rem .7rem;
    border-bottom: 1px solid #eceff3;
}
.record-editor-layout-list > .record-editor-layout-row:last-child { border-bottom: 0; }
.record-editor-layout-identity { display: flex; flex-direction: column; gap: .15rem; min-width: 12rem; }
.record-editor-layout-title { font-weight: 600; }
.record-editor-layout-meta { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: #6b7681; }
.record-editor-layout-new { display: flex; flex-direction: column; gap: .5rem; }
.record-editor-target-fields { display: flex; flex-direction: column; gap: .25rem; }

.record-editor-designer-heading { display: flex; align-items: center; gap: .6rem; }
.record-editor-rows { display: flex; flex-direction: column; gap: .6rem; }
.record-editor-row { border: 1px solid #e3e8ee; border-radius: .6rem; padding: .55rem; display: flex; flex-direction: column; gap: .5rem; }
.record-editor-row-header { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.record-editor-row-order { font-weight: 600; color: #6b7681; min-width: 1.6rem; }
.record-editor-row-layout { min-width: 9rem; }
.record-editor-row-commands { margin-left: auto; }

.record-editor-row-cells { display: grid; gap: .45rem; }
.record-editor-row-cells.cells-1 { grid-template-columns: 1fr; }
.record-editor-row-cells.cells-2 { grid-template-columns: 1fr 1fr; }
.record-editor-row-cells.cells-3 { grid-template-columns: 1fr 1fr 1fr; }
.record-editor-cell {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    align-items: center;
    justify-content: center;
    min-height: 3.6rem;
    padding: .5rem;
    border: 1px solid #d8dee6;
    border-radius: .55rem;
    background: #f7f9fb;
    cursor: pointer;
    text-align: center;
}
.record-editor-cell:hover { border-color: #0b75bc; }
.record-editor-cell.empty { border-style: dashed; color: #6b7681; }
.record-editor-cell-title { font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }
.record-editor-cell-subtitle { font-size: .75rem; color: #6b7681; overflow-wrap: anywhere; }

/* On a phone the three-cell row cannot keep three readable columns, so the cells stack. */
@media (max-width: 700px) {
    .record-editor-row-cells.cells-2, .record-editor-row-cells.cells-3 { grid-template-columns: 1fr; }
    .record-editor-row-commands { margin-left: 0; }
}

@media (prefers-color-scheme: dark) {
    .record-editor-layout-list, .record-editor-row { border-color: #2f343a; }
    .record-editor-layout-row { border-bottom-color: #2f343a; }
    .record-editor-cell { background: #1d2024; border-color: #3a4048; }
    .record-editor-cell:hover { border-color: #4a9fe0; }
    .record-editor-cell.empty, .record-editor-cell-subtitle, .record-editor-layout-meta, .record-editor-row-order { color: #9aa4ae; }
}
