.helpdesk-page .helpdesk-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.helpdesk-column-row {
    cursor: grab;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}

.helpdesk-column-row.is-dragging {
    opacity: 0.55;
}

.helpdesk-column-row.is-disabled {
    opacity: 0.45;
}

.helpdesk-column-row.is-drop-target {
    border-color: rgba(28, 138, 169, 0.45) !important;
    background: #f5fbfd;
}

.helpdesk-column-row.is-drop-target-before,
.helpdesk-column-row.is-drop-target-after {
    position: relative;
}

.helpdesk-column-row.is-drop-target-before::before,
.helpdesk-column-row.is-drop-target-after::after {
    content: '';
    position: absolute;
    left: 0.5rem;
    right: 0.5rem;
    height: 3px;
    border-radius: 999px;
    background: #1c8aa9;
    box-shadow: 0 0 0 2px rgba(28, 138, 169, 0.12);
}

.helpdesk-column-row.is-drop-target-before::before {
    top: -3px;
}

.helpdesk-column-row.is-drop-target-after::after {
    bottom: -3px;
}

.helpdesk-column-drag-handle {
    color: #899bbd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.helpdesk-form {
    text-align: left;
}

.helpdesk-modal-dialog .modal-body {
    padding-top: 18px;
}

.helpdesk-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}

.helpdesk-form__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.helpdesk-form__field label {
    font-size: 13px;
    font-weight: 600;
    color: #163245;
}

.helpdesk-form__textarea {
    min-height: 140px;
    resize: vertical;
}

.helpdesk-form__textarea--ticket-body {
    min-height: 400px;
}

.helpdesk-form__field--full {
    grid-column: 1 / -1;
}

.helpdesk-form__stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.helpdesk-form__section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.helpdesk-form__section-title {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #4a6575;
}

.helpdesk-inline-form-row {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.helpdesk-inline-form-row + .helpdesk-inline-form-row {
    margin-top: 12px;
}

.helpdesk-inline-form-row > label {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #163245;
}

.helpdesk-inline-form-row__control {
    min-width: 0;
}

.helpdesk-sla-cell {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.helpdesk-sla-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.1;
}

.helpdesk-sla-chip--ok {
    color: #146c43;
    background: #d1e7dd;
}

.helpdesk-sla-chip--warning {
    color: #9a6700;
    background: #fef0c7;
}

.helpdesk-sla-chip--breached {
    color: #842029;
    background: #f8d7da;
}

.helpdesk-ticket-editor-shell .tox-editor-header,
.helpdesk-ticket-editor-shell .tox-toolbar-overlord,
.helpdesk-ticket-editor-shell .tox-statusbar {
    border-color: #dbe4ea;
}

#helpdesk-action-modal-validation {
    white-space: pre-wrap;
}

.helpdesk-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.helpdesk-summary-card {
    border: 1px solid #e6eaed;
    border-radius: 8px;
    background: #fff;
    padding: 14px 16px;
}

.helpdesk-summary-card h6 {
    margin: 0 0 10px;
    color: #163245;
}

.helpdesk-mailbox {
    font-size: 18px;
    font-weight: 700;
    color: #163245;
}

.helpdesk-settings-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.helpdesk-config-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-top: 1px solid #eef2f5;
}

.helpdesk-config-row:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.helpdesk-routing-rule__title {
    font-weight: 600;
    color: #163245;
}

.helpdesk-routing-rule__meta {
    font-size: 12px;
    color: #637381;
    margin-top: 2px;
}

.helpdesk-routing-summary {
    font-size: 18px;
    font-weight: 700;
    color: #163245;
}

.helpdesk-inbound-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.helpdesk-inbound-toolbar .form-control {
    min-width: 160px;
}

.helpdesk-related-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.helpdesk-related-item {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 6px 0;
    border-top: 1px solid #eef2f5;
}

.helpdesk-related-item:first-child {
    border-top: 0;
    padding-top: 0;
}

.helpdesk-ticket-actions {
    display: inline-flex;
    position: relative;
}

.helpdesk-ticket-actions-cell {
    width: 1%;
    white-space: nowrap;
}

.helpdesk-ticket-actions .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: #4a6575;
    text-decoration: none;
}

