/* Shared HelpDesk list, detail, picker and edit presentation. */
.org-helpdesk-layout,
.helpdesk-email-layout {
    min-width: 0;
    align-items: stretch;
}

/* Notification detail modal */
    .notification-dialog-header-actions {
        display: flex;
        align-items: center;
        gap: 0.65rem;
        flex: 0 0 auto;
    }

    .notification-close-confirmation {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.65rem;
        flex-wrap: wrap;
        width: 100%;
    }

    .notification-detach-button {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        white-space: nowrap;
    }

    .notification-window-layout {
        min-height: 100dvh;
        background: var(--bware-bg, var(--bs-body-bg));
        color: var(--bware-text, var(--bs-body-color));
    }

    .notification-window-workspace {
        display: flex;
        flex-direction: column;
        width: 100%;
        min-width: 0;
        height: 100dvh;
        min-height: 0;
        background: var(--bware-surface, var(--bs-body-bg));
    }

    .notification-window-header,
    .notification-window-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        flex: 0 0 auto;
        padding: 0.75rem 1rem;
        border-color: var(--bware-border-color, var(--bs-border-color));
        background: var(--bware-surface-2, var(--bs-body-bg));
    }

    .notification-window-header {
        border-bottom: 1px solid var(--bware-border-color, var(--bs-border-color));
    }

    .notification-window-footer {
        justify-content: flex-end;
        border-top: 1px solid var(--bware-border-color, var(--bs-border-color));
    }

    .notification-window-body.notification-dialog-body-fixed {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        padding: 1rem;
        overflow: hidden;
    }

    .notification-window-body .notification-modal-body {
        height: 100%;
    }

    .notification-window-state {
        max-width: 48rem;
        margin: 0 auto;
        padding: 2rem;
    }

    .notification-window-workspace-preparing {
        position: fixed;
        inset: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .notification-modal-body {
        height: min(820px, calc(100dvh - 11rem));
        overflow: hidden;
    }

    .notification-modal-initializing {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        color: var(--bware-text-muted, var(--bs-secondary-color));
    }

    .notification-dialog-body-fixed {
        max-height: none;
        overflow: hidden;
    }

    .notification-dialog-overlay-fixed {
        overflow: hidden;
        overscroll-behavior: none;
    }

    .notification-left-panel,
    .notification-right-panel {
        min-height: 0;
        height: 100%;
    }

    .notification-left-panel {
        overflow-y: auto;
        padding-right: 0.25rem;
    }

    .notification-right-panel {
        display: flex;
        flex-direction: column;
    }

    .notification-history-card {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .notification-history-chat {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        padding: 0.75rem;
    }

    .history-row {
        display: flex;
        gap: 0.55rem;
        margin-bottom: 0.65rem;
        align-items: center;
    }

    .history-row-current {
        flex-direction: row-reverse;
    }

    .history-avatar {
        width: 30px;
        height: 30px;
        border-radius: 999px;
        color: #fff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        flex: 0 0 auto;
        font-size: 0.8rem;
    }

    .history-bubble {
        max-width: 88%;
        border: 1px solid var(--bs-border-color);
        border-left: 6px solid var(--history-colour);
        border-right: 1px solid var(--bs-border-color);
        background: rgba(127,127,127,0.08);
        color: var(--bs-body-color);
        border-radius: 0.65rem;
        padding: 0.45rem 0.7rem;
        line-height: 1.25;
    }

    .history-row-current .history-bubble {
        border-left: 1px solid var(--bs-border-color);
        border-right: 6px solid var(--history-colour);
        background: rgba(13,110,253,0.12);
    }

    .history-action {
        color: var(--bs-secondary-color);
        font-size: 0.8rem;
    }

    .history-comment {
        color: var(--bs-body-color);
        margin-top: 0.25rem;
    }

    .history-topline {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 0.75rem;
    }

    .history-heading {
        display: flex;
        align-items: baseline;
        gap: 0.25rem;
        min-width: 0;
    }

    .history-name {
        color: var(--bs-body-color);
        font-weight: 700;
        line-height: 1.15;
    }

    .history-action-inline {
        color: var(--bs-secondary-color);
        font-size: 0.82rem;
        font-weight: 500;
        line-height: 1.15;
    }

    .history-date {
        color: var(--bs-secondary-color);
        font-size: 0.78rem;
        line-height: 1.15;
        white-space: nowrap;
    }

    .notification-modal-dialog {
        max-width: min(1500px, calc(100vw - 3rem));
    }

    .notification-action-btn {
        padding: 0.35rem 0.55rem;
        font-size: 0.84rem;
        font-weight: 700;
        border-radius: 0.45rem;
    }

    .notification-submit-btn {
        padding: 0.42rem 0.75rem;
        font-size: 0.9rem;
        font-weight: 700;
        border-radius: 0.45rem;
    }

    .action-notes,
    .notification-comment-box {
        height: 112px;
        min-height: 112px;
        max-height: 112px;
        font-size: 0.88rem;
        line-height: 1.3;
        resize: none;
        overflow-y: auto;
    }

    .notification-inline-comment .form-label {
        margin-bottom: 0.35rem;
    }

    .notification-file-list .notification-file-item {
        background: var(--bs-body-bg);
        color: var(--bs-body-color);
        border-color: var(--bs-border-color);
        padding: 0.5rem 0.75rem;
        text-decoration: none;
    }

        .notification-file-list .notification-file-item:nth-child(odd) {
            background: rgba(127, 127, 127, 0.06);
        }

        .notification-file-list .notification-file-item:nth-child(even) {
            background: rgba(127, 127, 127, 0.12);
        }

        .notification-file-list .notification-file-item:hover {
            background: rgba(13, 110, 253, 0.16);
            color: var(--bs-body-color);
        }

    .notification-file-list .notification-file-title {
        color: var(--bs-body-color);
        font-weight: 600;
        line-height: 1.2;
    }

    .notification-file-list .notification-file-meta {
        color: var(--bs-secondary-color);
        line-height: 1.15;
    }

    .notification-file-row {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        min-width: 0;
    }

    .notification-file-link {
        flex: 1 1 auto;
        min-width: 0;
        color: inherit;
        text-decoration: none;
    }

    .notification-file-link:hover .notification-file-title,
    .notification-file-link:focus-visible .notification-file-title {
        text-decoration: underline;
    }

    .notification-file-remove {
        flex: 0 0 auto;
    }

    .notification-file-delete-confirm {
        margin: 0.75rem;
    }

    .notification-pending-files {
        padding: 0.65rem;
        border: 1px solid var(--bs-border-color);
        border-radius: 0.45rem;
        background: rgba(127, 127, 127, 0.06);
    }

    .notification-pending-file-list {
        display: grid;
        gap: 0.4rem;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .notification-pending-file {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.5rem;
        min-width: 0;
        padding-top: 0.4rem;
        border-top: 1px solid var(--bs-border-color);
    }

    .notification-pending-file-info {
        display: flex;
        grid-column: 1;
        grid-row: 1;
        align-items: baseline;
        gap: 0.5rem;
        min-width: 0;
    }

    .notification-pending-file-name {
        overflow: hidden;
        font-weight: 600;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .notification-file-conflict {
        display: flex;
        grid-column: 1 / -1;
        grid-row: 2;
        align-items: center;
        gap: 0.35rem;
        flex-wrap: wrap;
    }

    .notification-pending-file-remove,
    .notification-pending-file > .btn-link:last-child {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    @media (max-width: 575.98px) {
        .notification-pending-file-info {
            align-items: flex-start;
            flex-direction: column;
            gap: 0;
        }
    }

    .notification-modal-subtitle {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        flex-wrap: wrap;
    }

    .notification-modal-member-strip {
        margin-left: 0.15rem;
    }

    .notification-complete-notes {
        background: rgba(127, 127, 127, 0.08);
        border: 1px solid var(--bs-border-color);
        border-radius: 0.45rem;
        padding: 0.6rem 0.75rem;
        color: var(--bs-body-color);
        white-space: pre-wrap;
    }

    .membership-status-panel {
        margin-bottom: 0.75rem;
        padding: 0.65rem;
        border: 1px solid var(--bs-border-color);
        border-radius: 0.45rem;
        background: rgba(127, 127, 127, 0.06);
        color: var(--bs-body-color);
    }

    .membership-status-meta {
        display: flex;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .membership-cancellation-form {
        padding-top: 0.6rem;
        border-top: 1px solid var(--bs-border-color);
        container-type: inline-size;
    }

    .membership-cancellation-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 0.5rem;
        align-items: end;
    }

    .membership-cancellation-option {
        min-width: 0;
    }

    .membership-cancellation-actions {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    @container (min-width: 40rem) {
        .membership-cancellation-layout {
            grid-template-columns: minmax(12rem, 1fr) auto auto;
        }

        .membership-cancellation-option {
            padding-bottom: 0.2rem;
            white-space: nowrap;
        }

        .membership-cancellation-actions {
            justify-content: flex-end;
            flex-wrap: nowrap;
        }
    }

    .email-thread-panel {
        min-height: 0;
    }

    .notification-linked-email-card {
        background: rgba(13, 110, 253, 0.08);
        border-color: rgba(13, 110, 253, 0.25);
    }

        .notification-linked-email-card .card-body {
            overflow: hidden;
        }

        .email-thread-list-item.is-selected {
            background: var(--bs-primary);
            color: #fff;
        }

            .email-thread-list-item.is-selected strong,
            .email-thread-list-item.is-selected small,
            .email-thread-list-item.is-selected .small,
            .email-thread-list-item.is-selected div {
                color: #fff;
            }

    .email-thread-list-item.is-selected .email-thread-preview {
        opacity: 1;
        color: #fff;
    }

    @media (max-width: 991.98px) {
        .notification-window-body.notification-dialog-body-fixed {
            overflow-y: auto;
        }

        .notification-dialog-body-fixed {
            max-height: calc(100dvh - 10rem);
            overflow-y: auto;
        }

        .notification-modal-body {
            height: auto;
            overflow: visible;
        }

        .notification-left-panel,
        .notification-right-panel,
        .notification-history-card {
            height: auto;
            overflow: visible;
        }

        .notification-history-chat {
            overflow: visible;
        }
    }

    @media (max-width: 575.98px) {
        .notification-detach-button span {
            display: none;
        }

        .notification-window-header,
        .notification-window-footer,
        .notification-window-body.notification-dialog-body-fixed {
            padding: 0.75rem;
        }
    }


/* Create notification modal */
    .notification-member-picker {
        display: flex;
        flex-wrap: wrap;
        gap: 0.45rem;
        align-items: center;
    }

    .notification-member-badge {
        width: 36px;
        height: 36px;
        border-radius: 999px;
        border: 2px solid var(--bs-border-color);
        background: #6c757d;
        color: #fff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.82rem;
        font-weight: 800;
        line-height: 1;
        padding: 0;
        opacity: 0.45;
        filter: grayscale(1);
        transition: transform 0.12s ease, opacity 0.12s ease, filter 0.12s ease;
    }

        .notification-member-badge:hover {
            opacity: 0.85;
            transform: translateY(-1px);
        }

        .notification-member-badge.selected {
            opacity: 1;
            filter: none;
            color: #fff;
        }

            .notification-member-badge.selected::after {
                content: "";
            }

    .notification-message {
        min-height: 110px;
    }

    .priority-preview {
        min-height: 38px;
        border-radius: 0.375rem;
        padding: 0.45rem 0.75rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        border: 1px solid transparent;
    }

    .priority-preview.priority-urgent { border-color: #dc3545; }
    .priority-preview.priority-high { border-color: #fd7e14; }
    .priority-preview.priority-medium { border-color: #ffc107; }
    .priority-preview.priority-low { border-color: #198754; }

/* Notification bell */
    .notification-bell-btn {
        position: relative;
        width: 42px;
        height: 42px;
        border: 1px solid rgba(255,255,255,.18);
        border-radius: 10px;
        background: transparent;
        color: rgba(255,255,255,.85);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

        .notification-bell-btn i {
            color: inherit;
        }

        .notification-bell-btn:hover {
            background: #fff;
            color: #212529;
            border-color: #fff;
        }

    .notification-dropdown {
        position: absolute;
        right: 0;
        top: calc(100% + 8px);
        width: 430px;
        max-height: 480px;
        overflow-y: auto;
        z-index: 9999;
        background: var(--bs-body-bg);
        color: var(--bs-body-color);
        border: 1px solid var(--bs-border-color);
    }

    .notification-dropdown-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        background: var(--bs-tertiary-bg);
        color: var(--bs-body-color);
        border-bottom: 1px solid var(--bs-border-color);
    }

    .notification-read-all {
        flex: 0 0 auto;
        padding-block: 0;
        text-decoration: none;
    }

    .notification-dropdown-item {
        width: 100%;
        border: 0;
        border-bottom: 1px solid var(--bs-border-color);
        background: var(--bs-body-bg);
        color: var(--bs-body-color);
        text-align: left;
        padding: 0.65rem 0.75rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }

        .notification-dropdown-item:nth-child(odd) {
            background: rgba(127, 127, 127, 0.06);
        }

        .notification-dropdown-item:hover {
            background: rgba(127, 127, 127, 0.12);
            color: var(--bs-body-color);
        }

    .notification-dropdown-meta-line {
        display: flex;
        align-items: center;
        gap: 0.3rem;
        color: var(--bs-secondary-color);
        font-size: 0.78rem;
        line-height: 1.2;
        flex-wrap: wrap;
    }

    .notification-dropdown .notification-badge-compact {
        min-width: 58px;
        padding: 0.16rem 0.38rem;
        font-size: 0.64rem;
    }

    .notifications-panel .notification-member-avatar,
    .notification-dropdown .notification-member-avatar {
        width: 21px;
        height: 21px;
        font-size: 0.56rem;
        border-width: 1px;
    }


/* Notification panel */
    .notifications-panel {
        max-height: calc(100vh - 150px);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .notifications-panel-header {
        flex: 0 0 auto;
    }

    .notifications-panel-filter {
        flex: 0 0 auto;
        padding: 0.75rem;
        border-bottom: 1px solid var(--bs-border-color);
    }

    .notifications-panel-list {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .notification-list-item {
        background: var(--bs-body-bg);
        color: var(--bs-body-color);
        border-color: var(--bs-border-color);
    }

        .notification-list-item:nth-child(odd) {
            background: rgba(127, 127, 127, 0.06);
        }

        .notification-list-item:nth-child(even) {
            background: rgba(127, 127, 127, 0.02);
        }

        .notification-list-item:hover {
            background: rgba(127, 127, 127, 0.12);
            color: var(--bs-body-color);
        }


.org-helpdesk-layout > [class*="col-"],
.helpdesk-email-layout > [class*="col-"] {
    min-width: 0;
    min-height: 0;
}

.helpdesk-email-table,
.org-helpdesk-table {
    width: 100%;
    table-layout: fixed;
}

.helpdesk-email-table th,
.helpdesk-email-table td,
.org-helpdesk-table th,
.org-helpdesk-table td {
    overflow: hidden;
    vertical-align: top;
}

.helpdesk-email-table .col-received { width: 7.5rem; }
.helpdesk-email-table .col-from { width: 12rem; }
.helpdesk-email-table .col-subject { width: auto; }
.helpdesk-email-table .col-tags { width: 11rem; }
.helpdesk-email-table .col-org { width: 13rem; }
.helpdesk-email-table .col-action { width: 4.75rem; }

.org-helpdesk-table .col-received { width: 6.25rem; }
.org-helpdesk-table .col-from { width: 7.5rem; }
.org-helpdesk-table .col-subject { width: auto; }
.org-helpdesk-table .col-tags { width: 7rem; }
.org-helpdesk-table .col-edit,
.org-helpdesk-table .col-notify { width: 4.75rem; }

.helpdesk-email-row > *,
.org-helpdesk-row > * {
    transition: background-color 0.15s ease;
}

.helpdesk-email-row:nth-child(odd) > *,
.org-helpdesk-row:nth-child(odd) > * {
    background-color: color-mix(in srgb, var(--bware-surface-2, var(--bs-body-bg)) 94%, var(--bware-text, var(--bs-body-color)) 6%);
}

.helpdesk-email-row:hover > *,
.org-helpdesk-row:hover > * {
    background-color: color-mix(in srgb, var(--bware-surface-2, var(--bs-body-bg)) 88%, var(--bware-text, var(--bs-body-color)) 12%);
}

.helpdesk-email-row.is-selected > *,
.org-helpdesk-row.is-selected > * {
    background-color: color-mix(in srgb, var(--bware-primary, var(--bs-primary)) 20%, var(--bware-surface, var(--bs-body-bg)));
    color: var(--bware-text, var(--bs-body-color));
}

.helpdesk-email-row.is-selected > td:first-child,
.org-helpdesk-row.is-selected > td:first-child {
    border-left: 0.25rem solid var(--bware-primary, var(--bs-primary));
}

.table-picker-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    text-align: left;
}

.org-helpdesk-action-btn {
    min-width: 4rem;
}

.helpdesk-picker-body {
    max-height: min(26rem, 60vh);
    overflow: auto;
}

.helpdesk-picker-item {
    display: block;
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 0;
    border-bottom: 1px solid var(--bware-border-color, var(--bs-border-color));
    background: transparent;
    color: var(--bware-text, var(--bs-body-color));
    text-align: left;
}

.helpdesk-picker-item:hover,
.helpdesk-picker-item.is-selected,
.helpdesk-picker-check-item:hover {
    background: var(--bware-surface-2, rgba(127, 127, 127, 0.12));
}

.helpdesk-picker-check-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.65rem;
    border-radius: var(--bware-radius-sm, 0.35rem);
    cursor: pointer;
}

.helpdesk-current-org {
    padding: 0.75rem;
    border: 1px solid var(--bware-border-color, var(--bs-border-color));
    border-radius: var(--bware-radius-sm, 0.375rem);
    background: var(--bware-surface-2, var(--bs-tertiary-bg));
}

.helpdesk-edit-org-list {
    max-height: 16.25rem;
    overflow: auto;
    border: 1px solid var(--bware-border-color, var(--bs-border-color));
    border-radius: var(--bware-radius-sm, 0.375rem);
}

.helpdesk-edit-org-item {
    display: block;
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 0;
    border-bottom: 1px solid var(--bware-border-color, var(--bs-border-color));
    background: transparent;
    color: var(--bware-text, var(--bs-body-color));
    text-align: left;
}

.helpdesk-edit-org-item:last-child { border-bottom: 0; }

.helpdesk-edit-org-item:hover,
.helpdesk-edit-org-item.is-selected {
    background: var(--bware-surface-2, rgba(127, 127, 127, 0.12));
}
/* Shared presentation for notification surfaces and linked helpdesk email threads. */
.notification-row-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 74px auto;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
}

.notification-list-main { min-width: 0; }

.notification-list-title {
    display: block;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-list-meta {
    color: var(--bs-secondary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-member-strip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    flex-wrap: nowrap;
}

.notification-member-strip-row {
    width: 74px;
    min-width: 74px;
    max-width: 74px;
    justify-content: flex-end;
    gap: 0.12rem;
    overflow: hidden;
}

.notification-list-badges {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.notification-member-avatar {
    width: 23px;
    height: 23px;
    border-radius: 999px;
    border: 2px solid transparent;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    flex: 0 0 auto;
}

.notification-member-more {
    background: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.notification-badge-compact {
    display: inline-block;
    min-width: 62px;
    padding: 0.18rem 0.45rem;
    border: 1px solid transparent;
    border-radius: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
}

.status-unread { background: #0d6efd; color: #fff; }
.status-read { background: #6c757d; color: #fff; }
.status-deferred { background: #6f42c1; color: #fff; }
.status-complete { background: #198754; color: #fff; }
.status-archived { background: #495057; color: #fff; }
.status-unknown { background: #adb5bd; color: #212529; }
.status-review { background: #0dcaf0; color: #052c36; }

.priority-urgent { background: #dc3545; color: #fff; }
.priority-high { background: #fd7e14; color: #fff; }
.priority-medium { background: #ffc107; color: #212529; }
.priority-low { background: #198754; color: #fff; }

.notification-date-overdue {
    color: #ff6b6b !important;
    font-weight: 800;
}

.notification-date-normal { color: inherit; }

.min-w-0 { min-width: 0; }

.notification-email-body-panel { background: var(--bs-body-bg); }

.notification-email-body-panel .email-body {
    max-height: none;
    overflow: visible;
}

.email-body img {
    max-width: 100%;
    height: auto;
}

.email-body table { max-width: 100%; }

.email-thread-list {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    overflow: hidden;
}

.email-thread-list-item {
    display: block;
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 0;
    border-bottom: 1px solid var(--bs-border-color);
    text-align: left;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

.email-thread-list-item:last-child { border-bottom: 0; }
.email-thread-list-item:nth-child(odd) { background: rgba(127, 127, 127, 0.06); }
.email-thread-list-item:nth-child(even) { background: rgba(127, 127, 127, 0.02); }

.email-thread-list-item:hover {
    background: rgba(127, 127, 127, 0.12);
    color: var(--bs-body-color);
}

.email-thread-preview { opacity: 0.85; }

/* Canonical HelpDesk list/detail contract: one scroll owner per data region. */
.helpdesk-email-open-action {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}

.helpdesk-email-open-action:focus-visible {
    border-radius: var(--bware-radius-sm, 0.25rem);
    outline: 3px solid var(--bware-focus-ring, rgba(13, 110, 253, 0.45));
    outline-offset: 2px;
}

.helpdesk-email-subject,
.helpdesk-email-preview {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.helpdesk-workspace .org-helpdesk-layout,
.helpdesk-workspace .helpdesk-email-layout {
    width: 100%;
    min-width: 0;
    align-items: stretch;
}

.helpdesk-workspace .org-helpdesk-layout > [class*="col-"],
.helpdesk-workspace .helpdesk-email-layout > [class*="col-"] {
    min-width: 0;
    min-height: 0;
}

.helpdesk-workspace .org-helpdesk-list-card,
.helpdesk-workspace .helpdesk-email-list-card,
.helpdesk-workspace .helpdesk-email-detail-card {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.helpdesk-workspace--crm .org-helpdesk-list-card,
.helpdesk-workspace--crm .helpdesk-email-detail-card {
    height: clamp(30rem, calc(100dvh - 12.5rem), 56rem);
}

.helpdesk-workspace--crm .helpdesk-email-detail-body {
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.helpdesk-workspace--mailbox .helpdesk-email-list-card,
.helpdesk-workspace--mailbox .helpdesk-email-detail-card {
    height: clamp(32rem, calc(100vh - 16rem), 50rem);
}

.helpdesk-workspace .org-helpdesk-list-card > .table-responsive,
.helpdesk-workspace .helpdesk-email-list-card > .table-responsive,
.helpdesk-workspace .helpdesk-email-detail-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    scrollbar-gutter: stable;
}

.helpdesk-workspace--crm {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

.helpdesk-workspace .org-helpdesk-list-card > .table-responsive,
.helpdesk-workspace .helpdesk-email-list-card > .table-responsive {
    overscroll-behavior: contain;
}

.helpdesk-workspace table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bware-surface, var(--bs-body-bg));
    box-shadow: inset 0 -1px var(--bware-border-color, var(--bs-border-color));
}

@media (max-width: 1399.98px) {
    .helpdesk-workspace--crm .org-helpdesk-layout > [class*="col-"],
    .helpdesk-workspace--mailbox .helpdesk-email-layout > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .helpdesk-workspace--crm .org-helpdesk-list-card,
    .helpdesk-workspace--crm .helpdesk-email-detail-card,
    .helpdesk-workspace--mailbox .helpdesk-email-list-card,
    .helpdesk-workspace--mailbox .helpdesk-email-detail-card {
        height: min(32rem, 65vh);
        position: static;
    }

    .helpdesk-workspace--crm .org-helpdesk-list-card > .table-responsive {
        max-width: 100%;
        overflow-x: auto;
    }

    .helpdesk-workspace--crm .org-helpdesk-table {
        min-width: 44rem;
    }
}

@media (max-width: 575.98px) {
    .helpdesk-workspace--crm .org-helpdesk-list-card,
    .helpdesk-workspace--crm .helpdesk-email-detail-card,
    .helpdesk-workspace--mailbox .helpdesk-email-list-card,
    .helpdesk-workspace--mailbox .helpdesk-email-detail-card {
        height: min(28rem, 70vh);
    }
}
