/**
 * Settings / Preferences hub — full-width layout
 *
 * Patterns (common in SaaS admin UIs: Stripe, GitHub, Google Workspace):
 * - Full-width content area with comfortable padding (not a narrow centered column).
 * - Card-style sections with clear headings and subtle elevation.
 * - Primary actions grouped at the bottom of each section (Save + status).
 * - Readable intro text: max-width in ch units only for the lead paragraph.
 *
 * See: docs/ui-settings-patterns.md
 */

#preferences-hub.submodule-body {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.preferences-hub-inner {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 1rem 1.25rem 1.75rem;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Hidden by menu search (see preferences_bind_hub_search) */
.preferences-section.preferences-section--search-hidden {
    display: none !important;
}

/* Page title */
.preferences-app-header {
    margin-bottom: 1.25rem;
}

.preferences-app-header h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    color: #212529;
}

.preferences-app-lead {
    margin: 0;
    color: #5c5c5c;
    font-size: 0.9375rem;
    line-height: 1.45;
    max-width: 65ch;
}

/* Top-level hub regions: Applications → Lists → User — distinct bordered panels */
.preferences-primary {
    margin-bottom: 2rem;
    padding: 1.25rem 1.35rem 1.35rem;
    border: 2px solid #adb5bd;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    box-sizing: border-box;
}

.preferences-primary:last-child {
    margin-bottom: 0;
}

.preferences-primary__header {
    margin-bottom: 1rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #dee2e6;
}

.preferences-primary__title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #212529;
}

.preferences-primary__body--apps .preferences-section:last-child {
    margin-bottom: 0;
}

.preferences-primary__body--users .preferences-section.preferences-section--perm-admin {
    margin-bottom: 0;
    background: #fff;
}

/* One card per app */
.preferences-section {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem 1.125rem;
    margin-bottom: 1rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.preferences-section h3 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    font-weight: 600;
    text-transform: capitalize;
    color: #212529;
    letter-spacing: 0.01em;
}

.preferences-section > summary {
    list-style: none;
}

.preferences-section > summary::-webkit-details-marker {
    display: none;
}

.preferences-section-summary {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.preferences-section-summary__left {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

/* Toggle + chevron: keep aligned on the right; title width no longer pushes toggles sideways */
.preferences-section-summary__trailing {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: auto;
}

/* On/off pill: Apps menu visibility */
.preferences-section-summary__apps-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.preferences-section-summary__apps-toggle .pref-apps-menu-pill.smp-inactive-pill {
    margin: 0;
}

/* On (visible in Apps menu): blue track — distinct from gray employees inactive pill */
.preferences-section-summary__apps-toggle
    .pref-apps-menu-pill
    .smp-inactive-pill__input:checked
    + .smp-inactive-pill__track {
    background: #0d6efd;
}

.preferences-section-summary h3 {
    margin: 0;
}

.preferences-section-icon {
    width: 1.125rem;
    height: 1.125rem;
    object-fit: contain;
}

.preferences-section-summary__state::before {
    content: "▸";
    color: #6c757d;
    transition: transform 0.15s ease;
    display: inline-block;
}

.preferences-section[open] .preferences-section-summary__state::before {
    transform: rotate(90deg);
}

.preferences-section-body {
    margin-top: 0.85rem;
}

/* List Items: MySQL lookup table editor (moved out of per-app sections) */
.preferences-section--list-items .preferences-section-summary h3 {
    text-transform: none;
}

.pref-field {
    margin-bottom: 0.75rem;
}

.pref-field--checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
}

.pref-field--checkbox input {
    flex-shrink: 0;
}

.pref-field--ui-scale-slider {
    margin-top: 0.65rem;
}

.pref-ui-scale-slider-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pref-ui-scale-slider-row .form-range {
    flex: 1;
    min-width: 0;
}

.pref-ui-scale-value {
    min-width: 3.25rem;
    text-align: right;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    color: #495057;
}

.pref-label-text {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #495057;
}

.pref-section-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-top: 0.875rem;
}

.pref-status,
.pref-list-columns-status {
    font-size: 0.8125rem;
    color: #6c757d;
}