.helpdesk-ticket-actions .icon:hover,
.helpdesk-ticket-actions .icon:focus {
    background: rgba(28, 138, 169, 0.08);
    color: #163245;
}

.helpdesk-ticket-actions .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.helpdesk-ticket-actions .dropdown-item i {
    width: 14px;
    text-align: center;
}

.helpdesk-ticket-actions-menu--floating {
    z-index: 1085;
}

.helpdesk-link-device-placeholder {
    color: #8a97a6;
    text-decoration: none;
}

.helpdesk-link-device-placeholder:hover,
.helpdesk-link-device-placeholder:focus {
    color: #667485;
    text-decoration: underline;
}

.helpdesk-link-device-placeholder.is-disabled {
    pointer-events: none;
    opacity: 0.7;
}

.helpdesk-table-placeholder {
    color: #8a97a6;
}

.helpdesk-inline-edit-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
    color: #4a6575;
    font-size: 13px;
}

.helpdesk-inline-edit-toggle .form-switch {
    display: inline-flex;
    align-items: center;
    min-height: 0;
    padding-left: 0;
}

.helpdesk-inline-edit-toggle .form-check-input {
    margin: 0;
    position: static;
}

.helpdesk-inline-edit-toggle__label {
    white-space: nowrap;
}

.helpdesk-inline-edit-control {
    min-width: 140px;
}

.helpdesk-inline-editable-cell {
    cursor: pointer;
}

.helpdesk-inline-editable-cell:hover {
    background: rgba(28, 138, 169, 0.04);
}

.helpdesk-inline-edit-control.is-saving {
    opacity: 0.7;
}

.helpdesk-workload-overview,
.helpdesk-workload-total,
.helpdesk-workload-cell__badges {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.helpdesk-workload-table-wrap {
    margin-top: 18px;
}

.helpdesk-workload-section .dataTables_wrapper table.dataTable thead th {
    white-space: nowrap;
    vertical-align: bottom;
    color: #264052;
    font-size: 12px;
}

.helpdesk-workload-section .dataTables_wrapper table.dataTable tbody td:first-child {
    min-width: 180px;
}

.helpdesk-workload-person {
    font-weight: 600;
    color: #163245;
}

.helpdesk-workload-cell {
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    border: 0;
    background: transparent;
    text-align: left;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    border-radius: 8px;
}

.helpdesk-workload-cell:disabled {
    opacity: 1;
    cursor: default;
}

.helpdesk-workload-cell--interactive {
    cursor: pointer;
}

.helpdesk-workload-cell--interactive:hover,
.helpdesk-workload-cell--interactive:focus {
    background: rgba(28, 138, 169, 0.06);
}

.helpdesk-workload-badge {
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 6px 7px;
    min-width: 24px;
    text-align: center;
}

.helpdesk-workload-badge--ok {
    background: #e5f6ea;
    color: #166534;
}

.helpdesk-workload-badge--warning {
    background: #fff4d6;
    color: #9a6700;
}

.helpdesk-workload-badge--breached {
    background: #fde8e8;
    color: #b42318;
}

.helpdesk-workload-ticket-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.helpdesk-workload-ticket-row {
    width: 100%;
    border: 1px solid #e6eaed;
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
}

.helpdesk-workload-ticket-row:hover,
.helpdesk-workload-ticket-row:focus {
    border-color: #c9d8e2;
    background: #f9fcfd;
}

.helpdesk-workload-ticket-row__main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.helpdesk-workload-ticket-row__main span {
    color: #4a6575;
}

.helpdesk-sla-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
    margin-bottom: 16px;
}

.select2-drop.helpdesk-ticket-additional-filters-select2-dropdown {
    border: 1px solid rgba(13, 136, 171, 0.4) !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 136, 171, 0.16) !important;
    border-radius: 4px;
}

body.admin-theme-default .helpdesk-sla-filter-select.select2-container.select2-container-multi {
    padding: 0;
    border: 0px solid white;
    box-shadow: none !important;
}

body.admin-theme-default .helpdesk-sla-filter-select.select2-container-multi .select2-choices .select2-search-field input {
    cursor: pointer;
}

body.admin-theme-default .helpdesk-sla-filter-select.select2-container-multi .select2-choices .select2-search-field:not(:first-child):not(:has(input:focus)):after {
    content: "Add another filter";
    color: #999999;
    cursor: pointer;
}

.helpdesk-sla-controls__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 160px;
}

.helpdesk-sla-controls__field--wide {
    min-width: 220px;
}

.helpdesk-sla-controls--filters {
    margin-top: 10px;
}

.helpdesk-sla-controls__field--filters {
    min-width: min(100%, 520px);
    width: min(100%, 520px);
}

.helpdesk-sla-controls__field label {
    font-size: 12px;
    font-weight: 600;
    color: #264052;
}

.helpdesk-sla-controls__custom {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.helpdesk-sla-heatmap-card {
    border-radius: 10px;
    padding: 14px 16px;
    background: #fff;
}

.helpdesk-sla-heatmap-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.helpdesk-sla-heatmap-legend {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.helpdesk-sla-heatmap-legend__label {
    font-size: 12px;
    color: #5f7280;
}

.helpdesk-sla-summary-emphasis {
    color: #264052;
    font-weight: 700;
}

.helpdesk-sla-table-state {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.helpdesk-sla-status-section .data-table-shell__content {
    margin-top: 18px;
}

#helpdesk-sla-status-table_wrapper > .data-table-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#helpdesk-sla-status-table_wrapper > .data-table-toolbar .helpdesk-sla-toolbar-stats {
    margin-right: auto;
}

.helpdesk-sla-toolbar-stats {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.helpdesk-sla-toolbar-stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-width: 1px;
    border-style: solid;
    border-radius: 6px;
    padding: 0.375rem 0.65rem;
    font-size: 0.875rem;
    line-height: 1.2;
    cursor: default;
    pointer-events: none;
}

.helpdesk-sla-toolbar-stat__value {
    font-weight: 700;
}

.helpdesk-sla-toolbar-stat__label {
    color: inherit;
}

.helpdesk-sla-toolbar-stat--danger {
    background: #fff3f2;
    border-color: #f2c8c5;
    color: #9f1f28;
}

.helpdesk-sla-toolbar-stat--warning {
    background: #fff8e5;
    border-color: #efd89a;
    color: #946200;
}

.helpdesk-sla-toolbar-stat--muted {
    background: #f4f7f9;
    border-color: #dbe4ea;
    color: #3e596b;
}

#helpdesk-sla-status-table_wrapper > .data-table-toolbar .dataTables_filter,
#helpdesk-sla-status-table_wrapper > .data-table-toolbar .data-table-export {
    margin-left: 0;
}

#helpdesk-sla-status-table_wrapper .dataTables_scrollBody tbody tr.helpdesk-sla-group-empty-row td,
#helpdesk-sla-status-table tbody tr.helpdesk-sla-group-empty-row td {
    padding: 10px 14px;
}

.helpdesk-sla-empty-state {
    display: inline-flex;
    align-items: center;
}

.helpdesk-sla-empty-state__label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background: #d1e7dd;
    color: #146c43;
    font-weight: 600;
    line-height: 1.2;
}

.helpdesk-activity-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.helpdesk-activity-toolbar-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    flex-wrap: wrap;
}

.helpdesk-activity-toolbar--left {
    justify-content: flex-start;
}

.helpdesk-activity-toolbar--right {
    justify-content: flex-end;
    margin-left: auto;
    flex-wrap: nowrap;
}

.helpdesk-activity-toolbar .form-control {
    min-width: 180px;
}

.helpdesk-activity-toolbar-row--filters {
    width: 100%;
    margin-bottom: 12px;
}

#helpdesk-activity-table_wrapper > .data-table-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#helpdesk-activity-table_wrapper > .data-table-toolbar > .helpdesk-activity-toolbar-row--filters,
#helpdesk-activity-table_wrapper > .data-table-toolbar > .helpdesk-activity-toolbar-main {
    width: 100%;
}

#helpdesk-activity-table_wrapper > .data-table-toolbar #helpdesk-activity-filters {
    width: 100%;
    min-width: 100%;
}