/* List columns sub-block */
.pref-list-columns-wrap {
    margin: 1rem 0;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.pref-list-columns-wrap > .pref-list-columns-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
}

.pref-list-columns-title__row {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.pref-list-columns-title-icon {
    width: 1.125rem;
    height: 1.125rem;
    object-fit: contain;
    flex-shrink: 0;
}

.pref-list-columns-title-text {
    line-height: 1.25;
}

.pref-list-columns-wrap > .pref-list-columns-help {
    font-size: 0.8125rem;
    color: #6c757d;
    margin: 0 0 0.5rem;
    line-height: 1.4;
}

.pref-list-columns-sticky-note {
    margin: 0 0 0.5rem;
}

.pref-list-columns-edit-caption {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    margin: 0 0 0.35rem;
}

.pref-list-columns-controls-scroll {
    overflow-x: auto;
    max-width: 100%;
    border-radius: 0.35rem;
    border: 1px solid #dee2e6;
    background: #f1f3f5;
    padding: 0.5rem;
}

.pref-list-columns-controls {
    margin: 0;
    padding: 0;
}

.pref-list-columns-controls--horizontal {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    min-height: 7rem;
}

.pref-col-row {
    flex: 0 0 auto;
    width: 7.25rem;
    min-width: 7.25rem;
    max-width: 9rem;
    border: 1px solid #ced4da;
    border-radius: 0.3rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    margin-right: 0.4rem;
}

.pref-col-row:last-child {
    margin-right: 0;
}

.pref-col-row-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0.45rem 0.4rem 0.35rem;
    gap: 0.35rem;
}

.pref-col-drag-handle {
    cursor: grab;
    text-align: center;
    padding: 0.2rem 0;
    margin: -0.15rem 0 0.1rem;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.95rem;
    line-height: 1;
    color: #868e96;
    letter-spacing: 0.05em;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.pref-col-drag-handle:hover {
    color: #495057;
    background: #f8f9fa;
    border-radius: 0.2rem;
}

.pref-col-drag-handle:active {
    cursor: grabbing;
}

.pref-col-row--dragging {
    opacity: 0.55;
}

.pref-col-row--dragging .pref-col-drag-handle {
    cursor: grabbing;
}

.pref-col-row--drop-target {
    outline: 2px dashed #0d6efd;
    outline-offset: 1px;
    background: #e7f1ff;
}

.pref-col-row-label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    cursor: pointer;
    min-width: 0;
    flex: 1;
}

.pref-col-row-label .pref-col-visible {
    flex-shrink: 0;
}

.pref-col-row-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #212529;
    line-height: 1.25;
    display: block;
    width: 100%;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.35rem;
    margin-bottom: 0.1rem;
}

.pref-col-row-key {
    font-size: 0.65rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 0.15rem 0.3rem;
    border-radius: 0.2rem;
    display: block;
    word-break: break-all;
    line-height: 1.2;
}

.pref-col-row-actions {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 0.2rem;
    margin-top: auto;
    padding-top: 0.35rem;
    border-top: 1px solid #f1f3f5;
}

.pref-col-row-actions .btn {
    padding: 0.1rem 0.35rem;
    font-size: 0.75rem;
    line-height: 1.2;
}

/* Employees lookup: MySQL list editor */
.pref-lookup-details {
    margin: 0.75rem 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
}

.pref-lookup-details > summary {
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #495057;
    list-style: none;
}

.pref-lookup-details > summary::-webkit-details-marker {
    display: none;
}

.pref-lookup-details > summary::before {
    content: "▸ ";
    display: inline-block;
    transition: transform 0.15s ease;
}

.pref-lookup-details[open] > summary::before {
    transform: rotate(90deg);
}

.pref-lookup-intro {
    font-size: 0.8125rem;
    color: #6c757d;
    margin: 0.5rem 0 0.75rem;
    line-height: 1.45;
}

/* --- List Items lookup editor (Settings hub) — calm, readable, theme-aware --- */
.settings-lookup-shell {
    border-radius: 0.5rem;
}

.settings-lookup-lead {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--bs-secondary-color, #6c757d);
    margin: 0 0 0.85rem;
    max-width: 52rem;
}