#helpdesk-activity-table_wrapper > .data-table-toolbar #helpdesk-refresh-activity {
    min-width: 34px;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
}

#helpdesk-activity-table_wrapper > .data-table-toolbar .helpdesk-activity-toolbar--right .dataTables_filter,
#helpdesk-activity-table_wrapper > .data-table-toolbar .helpdesk-activity-toolbar--right .data-table-export {
    float: none;
    margin-left: 0;
}

#helpdesk-activity-table_wrapper > .data-table-toolbar .helpdesk-activity-toolbar--right .dataTables_filter {
    order: 2;
}

#helpdesk-activity-table_wrapper > .data-table-toolbar .helpdesk-activity-toolbar--right .helpdesk-activity-important-toggle {
    order: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    white-space: nowrap;
}

#helpdesk-activity-table_wrapper > .data-table-toolbar .helpdesk-activity-toolbar--right .helpdesk-activity-important-toggle .ui-switch-toggle__label {
    white-space: nowrap;
}

#helpdesk-activity-table_wrapper > .data-table-toolbar .helpdesk-activity-toolbar--right #helpdesk-refresh-activity {
    order: 3;
}

#helpdesk-activity-table_wrapper > .data-table-toolbar .helpdesk-activity-toolbar--right .data-table-export {
    order: 4;
}

.helpdesk-activity-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.1;
}

.helpdesk-activity-badge--success {
    color: #146c43;
    background: #d1e7dd;
}

.helpdesk-activity-badge--warning {
    color: #9a6700;
    background: #fef0c7;
}

.helpdesk-activity-badge--danger {
    color: #842029;
    background: #f8d7da;
}

.helpdesk-activity-badge--info {
    color: #264052;
    background: #e8f1f5;
}

.helpdesk-activity-event,
.helpdesk-activity-ticket {
    min-width: 180px;
}

.helpdesk-activity-summary-change {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.helpdesk-activity-context {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    line-height: 1.5;
}

.helpdesk-activity-context__part {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.helpdesk-activity-context__sep {
    color: #8ca0ad;
    font-size: 0.7rem;
}

.helpdesk-activity-context__value {
    color: #264052;
    font-weight: 600;
}

.helpdesk-heatmap-table-wrap {
    overflow-x: auto;
}

.helpdesk-heatmap-table {
    border-collapse: separate;
    border-spacing: 4px;
    min-width: max-content;
}

.helpdesk-heatmap-table th {
    font-size: 11px;
    font-weight: 600;
    color: #5f7280;
    text-align: center;
    white-space: nowrap;
    padding: 0 4px 6px;
}

.helpdesk-heatmap-table td {
    padding: 0;
    border-top: 0 !important;
}

.helpdesk-heatmap-table th {
    border-top: 0 !important;
}

.helpdesk-heatmap-table__hour {
    width: 34px;
    min-width: 34px;
    max-width: 34px;
}

.helpdesk-heatmap-hour-label {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    line-height: 1;
}

.helpdesk-heatmap-hour-label__meridiem {
    font-size: 9px;
    text-transform: lowercase;
}

.helpdesk-heatmap-cell {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    color: #264052;
    background: #eef2f5;
}

.helpdesk-heatmap-cell--empty {
    background: transparent;
}

.helpdesk-heatmap-cell--level-0 {
    background: #eef2f5;
    color: #9aaab7;
}

.helpdesk-heatmap-cell--level-1 {
    background: #d7eff5;
    color: #1e5566;
}

.helpdesk-heatmap-cell--level-2 {
    background: #aadfe9;
    color: #124658;
}

.helpdesk-heatmap-cell--level-3 {
    background: #72c6d8;
    color: #0d3544;
}

.helpdesk-heatmap-cell--level-4 {
    background: #1c8aa9;
    color: #fff;
}

.helpdesk-heatmap-week-range {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    line-height: 1.1;
}

.helpdesk-heatmap-week-range__arrow {
    color: #8aa0ae;
    font-size: 10px;
}

@media (max-width: 767px) {
    .helpdesk-form__grid,
    .helpdesk-settings-grid,
    .helpdesk-inline-form-row,
    .helpdesk-sla-status-overview {
        grid-template-columns: 1fr;
    }
}