.settings-lookup-placeholder,
.settings-lookup-loading {
    margin: 0;
    font-size: 0.875rem;
    color: var(--bs-secondary-color, #868e96);
}

.settings-lookup-error {
    margin: 0;
    color: var(--bs-danger, #b00020);
    font-size: 0.875rem;
}

.settings-lookup-layout {
    display: flex;
    gap: 1rem;
    align-items: stretch;
    flex-wrap: nowrap;
    width: 100%;
    min-width: 0;
    min-height: min(58vh, 520px);
}

.settings-lookup-nav {
    flex: 0 0 11.5rem;
    min-width: 9.5rem;
    align-self: stretch;
    max-height: min(58vh, 520px);
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.35rem 0.65rem 0.35rem 0;
    border-right: 1px solid var(--bs-border-color, #dee2e6);
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.settings-lookup-nav-group-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bs-secondary-color, #868e96);
    margin: 0;
    padding: 0.35rem 0.25rem 0.15rem;
}

.settings-lookup-nav-group-label--spaced {
    margin-top: 0.5rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.08));
}

.settings-lookup-nav button {
    text-align: left;
    padding: 0.45rem 0.6rem;
    border: 1px solid transparent;
    border-radius: 0.35rem;
    background: var(--bs-tertiary-bg, #f8f9fa);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--bs-body-color, #212529);
    width: 100%;
    line-height: 1.35;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.settings-lookup-nav button:hover {
    background: var(--bs-secondary-bg, #e9ecef);
    border-color: var(--bs-border-color, #dee2e6);
}

.settings-lookup-nav button.settings-lookup-nav--active {
    font-weight: 600;
    background: color-mix(in srgb, var(--bs-primary, #0d6efd) 12%, transparent);
    border-color: color-mix(in srgb, var(--bs-primary, #0d6efd) 35%, transparent);
    color: var(--bs-emphasis-color, #212529);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--bs-primary, #0d6efd) 20%, transparent);
}

.settings-lookup-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.settings-lookup-toolbar-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
    justify-content: space-between;
}

.settings-lookup-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 0.75rem;
    min-width: 0;
}

.settings-lookup-table-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--bs-emphasis-color, #212529);
}

.settings-lookup-table-slug {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--bs-secondary-color, #868e96);
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    background: var(--bs-tertiary-bg, #f1f3f5);
}

.settings-lookup-toolbar-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    justify-content: space-between;
}

.settings-lookup-search-wrap {
    flex: 1 1 14rem;
    min-width: 10rem;
    max-width: 22rem;
}

.settings-lookup-search-wrap input[type="search"] {
    width: 100%;
    border-radius: 0.35rem;
}

.settings-lookup-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--bs-secondary-color, #6c757d);
}

.settings-lookup-page-size-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-size: 0.8125rem;
    color: var(--bs-secondary-color, #6c757d);
}

.settings-lookup-page-size-label select {
    width: auto;
    min-width: 4.25rem;
}

.settings-lookup-page-info {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.settings-lookup-pager-btns {
    display: inline-flex;
    gap: 0.35rem;
}

.settings-lookup-prev,
.settings-lookup-next {
    border: 1px solid var(--bs-border-color, #ced4da);
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
    padding: 0.25rem 0.65rem;
    border-radius: 0.35rem;
    font-size: 0.8125rem;
}

.settings-lookup-prev:hover:not(:disabled),
.settings-lookup-next:hover:not(:disabled) {
    background: var(--bs-secondary-bg, #e9ecef);
}

.settings-lookup-prev:disabled,
.settings-lookup-next:disabled {
    opacity: 0.45;
}

.settings-lookup-sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.12s ease;
}

.settings-lookup-sortable:hover {
    background: color-mix(in srgb, var(--bs-primary, #0d6efd) 6%, transparent) !important;
}

.settings-lookup-sort-ind {
    font-size: 0.6rem;
    margin-left: 0.15rem;
    opacity: 0.75;
}

.settings-lookup-th-name {
    display: block;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.01em;
    color: var(--bs-emphasis-color, #343a40);
}

.settings-lookup-th-meta {
    display: block;
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0.02em;
    color: var(--bs-secondary-color, #868e96);
    margin-top: 0.15rem;
}

.settings-lookup-th-id {
    width: 3.5rem;
}

.settings-lookup-th-actions {
    width: 4.5rem;
    text-align: right;
}

.settings-lookup-table {
    font-size: 0.8125rem;
    border-collapse: separate;
    border-spacing: 0;
    --lookup-row-border: var(--bs-border-color-translucent, rgba(0, 0, 0, 0.08));
}

.settings-lookup-table tbody tr {
    border-bottom: 1px solid var(--lookup-row-border);
}

.settings-lookup-table tbody tr:last-child {
    border-bottom: none;
}

.settings-lookup-td-id {
    vertical-align: middle;
    padding: 0.35rem 0.5rem;
}

.settings-lookup-id-pill {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.12rem 0.4rem;
    border-radius: 0.25rem;
    background: var(--bs-tertiary-bg, #f1f3f5);
    color: var(--bs-secondary-color, #495057);
}

.settings-lookup-td-field {
    vertical-align: middle;
    padding: 0.25rem 0.45rem;
}

.settings-lookup-cell-input {
    border: 1px solid transparent !important;
    border-radius: 0.3rem !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0.35rem 0.45rem !important;
    min-width: 5rem !important;
    max-width: 18rem !important;
    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

.settings-lookup-cell-input:hover {
    background: color-mix(in srgb, var(--bs-body-color, #000) 3%, transparent) !important;
}

.settings-lookup-cell-input:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--bs-primary, #0d6efd) 45%, transparent) !important;
    background: var(--bs-body-bg, #fff) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--bs-primary, #0d6efd) 18%, transparent) !important;
}

.settings-lookup-td-save {
    vertical-align: middle;
    text-align: right;
    padding: 0.35rem 0.45rem;
}

.settings-lookup-save-row {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.28rem 0.65rem;
    border-radius: 0.3rem;
    border: 1px solid color-mix(in srgb, var(--bs-primary, #0d6efd) 40%, transparent);
    background: transparent;
    color: var(--bs-primary, #0d6efd);
}

.settings-lookup-save-row:hover {
    background: color-mix(in srgb, var(--bs-primary, #0d6efd) 10%, transparent);
}

.settings-lookup-empty {
    text-align: center;
    padding: 1.75rem 1rem !important;
    color: var(--bs-secondary-color, #868e96);
    font-size: 0.875rem;
}

.settings-lookup-add-wrap {
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 0.4rem;
    border: 1px dashed var(--bs-border-color, #ced4da);
    background: color-mix(in srgb, var(--bs-tertiary-bg, #f8f9fa) 85%, transparent);
}

.settings-lookup-add-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.65rem;
}

.settings-lookup-add-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bs-emphasis-color, #343a40);
}

.settings-lookup-add-hint {
    font-size: 0.75rem;
    color: var(--bs-secondary-color, #868e96);
}

.settings-lookup-add-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 0.85rem;
}

.settings-lookup-add-field {
    flex: 1 1 10rem;
    min-width: 7rem;
    max-width: 16rem;
}

.settings-lookup-add-field--action {
    flex: 0 0 auto;
    min-width: auto;
    max-width: none;
    align-self: flex-end;
}

.settings-lookup-mini-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.02em;
    color: var(--bs-secondary-color, #6c757d);
    margin-bottom: 0.2rem;
}

.settings-lookup-add-row {
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 0.4rem 0.85rem;
    border-radius: 0.35rem;
    border: none;
    background: var(--bs-primary, #0d6efd);
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.settings-lookup-add-row:hover {
    filter: brightness(1.06);
}

.settings-lookup-main {
    flex: 1;
    min-width: 0;
    min-height: 120px;
}

.settings-lookup-table-scroll {
    max-height: min(58vh, 520px);
    overflow: auto;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.4rem;
    background: var(--bs-body-bg, #fff);
    scrollbar-gutter: stable;
}

.settings-lookup-table-scroll table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bs-secondary-bg, #f1f3f5);
    box-shadow: inset 0 -1px 0 var(--bs-border-color, #dee2e6);
    padding: 0.5rem 0.45rem;
    vertical-align: bottom;
}

.settings-lookup-status {
    font-size: 0.8125rem;
    margin: 0.5rem 0 0;
    min-height: 1.1rem;
    color: var(--bs-secondary-color, #6c757d);
}

.settings-lookup-status--ok {
    color: var(--bs-success, #198754);
}

.settings-lookup-status--error {
    color: var(--bs-danger, #dc3545);
}

@media (max-width: 576px) {
    .settings-lookup-layout {
        flex-direction: column;
        min-height: auto;
        align-items: stretch;
    }

    .settings-lookup-nav {
        flex: none;
        max-height: min(36vh, 220px);
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--bs-border-color, #e9ecef);
        padding: 0 0 0.65rem;
    }

    .settings-lookup-toolbar-top {
        flex-direction: column;
        align-items: stretch;
    }

    .settings-lookup-search-wrap {
        max-width: none;
    }

    .settings-lookup-toolbar-bottom {
        flex-direction: column;
        align-items: stretch;
    }

    .settings-lookup-pager {
        justify-content: space-between;
    }

    .settings-lookup-table-scroll {
        max-height: min(50vh, 400px);
    }
}

.pref-lookup-details > summary + * {
    margin-top: 0.5rem;
}

/* --- User permissions admin (employees_permissions) --- */
.preferences-section--perm-admin .pref-perm-admin-details > summary {
    cursor: pointer;
    list-style: none;
    padding: 0.25rem 0;
}

.preferences-section--perm-admin .pref-perm-admin-details > summary::-webkit-details-marker {
    display: none;
}

.preferences-section--perm-admin .pref-perm-admin-details > summary::before {
    content: "▸ ";
    display: inline-block;
    transition: transform 0.15s ease;
    margin-right: 0.35rem;
    color: #6c757d;
}

.preferences-section--perm-admin .pref-perm-admin-details[open] > summary::before {
    transform: rotate(90deg);
}

.pref-perm-admin-intro .pref-perm-lead {
    max-width: 72ch;
}

.pref-perm-help-callout {
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
}

.pref-perm-help-callout > summary {
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
}

.pref-perm-results {
    max-height: 240px;
    overflow-y: auto;
    margin-bottom: 0;
}

.pref-perm-results .pref-perm-result-row.active {
    background: #e7f1ff;
    border-color: #b6d4fe;
}

.pref-perm-result-id {
    font-weight: 600;
    color: #495057;
}

.pref-perm-result-email {
    font-size: 0.8125rem;
}

.pref-perm-employee-card {
    border: 1px solid #dee2e6 !important;
}

/* User permissions: employee header — status under name/email; Reload top-right */
.pref-perm-employee-card-body {
    padding-bottom: 1rem;
}

.pref-perm-reload-wrap {
    align-self: flex-start;
}

.pref-perm-secondary-actions-bar {
    border-top: 1px solid #e9ecef;
}

/* User permissions: suspension (left) vs reset template + button (right) */
.pref-perm-mail-actions {
    row-gap: 0.75rem !important;
}

.pref-perm-mail-left,
.pref-perm-mail-right {
    flex: 0 1 auto;
    min-width: 0;
}

.pref-perm-mail-field {
    max-width: 100%;
}

.pref-perm-mail-select {
    min-width: 11rem;
    max-width: 22rem;
}

.pref-perm-mail-field .select2-container {
    min-width: 11rem;
    max-width: 22rem;
}

.pref-perm-status {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.35rem 0.6rem;
    border-radius: 0.25rem;
    border: 1px solid #ced4da;
    background: #f8f9fa;
    color: #495057;
    line-height: 1.2;
}

.pref-perm-status--full {
    border-color: #a3cfbb;
    background: #e8f5ef;
    color: #0f5132;
}

.pref-perm-status--custom {
    border-color: #9ec5fe;
    background: #e7f1ff;
    color: #084298;
}

.pref-perm-suspend-check {
    flex: 0 0 auto;
    white-space: nowrap;
}

.pref-perm-json-details {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
}

.pref-perm-json-details > summary {
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
}

.pref-perm-json-pre {
    max-height: 280px;
    overflow: auto;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.75rem;
    font-size: 0.75rem;
    line-height: 1.4;
}

.pref-perm-app-card .card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.pref-perm-profile-table th {
    font-size: 0.75rem;
    white-space: nowrap;
}
