/*
 * Qisutu - Open Source Ticket System
 * Copyright (C) 2026 Franziska Steps
 * Qisutu - Kim-KI, https://qisutu.de
 *
 * This file is part of Qisutu.
 *
 * Qisutu is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Qisutu is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Qisutu. If not, see <https://www.gnu.org/licenses/>.
 *
 * SPDX-FileCopyrightText: 2026 Franziska Steps
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */

:root {
    --qisutu-bg: #f4f7f9;
    --qisutu-surface: #ffffff;
    --qisutu-border: #d8e0e7;
    --qisutu-text: #1f2933;
    --qisutu-muted: #6b7785;
    --qisutu-primary: #015068;
    --qisutu-primary-hover: #013f52;
    --qisutu-primary-soft: rgba(1, 80, 104, 0.10);
    --qisutu-danger: #b42318;
    --qisutu-shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
    --qisutu-radius: 8px;
}

.qisutu-time-accounting-fields {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid var(--qisutu-border, #d9e0e8);
    border-radius: 0.75rem;
}

.qisutu-time-accounting-fields legend {
    padding: 0 0.4rem;
    font-weight: 700;
}

.qisutu-time-accounting-grid {
    display: grid;
    grid-template-columns: minmax(7rem, 0.7fr) minmax(7rem, 0.7fr) minmax(12rem, 1.8fr) minmax(10rem, 1fr);
    gap: 0.8rem;
    align-items: end;
}

.qisutu-time-accounting-billable {
    min-height: 2.75rem;
    align-items: center;
}

.qisutu-ticket-time-accounting-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.qisutu-ticket-time-accounting-summary > div {
    display: grid;
    gap: 0.25rem;
    padding: 0.75rem;
    border-radius: 0.65rem;
    background: var(--qisutu-surface-muted, #f4f7fa);
}

.qisutu-ticket-time-accounting-summary span {
    font-size: 0.82rem;
    color: var(--qisutu-text-muted, #5f6f7f);
}

.qisutu-time-accounting-entry-list {
    display: grid;
    gap: 0.75rem;
}

.qisutu-time-accounting-entry {
    min-width: 0;
    padding: 0.75rem;
    border: 1px solid var(--qisutu-border, #d9e0e8);
    border-radius: 0.65rem;
    background: var(--qisutu-surface, #fff);
}

.qisutu-time-accounting-entry-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--qisutu-border, #d9e0e8);
}

.qisutu-time-accounting-entry-head span {
    flex: 0 0 auto;
    font-weight: 700;
}

.qisutu-ticket-info-block .qisutu-time-accounting-entry-data {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
    margin: 0.65rem 0 0;
}

.qisutu-ticket-info-block .qisutu-time-accounting-entry-data > div {
    display: grid;
    grid-template-columns: minmax(5.5rem, 0.8fr) minmax(0, 1.2fr);
    gap: 0.55rem;
    min-width: 0;
}

.qisutu-time-accounting-entry-data dt {
    color: var(--qisutu-muted, #6b7785);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.qisutu-ticket-info-block .qisutu-time-accounting-entry-data dd {
    min-width: 0;
    margin: 0;
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
}

.qisutu-time-accounting-entry-actions {
    margin-top: 0.65rem;
}

.qisutu-time-accounting-entry-actions:empty {
    display: none;
}

.qisutu-time-accounting-cancelled {
    opacity: 0.68;
}

.qisutu-time-accounting-cancelled .qisutu-time-accounting-entry-head,
.qisutu-time-accounting-cancelled .qisutu-time-accounting-entry-data {
    text-decoration: line-through;
}

.qisutu-time-accounting-dialog {
    width: min(720px, calc(100vw - 40px));
    max-width: 720px;
    max-height: calc(100vh - 40px);
    padding: 0;
    border: 0;
    border-radius: 0.8rem;
    background: var(--qisutu-surface, #fff);
    color: var(--qisutu-text, #1f2933);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    overflow: hidden;
}

.qisutu-time-accounting-dialog::backdrop {
    background: rgba(15, 23, 42, 0.58);
}

.qisutu-time-accounting-dialog-shell {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
}

.qisutu-time-accounting-dialog-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--qisutu-border, #d9e0e8);
}

.qisutu-time-accounting-dialog-header h3 {
    margin: 0;
    color: var(--qisutu-text, #1f2933);
    font-size: 1.15rem;
}

.qisutu-time-accounting-dialog-close {
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--qisutu-bg, #f4f7f9);
    color: var(--qisutu-text, #1f2933);
    font: inherit;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.qisutu-time-accounting-dialog-close:hover {
    background: var(--qisutu-primary-soft, rgba(1, 80, 104, 0.10));
}

.qisutu-time-accounting-correction {
    width: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 1.25rem;
    overflow: auto;
    text-decoration: none;
}

.qisutu-time-accounting-correction > .qisutu-form-field + .qisutu-form-field {
    margin-top: 1rem;
}

.qisutu-time-accounting-correction .qisutu-form-field textarea {
    min-height: 90px;
}

.qisutu-time-accounting-correction .qisutu-time-accounting-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qisutu-time-accounting-correction .qisutu-time-accounting-billable {
    grid-column: 1 / -1;
}

.qisutu-time-accounting-correction .qisutu-form-actions {
    gap: 0.75rem;
}

@media (max-width: 800px) {
    .qisutu-time-accounting-grid,
    .qisutu-ticket-time-accounting-summary {
        grid-template-columns: 1fr;
    }

    .qisutu-time-accounting-dialog {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
    }

    .qisutu-time-accounting-dialog-shell {
        max-height: calc(100vh - 24px);
    }

    .qisutu-time-accounting-correction .qisutu-time-accounting-grid {
        grid-template-columns: 1fr;
    }
}

.qisutu-time-report-filter {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    align-items: end;
}

.qisutu-time-report-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.qisutu-time-report-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

.qisutu-time-report-metrics .qisutu-metric-value {
    font-size: clamp(1.55rem, 2.2vw, 2.15rem);
}

.qisutu-time-report-metric-cancelled {
    border-color: rgba(180, 35, 24, 0.24);
    background: rgba(180, 35, 24, 0.035);
}

.qisutu-time-report-audit-hint {
    margin: -0.35rem 0 0;
    color: var(--qisutu-muted, #6b7785);
    font-size: 0.9rem;
}

.qisutu-time-report-groups {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    min-width: 0;
}

.qisutu-time-report-groups > .qisutu-panel {
    min-width: 0;
}

.qisutu-time-report-detail-table td {
    vertical-align: middle;
}

.qisutu-time-report-detail-table .qisutu-time-report-description {
    min-width: 15rem;
    max-width: 24rem;
    overflow-wrap: anywhere;
    white-space: normal;
}

.qisutu-time-report-entry-cancelled {
    background: rgba(180, 35, 24, 0.055);
    color: var(--qisutu-muted, #6b7785);
}

.qisutu-time-report-entry-cancelled strong {
    color: var(--qisutu-danger, #b42318);
}

@media (max-width: 1200px) {
    .qisutu-time-report-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .qisutu-time-report-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .qisutu-time-report-filter,
    .qisutu-time-report-metrics {
        grid-template-columns: 1fr;
    }

    .qisutu-time-report-filter-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    height: 100%;
    margin: 0;
    background: var(--qisutu-bg);
    color: var(--qisutu-text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    overflow: hidden;
}

a {
    color: var(--qisutu-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.qisutu-app {
    height: 100vh;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    overflow: hidden;
}

.qisutu-sidebar {
    height: 100vh;
    min-height: 0;
    background: var(--qisutu-primary);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.qisutu-sidebar-brand {
    flex: 0 0 64px;
    height: 64px;
    min-height: 64px;
    max-height: 64px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    overflow: hidden;
}

.qisutu-sidebar-logo {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.16);
    font-weight: 700;
}

.qisutu-sidebar-logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.qisutu-sidebar-name {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
    overflow: hidden;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qisutu-sidebar-name > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qisutu-sidebar-version {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    opacity: .78;
}

.qisutu-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16px 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.qisutu-nav::-webkit-scrollbar {
    width: 8px;
}

.qisutu-nav::-webkit-scrollbar-track {
    background: transparent;
}

.qisutu-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.35);
    border-radius: 8px;
}

.qisutu-nav-item {
    flex: 0 0 42px;
    height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border-radius: 7px;
    color: rgba(255, 255, 255, 0.84);
    font-weight: 700;
}

.qisutu-nav-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qisutu-nav-item:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    text-decoration: none;
}

.qisutu-nav-item-active {
    background: #ffffff;
    color: var(--qisutu-primary);
}

.qisutu-nav-item-active:hover {
    background: #ffffff;
    color: var(--qisutu-primary);
}

.qisutu-nav-item-parent {
    cursor: default;
}

.qisutu-nav-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 12px;
}

.qisutu-nav-item-active .qisutu-nav-icon {
    background: var(--qisutu-primary-soft);
}

.qisutu-subnav {
    display: none;
    flex-direction: column;
    gap: 3px;
    margin: -1px 0 6px 42px;
}

.qisutu-subnav-open {
    display: flex;
}

.qisutu-nav-group:hover .qisutu-subnav,
.qisutu-nav-group:focus-within .qisutu-subnav {
    display: flex;
}

.qisutu-subnav-item {
    min-height: 32px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-radius: 7px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 14px;
    font-weight: 700;
}

.qisutu-subnav-item:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    text-decoration: none;
}

.qisutu-subnav-item-active {
    background: #ffffff;
    color: var(--qisutu-primary);
}

.qisutu-subnav-item-active:hover {
    background: #ffffff;
    color: var(--qisutu-primary);
}

.qisutu-subnav-separator {
    flex: 0 0 1px;
    height: 1px;
    margin: 8px 12px 5px;
    background: rgba(255, 255, 255, 0.28);
    pointer-events: none;
}

.qisutu-sidebar-user {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.qisutu-sidebar-user-avatar {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

.qisutu-sidebar-user-text {
    flex: 1 1 auto;
    min-width: 0;
}

.qisutu-sidebar-user-name {
    overflow: hidden;
    color: #ffffff;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qisutu-sidebar-user-link {
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
}

.qisutu-sidebar-user-link:hover {
    color: #ffffff;
}

.qisutu-workspace {
    height: 100vh;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

.qisutu-main {
    flex: 1;
    min-width: 0;
    padding: 28px;
}

.qisutu-dashboard {
    display: grid;
    gap: 22px;
}

.qisutu-dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.qisutu-dashboard-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.qisutu-dashboard h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.2;
}

.qisutu-dashboard p {
    margin: 8px 0 0;
    color: var(--qisutu-muted);
}

.qisutu-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.qisutu-metric-card,
.qisutu-panel {
    background: var(--qisutu-surface);
    border: 1px solid var(--qisutu-border);
    border-radius: var(--qisutu-radius);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.qisutu-metric-card {
    display: grid;
    gap: 8px;
    padding: 18px;
}

.qisutu-metric-label {
    color: var(--qisutu-muted);
    font-weight: 700;
}

.qisutu-metric-value {
    font-size: 34px;
    line-height: 1;
}

.qisutu-panel {
    padding: 20px;
}

.qisutu-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.qisutu-panel-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.qisutu-panel-subtitle {
    display: block;
    margin-top: 4px;
    color: var(--qisutu-muted);
    font-size: 13px;
}

.qisutu-panel h2 {
    margin: 0;
    font-size: 20px;
}

.qisutu-panel p {
    margin: 0;
}

.qisutu-panel-counter {
    min-width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--qisutu-primary-soft);
    color: var(--qisutu-primary);
    font-size: 13px;
    font-weight: 700;
}

.qisutu-panel-header-compact {
    min-height: 0;
    justify-content: flex-end;
}

.qisutu-panel-actions-right {
    margin-left: auto;
}

.qisutu-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.qisutu-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.qisutu-table th,
.qisutu-table td {
    padding: 3px 3px;
    border-bottom: 1px solid var(--qisutu-border);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

.qisutu-table th {
    color: var(--qisutu-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.qisutu-table tbody tr:hover {
    background: rgba(1, 80, 104, 0.04);
}

.qisutu-table-compact th,
.qisutu-table-compact td {
    padding: 5px 10px;
    line-height: 1.2;
}

.qisutu-table-compact {
    font-size: 13px;
}

.qisutu-admin-addons,
.qisutu-admin-addons .qisutu-panel,
.qisutu-admin-addons .qisutu-table-wrap {
    min-width: 0;
    max-width: 100%;
}

.qisutu-admin-addons .qisutu-table {
    table-layout: fixed;
}

.qisutu-admin-addons .qisutu-table th,
.qisutu-admin-addons .qisutu-table td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.qisutu-addon-installed-table th:nth-child(1) { width: 22%; }
.qisutu-addon-installed-table th:nth-child(2) { width: 28%; }
.qisutu-addon-installed-table th:nth-child(3) { width: 12%; }
.qisutu-addon-installed-table th:nth-child(4) { width: 16%; }
.qisutu-addon-installed-table th:nth-child(5) { width: 22%; }

.qisutu-addon-operation-table th:nth-child(1) { width: 5%; }
.qisutu-addon-operation-table th:nth-child(2) { width: 18%; }
.qisutu-addon-operation-table th:nth-child(3) { width: 11%; }
.qisutu-addon-operation-table th:nth-child(4) { width: 12%; }
.qisutu-addon-operation-table th:nth-child(5) { width: 42%; }
.qisutu-addon-operation-table th:nth-child(6) { width: 12%; }

.qisutu-table-link {
    color: var(--qisutu-primary);
    font-weight: 700;
}

.qisutu-table-number {
    color: var(--qisutu-primary);
    font-weight: 700;
}

.qisutu-table-muted {
    display: block;
    margin-top: 2px;
    color: var(--qisutu-muted);
    font-size: 12px;
}

.qisutu-admin-agents,
.qisutu-admin-agents .qisutu-panel,
.qisutu-admin-agents .qisutu-table-wrap {
    min-width: 0;
    max-width: 100%;
}

.qisutu-admin-agent-list-table {
    table-layout: fixed;
}

.qisutu-admin-agent-list-table th,
.qisutu-admin-agent-list-table td {
    white-space: normal;
    overflow-wrap: anywhere;
}

.qisutu-admin-agent-list-table th:nth-child(1) { width: 15%; }
.qisutu-admin-agent-list-table th:nth-child(2) { width: 14%; }
.qisutu-admin-agent-list-table th:nth-child(3) { width: 18%; }
.qisutu-admin-agent-list-table th:nth-child(4) { width: 11%; }
.qisutu-admin-agent-list-table th:nth-child(5) { width: 27%; }
.qisutu-admin-agent-list-table th:nth-child(6) { width: 7%; }
.qisutu-admin-agent-list-table th:nth-child(7) { width: 8%; }

@media (max-width: 900px) {
    .qisutu-admin-agent-list-table {
        min-width: 760px;
    }
}


/* Compact responsive ticket lists */
.qisutu-ticket-list-wrap {
    overflow-x: hidden;
}

.qisutu-ticket-list-table {
    table-layout: fixed;
}

.qisutu-ticket-list-table th,
.qisutu-ticket-list-table td {
    white-space: normal;
}

.qisutu-ticket-list-table .qisutu-ticket-list-col-number {
    width: 112px;
}

.qisutu-ticket-list-table .qisutu-ticket-list-col-title {
    width: 29%;
}

.qisutu-ticket-list-table .qisutu-ticket-list-col-ticketdata {
    width: 160px;
}

.qisutu-ticket-list-table .qisutu-ticket-list-col-customer {
    width: 180px;
}

.qisutu-ticket-list-table .qisutu-ticket-list-col-escalation {
    width: 132px;
}

.qisutu-ticket-list-table .qisutu-ticket-list-col-changed {
    width: 138px;
}

.qisutu-ticket-list-number,
.qisutu-ticket-list-changed-cell,
.qisutu-ticket-list-escalation-cell {
    white-space: nowrap;
}

.qisutu-ticket-title-link {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--qisutu-text);
    font-weight: 600;
}

.qisutu-ticket-title-link:hover {
    color: var(--qisutu-primary);
}

.qisutu-ticket-list-main {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .qisutu-ticket-list-table {
        font-size: 13px;
    }

    .qisutu-ticket-list-table th,
    .qisutu-ticket-list-table td {
        padding: 10px 7px;
    }

    .qisutu-ticket-list-table .qisutu-ticket-list-col-number {
        width: 104px;
    }

    .qisutu-ticket-list-table .qisutu-ticket-list-col-ticketdata {
        width: 138px;
    }

    .qisutu-ticket-list-table .qisutu-ticket-list-col-customer {
        width: 152px;
    }

    .qisutu-ticket-list-table .qisutu-ticket-list-col-escalation {
        width: 116px;
    }

    .qisutu-ticket-list-table .qisutu-ticket-list-col-changed {
        width: 118px;
    }
}

@media (max-width: 820px) {
    .qisutu-ticket-list-wrap {
        overflow-x: visible;
    }

    .qisutu-ticket-list-table,
    .qisutu-ticket-list-table thead,
    .qisutu-ticket-list-table tbody,
    .qisutu-ticket-list-table tr,
    .qisutu-ticket-list-table th,
    .qisutu-ticket-list-table td {
        display: block;
        width: 100%;
    }

    .qisutu-ticket-list-table colgroup,
    .qisutu-ticket-list-table thead {
        display: none;
    }

    .qisutu-ticket-list-table {
        border-collapse: separate;
        border-spacing: 0;
        font-size: 14px;
    }

    .qisutu-ticket-list-table tbody tr {
        position: relative;
        margin-bottom: 10px;
        padding: 12px 12px 10px;
        border: 1px solid var(--qisutu-border);
        border-radius: var(--qisutu-radius);
        background: #ffffff;
    }

    .qisutu-ticket-list-table tbody tr:hover {
        background: #ffffff;
    }

    .qisutu-ticket-list-table td {
        padding: 2px 0;
        border-bottom: none;
    }

    .qisutu-ticket-list-number {
        padding-right: 128px;
        font-size: 13px;
    }

    .qisutu-ticket-list-title-cell {
        clear: both;
        padding-top: 5px;
    }

    .qisutu-ticket-title-link {
        font-weight: 700;
    }

    .qisutu-ticket-list-escalation-cell {
        position: absolute;
        top: 10px;
        right: 12px;
        max-width: 124px;
        text-align: right;
    }

    .qisutu-ticket-list-meta-cell,
    .qisutu-ticket-list-customer-cell,
    .qisutu-ticket-list-changed-cell {
        font-size: 13px;
    }

    .qisutu-ticket-list-changed-cell::before {
        content: attr(data-label) ': ';
        color: var(--qisutu-muted);
        font-weight: 700;
    }
}

.qisutu-empty {
    padding: 22px;
    border: 1px dashed var(--qisutu-border);
    border-radius: var(--qisutu-radius);
    background: #fbfdfe;
}

.qisutu-empty strong {
    display: block;
    margin-bottom: 6px;
}

.qisutu-ticket-merged-shell {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #b9d8e3;
    border-radius: var(--qisutu-radius);
    background: #f1f8fa;
}

.qisutu-ticket-merged-shell h3 {
    margin: 0 0 6px;
}

.qisutu-ticket-merged-shell p {
    margin: 0 0 16px;
    color: var(--qisutu-muted);
}

.qisutu-ticket-merged-icon {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 50%;
    background: var(--qisutu-primary);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
}

.qisutu-ticket-merge-direction {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    border: 0;
}

.qisutu-ticket-merge-direction legend {
    margin-bottom: 6px;
    font-weight: 700;
}

.qisutu-ticket-merge-direction label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--qisutu-border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.qisutu-ticket-merge-direction label:hover,
.qisutu-ticket-merge-direction label:focus-within {
    border-color: var(--qisutu-primary);
    background: #f1f8fa;
}

.qisutu-ticket-merge-direction input {
    margin-top: 3px;
}

.qisutu-button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid var(--qisutu-border);
    border-radius: 7px;
    background: var(--qisutu-surface);
    color: var(--qisutu-text);
    font-weight: 700;
}

.qisutu-button:hover {
    text-decoration: none;
}

.qisutu-button-secondary {
    color: var(--qisutu-primary);
    cursor: pointer;
}

.qisutu-button-secondary:hover,
.qisutu-button-secondary:focus-visible {
    border-color: var(--qisutu-primary);
    background: var(--qisutu-primary-soft);
    color: var(--qisutu-primary-hover);
}

.qisutu-button-primary {
    border-color: var(--qisutu-primary);
    background: var(--qisutu-primary);
    color: #ffffff;
    cursor: pointer;
}

.qisutu-button-primary:hover {
    background: var(--qisutu-primary-hover);
    color: #ffffff;
}

.qisutu-button-danger {
    border-color: rgba(180, 35, 24, 0.28);
    background: rgba(180, 35, 24, 0.08);
    color: var(--qisutu-danger);
    cursor: pointer;
}

.qisutu-button-danger:hover {
    background: rgba(180, 35, 24, 0.14);
    color: var(--qisutu-danger);
}

.qisutu-button-success {
    border-color: rgba(17, 122, 70, 0.34);
    background: rgba(17, 122, 70, 0.10);
    color: #117a46;
    cursor: pointer;
}

.qisutu-button-success:hover,
.qisutu-button-success:focus-visible {
    border-color: #117a46;
    background: #117a46;
    color: #ffffff;
}

.qisutu-button-small {
    min-height: 24px;
    padding: 0 9px;
    font-size: 12px;
}

.qisutu-inline-form {
    margin: 0;
}

.qisutu-inline-form .qisutu-button {
    min-height: 30px;
    padding: 0 10px;
    font-size: 13px;
}

.qisutu-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.qisutu-admin-form {
    display: grid;
    gap: 14px;
}

.qisutu-admin-form-wide {
    max-width: 960px;
}

.qisutu-admin-form-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
}

.qisutu-group-assignment-table th,
.qisutu-group-assignment-table td {
    padding-top: 2px;
    padding-bottom: 2px;
    line-height: 1.05;
    vertical-align: middle;
}

.qisutu-group-permission-column,
.qisutu-group-permission-choice {
    width: 1%;
    text-align: center !important;
}

.qisutu-group-permission-choice label {
    min-width: 38px;
    min-height: 22px;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.qisutu-group-permission-choice input[type="radio"] {
    width: 15px;
    height: 15px;
    margin: 0;
    cursor: pointer;
}

.qisutu-group-customer-list {
    min-width: 0;
}

.qisutu-group-customer-filter {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 8px;
}

.qisutu-group-customer-filter input[type="search"] {
    min-width: 180px;
    min-height: 34px;
    flex: 1 1 280px;
    padding: 5px 9px;
    border: 1px solid var(--qisutu-border);
    border-radius: 7px;
    background: #ffffff;
    color: var(--qisutu-text);
    font: inherit;
}

.qisutu-group-customer-filter .qisutu-button {
    min-height: 34px;
    padding: 0 11px;
}

.qisutu-group-customer-result-summary {
    margin: 0 0 5px;
    color: var(--qisutu-muted);
    font-size: 12px;
    font-weight: 700;
}

.qisutu-group-customer-pagination {
    justify-content: flex-end;
    width: 100%;
    margin-top: 10px;
}

.qisutu-group-empty-result {
    padding: 12px !important;
    color: var(--qisutu-muted);
    text-align: center !important;
}

@media (max-width: 720px) {
    .qisutu-group-customer-filter {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .qisutu-group-customer-filter input[type="search"] {
        flex-basis: 100%;
    }

    .qisutu-group-customer-pagination {
        justify-content: flex-start;
        overflow-x: auto;
    }
}

.qisutu-admin-radio-group {
    display: grid;
    grid-column: 1 / -1;
    gap: 9px;
    margin: 0;
    padding: 0;
    border: 0;
}

.qisutu-admin-radio-group legend {
    margin-bottom: 3px;
    font-weight: 700;
}

.qisutu-admin-radio-group label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--qisutu-border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.qisutu-admin-radio-group label:hover,
.qisutu-admin-radio-group label:focus-within {
    border-color: var(--qisutu-primary);
    background: #f1f8fa;
}

.qisutu-admin-radio-group input {
    margin-top: 3px;
}

.qisutu-admin-radio-group span,
.qisutu-admin-radio-group small {
    display: block;
}

.qisutu-admin-radio-group small {
    margin-top: 3px;
    color: var(--qisutu-muted);
    font-weight: 400;
    line-height: 1.4;
}

.qisutu-form-field-wide {
    grid-column: 1 / -1;
}

.qisutu-admin-form-block {
    display: grid;
    gap: 12px;
    padding-top: 4px;
}

.qisutu-admin-form-block h3 {
    margin: 0;
    font-size: 16px;
}

.qisutu-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border: 1px solid var(--qisutu-border);
    border-radius: 999px;
    background: #f3f6f8;
    color: var(--qisutu-muted);
    font-size: 12px;
    font-weight: 800;
}

.qisutu-status-badge-active {
    border-color: rgba(17, 122, 70, 0.25);
    background: rgba(17, 122, 70, 0.08);
    color: #117a46;
}

.qisutu-ldap-mapping-table input[type="text"] {
    width: 100%;
    min-width: 13rem;
}

.qisutu-mail-account-page {
    display: grid;
    gap: 18px;
}

.qisutu-mail-account-page > .qisutu-form-error,
.qisutu-mail-account-page > .qisutu-form-success {
    margin: 0;
}

.qisutu-mail-account-choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.qisutu-mail-account-choice {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 5px 12px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--qisutu-border);
    border-radius: var(--qisutu-radius);
    background: #fbfdfe;
    color: var(--qisutu-text);
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.qisutu-mail-account-choice:hover,
.qisutu-mail-account-choice:focus-visible {
    border-color: var(--qisutu-primary);
    background: var(--qisutu-primary-soft);
    box-shadow: 0 10px 24px rgba(1, 80, 104, 0.12);
    text-decoration: none;
    transform: translateY(-2px);
}

.qisutu-mail-account-choice-icon {
    width: 46px;
    height: 46px;
    grid-row: 1 / span 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--qisutu-primary);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.qisutu-mail-account-choice strong,
.qisutu-mail-account-choice span,
.qisutu-mail-account-choice em {
    min-width: 0;
}

.qisutu-mail-account-choice strong {
    font-size: 16px;
}

.qisutu-mail-account-choice > span:not(.qisutu-mail-account-choice-icon) {
    color: var(--qisutu-muted);
    font-size: 13px;
    line-height: 1.4;
}

.qisutu-mail-account-choice em {
    color: var(--qisutu-primary);
    font-size: 13px;
    font-style: normal;
    font-weight: 800;
}

.qisutu-mail-provider-info {
    display: grid;
    gap: 4px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-left: 4px solid var(--qisutu-primary);
    border-radius: 0 7px 7px 0;
    background: var(--qisutu-primary-soft);
}

.qisutu-mail-provider-info span,
.qisutu-form-field small {
    color: var(--qisutu-muted);
    font-size: 13px;
    line-height: 1.4;
}

.qisutu-form-field small {
    display: block;
    margin-top: 5px;
}

.qisutu-mail-connection-panel {
    display: grid;
    gap: 14px;
}

.qisutu-mail-connection-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    margin: 0;
}

.qisutu-mail-connection-details div {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--qisutu-border);
    border-radius: 7px;
    background: #fbfdfe;
}

.qisutu-mail-connection-details dt {
    margin-bottom: 4px;
    color: var(--qisutu-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.qisutu-mail-connection-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.qisutu-mail-account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.qisutu-mail-delete-overlay {
    position: fixed;
    z-index: 1600;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.48);
}

.qisutu-mail-delete-overlay[hidden] {
    display: none;
}

.qisutu-mail-delete-dialog {
    width: min(520px, 100%);
    padding: 24px;
    border: 1px solid var(--qisutu-border);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.qisutu-mail-delete-dialog h3 {
    margin: 0 0 12px;
    color: var(--qisutu-danger);
    font-size: 21px;
}

.qisutu-mail-delete-dialog p {
    margin: 0 0 12px;
    color: var(--qisutu-text);
    line-height: 1.5;
}

.qisutu-mail-delete-account {
    padding: 10px 12px;
    border: 1px solid var(--qisutu-border);
    border-radius: 7px;
    background: #f7f9fb;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.qisutu-mail-delete-actions {
    gap: 10px;
    margin-top: 20px;
}

.qisutu-translation-rows {
    display: grid;
    gap: 10px;
}

.qisutu-translation-row {
    display: grid;
    grid-template-columns: minmax(170px, 240px) minmax(220px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.qisutu-admin-active-checkbox {
    align-self: end;
    min-height: 40px;
}

.qisutu-admin-assign-form {
    max-width: 520px;
}

.qisutu-admin-permission-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
}

.qisutu-admin-static-value {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    color: var(--qisutu-muted);
    font-weight: 700;
}

.qisutu-admin-definition-panel {
    margin-top: 18px;
}

.qisutu-admin-delete-form {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--qisutu-border);
}

.qisutu-admin-test-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.qisutu-admin-help {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--qisutu-border);
    color: var(--qisutu-muted);
}

.qisutu-admin-help strong {
    display: block;
    margin-bottom: 8px;
    color: var(--qisutu-text);
}

.qisutu-admin-mini-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.qisutu-admin-mini-list span {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--qisutu-primary-soft);
    color: var(--qisutu-primary);
    font-size: 12px;
    font-weight: 700;
}

.qisutu-admin-start-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.qisutu-admin-start-item {
    display: grid;
    gap: 5px;
    padding: 14px;
    border: 1px solid var(--qisutu-border);
    border-radius: var(--qisutu-radius);
    background: #fbfdfe;
    color: var(--qisutu-text);
}

.qisutu-admin-start-item:hover {
    border-color: rgba(1, 80, 104, 0.35);
    background: rgba(1, 80, 104, 0.04);
    text-decoration: none;
}

.qisutu-admin-start-item span {
    color: var(--qisutu-muted);
}

.qisutu-ticket-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
}

.qisutu-ticket-main,
.qisutu-ticket-sidebar {
    min-width: 0;
}

.qisutu-ticket-meta-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.qisutu-ticket-meta-grid div {
    padding: 14px;
    border: 1px solid var(--qisutu-border);
    border-radius: var(--qisutu-radius);
    background: #fbfdfe;
}

.qisutu-ticket-meta-grid span {
    display: block;
    margin-bottom: 5px;
    color: var(--qisutu-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.qisutu-ticket-meta-grid strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qisutu-ticket-placeholder {
    margin-top: 18px;
    padding: 18px;
    border: 1px dashed var(--qisutu-border);
    border-radius: var(--qisutu-radius);
    background: #fbfdfe;
}

.qisutu-ticket-placeholder strong {
    display: block;
    margin-bottom: 6px;
}

.qisutu-ticket-reply-top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.qisutu-ticket-tools-button {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ff7f50;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff7f50 0%, #ff5f3f 100%);
    color: #ffffff;
    cursor: pointer;
    font-size: 25px;
    font-weight: 800;
    line-height: 1;
    box-shadow: none;
    transition: transform 0.16s ease, background 0.16s ease;
}

.qisutu-ticket-tools-button:hover,
.qisutu-ticket-tools-button:focus-visible {
    background: linear-gradient(135deg, #ff8f68 0%, #ff6b4b 100%);
    box-shadow: none;
    outline: none;
    transform: translateY(-1px) rotate(14deg);
}

.qisutu-ticket-tools-button[aria-expanded="true"] {
    background: #ff7f50;
    box-shadow: none;
}

.qisutu-ticket-tools-overlay {
    position: fixed;
    z-index: 1000;
    top: 96px;
    left: 314px;
    width: min(960px, calc(100vw - 360px));
    min-height: min(630px, calc(100vh - 210px));
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    padding: 24px;
    border: 1px solid rgba(216, 224, 231, 0.72);
    background: #ffffff;
    box-shadow: 0 24px 42px rgba(15, 23, 42, 0.26);
}

.qisutu-ticket-tools-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.qisutu-ticket-tools-header h3 {
    margin: 0;
    font-size: 21px;
}

.qisutu-ticket-tools-header p {
    margin: 6px 0 0;
    color: var(--qisutu-muted);
}

.qisutu-ticket-tools-close {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--qisutu-border);
    border-radius: 50%;
    background: #fbfdfe;
    color: var(--qisutu-muted);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.qisutu-ticket-tools-close:hover,
.qisutu-ticket-tools-close:focus-visible {
    border-color: #ff7f50;
    color: #ff5f3f;
    outline: none;
}

.qisutu-ticket-tools-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.qisutu-ticket-tools-tile {
    min-height: 74px;
    padding: 12px 14px;
    border: 1px solid var(--qisutu-border);
    border-radius: 12px;
    background: #fbfdfe;
    color: var(--qisutu-text);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    line-height: 1.25;
    text-align: left;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
}

.qisutu-ticket-tools-tile:hover,
.qisutu-ticket-tools-tile:focus-visible {
    border-color: rgba(255, 127, 80, 0.58);
    background: rgba(255, 127, 80, 0.07);
    outline: none;
}

.qisutu-ticket-tools-tile-active,
.qisutu-ticket-tools-tile-active:hover,
.qisutu-ticket-tools-tile-active:focus-visible {
    border-color: #ff7f50;
    background: rgba(255, 127, 80, 0.13);
    color: #c64628;
    box-shadow: inset 0 0 0 1px rgba(255, 127, 80, 0.16), 0 12px 24px rgba(255, 127, 80, 0.10);
}

.qisutu-ticket-tools-panels {
    margin-top: 18px;
}

.qisutu-ticket-tools-panel {
    padding: 18px;
    border: 1px solid var(--qisutu-border);
    border-radius: 12px;
    background: #fbfdfe;
}

.qisutu-ticket-tools-panel h4 {
    margin: 0 0 14px;
    font-size: 18px;
}

.qisutu-ticket-tools-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.qisutu-ticket-tools-form-wide {
    grid-column: 1 / -1;
}

.qisutu-ticket-tools-panel input:disabled,
.qisutu-ticket-tools-panel textarea:disabled,
.qisutu-ticket-tools-panel select:disabled {
    background: #f4f7f9;
    color: var(--qisutu-muted);
    cursor: not-allowed;
}

.qisutu-ticket-tools-panel .qisutu-form-actions {
    margin-top: 14px;
}

.qisutu-ticket-tools-panel .qisutu-form-help {
    margin: 7px 0 0;
    color: var(--qisutu-muted);
    font-size: 13px;
}

.qisutu-ticket-tools-panel .ck.ck-editor__main > .ck-editor__editable {
    min-height: 150px;
}

.qisutu-autocomplete {
    position: relative;
}

.qisutu-autocomplete-results {
    position: absolute;
    z-index: 1100;
    left: 0;
    right: 0;
    top: 64px;
    max-height: 270px;
    overflow-y: auto;
    border: 1px solid var(--qisutu-border);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
}

.qisutu-autocomplete-item {
    width: 100%;
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid rgba(216, 224, 231, 0.7);
    background: #ffffff;
    color: var(--qisutu-text);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.qisutu-autocomplete-item:last-child {
    border-bottom: 0;
}

.qisutu-autocomplete-item:hover,
.qisutu-autocomplete-item:focus-visible {
    background: rgba(255, 127, 80, 0.08);
    outline: none;
}

.qisutu-autocomplete-item strong {
    font-weight: 800;
}

.qisutu-autocomplete-item span,
.qisutu-autocomplete-empty {
    color: var(--qisutu-muted);
    font-size: 13px;
}

.qisutu-autocomplete-empty {
    padding: 12px;
}

.qisutu-ticket-split-dialog {
    width: min(820px, calc(100vw - 40px));
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    padding: 24px;
    border: 1px solid var(--qisutu-border);
    border-radius: 14px;
    background: #ffffff;
    color: var(--qisutu-text);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.30);
}

.qisutu-ticket-split-dialog::backdrop {
    background: rgba(15, 23, 42, 0.48);
}

.qisutu-ticket-split-dialog .qisutu-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.qisutu-ticket-split-dialog .qisutu-dialog-header h3 {
    margin: 0;
}

.qisutu-ticket-split-dialog .qisutu-dialog-header p {
    margin: 6px 0 0;
    color: var(--qisutu-muted);
}

.qisutu-ticket-split-dialog .qisutu-form-actions {
    margin-top: 20px;
}

.qisutu-ticket-split-customer {
    margin: 0;
}

.qisutu-ticket-article-origin {
    padding: 2px 7px;
    border: 1px solid #b9d8e3;
    border-radius: 999px;
    background: #eef7fa;
    color: #075c75;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
}

.qisutu-ticket-article-origin:hover,
.qisutu-ticket-article-origin:focus-visible {
    border-color: #087a9a;
    background: #def1f7;
    outline: none;
}

.qisutu-ticket-link-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.qisutu-ticket-link-list li {
    display: grid;
    gap: 2px;
    padding: 9px 10px;
    border: 1px solid var(--qisutu-border);
    border-radius: 8px;
    background: #f8fbfc;
}

.qisutu-ticket-link-list a {
    color: var(--qisutu-primary);
    font-weight: 800;
}

.qisutu-ticket-link-list span,
.qisutu-ticket-link-list small {
    color: var(--qisutu-muted);
}

.qisutu-ticket-tools-placeholder {
    margin: 14px 0 0;
    padding: 10px 12px;
    border: 1px dashed rgba(255, 127, 80, 0.45);
    border-radius: 8px;
    background: rgba(255, 127, 80, 0.06);
    color: #9b4329;
    font-weight: 700;
}

.qisutu-ticket-tools-history-placeholder {
    display: grid;
    gap: 6px;
    padding: 18px;
    border: 1px dashed var(--qisutu-border);
    border-radius: 10px;
    background: #ffffff;
}

.qisutu-ticket-tools-history-placeholder span {
    color: var(--qisutu-muted);
}

.qisutu-ticket-bulk-history {
    display: grid;
    gap: 12px;
}

.qisutu-ticket-bulk-history-entry {
    display: grid;
    gap: 11px;
    padding: 14px;
    border: 1px solid var(--qisutu-border);
    border-radius: 10px;
    background: #ffffff;
}

.qisutu-ticket-bulk-history-entry header,
.qisutu-ticket-bulk-history-agent,
.qisutu-ticket-bulk-history-entry li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.qisutu-ticket-bulk-history-entry header time,
.qisutu-ticket-bulk-history-agent span,
.qisutu-ticket-bulk-history-entry li span,
.qisutu-ticket-bulk-history-reason span {
    color: var(--qisutu-muted);
    font-size: 12px;
}

.qisutu-ticket-bulk-history-entry ul {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 11px 0;
    border-top: 1px solid var(--qisutu-border);
    border-bottom: 1px solid var(--qisutu-border);
    list-style: none;
}

.qisutu-ticket-bulk-history-entry li strong {
    text-align: right;
}

.qisutu-ticket-bulk-history-reason p {
    margin: 4px 0 0;
    white-space: pre-wrap;
}

.qisutu-ticket-history {
    display: grid;
    gap: 14px;
}

.qisutu-ticket-history-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.qisutu-ticket-history-filter-active,
.qisutu-ticket-history-filter-active:hover,
.qisutu-ticket-history-filter-active:focus-visible {
    border-color: var(--qisutu-primary);
    background: var(--qisutu-primary);
    color: #ffffff;
}

.qisutu-ticket-history-list {
    position: relative;
    display: grid;
    gap: 0;
}

.qisutu-ticket-history-list::before {
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 19px;
    width: 2px;
    background: var(--qisutu-border);
    content: '';
}

.qisutu-ticket-history-entry {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    padding: 0 0 14px;
}

.qisutu-ticket-history-marker {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #ffffff;
    border-radius: 50%;
    background: #e8f3f6;
    color: var(--qisutu-primary);
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 0 0 1px var(--qisutu-border);
}

.qisutu-ticket-history-entry-change .qisutu-ticket-history-marker {
    background: #fff0e9;
    color: #c64628;
}

.qisutu-ticket-history-entry-communication .qisutu-ticket-history-marker {
    background: #e7f6ed;
    color: #176b3a;
}

.qisutu-ticket-history-entry-time .qisutu-ticket-history-marker {
    background: #f0ebff;
    color: #5b3fa3;
}

.qisutu-ticket-history-card {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid var(--qisutu-border);
    border-radius: 10px;
    background: #ffffff;
}

.qisutu-ticket-history-card header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.qisutu-ticket-history-card header > div {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.qisutu-ticket-history-card time,
.qisutu-ticket-history-meta,
.qisutu-ticket-history-field {
    color: var(--qisutu-muted);
    font-size: 12px;
}

.qisutu-ticket-history-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.qisutu-ticket-history-meta strong {
    color: var(--qisutu-text);
}

.qisutu-ticket-history-backfill {
    display: inline-flex;
    padding: 2px 7px;
    border-radius: 999px;
    background: #edf2f5;
    color: var(--qisutu-muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.qisutu-ticket-history-change {
    display: grid;
    gap: 5px;
    padding: 9px 10px;
    border-radius: 8px;
    background: #f7fafb;
}

.qisutu-ticket-history-change > div {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.qisutu-ticket-history-old {
    color: var(--qisutu-muted);
    text-decoration: line-through;
}

.qisutu-ticket-history-arrow {
    color: #ff7f50;
    font-weight: 900;
}

.qisutu-ticket-history-details p {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.qisutu-ticket-history-details > span {
    display: inline-flex;
    margin-bottom: 5px;
    color: var(--qisutu-muted);
    font-size: 12px;
    font-weight: 700;
}

.qisutu-ticket-history-details ul {
    display: grid;
    gap: 5px;
    margin: 7px 0 0;
    padding: 8px 0 0;
    border-top: 1px solid var(--qisutu-border);
    list-style: none;
}

.qisutu-ticket-history-details li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.qisutu-ticket-history-link {
    justify-self: start;
    color: var(--qisutu-primary);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.qisutu-ticket-history-link:hover,
.qisutu-ticket-history-link:focus-visible {
    text-decoration: underline;
}

.qisutu-ticket-history-empty {
    position: relative;
    z-index: 1;
    padding: 18px;
    border: 1px dashed var(--qisutu-border);
    border-radius: 10px;
    background: #ffffff;
    color: var(--qisutu-muted);
}

.qisutu-ticket-history-actions {
    display: flex;
    justify-content: center;
}

.qisutu-ticket-articles {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.qisutu-ticket-articles-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.qisutu-ticket-articles-header h3 {
    margin: 0;
    font-size: 17px;
}

.qisutu-ticket-article-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.qisutu-ticket-articles-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 2px;
}

.qisutu-ticket-article-list {
    display: grid;
    gap: 14px;
}

.qisutu-ticket-article {
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
}

.qisutu-ticket-article-shell {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 92%;
}

.qisutu-ticket-article-from-agent .qisutu-ticket-article-shell,
.qisutu-ticket-article-from-system .qisutu-ticket-article-shell,
.qisutu-ticket-article-from-mail .qisutu-ticket-article-shell {
    margin-left: auto;
    flex-direction: row-reverse;
}

.qisutu-ticket-article-from-customer .qisutu-ticket-article-shell {
    margin-right: auto;
}

.qisutu-ticket-article-avatar {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef5f7;
    color: var(--qisutu-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.qisutu-ticket-article-from-customer .qisutu-ticket-article-avatar {
    background: #f7dfbf;
    color: #8b4700;
}

.qisutu-ticket-article-from-agent .qisutu-ticket-article-avatar {
    background: var(--qisutu-primary-soft);
    color: var(--qisutu-primary);
}

.qisutu-ticket-article-from-system .qisutu-ticket-article-avatar,
.qisutu-ticket-article-from-mail .qisutu-ticket-article-avatar {
    background: #e6e9ed;
    color: #526070;
}

.qisutu-ticket-article-bubble {
    min-width: 0;
    flex: 1 1 auto;
    border: 1px solid var(--qisutu-border);
    border-radius: var(--qisutu-radius);
    background: #fbfdfe;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
}

.qisutu-ticket-article-from-agent .qisutu-ticket-article-bubble {
    background: #eaf6fa;
    border-color: #cde7ef;
}

.qisutu-ticket-article-from-customer .qisutu-ticket-article-bubble {
    background: #fffdf8;
    border-color: #ead8bd;
}

.qisutu-ticket-article-internal .qisutu-ticket-article-bubble {
    background: #f6f7f9;
    border-style: dashed;
}

.qisutu-ticket-article-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
}

.qisutu-ticket-article-summary .qisutu-ticket-article-toggle {
    width: 100%;
    min-width: 0;
}

.qisutu-ticket-article-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    padding: 14px 16px 14px 0;
    max-width: 230px;
}

.qisutu-ticket-article-top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 0;
}

.qisutu-ticket-article-top-actions.qisutu-hidden {
    display: none;
}

.qisutu-ticket-article-toggle {
    width: 100%;
    padding: 14px 16px;
    border: 0;
    background: transparent;
    color: var(--qisutu-text);
    cursor: pointer;
    font: inherit;
    text-align: left;
    display: block;
}

.qisutu-ticket-article-toggle:hover {
    background: rgba(1, 80, 104, 0.04);
}

.qisutu-ticket-article-headline {
    min-width: 0;
}

.qisutu-ticket-article-sender {
    display: block;
    color: var(--qisutu-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.qisutu-ticket-article-toggle strong {
    display: block;
    margin-top: 3px;
    font-size: 16px;
    word-break: normal;
    overflow-wrap: break-word;
}

.qisutu-ticket-article-headline > span:not(.qisutu-ticket-article-sender) {
    display: block;
    margin-top: 3px;
    color: var(--qisutu-muted);
    font-size: 12px;
}

.qisutu-ticket-article-badges {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 5px;
}

.qisutu-ticket-article-role,
.qisutu-ticket-article-label {
    flex: 0 0 auto;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.15;
    white-space: nowrap;
}

.qisutu-ticket-article-role {
    background: #ffffff;
    color: var(--qisutu-text);
    border: 1px solid var(--qisutu-border);
}

.qisutu-ticket-article-from-customer .qisutu-ticket-article-role {
    color: #8b4700;
    border-color: #ead8bd;
}

.qisutu-ticket-article-label {
    background: var(--qisutu-primary-soft);
    color: var(--qisutu-primary);
}

.qisutu-ticket-article-internal .qisutu-ticket-article-label {
    background: #e6e9ed;
    color: #526070;
}

.qisutu-ticket-article-content {
    display: none;
    padding: 0 16px 16px;
}

.qisutu-ticket-article-open .qisutu-ticket-article-content {
    display: block;
}

.qisutu-ticket-article-meta {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 6px 12px;
    margin: 0 0 14px;
}

.qisutu-ticket-article-meta dt {
    color: var(--qisutu-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.qisutu-ticket-article-meta dd {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qisutu-ticket-article-body {
    padding-top: 14px;
    border-top: 1px solid var(--qisutu-border);
    color: var(--qisutu-text);
}

.qisutu-ticket-article-empty {
    margin-top: 0;
}

.qisutu-ticket-reply {
    display: grid;
    gap: 14px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--qisutu-border);
}

.qisutu-ticket-reply-header h3 {
    margin: 0;
    font-size: 17px;
}

.qisutu-ticket-reply-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.qisutu-ticket-reply-form-title {
    margin: 0;
    font-size: 17px;
}

.qisutu-ticket-reply-form {
    display: grid;
    gap: 14px;
}

.qisutu-form-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.qisutu-form-field-richtext {
    grid-column: 1 / -1;
}

.qisutu-form-hint {
    color: var(--qisutu-muted);
    font-size: 12px;
}

.qisutu-form-field label,
.qisutu-form-checkbox {
    color: var(--qisutu-text);
    font-weight: 700;
}

.qisutu-form-field input,
.qisutu-form-field textarea,
.qisutu-form-field select {
    width: 100%;
    border: 1px solid var(--qisutu-border);
    border-radius: 7px;
    background: #ffffff;
    color: var(--qisutu-text);
    font: inherit;
}

.qisutu-form-field input,
.qisutu-form-field select {
    height: 40px;
    padding: 8px 10px;
}

.qisutu-form-field textarea {
    min-height: 150px;
    padding: 10px;
    resize: vertical;
}

.qisutu-form-field input:focus,
.qisutu-form-field textarea:focus,
.qisutu-form-field select:focus {
    outline: 3px solid rgba(1, 80, 104, 0.16);
    border-color: var(--qisutu-primary);
}

.qisutu-form-field .ck.ck-editor {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.qisutu-form-field .ck.ck-toolbar,
.qisutu-form-field .ck.ck-toolbar > .ck-toolbar__items {
    max-width: 100%;
    flex-wrap: wrap;
}

.qisutu-form-field .ck.ck-toolbar {
    border-color: var(--qisutu-border);
    border-radius: 7px 7px 0 0;
    background: #fbfdfe;
}

.qisutu-form-field .ck.ck-editor__main > .ck-editor__editable {
    min-height: 220px;
    border-color: var(--qisutu-border);
    border-radius: 0 0 7px 7px;
    color: var(--qisutu-text);
    font: inherit;
}

.qisutu-form-field .ck.ck-editor__main > .ck-editor__editable:focus {
    border-color: var(--qisutu-primary);
    box-shadow: 0 0 0 3px rgba(1, 80, 104, 0.16);
}

.qisutu-richtext-output {
    overflow-wrap: anywhere;
}

.qisutu-richtext-output p,
.qisutu-richtext-output ul,
.qisutu-richtext-output ol,
.qisutu-richtext-output blockquote,
.qisutu-richtext-output table {
    margin: 0 0 10px;
}

.qisutu-richtext-output p:last-child,
.qisutu-richtext-output ul:last-child,
.qisutu-richtext-output ol:last-child,
.qisutu-richtext-output blockquote:last-child,
.qisutu-richtext-output table:last-child {
    margin-bottom: 0;
}

.qisutu-richtext-output ul,
.qisutu-richtext-output ol {
    padding-left: 22px;
}

.qisutu-richtext-output img {
    max-width: 100%;
    height: auto;
}

.qisutu-richtext-output .qisutu-mail-signature {
    margin-top: 10px;
    padding-top: 6px;
    border-top: 1px dashed var(--qisutu-border);
    color: var(--qisutu-muted);
    font-size: 13px;
    line-height: 1.25;
}

.qisutu-richtext-output pre.qisutu-mail-signature {
    white-space: pre-wrap;
    font-family: inherit;
}

.qisutu-richtext-output .qisutu-mail-signature p,
.qisutu-richtext-output .qisutu-mail-signature div {
    margin: 0 0 2px;
}

.qisutu-richtext-output .qisutu-mail-signature p:last-child,
.qisutu-richtext-output .qisutu-mail-signature div:last-child {
    margin-bottom: 0;
}

.qisutu-richtext-output .qisutu-mail-quote,
.qisutu-richtext-output .qisutu-mail-quote-wrap {
    margin: 10px 0 14px;
    padding: 0 0 0 12px;
    border-left: 3px solid #4f8df7;
    color: #1f4f8f;
}

.qisutu-richtext-output .qisutu-mail-quote-head {
    margin: 16px 0 6px;
    color: var(--qisutu-text);
    font-weight: 600;
}

.qisutu-richtext-output .qisutu-mail-quote p,
.qisutu-richtext-output .qisutu-mail-quote div,
.qisutu-richtext-output .qisutu-mail-quote-wrap p,
.qisutu-richtext-output .qisutu-mail-quote-wrap div {
    margin-top: 0;
    margin-bottom: 4px;
}

.qisutu-richtext-output .qisutu-mail-quote p:last-child,
.qisutu-richtext-output .qisutu-mail-quote div:last-child,
.qisutu-richtext-output .qisutu-mail-quote-wrap p:last-child,
.qisutu-richtext-output .qisutu-mail-quote-wrap div:last-child {
    margin-bottom: 0;
}

.qisutu-richtext-output table {
    max-width: 100%;
    border-collapse: collapse;
}

.qisutu-richtext-output th,
.qisutu-richtext-output td {
    padding: 6px 8px;
    border: 1px solid var(--qisutu-border);
}

.qisutu-form-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.qisutu-form-actions {
    display: flex;
    justify-content: flex-end;
}

.qisutu-form-error {
    padding: 10px 12px;
    border: 1px solid rgba(180, 35, 24, 0.25);
    border-radius: 7px;
    background: rgba(180, 35, 24, 0.08);
    color: var(--qisutu-danger);
    font-weight: 700;
}

.qisutu-form-success {
    border-color: rgba(17, 122, 70, 0.25);
    background: rgba(17, 122, 70, 0.08);
    color: #117a46;
}

.qisutu-hidden {
    display: none;
}

.qisutu-ticket-info-block + .qisutu-ticket-info-block {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--qisutu-border);
}

.qisutu-ticket-info-block h3 {
    margin: 0;
    font-size: 16px;
}

.qisutu-ticket-info-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--qisutu-text);
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.qisutu-ticket-info-toggle:focus-visible {
    outline: 2px solid var(--qisutu-primary);
    outline-offset: 4px;
    border-radius: 3px;
}

.qisutu-ticket-info-chevron {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.18s ease;
}

.qisutu-ticket-info-block-open .qisutu-ticket-info-chevron {
    transform: rotate(225deg);
}

.qisutu-ticket-info-content {
    margin-top: 12px;
}

.qisutu-ticket-info-content[hidden] {
    display: none;
}

.qisutu-ticket-info-block dl {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    column-gap: 18px;
    row-gap: 8px;
    margin: 0;
}

.qisutu-ticket-info-block dt {
    color: var(--qisutu-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    text-transform: uppercase;
}

.qisutu-ticket-info-block dd {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--qisutu-text);
    font-size: 14px;
    line-height: 1.35;
    text-overflow: ellipsis;
}

.qisutu-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

@media (max-width: 900px) {
    body {
        overflow: auto;
    }

    .qisutu-app {
        height: auto;
        min-height: 100vh;
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .qisutu-sidebar {
        height: auto;
        min-height: auto;
        overflow: visible;
    }

    .qisutu-nav {
        flex: 0 0 auto;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 12px;
    }

    .qisutu-nav-item {
        flex: 0 0 auto;
    }

    .qisutu-sidebar-user {
        display: none;
    }

    .qisutu-workspace {
        height: auto;
        overflow: visible;
    }

    .qisutu-main {
        padding: 20px;
    }

    .qisutu-dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .qisutu-dashboard-header-actions {
        justify-content: flex-start;
    }

    .qisutu-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .qisutu-panel-actions {
        flex-wrap: wrap;
    }

    .qisutu-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .qisutu-ticket-layout {
        grid-template-columns: 1fr;
    }

    .qisutu-ticket-meta-grid {
        grid-template-columns: 1fr;
    }

    .qisutu-ticket-tools-overlay {
        top: 92px;
        left: 20px;
        width: calc(100vw - 40px);
        min-height: 0;
        max-height: calc(100vh - 120px);
        padding: 18px;
    }

    .qisutu-ticket-tools-grid,
    .qisutu-ticket-tools-form-grid {
        grid-template-columns: 1fr;
    }

    .qisutu-ticket-articles-header,
    .qisutu-ticket-article-controls {
        align-items: flex-start;
        flex-direction: column;
    }

    .qisutu-ticket-article-shell {
        max-width: 100%;
    }

    .qisutu-ticket-article-summary {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .qisutu-ticket-article-side {
        align-items: flex-start;
        padding: 0 16px 14px;
        max-width: none;
    }

    .qisutu-ticket-article-badges,
    .qisutu-ticket-article-top-actions {
        justify-content: flex-start;
    }

    .qisutu-admin-grid {
        grid-template-columns: 1fr;
    }

    .qisutu-admin-form-columns {
        grid-template-columns: 1fr;
    }

    .qisutu-mail-account-choice-grid,
    .qisutu-mail-connection-details {
        grid-template-columns: 1fr;
    }

    .qisutu-translation-row {
        grid-template-columns: 1fr;
    }

    .qisutu-admin-start-grid {
        grid-template-columns: 1fr;
    }
}

.qisutu-form-field .qisutu-form-checkbox input[type="checkbox"] {
    width: auto;
    height: auto;
    padding: 0;
}

.qisutu-sidebar-user-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qisutu-sidebar-user-settings {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

.qisutu-sidebar-user-settings:hover {
    background: rgba(255, 255, 255, 0.28);
    color: #ffffff;
    text-decoration: none;
}

.qisutu-preference-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
}

@media (max-width: 900px) {
    .qisutu-preference-checkbox-grid {
        grid-template-columns: 1fr;
    }
}

.qisutu-calendar-worktime-block {
    margin-top: 10px;
}

.qisutu-calendar-worktime-list {
    display: grid;
    gap: 10px;
}

.qisutu-calendar-worktime-row {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(130px, 1fr) minmax(130px, 1fr);
    gap: 12px;
    align-items: end;
    padding: 10px 0;
    border-bottom: 1px solid var(--qisutu-border);
}

.qisutu-calendar-worktime-row:last-child {
    border-bottom: none;
}

.qisutu-calendar-holiday-form {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--qisutu-border);
}

@media (max-width: 900px) {
    .qisutu-calendar-worktime-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

.qisutu-escalation-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    border: 1px solid var(--qisutu-border);
    background: var(--qisutu-panel-soft);
    color: var(--qisutu-text);
}

.qisutu-escalation-normal {
    background: #eef7f0;
    border-color: #b8dbc0;
    color: #17672a;
}

.qisutu-escalation-warning {
    background: #fff7dd;
    border-color: #f2d27a;
    color: #815c00;
}

.qisutu-escalation-escalated {
    background: #fdeaea;
    border-color: #f0a0a0;
    color: #a41414;
}


.qisutu-escalation-value-escalated {
    color: #a41414;
    font-weight: 700;
}

.qisutu-escalation-since {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.25;
    color: #a41414;
    font-weight: 600;
}

.qisutu-ticket-list-escalation-cell .qisutu-table-muted {
    white-space: normal;
}

.qisutu-ticket-list-owner-line:empty {
    display: none;
}


.qisutu-notification-placeholder-box {
    margin-top: 20px;
    border: 1px solid var(--qisutu-border);
    border-radius: var(--qisutu-radius);
    background: #fbfdfe;
    padding: 16px;
}

.qisutu-notification-placeholder-box h3 {
    margin: 0 0 6px 0;
    font-size: 15px;
}

.qisutu-notification-placeholder-box p {
    margin: 0 0 14px 0;
    color: var(--qisutu-muted);
    font-size: 13px;
}

.qisutu-notification-placeholder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}

.qisutu-notification-placeholder-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--qisutu-border);
    border-radius: 6px;
    background: #ffffff;
}

.qisutu-notification-placeholder-item code {
    color: var(--qisutu-primary);
    font-weight: 700;
    font-size: 13px;
}

.qisutu-notification-placeholder-item span {
    color: var(--qisutu-muted);
    font-size: 12px;
}

.qisutu-agent-notification-language,
.qisutu-localized-content-language {
    align-items: end;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin: 0 0 14px auto;
}

.qisutu-agent-notification-language .qisutu-form-field,
.qisutu-localized-content-language .qisutu-form-field {
    min-width: 240px;
}

@media (max-width: 640px) {
    .qisutu-agent-notification-language,
    .qisutu-localized-content-language {
        align-items: stretch;
        flex-direction: column;
    }

    .qisutu-agent-notification-language .qisutu-form-field,
    .qisutu-localized-content-language .qisutu-form-field {
        min-width: 0;
    }
}


.qisutu-system-settings-table {
    table-layout: fixed;
}

.qisutu-system-settings-table th,
.qisutu-system-settings-table td {
    white-space: normal;
    vertical-align: middle;
}

.qisutu-system-settings-table th:nth-child(1),
.qisutu-system-settings-table td:nth-child(1) {
    width: 45%;
}

.qisutu-system-settings-table th:nth-child(2),
.qisutu-system-settings-table td:nth-child(2) {
    width: 24%;
}

.qisutu-system-settings-table th:nth-child(3),
.qisutu-system-settings-table td:nth-child(3) {
    width: 21%;
}

.qisutu-system-settings-table th:nth-child(4),
.qisutu-system-settings-table td:nth-child(4) {
    width: 10%;
}

.qisutu-system-settings-group th {
    background: rgba(1, 80, 104, 0.06);
    color: var(--qisutu-primary);
    font-size: 13px;
}

.qisutu-system-settings-name .qisutu-table-link {
    display: block;
    margin-bottom: 4px;
}

.qisutu-system-settings-name span {
    display: block;
    color: var(--qisutu-muted);
    font-size: 12px;
    line-height: 1.35;
}

.qisutu-system-settings-key {
    color: var(--qisutu-primary);
    font-size: 12px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.qisutu-system-settings-value {
    color: var(--qisutu-muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.qisutu-system-settings-edit-form {
    max-width: none;
}

.qisutu-system-settings-input-full {
    max-width: 960px;
}

.qisutu-system-setting-description {
    padding: 12px 14px;
    border: 1px solid var(--qisutu-border);
    border-radius: 8px;
    background: rgba(1, 80, 104, 0.04);
    color: var(--qisutu-muted);
    font-size: 13px;
    line-height: 1.45;
}

.qisutu-system-settings-input input,
.qisutu-system-settings-input select,
.qisutu-system-settings-input textarea {
    width: 100%;
    max-width: none;
    border: 1px solid var(--qisutu-border);
    border-radius: 7px;
    background: #ffffff;
    color: var(--qisutu-text);
    font: inherit;
}

.qisutu-system-settings-input input,
.qisutu-system-settings-input select {
    height: 38px;
    padding: 7px 10px;
}

.qisutu-system-settings-input textarea {
    min-height: 120px;
    padding: 10px;
    resize: vertical;
}


.qisutu-ticket-article-attachments {
    margin: 14px 0 14px 0;
    padding: 12px;
    border: 1px solid var(--qisutu-border);
    border-radius: 10px;
    background: #f8fbfd;
}

.qisutu-ticket-article-attachments > strong {
    display: block;
    margin-bottom: 8px;
    color: var(--qisutu-text);
    font-size: 13px;
}

.qisutu-ticket-article-attachments ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.qisutu-ticket-article-attachments li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.qisutu-ticket-article-attachments a {
    font-weight: 700;
    color: var(--qisutu-primary);
    text-decoration: none;
}

.qisutu-ticket-article-attachments a:hover {
    text-decoration: underline;
}

.qisutu-ticket-article-attachments span,
.qisutu-ticket-article-attachments em {
    color: var(--qisutu-muted);
    font-style: normal;
}

.qisutu-ticket-reply-attachments input[type="file"] {
    padding: 8px 10px;
    background: #fff;
}

.qisutu-ticket-reply-attachment-list {
    padding: 10px 12px;
    border: 1px dashed var(--qisutu-border);
    border-radius: 10px;
    background: #f8fbfd;
}

.qisutu-ticket-reply-attachment-list .qisutu-form-hint {
    margin: 0;
}

.qisutu-ticket-reply-attachment-items {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.qisutu-ticket-reply-attachment-items li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 8px;
    border: 1px solid var(--qisutu-border);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
}

.qisutu-ticket-reply-attachment-remove {
    border: 1px solid #fecaca;
    border-radius: 999px;
    background: #fff5f5;
    color: #b91c1c;
    cursor: pointer;
    font-weight: 700;
    padding: 3px 9px;
}

.qisutu-ticket-reply-attachment-remove:hover {
    background: #fee2e2;
}

/* CKEditor: system signature in reply editor */
.ck-content .qisutu-mail-signature {
    margin-top: 10px;
    padding-top: 6px;
    border-top: 1px dashed var(--qisutu-border);
    color: var(--qisutu-muted);
    font-size: 13px;
    line-height: 1.25;
}

.ck-content .qisutu-mail-signature p,
.ck-content .qisutu-mail-signature div {
    margin: 0 0 2px;
}

.ck-content .qisutu-mail-signature p:last-child,
.ck-content .qisutu-mail-signature div:last-child {
    margin-bottom: 0;
}

.ck-content .qisutu-mail-signature *,
.qisutu-richtext-output .qisutu-mail-signature * {
    line-height: 1.25;
}


.qisutu-ticket-article-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--qisutu-border);
}

.qisutu-ticket-reply-recipient-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.qisutu-ticket-reply-recipient-grid.qisutu-hidden {
    display: none;
}

@media (max-width: 860px) {
    .qisutu-ticket-reply-recipient-grid {
        grid-template-columns: 1fr;
    }
}

/* Article actions: reply and forward stay in the article header. */
.qisutu-ticket-article-top-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}
.qisutu-ticket-article-top-actions .qisutu-hidden {
    display: none !important;
}

/* TicketZoom: alternating row backgrounds in the right information sidebar. */
.qisutu-ticket-info-block .qisutu-ticket-info-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.qisutu-ticket-info-row {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    align-items: start;
    column-gap: 18px;
    margin: 0 -8px;
    padding: 6px 8px;
    border-radius: 4px;
}

.qisutu-ticket-info-row:nth-child(odd) {
    background: #e7f0f4;
}

.qisutu-ticket-info-row:nth-child(even) {
    background: transparent;
}

/* Agent ticket list views, filters, sorting and selectable columns */
.qisutu-ticket-list-page-description {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.qisutu-ticket-list-page-description p,
.qisutu-ticket-list-default-view-form {
    margin: 0;
}

.qisutu-ticket-list-panel {
    padding: 0;
    overflow: visible;
}

.qisutu-ticket-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--qisutu-border);
}

.qisutu-ticket-list-toolbar-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.qisutu-ticket-list-view-select {
    position: relative;
}

.qisutu-ticket-list-view-button {
    gap: 9px;
}

.qisutu-ticket-list-view-button strong {
    color: var(--qisutu-primary);
    font-weight: 800;
}

.qisutu-ticket-list-toolbar-left .qisutu-button {
    min-height: 40px;
    border-color: #b8c7d0;
    border-bottom-color: #9fb2bd;
    background: linear-gradient(180deg, #ffffff 0%, #f5f8fa 100%);
    color: var(--qisutu-primary);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.10),
        0 2px 5px rgba(15, 23, 42, 0.05);
    cursor: pointer;
    transition:
        background-color 150ms ease,
        border-color 150ms ease,
        box-shadow 150ms ease,
        color 150ms ease,
        transform 120ms ease;
}

.qisutu-ticket-list-toolbar-left .qisutu-button:hover:not(:disabled) {
    border-color: var(--qisutu-primary);
    background: var(--qisutu-primary);
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(1, 80, 104, 0.24);
    transform: translateY(-1px);
}

.qisutu-ticket-list-toolbar-left .qisutu-button:hover:not(:disabled) strong,
.qisutu-ticket-list-toolbar-left .qisutu-button:active:not(:disabled) strong,
.qisutu-ticket-list-toolbar-left .qisutu-ticket-list-view-button[aria-expanded="true"] strong {
    color: #ffffff;
}

.qisutu-ticket-list-toolbar-left .qisutu-button:active:not(:disabled) {
    border-color: var(--qisutu-primary-hover);
    background: var(--qisutu-primary-hover);
    color: #ffffff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.18);
    transform: translateY(1px);
}

.qisutu-ticket-list-toolbar-left .qisutu-button:focus-visible {
    border-color: var(--qisutu-primary);
    outline: 3px solid rgba(1, 80, 104, 0.24);
    outline-offset: 2px;
    box-shadow: 0 5px 13px rgba(1, 80, 104, 0.18);
}

.qisutu-ticket-list-toolbar-left .qisutu-ticket-list-view-button[aria-expanded="true"] {
    border-color: var(--qisutu-primary);
    background: var(--qisutu-primary);
    color: #ffffff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.14);
}

.qisutu-ticket-list-toolbar-left .qisutu-button:disabled,
.qisutu-ticket-list-toolbar-left .qisutu-button[aria-disabled="true"] {
    border-color: #d7e0e5;
    background: #f3f6f8;
    color: #8997a1;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.72;
    transform: none;
}

.qisutu-ticket-list-view-chevron {
    width: 8px;
    height: 8px;
    margin-left: 2px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.16s ease;
}

.qisutu-ticket-list-view-button[aria-expanded="true"] .qisutu-ticket-list-view-chevron {
    transform: rotate(225deg) translate(-1px, -1px);
}

.qisutu-ticket-list-view-menu {
    position: absolute;
    z-index: 80;
    top: calc(100% + 7px);
    left: 0;
    width: 230px;
    padding: 7px;
    border: 1px solid var(--qisutu-border);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
}

.qisutu-ticket-list-view-option {
    display: grid;
    grid-template-columns: 22px 1fr;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 7px 10px;
    border-radius: 7px;
    color: var(--qisutu-text);
    font-weight: 700;
    text-decoration: none;
}

.qisutu-ticket-list-view-option:hover,
.qisutu-ticket-list-view-option:focus-visible {
    background: #eef5f8;
    color: var(--qisutu-primary);
    outline: none;
}

.qisutu-ticket-list-view-active {
    background: #e4f0f4;
    color: var(--qisutu-primary);
}

.qisutu-ticket-list-filter-form {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--qisutu-border);
    background: #f8fafb;
}

.qisutu-ticket-list-filter {
    display: grid;
    gap: 5px;
    min-width: 190px;
}

.qisutu-ticket-list-filter > span {
    color: var(--qisutu-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.qisutu-ticket-list-filter select {
    min-height: 38px;
    padding: 0 34px 0 10px;
    border: 1px solid var(--qisutu-border);
    border-radius: 7px;
    background: #ffffff;
    color: var(--qisutu-text);
    font: inherit;
}

.qisutu-ticket-list-filter select:focus {
    border-color: var(--qisutu-primary);
    outline: 2px solid rgba(0, 91, 115, 0.12);
}

.qisutu-ticket-list-filter-reset {
    margin-left: auto;
}

.qisutu-ticket-list-table-flexible {
    width: max-content;
    min-width: 0;
    table-layout: auto;
}

.qisutu-ticket-list-table-flexible.qisutu-ticket-list-table-resized {
    table-layout: fixed;
}

.qisutu-ticket-list-panel .qisutu-ticket-list-wrap {
    overflow-x: auto;
    padding: 0 20px 18px;
}

.qisutu-ticket-list-table-flexible th,
.qisutu-ticket-list-table-flexible td {
    width: auto;
    min-width: 0;
    max-width: none;
    overflow: hidden;
    vertical-align: top;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qisutu-ticket-list-table-flexible th {
    overflow: visible;
}

.qisutu-ticket-list-sort-heading {
    position: relative;
    padding: 0;
}

.qisutu-ticket-list-sort-heading > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    min-height: 54px;
    padding: 12px 20px 12px 8px;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.qisutu-ticket-list-sort-heading > a > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qisutu-ticket-list-sort-heading > a:hover,
.qisutu-ticket-list-sort-heading > a:focus-visible {
    background: #eef5f8;
    color: var(--qisutu-primary);
    outline: none;
}

.qisutu-ticket-list-sort-indicator {
    min-width: 12px;
    color: var(--qisutu-primary);
    font-size: 10px;
    text-align: right;
}


.qisutu-ticket-list-resize-handle {
    position: absolute;
    z-index: 5;
    top: 7px;
    right: 0;
    bottom: 7px;
    width: 9px;
    border-right: 2px solid transparent;
    cursor: col-resize;
    touch-action: none;
}

.qisutu-ticket-list-resize-handle::after {
    position: absolute;
    top: 0;
    right: 3px;
    bottom: 0;
    width: 1px;
    background: #b9c8cf;
    content: '';
    opacity: 0;
    transition: opacity 0.12s ease;
}

.qisutu-ticket-list-sort-heading:hover .qisutu-ticket-list-resize-handle::after,
.qisutu-ticket-list-resize-handle:focus-visible::after,
.qisutu-ticket-list-column-active .qisutu-ticket-list-resize-handle::after {
    opacity: 1;
}

.qisutu-ticket-list-resize-handle:focus-visible {
    outline: 2px solid rgba(0, 91, 115, 0.24);
    outline-offset: -2px;
}

body.qisutu-ticket-list-column-resizing,
body.qisutu-ticket-list-column-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
}

.qisutu-ticket-list-cell {
    padding: 12px 10px;
}

.qisutu-ticket-list-number-link {
    color: var(--qisutu-primary);
    font-weight: 700;
}

.qisutu-ticket-list-column-overlay {
    position: fixed;
    z-index: 1200;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 86px 24px 24px;
    background: rgba(15, 23, 42, 0.36);
    overflow-y: auto;
}

.qisutu-ticket-list-column-overlay[hidden] {
    display: none;
}

.qisutu-ticket-list-column-dialog {
    width: min(900px, 100%);
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding: 24px;
    border: 1px solid var(--qisutu-border);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 24px 52px rgba(15, 23, 42, 0.24);
}

.qisutu-ticket-list-column-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.qisutu-ticket-list-column-header h2 {
    margin: 0;
    font-size: 22px;
}

.qisutu-ticket-list-column-header p {
    margin: 6px 0 0;
    color: var(--qisutu-muted);
}

.qisutu-ticket-list-column-close {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--qisutu-border);
    border-radius: 50%;
    background: #fbfdfe;
    color: var(--qisutu-muted);
    cursor: pointer;
    font-size: 25px;
    line-height: 1;
}

.qisutu-ticket-list-column-close:hover,
.qisutu-ticket-list-column-close:focus-visible {
    border-color: var(--qisutu-primary);
    color: var(--qisutu-primary);
    outline: none;
}

.qisutu-ticket-list-column-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.qisutu-ticket-list-column-option {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-height: 44px;
    padding: 10px 11px;
    border: 1px solid var(--qisutu-border);
    border-radius: 8px;
    background: #fbfdfe;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.3;
}

.qisutu-ticket-list-column-option:hover {
    border-color: #9fb8c2;
    background: #eef5f8;
}

.qisutu-ticket-list-column-option input {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    margin: 1px 0 0;
    accent-color: var(--qisutu-primary);
}

.qisutu-ticket-list-column-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--qisutu-border);
}

body.qisutu-overlay-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .qisutu-ticket-list-column-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .qisutu-ticket-list-toolbar,
    .qisutu-ticket-list-filter-form {
        align-items: stretch;
        flex-direction: column;
    }

    .qisutu-ticket-list-toolbar-left {
        align-items: stretch;
        flex-direction: column;
    }

    .qisutu-ticket-list-view-button,
    .qisutu-ticket-list-toolbar-left > .qisutu-button,
    .qisutu-ticket-list-filter,
    .qisutu-ticket-list-filter-reset {
        width: 100%;
    }

    .qisutu-ticket-list-view-menu {
        width: 100%;
    }

    .qisutu-ticket-list-column-overlay {
        padding: 18px 10px;
    }

    .qisutu-ticket-list-column-dialog {
        max-height: calc(100vh - 36px);
        padding: 18px;
    }

    .qisutu-ticket-list-column-grid {
        grid-template-columns: 1fr;
    }
}

/* Ticket list viewport containment and reliable table scrolling */
.qisutu-agent-ticket-list,
.qisutu-ticket-list-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.qisutu-ticket-list-panel .qisutu-ticket-list-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: max(240px, calc(100vh - 365px));
    overflow-x: auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.qisutu-ticket-list-table-flexible {
    max-width: none;
}

.qisutu-ticket-list-table-flexible thead th {
    position: sticky;
    z-index: 3;
    top: 0;
    background: #ffffff;
}

@media (max-width: 820px) {
    .qisutu-ticket-list-panel .qisutu-ticket-list-wrap {
        max-height: none;
        overflow: visible;
        scrollbar-gutter: auto;
    }

    .qisutu-ticket-list-table-flexible,
    .qisutu-ticket-list-table-flexible.qisutu-ticket-list-table-resized {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: auto;
    }

    .qisutu-ticket-list-resize-handle {
        display: none;
    }
}



.qisutu-system-setting-value-with-unit {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qisutu-system-setting-value-with-unit input {
    max-width: 220px;
}

.qisutu-system-setting-value-with-unit span {
    color: var(--qisutu-muted);
    font-weight: 700;
}

.qisutu-attachment-limit-overlay {
    position: fixed;
    z-index: 1500;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.34);
}

.qisutu-attachment-limit-overlay[hidden] {
    display: none;
}

.qisutu-attachment-limit-dialog {
    width: min(460px, 100%);
    padding: 22px;
    border: 1px solid var(--qisutu-border);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.24);
}

.qisutu-attachment-limit-dialog h3 {
    margin: 0 0 12px;
    font-size: 20px;
}

.qisutu-attachment-limit-dialog p {
    margin: 0 0 10px;
    color: var(--qisutu-text);
    line-height: 1.5;
}

.qisutu-attachment-limit-dialog .qisutu-form-actions {
    margin-top: 18px;
}

/* Agent: ticket creation */
.qisutu-agent-ticket-create .qisutu-panel {
    overflow: visible;
}

.qisutu-agent-ticket-create-form {
    max-width: none;
}

.qisutu-agent-ticket-create-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.9fr) minmax(300px, 0.85fr);
    gap: 24px;
    align-items: start;
}

.qisutu-agent-ticket-create-main {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.qisutu-agent-ticket-create-send {
    padding: 12px 14px;
    border: 1px solid var(--qisutu-border);
    border-radius: 9px;
    background: #f8fbfd;
}

.qisutu-agent-ticket-create-send .qisutu-form-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
}

.qisutu-agent-ticket-create-send input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--qisutu-primary);
}

.qisutu-agent-ticket-create-sla-info {
    padding: 14px 16px;
    border: 1px solid var(--qisutu-border);
    border-radius: 9px;
    background: #f8fbfd;
}

.qisutu-agent-ticket-create-sla-info h3 {
    margin: 0 0 10px;
    font-size: 16px;
}

.qisutu-agent-ticket-create-sla-info .qisutu-ticket-info-list {
    margin: 0;
}

.qisutu-agent-ticket-create-sla-info .qisutu-ticket-info-row {
    grid-template-columns: minmax(170px, 0.9fr) minmax(0, 1.1fr);
}

.qisutu-agent-ticket-create-form .qisutu-form-field-richtext .ck.ck-editor__main > .ck-editor__editable {
    min-height: 300px;
}

.qisutu-agent-ticket-create-actions {
    justify-content: flex-end;
}

.qisutu-agent-ticket-create-customer-info {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--qisutu-border);
    border-radius: 10px;
    background: #f8fbfd;
}

.qisutu-agent-ticket-create-customer-info h2 {
    margin: 0;
    font-size: 18px;
}

.qisutu-agent-ticket-create-customer-info-message {
    margin: 14px 0 0;
    color: var(--qisutu-muted);
    line-height: 1.5;
}

.qisutu-agent-ticket-create-customer-info-content {
    display: grid;
    gap: 20px;
    margin-top: 18px;
}

.qisutu-agent-ticket-create-customer-info-content section {
    min-width: 0;
}

.qisutu-agent-ticket-create-customer-info-content h3 {
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--qisutu-border);
    font-size: 15px;
}

.qisutu-agent-ticket-create-customer-info-content dl {
    display: grid;
    gap: 0;
    margin: 0;
}

.qisutu-agent-ticket-create-customer-info-row {
    display: grid;
    grid-template-columns: minmax(110px, 0.9fr) minmax(0, 1.35fr);
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(203, 213, 223, 0.72);
}

.qisutu-agent-ticket-create-customer-info-row:last-child {
    border-bottom: 0;
}

.qisutu-agent-ticket-create-customer-info-row dt,
.qisutu-agent-ticket-create-customer-info-row dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.qisutu-agent-ticket-create-customer-info-row dt {
    color: var(--qisutu-muted);
    font-size: 12px;
    font-weight: 700;
}

.qisutu-agent-ticket-create-customer-info-row dd {
    color: var(--qisutu-text);
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
}

@media (max-width: 1080px) {
    .qisutu-agent-ticket-create-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .qisutu-agent-ticket-create-customer-info-row {
        grid-template-columns: 1fr;
        gap: 3px;
    }
}

/* Ticket dynamic fields and queue assignment. */
.qisutu-dynamic-assignment-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.qisutu-dynamic-assignment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.qisutu-dynamic-assignment-list h3 {
    margin: 0 0 4px;
}

.qisutu-dynamic-assignment-list > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 13px;
    border: 1px solid #d4dde6;
    border-radius: 7px;
    background: #fff;
    color: inherit;
    text-decoration: none;
}

.qisutu-dynamic-assignment-list > a:hover,
.qisutu-dynamic-assignment-list > a:focus-visible {
    border-color: #0c6078;
    box-shadow: 0 0 0 2px rgba(12, 96, 120, 0.12);
}

.qisutu-dynamic-assignment-list > a span {
    color: #687789;
    font-size: 12px;
}

.qisutu-assignment-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 4px 0 20px;
}

.qisutu-assignment-checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #d4dde6;
    border-radius: 7px;
    background: #f8fafc;
}

.qisutu-assignment-checkbox input {
    flex: 0 0 auto;
}

.qisutu-ticket-dynamic-fields {
    grid-column: 1 / -1;
    margin: 4px 0 2px;
    padding: 15px;
    border: 1px solid #d4dde6;
    border-radius: 8px;
    background: #f7fafc;
}

.qisutu-ticket-dynamic-fields h4 {
    margin: 0 0 13px;
    font-size: 16px;
}

.qisutu-ticket-dynamic-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.qisutu-ticket-dynamic-field-wide {
    grid-column: 1 / -1;
}

.qisutu-agent-ticket-create-main > [data-qisutu-create-dynamic-fields] {
    display: block;
}

@media (max-width: 900px) {
    .qisutu-dynamic-assignment-columns,
    .qisutu-assignment-checkbox-grid,
    .qisutu-ticket-dynamic-fields-grid {
        grid-template-columns: 1fr;
    }

    .qisutu-ticket-dynamic-field-wide {
        grid-column: auto;
    }
}

.qisutu-dynamic-selection-config {
    padding: 14px;
    border: 1px solid #d4dde6;
    border-radius: 8px;
    background: #f7fafc;
}

.qisutu-dynamic-option-rows {
    display: grid;
    gap: 10px;
}

.qisutu-dynamic-option-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.9fr) minmax(220px, 1.4fr) minmax(110px, 0.45fr) auto auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid #d4dde6;
    border-radius: 7px;
    background: #fff;
}

.qisutu-dynamic-option-default {
    align-self: end;
    min-height: 40px;
    white-space: nowrap;
}

.qisutu-dynamic-option-translations {
    grid-column: 1 / -1;
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid #d4dde6;
    border-radius: 7px;
    background: #f7fafc;
}

.qisutu-dynamic-option-translations.qisutu-hidden {
    display: none;
}

.qisutu-dynamic-option-translation-rows {
    display: grid;
    gap: 8px;
}

.qisutu-dynamic-option-translation-row {
    display: grid;
    grid-template-columns: minmax(180px, 0.75fr) minmax(240px, 1.25fr);
    gap: 10px;
    align-items: center;
}

.qisutu-dynamic-option-translation-row label {
    overflow-wrap: anywhere;
    font-weight: 700;
}

.qisutu-dynamic-show-empty {
    margin-top: 4px;
}

.qisutu-ticket-dynamic-fields select[multiple] {
    min-height: 110px;
}

@media (max-width: 1100px) {
    .qisutu-dynamic-option-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .qisutu-dynamic-option-row,
    .qisutu-dynamic-option-translation-row {
        grid-template-columns: 1fr;
    }
}

/* Collapsible sidebar and compact navigation flyouts. */
.qisutu-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.qisutu-app {
    transition: grid-template-columns 180ms ease;
}

.qisutu-sidebar {
    position: relative;
    z-index: 30;
    overflow: visible;
    transition: width 180ms ease;
}

.qisutu-workspace {
    position: relative;
    z-index: 1;
}

.qisutu-sidebar-toggle {
    position: absolute;
    top: 50px;
    right: 10px;
    z-index: 120;
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(1, 80, 104, 0.22);
    border-radius: 50%;
    background: #ffffff;
    color: var(--qisutu-primary);
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.20);
    cursor: pointer;
    font: inherit;
    line-height: 1;
    transition:
        background-color 140ms ease,
        color 140ms ease,
        border-color 140ms ease,
        box-shadow 140ms ease;
}

.qisutu-sidebar-toggle:hover,
.qisutu-sidebar-toggle:focus-visible {
    background: #f4f7f9;
    color: var(--qisutu-primary-hover);
    border-color: rgba(1, 80, 104, 0.38);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.24);
}

.qisutu-sidebar-toggle:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.95);
    outline-offset: 2px;
}

.qisutu-sidebar-toggle-icon {
    display: block;
    margin-top: -2px;
    font-size: 25px;
    font-weight: 400;
}

html.qisutu-sidebar-collapsed .qisutu-sidebar-toggle {
    right: -14px;
}

.qisutu-sidebar-user-avatar {
    padding: 0;
    border: 0;
    font-family: inherit;
    cursor: default;
}

.qisutu-sidebar-user-flyout {
    display: none;
}

html.qisutu-sidebar-collapsed .qisutu-app {
    grid-template-columns: 68px minmax(0, 1fr);
}

html.qisutu-sidebar-collapsed .qisutu-sidebar {
    width: 68px;
    overflow: visible;
}

html.qisutu-sidebar-collapsed .qisutu-sidebar-brand {
    justify-content: center;
    gap: 0;
    padding: 0;
}

html.qisutu-sidebar-collapsed .qisutu-sidebar-name,
html.qisutu-sidebar-collapsed .qisutu-nav-label,
html.qisutu-sidebar-collapsed .qisutu-sidebar-user-text,
html.qisutu-sidebar-collapsed .qisutu-sidebar-user-settings {
    display: none;
}

html.qisutu-sidebar-collapsed .qisutu-nav {
    align-items: center;
    overflow: visible;
    padding: 16px 10px;
}

html.qisutu-sidebar-collapsed .qisutu-nav-group {
    position: relative;
    width: 100%;
    align-items: center;
}

html.qisutu-sidebar-collapsed .qisutu-nav-item {
    width: 44px;
    min-width: 44px;
    flex: 0 0 44px;
    justify-content: center;
    gap: 0;
    padding: 0;
}

html.qisutu-sidebar-collapsed .qisutu-nav-icon {
    flex: 0 0 24px;
}

html.qisutu-sidebar-collapsed .qisutu-nav-item-parent {
    cursor: pointer;
}

html.qisutu-sidebar-collapsed .qisutu-subnav,
html.qisutu-sidebar-collapsed .qisutu-nav-group:hover .qisutu-subnav,
html.qisutu-sidebar-collapsed .qisutu-nav-group:focus-within .qisutu-subnav,
html.qisutu-sidebar-collapsed .qisutu-subnav-open {
    position: absolute;
    top: 0;
    left: calc(100% + 10px);
    z-index: 110;
    width: 282px;
    max-height: calc(100vh - 24px);
    margin: 0;
    padding: 46px 8px 8px;
    display: none;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 9px;
    background: var(--qisutu-primary);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.28);
}

html.qisutu-sidebar-collapsed .qisutu-subnav::before {
    content: attr(data-nav-title);
    position: absolute;
    top: 0;
    right: 8px;
    left: 8px;
    height: 38px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
}

html.qisutu-sidebar-collapsed .qisutu-nav-group.qisutu-flyout-open .qisutu-subnav {
    display: flex;
}

html.qisutu-sidebar-collapsed .qisutu-subnav-item {
    width: 100%;
    min-height: 36px;
    padding: 7px 10px;
}

html.qisutu-sidebar-collapsed .qisutu-sidebar-user {
    position: relative;
    justify-content: center;
    gap: 0;
    padding: 14px 0;
}

html.qisutu-sidebar-collapsed .qisutu-sidebar-user-avatar {
    flex: 0 0 36px;
    cursor: pointer;
}

html.qisutu-sidebar-collapsed .qisutu-sidebar-user-flyout {
    position: absolute;
    bottom: 10px;
    left: calc(100% + 10px);
    z-index: 110;
    width: 230px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 9px;
    background: var(--qisutu-primary);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.28);
}

html.qisutu-sidebar-collapsed .qisutu-sidebar-user.qisutu-user-flyout-open .qisutu-sidebar-user-flyout {
    display: grid;
    gap: 4px;
}

.qisutu-sidebar-user-flyout-name {
    padding: 4px 8px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-weight: 700;
}

.qisutu-sidebar-user-flyout-link {
    min-height: 34px;
    display: flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
    font-weight: 700;
}

.qisutu-sidebar-user-flyout-link:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    text-decoration: none;
}

@media (max-width: 900px) {
    html.qisutu-sidebar-collapsed .qisutu-app {
        grid-template-columns: 1fr;
    }

    html.qisutu-sidebar-collapsed .qisutu-sidebar {
        width: auto;
        overflow: visible;
    }

    html.qisutu-sidebar-collapsed .qisutu-sidebar-brand {
        justify-content: flex-start;
        gap: 12px;
        padding: 0 20px;
    }

    html.qisutu-sidebar-collapsed .qisutu-sidebar-name,
    html.qisutu-sidebar-collapsed .qisutu-nav-label,
    html.qisutu-sidebar-collapsed .qisutu-sidebar-user-text,
    html.qisutu-sidebar-collapsed .qisutu-sidebar-user-settings {
        display: initial;
    }

    html.qisutu-sidebar-collapsed .qisutu-nav {
        align-items: stretch;
        overflow-x: auto;
        overflow-y: hidden;
    }

    html.qisutu-sidebar-collapsed .qisutu-nav-group {
        width: auto;
        align-items: stretch;
    }

    html.qisutu-sidebar-collapsed .qisutu-nav-item {
        width: auto;
        min-width: 0;
        flex: 0 0 auto;
        justify-content: flex-start;
        gap: 10px;
        padding: 0 12px;
    }

    html.qisutu-sidebar-collapsed .qisutu-subnav,
    html.qisutu-sidebar-collapsed .qisutu-nav-group:hover .qisutu-subnav,
    html.qisutu-sidebar-collapsed .qisutu-nav-group:focus-within .qisutu-subnav,
    html.qisutu-sidebar-collapsed .qisutu-subnav-open {
        position: static;
        width: auto;
        max-height: none;
        margin: -1px 0 6px 42px;
        padding: 0;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        transform: none !important;
    }

    html.qisutu-sidebar-collapsed .qisutu-subnav::before {
        display: none;
    }

    html.qisutu-sidebar-collapsed .qisutu-subnav-open,
    html.qisutu-sidebar-collapsed .qisutu-nav-group:hover .qisutu-subnav,
    html.qisutu-sidebar-collapsed .qisutu-nav-group:focus-within .qisutu-subnav {
        display: flex;
    }

    .qisutu-sidebar-toggle {
        display: none;
    }

    html.qisutu-sidebar-collapsed .qisutu-sidebar-user-flyout {
        display: none !important;
    }
}

/* Ticket list pagination and page size selection */
.qisutu-ticket-list-toolbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-left: auto;
}

.qisutu-ticket-list-per-page-form {
    margin: 0;
}

.qisutu-ticket-list-per-page-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--qisutu-muted);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.qisutu-ticket-list-per-page-label select {
    min-width: 68px;
    height: 36px;
    padding: 0 28px 0 10px;
    border: 1px solid var(--qisutu-border);
    border-radius: 7px;
    background-color: #ffffff;
    color: var(--qisutu-text);
    font: inherit;
    cursor: pointer;
}

.qisutu-ticket-list-per-page-label select:focus {
    border-color: var(--qisutu-primary);
    outline: 2px solid rgba(0, 93, 117, 0.16);
    outline-offset: 1px;
}

.qisutu-ticket-list-pagination {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.qisutu-ticket-list-pagination-label {
    margin-right: 2px;
    color: var(--qisutu-muted);
    font-size: 13px;
    font-weight: 700;
}

.qisutu-ticket-list-page-link,
.qisutu-ticket-list-page-ellipsis {
    min-width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.qisutu-ticket-list-page-link {
    border: 1px solid var(--qisutu-border);
    background: #ffffff;
    color: var(--qisutu-primary);
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.qisutu-ticket-list-page-link:hover,
.qisutu-ticket-list-page-link:focus-visible {
    border-color: var(--qisutu-primary);
    background: var(--qisutu-primary-soft);
    outline: none;
}

.qisutu-ticket-list-page-active {
    border-color: var(--qisutu-primary);
    background: var(--qisutu-primary);
    color: #ffffff;
}

.qisutu-ticket-list-page-direction {
    font-size: 20px;
}

.qisutu-ticket-list-page-ellipsis {
    min-width: 20px;
    color: var(--qisutu-muted);
}

.qisutu-ticket-list-pagination-bottom {
    display: flex;
    justify-content: flex-end;
    padding: 14px 20px 20px;
    border-top: 1px solid var(--qisutu-border);
}

.qisutu-ticket-list-panel {
    margin-bottom: 32px;
}

@media (max-width: 900px) {
    .qisutu-ticket-list-toolbar-right {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    .qisutu-ticket-list-toolbar-right {
        align-items: stretch;
        flex-direction: column;
    }

    .qisutu-ticket-list-per-page-label {
        justify-content: space-between;
    }

    .qisutu-ticket-list-pagination {
        flex-wrap: wrap;
    }

    .qisutu-ticket-list-pagination-bottom {
        justify-content: flex-start;
        overflow-x: auto;
    }
}

/* Ticket search */
.qisutu-ticket-search-open-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.qisutu-ticket-search-open-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

/* Ticket bulk actions */
.qisutu-ticket-bulk-open-button strong {
    color: var(--qisutu-primary);
}

.qisutu-ticket-bulk-open-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.qisutu-ticket-list-select-col {
    width: 48px;
}

.qisutu-ticket-list-select-heading,
.qisutu-ticket-list-select-cell {
    width: 48px;
    min-width: 48px !important;
    max-width: 48px !important;
    padding: 0 !important;
    text-align: center;
}

.qisutu-ticket-list-select-heading {
    position: sticky !important;
    z-index: 6 !important;
    left: 0;
    background: #ffffff;
}

.qisutu-ticket-list-select-cell {
    position: sticky;
    z-index: 2;
    left: 0;
    background: #ffffff;
}

.qisutu-ticket-list-select-heading input,
.qisutu-ticket-list-select-cell input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--qisutu-primary);
    cursor: pointer;
}

.qisutu-ticket-list-row-selected td,
.qisutu-ticket-list-row-selected .qisutu-ticket-list-select-cell {
    background: #eaf4f7;
}

.qisutu-ticket-bulk-overlay {
    position: fixed;
    z-index: 1250;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 70px 24px 24px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.42);
}

.qisutu-ticket-bulk-overlay[hidden] {
    display: none;
}

.qisutu-ticket-bulk-dialog {
    width: min(820px, 100%);
    max-height: calc(100vh - 94px);
    padding: 24px;
    overflow-y: auto;
    border: 1px solid var(--qisutu-border);
    border-radius: 13px;
    background: #ffffff;
    box-shadow: 0 24px 52px rgba(15, 23, 42, 0.26);
}

.qisutu-ticket-bulk-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.qisutu-ticket-bulk-header h2 {
    margin: 0;
    font-size: 23px;
}

.qisutu-ticket-bulk-header p {
    margin: 6px 0 0;
    color: var(--qisutu-muted);
}

.qisutu-ticket-bulk-close {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--qisutu-border);
    border-radius: 50%;
    background: #fbfdfe;
    color: var(--qisutu-muted);
    cursor: pointer;
    font-size: 25px;
    line-height: 1;
}

.qisutu-ticket-bulk-close:hover,
.qisutu-ticket-bulk-close:focus-visible {
    border-color: var(--qisutu-primary);
    color: var(--qisutu-primary);
    outline: none;
}

.qisutu-ticket-bulk-selection-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #bed6df;
    border-radius: 9px;
    background: #eef6f8;
}

.qisutu-ticket-bulk-selection-summary span:last-child {
    color: var(--qisutu-muted);
    font-size: 13px;
}

.qisutu-ticket-bulk-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.qisutu-ticket-bulk-grid .qisutu-form-field {
    display: grid;
    gap: 6px;
}

.qisutu-ticket-bulk-grid .qisutu-form-field > span {
    font-weight: 750;
}

.qisutu-ticket-bulk-grid select,
.qisutu-ticket-bulk-grid input,
.qisutu-ticket-bulk-grid textarea {
    width: 100%;
}

.qisutu-ticket-bulk-reason {
    grid-column: 1 / -1;
}

.qisutu-ticket-bulk-reason small {
    color: var(--qisutu-muted);
}

.qisutu-ticket-bulk-notice {
    margin-top: 18px;
    padding: 12px 14px;
    border-left: 4px solid var(--qisutu-primary);
    border-radius: 7px;
    background: #f2f7f9;
    color: var(--qisutu-muted);
    line-height: 1.45;
}

.qisutu-ticket-bulk-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--qisutu-border);
}

.qisutu-ticket-bulk-result {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    padding: 16px 18px;
    border: 1px solid;
    border-radius: 10px;
}

.qisutu-ticket-bulk-result-success {
    border-color: #a9d8b8;
    background: #effaf2;
}

.qisutu-ticket-bulk-result-warning {
    border-color: #edc77b;
    background: #fff8e8;
}

.qisutu-ticket-bulk-result h2,
.qisutu-ticket-bulk-result p {
    margin: 0;
}

.qisutu-ticket-bulk-result h2 {
    margin-bottom: 5px;
    font-size: 18px;
}

.qisutu-ticket-bulk-result details {
    min-width: min(360px, 100%);
}

.qisutu-ticket-bulk-result summary {
    color: var(--qisutu-primary);
    cursor: pointer;
    font-weight: 700;
}

.qisutu-ticket-bulk-result ul {
    margin: 10px 0 0;
    padding-left: 18px;
}

.qisutu-ticket-bulk-result li {
    margin: 5px 0;
}

.qisutu-ticket-bulk-result li span {
    display: block;
    color: var(--qisutu-muted);
}

@media (max-width: 700px) {
    .qisutu-ticket-bulk-overlay {
        padding: 14px 9px;
    }

    .qisutu-ticket-bulk-dialog {
        max-height: calc(100vh - 28px);
        padding: 17px;
    }

    .qisutu-ticket-bulk-grid {
        grid-template-columns: 1fr;
    }

    .qisutu-ticket-bulk-reason {
        grid-column: auto;
    }

    .qisutu-ticket-bulk-selection-summary,
    .qisutu-ticket-bulk-result {
        align-items: flex-start;
        flex-direction: column;
    }

    .qisutu-ticket-bulk-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .qisutu-ticket-bulk-actions .qisutu-button {
        width: 100%;
    }
}

.qisutu-ticket-search-active {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    border-top: 1px solid var(--qisutu-border, #d5e0e8);
    border-bottom: 1px solid var(--qisutu-border, #d5e0e8);
    background: #eef8fb;
}

.qisutu-ticket-search-active > div:first-child {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}

.qisutu-ticket-search-active strong {
    color: #005b73;
}

.qisutu-ticket-search-active span {
    color: #5c6d7e;
    font-size: 13px;
}

.qisutu-ticket-search-active-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.qisutu-ticket-search-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 248px;
    z-index: 1800;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 28px;
    background: rgba(15, 29, 41, 0.58);
    backdrop-filter: blur(2px);
    transition: left 180ms ease;
}

html.qisutu-sidebar-collapsed .qisutu-ticket-search-overlay {
    left: 68px;
}

.qisutu-ticket-search-overlay[hidden] {
    display: none;
}

.qisutu-ticket-search-dialog {
    width: min(1380px, 100%);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #cbd8e2;
    border-radius: 12px;
    background: #f7f9fb;
    box-shadow: 0 24px 70px rgba(8, 28, 43, 0.28);
}

.qisutu-ticket-search-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    border-bottom: 1px solid #d5e0e8;
    background: #fff;
}

.qisutu-ticket-search-header h2 {
    margin: 0;
    font-size: 24px;
    color: #1d2935;
}

.qisutu-ticket-search-header p {
    margin: 5px 0 0;
    color: #647486;
}

.qisutu-ticket-search-close {
    width: 38px;
    height: 38px;
    border: 1px solid #cbd8e2;
    border-radius: 8px;
    background: #fff;
    color: #34495a;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.qisutu-ticket-search-close:hover,
.qisutu-ticket-search-close:focus-visible {
    border-color: #00657d;
    color: #00657d;
    outline: none;
}

.qisutu-ticket-search-form {
    min-height: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.qisutu-ticket-search-content {
    min-height: 0;
    overflow: auto;
    padding: 20px 24px 28px;
}

.qisutu-ticket-search-section {
    margin: 0 0 18px;
    padding: 18px;
    border: 1px solid #d5e0e8;
    border-radius: 9px;
    background: #fff;
}

.qisutu-ticket-search-section:last-child {
    margin-bottom: 0;
}

.qisutu-ticket-search-section h3 {
    margin: 0 0 14px;
    font-size: 17px;
    color: #24313d;
}

.qisutu-ticket-search-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.qisutu-ticket-search-section-title h3 {
    margin: 0;
}

.qisutu-ticket-search-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 16px;
}

.qisutu-ticket-search-grid-main {
    grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
}

.qisutu-ticket-search-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qisutu-ticket-search-field > span,
.qisutu-ticket-search-range legend,
.qisutu-ticket-search-range label span {
    color: #263542;
    font-size: 13px;
    font-weight: 700;
}

.qisutu-ticket-search-field input,
.qisutu-ticket-search-field select,
.qisutu-ticket-search-range input,
.qisutu-ticket-search-dynamic input,
.qisutu-ticket-search-dynamic select {
    width: 100%;
    min-width: 0;
    border: 1px solid #cbd8e2;
    border-radius: 7px;
    background: #fff;
    color: #1e2933;
    font: inherit;
}

.qisutu-ticket-search-field input,
.qisutu-ticket-search-range input,
.qisutu-ticket-search-dynamic input,
.qisutu-ticket-search-dynamic select:not([multiple]) {
    min-height: 40px;
    padding: 8px 10px;
}

.qisutu-ticket-search-field select {
    padding: 7px 9px;
}

.qisutu-ticket-search-field select[multiple],
.qisutu-ticket-search-dynamic select[multiple] {
    min-height: 112px;
}

.qisutu-ticket-search-field input:focus,
.qisutu-ticket-search-field select:focus,
.qisutu-ticket-search-range input:focus,
.qisutu-ticket-search-dynamic input:focus,
.qisutu-ticket-search-dynamic select:focus {
    border-color: #00657d;
    box-shadow: 0 0 0 3px rgba(0, 101, 125, 0.12);
    outline: none;
}

.qisutu-ticket-search-field small {
    color: #697989;
    font-size: 11px;
}

.qisutu-ticket-search-wide {
    grid-column: span 1;
}

.qisutu-ticket-search-scope {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px 16px;
    margin-top: 14px;
}

.qisutu-ticket-search-scope > span {
    font-size: 13px;
    font-weight: 700;
}

.qisutu-ticket-search-scope label,
.qisutu-ticket-search-checkbox-grid label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}

.qisutu-ticket-search-scope input,
.qisutu-ticket-search-checkbox-grid input {
    width: 17px;
    height: 17px;
    accent-color: #00657d;
}

.qisutu-ticket-search-range-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.qisutu-ticket-search-range {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 12px;
    border: 1px solid #dbe4eb;
    border-radius: 8px;
}

.qisutu-ticket-search-range legend {
    padding: 0 5px;
}

.qisutu-ticket-search-range label {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.qisutu-ticket-search-quick-periods {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.qisutu-ticket-search-quick-periods > span {
    align-self: center;
    color: #607083;
    font-size: 12px;
    font-weight: 700;
}

.qisutu-ticket-search-quick-periods button {
    padding: 5px 9px;
    border: 1px solid #cbd8e2;
    border-radius: 6px;
    background: #fff;
    color: #005b73;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.qisutu-ticket-search-quick-periods button:hover,
.qisutu-ticket-search-quick-periods button:focus-visible {
    border-color: #00657d;
    background: #eef8fb;
    outline: none;
}

.qisutu-ticket-search-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 16px;
}

.qisutu-ticket-search-dynamic-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.qisutu-ticket-search-dynamic {
    min-width: 0;
    padding: 12px;
    border: 1px solid #dbe4eb;
    border-radius: 8px;
    background: #fbfcfd;
}

.qisutu-ticket-search-dynamic > strong {
    display: block;
    margin-bottom: 8px;
    color: #263542;
    font-size: 13px;
}

.qisutu-ticket-search-dynamic-controls {
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.2fr) minmax(0, 1.2fr);
    gap: 8px;
    align-items: start;
}

.qisutu-ticket-search-dynamic-controls > :only-child {
    grid-column: 1 / -1;
}

.qisutu-ticket-search-dynamic-no-value [data-qisutu-search-dynamic-value] {
    opacity: 0.55;
}

.qisutu-ticket-search-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding: 14px 24px;
    border-top: 1px solid #d5e0e8;
    background: #fff;
}

@media (max-width: 1050px) {
    .qisutu-ticket-search-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .qisutu-ticket-search-grid-main {
        grid-template-columns: 1fr;
    }

    .qisutu-ticket-search-checkbox-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .qisutu-ticket-search-overlay,
    html.qisutu-sidebar-collapsed .qisutu-ticket-search-overlay {
        left: 0;
    }
}

@media (max-width: 760px) {
    .qisutu-ticket-search-overlay {
        padding: 0;
    }

    .qisutu-ticket-search-dialog {
        border: 0;
        border-radius: 0;
    }

    .qisutu-ticket-search-header,
    .qisutu-ticket-search-content,
    .qisutu-ticket-search-actions {
        padding-left: 15px;
        padding-right: 15px;
    }

    .qisutu-ticket-search-grid,
    .qisutu-ticket-search-range-grid,
    .qisutu-ticket-search-dynamic-list,
    .qisutu-ticket-search-checkbox-grid {
        grid-template-columns: 1fr;
    }

    .qisutu-ticket-search-range {
        grid-template-columns: 1fr;
    }

    .qisutu-ticket-search-section-title,
    .qisutu-ticket-search-active {
        align-items: stretch;
        flex-direction: column;
    }

    .qisutu-ticket-search-quick-periods {
        justify-content: flex-start;
    }

    .qisutu-ticket-search-dynamic-controls {
        grid-template-columns: 1fr;
    }

    .qisutu-ticket-search-actions {
        flex-wrap: wrap;
    }
}

/* Automation administration */
.qisutu-automation-form {
    display: grid;
    gap: 16px;
    width: 100%;
    max-width: none;
}

.qisutu-automation-base-grid,
.qisutu-automation-grid-3,
.qisutu-automation-grid-4 {
    display: grid;
    gap: 14px;
}

.qisutu-automation-base-grid,
.qisutu-automation-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.qisutu-automation-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.qisutu-automation-description {
    grid-column: span 2;
}

.qisutu-automation-section {
    padding: 0;
    overflow: hidden;
}

.qisutu-automation-section > summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    color: #20313d;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

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

.qisutu-automation-section > summary::after {
    content: '▾';
    color: #00657d;
    font-size: 18px;
    transition: transform 0.16s ease;
}

.qisutu-automation-section:not([open]) > summary::after {
    transform: rotate(-90deg);
}

.qisutu-automation-summary-hint {
    margin-left: auto;
    color: #71808c;
    font-size: 11px;
    font-weight: 600;
}

.qisutu-automation-section-content {
    display: grid;
    gap: 18px;
    padding: 0 20px 20px;
    border-top: 1px solid #e1e8ed;
}

.qisutu-automation-subsection {
    padding-top: 18px;
}

.qisutu-automation-subsection h3,
.qisutu-automation-delete-box h3,
.qisutu-automation-preview h3 {
    margin: 0 0 12px;
    color: #263743;
    font-size: 15px;
}

.qisutu-automation-check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-top: 12px;
}

.qisutu-automation-check-row label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
}

.qisutu-automation-check-row input,
.qisutu-automation-dynamic-row input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #00657d;
}

.qisutu-automation-range {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 12px;
    border: 1px solid #d7e1e8;
    border-radius: 8px;
}

.qisutu-automation-range legend {
    padding: 0 5px;
    color: #263743;
    font-size: 13px;
    font-weight: 800;
}

.qisutu-automation-dynamic-list {
    display: grid;
    gap: 10px;
}

.qisutu-automation-dynamic-row {
    display: grid;
    grid-template-columns: minmax(190px, 0.8fr) minmax(140px, 0.55fr) minmax(180px, 1fr) minmax(180px, 1fr);
    align-items: start;
    gap: 9px;
    padding: 10px;
    border: 1px solid #dce5eb;
    border-radius: 8px;
    background: #fbfcfd;
}

.qisutu-automation-dynamic-row .qisutu-form-checkbox {
    margin-top: 9px;
}

.qisutu-automation-dynamic-row select,
.qisutu-automation-dynamic-row input,
.qisutu-automation-communication-grid input,
.qisutu-automation-communication-grid textarea,
.qisutu-automation-delete-box input,
.qisutu-automation-job-filter select,
.qisutu-automation-range input {
    width: 100%;
    min-width: 0;
    border: 1px solid #cbd8e2;
    border-radius: 7px;
    background: #fff;
    color: #1e2933;
    font: inherit;
}

.qisutu-automation-dynamic-row select,
.qisutu-automation-dynamic-row input,
.qisutu-automation-communication-grid input,
.qisutu-automation-delete-box input,
.qisutu-automation-job-filter select,
.qisutu-automation-range input {
    min-height: 40px;
    padding: 8px 10px;
}

.qisutu-automation-communication-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.qisutu-automation-action-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid #dce5eb;
    border-radius: 8px;
    background: #fbfcfd;
}

.qisutu-automation-action-card textarea {
    min-height: 130px;
    padding: 10px;
    resize: vertical;
}

.qisutu-automation-delete-box {
    padding: 16px;
    border: 2px solid #c43e3e;
    border-radius: 9px;
    background: #fff4f4;
}

.qisutu-automation-delete-box p {
    margin: 0 0 12px;
    color: #7c2020;
    font-weight: 700;
}

.qisutu-automation-delete-box .qisutu-form-field {
    max-width: 360px;
    margin-top: 12px;
}

.qisutu-automation-preview-actions,
.qisutu-automation-save-actions {
    justify-content: flex-end;
}

.qisutu-automation-preview {
    padding: 15px;
    border: 1px solid #a9ccd5;
    border-radius: 8px;
    background: #f2fafc;
}

.qisutu-automation-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.qisutu-automation-status-pending {
    background: #fff2c9;
    color: #785900;
}

.qisutu-automation-status-running {
    background: #dcefff;
    color: #14527a;
}

.qisutu-automation-status-successful {
    background: #dff3e5;
    color: #176331;
}

.qisutu-automation-status-failed {
    background: #ffe0e0;
    color: #8b2020;
}

.qisutu-automation-status-cancelled {
    background: #e8ecef;
    color: #4d5963;
}

.qisutu-automation-job-error {
    max-width: 320px;
    white-space: normal;
    word-break: break-word;
}

.qisutu-automation-job-filter select {
    min-width: 190px;
}

.qisutu-inline-form {
    display: inline-block;
    margin: 2px;
}

[data-qisutu-schedule-field][hidden],
.qisutu-form-field select[hidden] {
    display: none !important;
}

@media (max-width: 1150px) {
    .qisutu-automation-base-grid,
    .qisutu-automation-grid-3,
    .qisutu-automation-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .qisutu-automation-dynamic-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .qisutu-automation-base-grid,
    .qisutu-automation-grid-3,
    .qisutu-automation-grid-4,
    .qisutu-automation-communication-grid,
    .qisutu-automation-dynamic-row,
    .qisutu-automation-range {
        grid-template-columns: 1fr;
    }

    .qisutu-automation-description {
        grid-column: auto;
    }

    .qisutu-automation-summary-hint {
        display: none;
    }
}

/* Reusable readable multiple selection for automation forms */
.qisutu-smart-multiselect {
    width: 100%;
    min-width: 0;
}

.qisutu-smart-multiselect-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 7px 10px;
    border: 1px solid #cbd8e2;
    border-radius: 8px;
    background: #fff;
    color: #1e2933;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.qisutu-smart-multiselect-trigger:hover {
    border-color: #7ea8b6;
    background: #fbfdfe;
}

.qisutu-smart-multiselect-trigger:focus-visible {
    outline: none;
    border-color: #00657d;
    box-shadow: 0 0 0 3px rgba(0, 101, 125, 0.14);
}

.qisutu-smart-multiselect-summary {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.qisutu-smart-multiselect-placeholder {
    color: #6f7d88;
    white-space: nowrap;
}

.qisutu-smart-multiselect-chip {
    display: inline-flex;
    align-items: center;
    max-width: 190px;
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid #bfd5dc;
    border-radius: 999px;
    background: #edf7fa;
    color: #005a70;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qisutu-smart-multiselect-chip-more {
    flex: 0 0 auto;
    background: #f2f4f6;
    border-color: #d8e0e5;
    color: #53616c;
}

.qisutu-smart-multiselect-meta {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    color: #00657d;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.qisutu-smart-multiselect-chevron {
    font-size: 18px;
    line-height: 1;
    transform: translateY(-1px);
}

.qisutu-smart-multiselect-trigger[aria-expanded="true"] .qisutu-smart-multiselect-chevron {
    transform: rotate(180deg) translateY(1px);
}

.qisutu-smart-multiselect-overlay {
    position: fixed;
    inset: 0;
    z-index: 4600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(22, 35, 45, 0.56);
    backdrop-filter: blur(2px);
}

.qisutu-smart-multiselect-overlay[hidden] {
    display: none;
}

.qisutu-smart-multiselect-dialog {
    display: grid;
    grid-template-rows: auto auto auto minmax(180px, 1fr) auto;
    width: min(680px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    overflow: hidden;
    border: 1px solid #cbd8e2;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(19, 38, 50, 0.28);
}

.qisutu-smart-multiselect-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 19px 20px 16px;
    border-bottom: 1px solid #e1e8ed;
}

.qisutu-smart-multiselect-header-text {
    min-width: 0;
}

.qisutu-smart-multiselect-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: #71808c;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.qisutu-smart-multiselect-header h2 {
    margin: 0;
    color: #1e2933;
    font-size: 21px;
    line-height: 1.25;
}

.qisutu-smart-multiselect-close {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid #cbd8e2;
    border-radius: 8px;
    background: #fff;
    color: #40515d;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.qisutu-smart-multiselect-close:hover,
.qisutu-smart-multiselect-close:focus-visible {
    border-color: #00657d;
    color: #00657d;
    outline: none;
}

.qisutu-smart-multiselect-search {
    position: relative;
    padding: 15px 20px 10px;
}

.qisutu-smart-multiselect-search input {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px 9px 40px;
    border: 1px solid #cbd8e2;
    border-radius: 8px;
    background: #fff;
    color: #1e2933;
    font: inherit;
}

.qisutu-smart-multiselect-search input:focus {
    outline: none;
    border-color: #00657d;
    box-shadow: 0 0 0 3px rgba(0, 101, 125, 0.12);
}

.qisutu-smart-multiselect-search-icon {
    position: absolute;
    left: 34px;
    top: 50%;
    color: #667784;
    font-size: 22px;
    transform: translateY(-36%);
    pointer-events: none;
}

.qisutu-smart-multiselect-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 20px 12px;
}

.qisutu-smart-multiselect-dialog-count {
    color: #42535f;
    font-size: 13px;
}

.qisutu-smart-multiselect-toolbar-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.qisutu-smart-multiselect-list {
    min-height: 180px;
    margin: 0 20px;
    overflow: auto;
    border: 1px solid #d8e2e8;
    border-radius: 9px;
    background: #fbfcfd;
}

.qisutu-smart-multiselect-option {
    position: relative;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 45px;
    padding: 8px 12px;
    border-bottom: 1px solid #e6ecef;
    color: #24343f;
    cursor: pointer;
}

.qisutu-smart-multiselect-option:last-child {
    border-bottom: 0;
}

.qisutu-smart-multiselect-option:hover {
    background: #edf7fa;
}

.qisutu-smart-multiselect-option[aria-selected="true"] {
    background: #e5f4f8;
    color: #004f63;
    font-weight: 750;
}

.qisutu-smart-multiselect-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.qisutu-smart-multiselect-checkmark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    border: 2px solid #aebdc7;
    border-radius: 5px;
    background: #fff;
    color: transparent;
    font-size: 14px;
    font-weight: 900;
}

.qisutu-smart-multiselect-option[aria-selected="true"] .qisutu-smart-multiselect-checkmark {
    border-color: #00657d;
    background: #00657d;
    color: #fff;
}

.qisutu-smart-multiselect-option:focus-within {
    outline: 2px solid #76aebe;
    outline-offset: -2px;
}

.qisutu-smart-multiselect-option-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.qisutu-smart-multiselect-no-results {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 20px;
    color: #71808c;
    text-align: center;
}

.qisutu-smart-multiselect-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px 19px;
    border-top: 1px solid #e1e8ed;
}

@media (max-width: 760px) {
    .qisutu-smart-multiselect-overlay {
        align-items: flex-end;
        padding: 10px;
    }

    .qisutu-smart-multiselect-dialog {
        max-height: calc(100vh - 20px);
        border-radius: 13px 13px 9px 9px;
    }

    .qisutu-smart-multiselect-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .qisutu-smart-multiselect-toolbar-buttons {
        justify-content: flex-start;
    }

    .qisutu-smart-multiselect-chip {
        max-width: 120px;
    }
}

/* Response templates */
.qisutu-response-template-attachment-block {
    margin-top: 20px;
}

.qisutu-response-template-admin-attachments {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.qisutu-response-template-admin-attachment {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 12px;
    border: 1px solid #d7e0ea;
    border-radius: 8px;
    background: #f8fafc;
}

.qisutu-response-template-reply-attachments {
    margin: 10px 0 12px;
    padding: 10px 12px;
    border: 1px solid #bcd2ec;
    border-radius: 8px;
    background: #f2f7fd;
}

.qisutu-response-template-reply-attachments > strong {
    display: block;
    margin-bottom: 7px;
    color: #244b74;
}

.qisutu-response-template-slot {
    min-height: 1px;
}

@media (max-width: 720px) {
    .qisutu-response-template-admin-attachment {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Hierarchical service selector */
.qisutu-service-tree-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.qisutu-service-tree {
    position: relative;
    width: 100%;
}

.qisutu-service-tree-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 41px;
    padding: 8px 12px;
    border: 1px solid #ccd8e3;
    border-radius: 8px;
    background: #fff;
    color: #1f2937;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.qisutu-service-tree-button:hover {
    border-color: #8eb1c4;
    background: #fbfdfe;
}

.qisutu-service-tree-button:focus-visible,
.qisutu-service-tree-button[aria-expanded="true"] {
    border-color: #00617a;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(0, 97, 122, 0.13);
}

.qisutu-service-tree-button:disabled {
    cursor: not-allowed;
    opacity: 0.66;
}

.qisutu-service-tree-button-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qisutu-service-tree-button-arrow {
    flex: 0 0 auto;
    color: #476274;
    font-size: 12px;
    transition: transform 0.16s ease;
}

.qisutu-service-tree-button[aria-expanded="true"] .qisutu-service-tree-button-arrow {
    transform: rotate(180deg);
}

.qisutu-service-tree-panel {
    position: absolute;
    z-index: 1800;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    min-width: 290px;
    max-height: min(460px, 62vh);
    overflow: hidden;
    border: 1px solid #c7d4de;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(23, 44, 59, 0.2);
}

.qisutu-service-tree-panel[hidden] {
    display: none;
}

.qisutu-service-tree-search-wrap {
    padding: 11px;
    border-bottom: 1px solid #e1e8ed;
    background: #f7fafc;
}

.qisutu-service-tree-search {
    width: 100%;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid #ccd8e3;
    border-radius: 7px;
    background: #fff;
    color: #1f2937;
    font: inherit;
}

.qisutu-service-tree-search:focus {
    border-color: #00617a;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(0, 97, 122, 0.11);
}

.qisutu-service-tree-list {
    max-height: min(390px, 52vh);
    overflow: auto;
    padding: 7px;
}

.qisutu-service-tree-empty-option {
    display: block;
    width: 100%;
    margin: 0 0 5px;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid #e5ebef;
    border-radius: 6px;
    background: transparent;
    color: #5d6d79;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.qisutu-service-tree-empty-option:hover {
    background: #edf5f8;
    color: #004f66;
}

.qisutu-service-tree-item {
    min-width: 0;
}

.qisutu-service-tree-row {
    display: flex;
    align-items: stretch;
    min-width: 0;
    border-radius: 7px;
}

.qisutu-service-tree-row:hover {
    background: #edf5f8;
}

.qisutu-service-tree-row-selected {
    background: #dceef4;
    color: #004f66;
}

.qisutu-service-tree-row-structural {
    color: #536876;
    font-weight: 600;
}

.qisutu-service-tree-node-toggle,
.qisutu-service-tree-node-spacer {
    display: inline-flex;
    flex: 0 0 28px;
    align-items: center;
    justify-content: center;
    width: 28px;
    min-height: 38px;
}

.qisutu-service-tree-node-toggle {
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #00617a;
    font-size: 11px;
    cursor: pointer;
}

.qisutu-service-tree-node-toggle:hover,
.qisutu-service-tree-node-toggle:focus-visible {
    background: rgba(0, 97, 122, 0.12);
    outline: 0;
}

.qisutu-service-tree-node-label {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 9px 8px 2px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.qisutu-service-tree-node-label:disabled {
    opacity: 1;
    cursor: default;
}

.qisutu-service-tree-node-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qisutu-service-tree-node-meta {
    flex: 0 0 auto;
    max-width: 42%;
    overflow: hidden;
    color: #687985;
    font-size: 12px;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qisutu-service-tree-children {
    margin-left: 18px;
    padding-left: 5px;
    border-left: 1px solid #d8e2e8;
}

.qisutu-service-tree-no-results {
    padding: 18px 12px;
    color: #677784;
    text-align: center;
}

@media (max-width: 720px) {
    .qisutu-service-tree-panel {
        min-width: 100%;
        max-height: 58vh;
    }

    .qisutu-service-tree-node-meta {
        display: none;
    }
}

/* Checklists */
.qisutu-checklist-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.qisutu-checklist-item-header h3,
.qisutu-checklist-item-header p {
    margin-top: 0;
}

.qisutu-checklist-admin-items {
    display: grid;
    gap: 10px;
}

.qisutu-checklist-admin-item {
    display: grid;
    grid-template-columns: auto minmax(260px, 1fr) 120px auto auto;
    grid-template-areas:
        "drag name sort required actions"
        "drag description description description actions";
    align-items: end;
    gap: 12px;
    padding: 12px;
    border: 1px solid #d7e1e8;
    border-radius: 8px;
    background: #f8fbfd;
}

.qisutu-checklist-admin-item-name {
    grid-area: name;
}

.qisutu-checklist-admin-item-description {
    grid-area: description;
}

.qisutu-checklist-admin-item-description textarea {
    min-height: 78px;
    resize: vertical;
}

.qisutu-checklist-admin-item-sort {
    grid-area: sort;
}

.qisutu-checklist-admin-item-actions {
    grid-area: actions;
    align-self: center;
    display: grid;
    gap: 8px;
}

.qisutu-checklist-drag-handle {
    grid-area: drag;
    align-self: center;
    color: #748492;
    font-size: 18px;
}

.qisutu-checklist-drag-handle[draggable="true"] {
    cursor: grab;
}

.qisutu-checklist-admin-item-dragging {
    opacity: 0.55;
    outline: 2px solid #08738c;
}

.qisutu-checklist-required-checkbox {
    grid-area: required;
    align-self: center;
    margin-bottom: 8px;
    white-space: nowrap;
}

.qisutu-checklist-assignment-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.qisutu-checklist-assignment-columns > div {
    min-width: 0;
    padding: 14px;
    border: 1px solid #d7e1e8;
    border-radius: 8px;
    background: #f8fbfd;
}

.qisutu-checklist-assignment-columns h3 {
    margin: 0 0 10px;
}

.qisutu-checklist-assignment-link {
    display: block;
    padding: 7px 9px;
    border-radius: 6px;
    color: #005a73;
    text-decoration: none;
}

.qisutu-checklist-assignment-link:hover {
    background: #e7f2f6;
}

.qisutu-ticket-checklist-overall-progress,
.qisutu-ticket-checklist-add-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qisutu-ticket-checklist-overall-progress {
    margin-bottom: 12px;
}

.qisutu-ticket-checklist-progress-track {
    flex: 1 1 auto;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #dce7ec;
}

.qisutu-ticket-checklist-progress-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #08738c;
    transition: width 0.2s ease;
}

.qisutu-ticket-checklist-list {
    display: grid;
    gap: 10px;
}

.qisutu-ticket-checklist {
    border: 1px solid #d7e1e8;
    border-radius: 8px;
    background: #fff;
}

.qisutu-ticket-checklist summary {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 11px;
    cursor: pointer;
    font-weight: 700;
}

.qisutu-ticket-checklist-complete summary {
    color: #1c7337;
}

.qisutu-ticket-checklist-description {
    margin: 0;
    padding: 0 11px 9px;
    color: #607080;
    font-size: 12px;
}

.qisutu-ticket-checklist > .qisutu-ticket-checklist-progress-track {
    margin: 0 11px 10px;
}

.qisutu-ticket-checklist-items {
    border-top: 1px solid #e3ebef;
}

.qisutu-ticket-checklist-item-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 8px;
    padding: 9px 11px;
    border-bottom: 1px solid #edf2f5;
}

.qisutu-ticket-checklist-item-form label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    cursor: pointer;
}

.qisutu-ticket-checklist-item-form input[type="checkbox"] {
    margin-top: 2px;
}

.qisutu-ticket-checklist-item-content {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.qisutu-ticket-checklist-item-text {
    font-weight: 700;
}

.qisutu-ticket-checklist-item-done .qisutu-ticket-checklist-item-text {
    color: #6c7a84;
    text-decoration: line-through;
}

.qisutu-ticket-checklist-item-meta {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.qisutu-ticket-checklist-required {
    align-self: start;
    padding: 2px 6px;
    border-radius: 999px;
    background: #fff0e7;
    color: #a33f00;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.qisutu-ticket-checklist-details-button {
    width: 100%;
}

.qisutu-ticket-checklist-completion {
    grid-column: 1 / -1;
    padding-left: 26px;
    color: #71808b;
    font-size: 10px;
}

.qisutu-ticket-checklist-details-overlay {
    position: fixed;
    z-index: 2200;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.58);
}

.qisutu-ticket-checklist-details-overlay[hidden] {
    display: none;
}

.qisutu-ticket-checklist-details-dialog {
    width: min(620px, 100%);
    max-height: min(720px, calc(100vh - 48px));
    overflow-y: auto;
    padding: 22px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.32);
}

.qisutu-ticket-checklist-details-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.qisutu-ticket-checklist-details-header h3 {
    margin: 0;
}

.qisutu-ticket-checklist-details-close {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--qisutu-border);
    border-radius: 50%;
    background: #fbfdfe;
    color: var(--qisutu-muted);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.qisutu-ticket-checklist-details-name {
    display: block;
    margin-bottom: 10px;
    color: var(--qisutu-text);
}

.qisutu-ticket-checklist-details-content {
    color: #425463;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.qisutu-ticket-checklist-remove-form {
    display: flex;
    justify-content: flex-end;
    padding: 9px 11px;
}

.qisutu-ticket-checklist-add-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #d7e1e8;
}

.qisutu-ticket-checklist-add-form > label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

.qisutu-ticket-checklist-add-row select {
    min-width: 0;
    flex: 1 1 auto;
}

@media (max-width: 900px) {
    .qisutu-checklist-admin-item {
        grid-template-columns: 1fr;
        grid-template-areas:
            "name"
            "description"
            "sort"
            "required"
            "actions";
        align-items: stretch;
    }

    .qisutu-checklist-drag-handle {
        display: none;
    }

    .qisutu-checklist-assignment-columns {
        grid-template-columns: 1fr;
    }
}

.qisutu-checklist-item-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

/* Postmaster filters */
.qisutu-postmaster-filter-page .qisutu-panel {
    margin-bottom: 1.25rem;
}

.qisutu-panel-header-actions {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.qisutu-postmaster-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
}

.qisutu-postmaster-rows {
    display: grid;
    gap: .9rem;
}

.qisutu-postmaster-row {
    align-items: end;
    background: var(--qisutu-surface-soft, #f5f7f8);
    border: 1px solid var(--qisutu-border, #d7dee2);
    border-radius: .45rem;
    display: grid;
    gap: .75rem;
    grid-template-columns: minmax(180px, 1.15fr) minmax(160px, 1fr) minmax(160px, 1fr) minmax(190px, 1.2fr) auto auto;
    padding: .9rem;
}

.qisutu-postmaster-action-row {
    grid-template-columns: minmax(230px, 1.4fr) minmax(230px, 1.2fr) minmax(210px, 1.2fr) auto;
}

.qisutu-postmaster-condition-row:not(.qisutu-postmaster-condition-has-argument) {
    grid-template-columns: minmax(210px, 1.2fr) minmax(170px, 1fr) minmax(210px, 1.2fr) auto auto;
}

.qisutu-postmaster-action-row.qisutu-postmaster-action-no-target {
    grid-template-columns: minmax(280px, 1.4fr) minmax(260px, 1.2fr) auto;
}

.qisutu-postmaster-action-row.qisutu-postmaster-action-no-value {
    grid-template-columns: minmax(280px, 1.4fr) minmax(280px, 1.2fr) auto;
}

.qisutu-postmaster-action-row.qisutu-postmaster-action-no-target.qisutu-postmaster-action-no-value {
    grid-template-columns: minmax(320px, 1fr) auto;
}

.qisutu-postmaster-row > [hidden],
.qisutu-postmaster-advanced-help[hidden] {
    display: none !important;
}

.qisutu-postmaster-advanced-toggle {
    align-self: center;
    margin: 0;
}

.qisutu-postmaster-advanced-help {
    margin: -.25rem 0 1rem;
}

.qisutu-postmaster-row .qisutu-form-field,
.qisutu-postmaster-row .qisutu-form-checkbox {
    margin: 0;
}

.qisutu-postmaster-row > .qisutu-button {
    margin-bottom: .08rem;
}

.qisutu-postmaster-case {
    align-self: center;
    min-width: 140px;
}

.qisutu-postmaster-form-actions {
    background: var(--qisutu-surface, #fff);
    bottom: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, .08);
    position: sticky;
    z-index: 5;
}

.qisutu-postmaster-test-result {
    border-top: 1px solid var(--qisutu-border, #d7dee2);
    margin-top: 1rem;
    padding-top: 1rem;
}

.qisutu-postmaster-test-filter {
    background: var(--qisutu-surface-soft, #f5f7f8);
    border-radius: .4rem;
    margin-top: .75rem;
    padding: .8rem 1rem;
}

.qisutu-postmaster-test-filter .is-match {
    font-weight: 600;
}

.qisutu-postmaster-test-filter .is-no-match {
    opacity: .72;
}

.qisutu-inline-form {
    display: inline;
}

.qisutu-admin-security-action {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--qisutu-border, #d4dee7);
}

.qisutu-admin-security-action h3 {
    margin: 0 0 .35rem;
}

.qisutu-admin-security-action p {
    margin: 0 0 .85rem;
    color: var(--qisutu-muted, #627286);
}

.qisutu-two-factor-secret {
    display: inline-block;
    max-width: 100%;
    padding: .7rem .9rem;
    border: 1px solid var(--qisutu-border, #d4dee7);
    border-radius: .35rem;
    background: #f5f8fa;
    font-size: 1rem;
    letter-spacing: .08em;
    overflow-wrap: anywhere;
    user-select: all;
}

.qisutu-two-factor-setup-grid {
    display: grid;
    grid-template-columns: minmax(15rem, 18rem) minmax(16rem, 1fr);
    gap: 1.5rem;
    align-items: start;
    margin: 1rem 0 1.25rem;
}

.qisutu-two-factor-setup-grid p {
    margin-top: 0;
}

.qisutu-two-factor-qr {
    width: min(100%, 17rem);
    min-height: 17rem;
    display: grid;
    place-items: center;
    padding: .65rem;
    border: 1px solid var(--qisutu-border, #d4dee7);
    border-radius: .5rem;
    background: #fff;
}

.qisutu-two-factor-qr:not(.qisutu-two-factor-qr-ready) {
    display: none;
}

.qisutu-two-factor-qr svg {
    display: block;
    width: 100%;
    height: auto;
}

.qisutu-recovery-code-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: .45rem .9rem;
    padding: 0;
    list-style: none;
}

.qisutu-postmaster-log-table small {
    overflow-wrap: anywhere;
}

@media (max-width: 1200px) {
    .qisutu-postmaster-row,
    .qisutu-postmaster-action-row,
    .qisutu-postmaster-condition-row:not(.qisutu-postmaster-condition-has-argument),
    .qisutu-postmaster-action-row.qisutu-postmaster-action-no-target,
    .qisutu-postmaster-action-row.qisutu-postmaster-action-no-value,
    .qisutu-postmaster-action-row.qisutu-postmaster-action-no-target.qisutu-postmaster-action-no-value {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .qisutu-two-factor-setup-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .qisutu-panel-header-actions,
    .qisutu-postmaster-checkboxes {
        align-items: stretch;
        flex-direction: column;
    }

    .qisutu-postmaster-row,
    .qisutu-postmaster-action-row,
    .qisutu-postmaster-condition-row:not(.qisutu-postmaster-condition-has-argument),
    .qisutu-postmaster-action-row.qisutu-postmaster-action-no-target,
    .qisutu-postmaster-action-row.qisutu-postmaster-action-no-value,
    .qisutu-postmaster-action-row.qisutu-postmaster-action-no-target.qisutu-postmaster-action-no-value {
        grid-template-columns: 1fr;
    }
}

.qisutu-postmaster-log-meta {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
    margin: 0 0 1.25rem;
}

.qisutu-postmaster-log-meta dt,
.qisutu-postmaster-log-meta dd {
    border-bottom: 1px solid var(--qisutu-border, #d7dee2);
    margin: 0;
    padding: .55rem .7rem;
}

.qisutu-postmaster-log-meta dt {
    font-weight: 700;
}

/* Customer forms and public form administration. */
.qisutu-ticket-form-card-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.qisutu-standard-ticket-card-grid {
    margin-bottom: 1rem;
}

.qisutu-ticket-form-card {
    align-items: flex-start;
    background: var(--qisutu-surface-soft, #f6f8f9);
    border: 1px solid var(--qisutu-border, #d7dee2);
    border-radius: .55rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: space-between;
    min-height: 190px;
    padding: 1.15rem;
}

.qisutu-ticket-form-card h3,
.qisutu-ticket-form-intro h2 {
    margin: 0 0 .45rem;
}

.qisutu-ticket-form-card p,
.qisutu-ticket-form-intro p {
    color: var(--qisutu-text-muted, #617283);
    line-height: 1.5;
    margin: 0;
}

.qisutu-ticket-form-intro { margin-bottom: 1.25rem; }
.qisutu-ticket-form-fields { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qisutu-ticket-form-field-wide { grid-column: 1 / -1; }
.qisutu-ticket-form-fields select[multiple] { height: auto; min-height: 132px; padding: 8px 10px; }
.qisutu-ticket-form-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.qisutu-ticket-form-admin .qisutu-panel + .qisutu-panel { margin-top: 1rem; }
.qisutu-ticket-form-admin .qisutu-assignment-grid { display: grid; gap: .55rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.qisutu-ticket-form-admin .qisutu-admin-form-block { border-top: 1px solid var(--qisutu-border, #d7dee2); margin-top: 1.25rem; padding-top: 1.1rem; }
.qisutu-ticket-form-options { background: var(--qisutu-surface-soft, #f6f8f9); border: 1px solid var(--qisutu-border, #d7dee2); border-radius: .5rem; margin-top: 1.1rem; padding: 1rem; }
.qisutu-ticket-form-options h3 { margin: 0 0 .75rem; }
.qisutu-ticket-form-option-list { display: grid; gap: .55rem; margin-top: .85rem; }
.qisutu-ticket-form-option-row { align-items: center; display: grid; gap: .55rem; grid-template-columns: minmax(0, 1fr) auto; }
.qisutu-ticket-form-option-value { min-width: 0; width: 100%; }
.qisutu-ticket-form-option-add { margin-top: .75rem; }
.qisutu-ticket-form-option-remove { white-space: nowrap; }
@media (max-width: 560px) {
    .qisutu-ticket-form-option-row { grid-template-columns: 1fr; }
    .qisutu-ticket-form-option-remove { justify-self: start; }
}
.qisutu-ticket-form-create-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; }
.qisutu-customer-assignment-summary { align-items: center; background: var(--qisutu-surface-soft, #f6f8f9); border: 1px solid var(--qisutu-border, #d7dee2); border-radius: .5rem; display: flex; gap: 1rem; justify-content: space-between; margin-top: .8rem; padding: .7rem .85rem; }
.qisutu-customer-assignment-all .qisutu-customer-assignment-summary { opacity: .65; }
.qisutu-customer-assignment-overlay { align-items: center; background: rgba(15, 31, 45, .58); display: flex; inset: 0; justify-content: center; padding: 1rem; position: fixed; z-index: 1200; }
.qisutu-customer-assignment-overlay[hidden] { display: none; }
.qisutu-customer-assignment-dialog { background: var(--qisutu-surface, #fff); border-radius: .65rem; box-shadow: 0 22px 70px rgba(15, 31, 45, .3); display: flex; flex-direction: column; max-height: min(820px, calc(100vh - 2rem)); overflow: hidden; width: min(1040px, calc(100vw - 2rem)); }
.qisutu-customer-assignment-dialog > header { align-items: flex-start; border-bottom: 1px solid var(--qisutu-border, #d7dee2); display: flex; gap: 1rem; justify-content: space-between; padding: 1rem 1.1rem; }
.qisutu-customer-assignment-dialog > header h3 { margin: 0; }
.qisutu-customer-assignment-dialog > header p { color: var(--qisutu-text-muted, #617283); margin: .25rem 0 0; }
.qisutu-customer-assignment-close { align-items: center; background: transparent; border: 0; border-radius: .35rem; color: var(--qisutu-text, #1e2935); cursor: pointer; display: inline-flex; font-size: 1.6rem; height: 2rem; justify-content: center; line-height: 1; width: 2rem; }
.qisutu-customer-assignment-close:hover { background: var(--qisutu-surface-soft, #eef3f5); }
.qisutu-customer-assignment-search { padding: .85rem 1.1rem .55rem; }
.qisutu-customer-assignment-search input { width: 100%; }
.qisutu-customer-assignment-status { color: var(--qisutu-text-muted, #617283); min-height: 1.25rem; padding: 0 1.1rem .35rem; }
.qisutu-customer-assignment-results { align-content: start; display: grid; gap: .35rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); min-height: 180px; overflow: auto; padding: .2rem 1.1rem .8rem; }
.qisutu-customer-assignment-item { align-items: center; border: 1px solid var(--qisutu-border, #d7dee2); border-radius: .38rem; cursor: pointer; display: grid; gap: .45rem; grid-template-columns: auto minmax(0, 1fr); min-height: 2.7rem; padding: .38rem .5rem; }
.qisutu-customer-assignment-item:hover { background: var(--qisutu-surface-soft, #f1f6f8); border-color: var(--qisutu-primary, #00627a); }
.qisutu-customer-assignment-item input { margin: 0; }
.qisutu-customer-assignment-item span { min-width: 0; }
.qisutu-customer-assignment-item strong, .qisutu-customer-assignment-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qisutu-customer-assignment-item strong { font-size: .87rem; }
.qisutu-customer-assignment-item small { color: var(--qisutu-text-muted, #617283); font-size: .75rem; margin-top: .08rem; }
.qisutu-customer-assignment-more { align-self: center; margin: 0 1.1rem .8rem; }
.qisutu-customer-assignment-dialog > footer { align-items: center; border-top: 1px solid var(--qisutu-border, #d7dee2); display: flex; gap: 1rem; justify-content: space-between; padding: .8rem 1.1rem; }
.qisutu-customer-assignment-dialog > footer > div { display: flex; gap: .55rem; }
@media (max-width: 620px) {
    .qisutu-customer-assignment-overlay { padding: 0; }
    .qisutu-customer-assignment-dialog { border-radius: 0; max-height: 100vh; min-height: 100vh; width: 100vw; }
    .qisutu-customer-assignment-results { grid-template-columns: 1fr; }
    .qisutu-customer-assignment-dialog > footer { align-items: stretch; flex-direction: column; }
    .qisutu-customer-assignment-dialog > footer > div { justify-content: flex-end; }
}
.qisutu-ticket-form-admin .qisutu-ticket-form-field-list { display: grid; gap: .65rem; }
.qisutu-ticket-form-admin .qisutu-ticket-form-field-card { align-items: center; background: var(--qisutu-surface-soft, #f6f8f9); border: 1px solid var(--qisutu-border, #d7dee2); border-radius: .45rem; display: flex; gap: .75rem; justify-content: space-between; padding: .8rem 1rem; }
.qisutu-ticket-form-admin .qisutu-ticket-form-field-card > div:first-child > span { color: var(--qisutu-text-muted, #617283); display: block; font-size: .85rem; margin-top: .25rem; }
.qisutu-ticket-form-admin .qisutu-ticket-form-field-actions,
.qisutu-ticket-form-admin .qisutu-ticket-form-actions { align-items: center; display: flex; flex-wrap: wrap; gap: .45rem; }
.qisutu-ticket-form-admin .qisutu-ticket-form-field-actions form,
.qisutu-ticket-form-admin .qisutu-ticket-form-actions form { margin: 0; }
.qisutu-ticket-form-admin details { border: 1px solid var(--qisutu-border, #d7dee2); border-radius: .45rem; margin-bottom: .65rem; padding: .75rem; }
.qisutu-ticket-form-admin summary { cursor: pointer; font-weight: 700; }
.qisutu-ticket-form-language-grid { display: grid; gap: .85rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: .8rem; }

@media (max-width: 720px) {
    .qisutu-ticket-form-fields { grid-template-columns: 1fr; }
    .qisutu-ticket-form-field-wide { grid-column: auto; }
    .qisutu-ticket-form-admin .qisutu-ticket-form-field-card { align-items: flex-start; flex-direction: column; }
    .qisutu-ticket-form-language-grid { grid-template-columns: 1fr; }
}

/* Operational dashboard. */
.qisutu-live-dashboard {
    gap: 18px;
}

.qisutu-live-dashboard-header {
    align-items: center;
}

.qisutu-dashboard-update {
    align-items: center;
    color: var(--qisutu-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 13px;
    gap: 10px;
    justify-content: flex-end;
}

.qisutu-dashboard-filter {
    align-items: end;
    background: var(--qisutu-surface);
    border: 1px solid var(--qisutu-border);
    border-radius: var(--qisutu-radius);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(150px, .7fr) minmax(240px, 1.35fr) minmax(170px, .75fr) auto;
    padding: 14px;
}

.qisutu-dashboard-filter-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.qisutu-dashboard-filter-field > span {
    color: var(--qisutu-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.qisutu-dashboard-filter-field select,
.qisutu-dashboard-filter-field input {
    min-width: 0;
    width: 100%;
}

.qisutu-dashboard-filter-queue {
    min-width: 240px;
}

.qisutu-dashboard-custom-dates {
    display: grid;
    gap: 10px;
    grid-column: 1 / span 2;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
}

.qisutu-dashboard-filter-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.qisutu-dashboard-metrics {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.qisutu-dashboard-metric {
    background: var(--qisutu-surface);
    border: 1px solid var(--qisutu-border);
    border-radius: var(--qisutu-radius);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
    color: var(--qisutu-text);
    display: grid;
    gap: 8px;
    min-height: 112px;
    overflow: hidden;
    padding: 15px 16px;
    position: relative;
    text-decoration: none;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.qisutu-dashboard-metric::before {
    background: var(--qisutu-dashboard-accent, var(--qisutu-primary));
    content: '';
    height: 4px;
    inset: 0 0 auto;
    position: absolute;
}

.qisutu-dashboard-metric:hover,
.qisutu-dashboard-metric:focus-visible {
    border-color: var(--qisutu-dashboard-accent, var(--qisutu-primary));
    box-shadow: 0 14px 30px rgba(15, 23, 42, .1);
    transform: translateY(-2px);
}

.qisutu-dashboard-metric-label {
    color: var(--qisutu-muted);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
}

.qisutu-dashboard-metric-value {
    align-self: end;
    font-size: 32px;
    line-height: 1;
}

.qisutu-dashboard-metric-arrow {
    bottom: 12px;
    color: var(--qisutu-dashboard-accent, var(--qisutu-primary));
    font-size: 18px;
    font-weight: 800;
    position: absolute;
    right: 14px;
}

.qisutu-dashboard-metric-primary { --qisutu-dashboard-accent: #00677f; }
.qisutu-dashboard-metric-info { --qisutu-dashboard-accent: #0284c7; }
.qisutu-dashboard-metric-neutral { --qisutu-dashboard-accent: #64748b; }
.qisutu-dashboard-metric-danger { --qisutu-dashboard-accent: #dc2626; }
.qisutu-dashboard-metric-warning { --qisutu-dashboard-accent: #d97706; }
.qisutu-dashboard-metric-customer { --qisutu-dashboard-accent: #7c3aed; }

.qisutu-dashboard-chart-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qisutu-dashboard-chart-card {
    min-width: 0;
    padding: 18px;
}

.qisutu-dashboard-chart-wide {
    grid-column: 1 / -1;
}

.qisutu-dashboard-chart-wrap {
    height: 310px;
    min-width: 0;
    position: relative;
}

.qisutu-dashboard-chart-wrap-compact {
    height: 285px;
}

.qisutu-dashboard-chart-wrap canvas {
    max-height: 100%;
    max-width: 100%;
}

.qisutu-dashboard-data-details {
    border-top: 1px solid var(--qisutu-border);
    margin-top: 12px;
    padding-top: 10px;
}

.qisutu-dashboard-data-details summary {
    color: var(--qisutu-muted);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.qisutu-dashboard-data-details[open] summary {
    margin-bottom: 10px;
}

.qisutu-dashboard-data-table {
    font-size: 13px;
}

.qisutu-dashboard-data-table th,
.qisutu-dashboard-data-table td {
    padding: 7px 9px;
}

.qisutu-dashboard-attention {
    padding: 18px;
}

.qisutu-dashboard-attention-table td {
    vertical-align: middle;
}

.qisutu-dashboard-ticket-title {
    display: block;
    font-weight: 700;
    max-width: 430px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qisutu-dashboard-reason {
    border: 1px solid currentColor;
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    padding: 4px 8px;
    white-space: nowrap;
}

.qisutu-dashboard-reason-danger { background: #fef2f2; color: #b91c1c; }
.qisutu-dashboard-reason-warning { background: #fffbeb; color: #b45309; }
.qisutu-dashboard-reason-customer { background: #f5f3ff; color: #6d28d9; }
.qisutu-dashboard-reason-neutral { background: #f8fafc; color: #475569; }
.qisutu-dashboard-reason-old { background: #fff7ed; color: #c2410c; }

.qisutu-dashboard-no-access {
    background: var(--qisutu-surface);
    border: 1px dashed var(--qisutu-border);
    border-radius: var(--qisutu-radius);
}

.qisutu-dashboard-customer-recent {
    padding: 18px;
}

.qisutu-dashboard-customer-table a {
    font-weight: 700;
}

@media (max-width: 1280px) {
    .qisutu-dashboard-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .qisutu-dashboard-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .qisutu-dashboard-filter-actions {
        justify-content: flex-start;
    }
}

/* Master data CSV imports */
.qisutu-master-import-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.qisutu-master-import-tab-active {
    background: var(--qisutu-primary);
    border-color: var(--qisutu-primary);
    color: #fff;
}

.qisutu-master-import-header {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.qisutu-master-import-header code {
    background: #f1f5f9;
    border: 1px solid var(--qisutu-border);
    border-radius: 7px;
    display: block;
    max-width: 100%;
    overflow-x: auto;
    padding: 10px 12px;
    white-space: nowrap;
}

.qisutu-master-import-rules {
    background: #f8fafc;
    border: 1px solid var(--qisutu-border);
    border-radius: 8px;
    margin-top: 16px;
    padding: 14px 16px;
}

.qisutu-master-import-rules ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.qisutu-master-import-upload {
    align-items: end;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.qisutu-master-import-metrics {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 18px;
}

.qisutu-master-import-metrics > div {
    background: #f4f7fa;
    border-radius: 9px;
    display: grid;
    gap: 5px;
    padding: 12px;
}

.qisutu-master-import-metrics span {
    color: var(--qisutu-muted);
    font-size: 12px;
}

.qisutu-master-import-metrics strong {
    font-size: 20px;
}

.qisutu-master-import-status,
.qisutu-master-import-action {
    border: 1px solid var(--qisutu-border);
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    white-space: nowrap;
}

.qisutu-master-import-status-pending,
.qisutu-master-import-status-imported,
.qisutu-master-import-action-create {
    background: #ecfdf3;
    border-color: #86efac;
    color: #166534;
}

.qisutu-master-import-action-update {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.qisutu-master-import-status-invalid,
.qisutu-master-import-action-error {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.qisutu-master-import-status-cancelled,
.qisutu-master-import-status-expired,
.qisutu-master-import-action-unchanged {
    background: #f8fafc;
    color: #475569;
}

.qisutu-master-import-preview-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

.qisutu-master-import-execute-form {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.qisutu-master-import-execute-form .qisutu-checkbox-row {
    align-items: flex-start;
    display: flex;
    gap: 8px;
    max-width: 520px;
}

.qisutu-master-import-execute-form .qisutu-checkbox-row span,
.qisutu-master-import-execute-form .qisutu-checkbox-row small {
    display: block;
}

@media (max-width: 900px) {
    .qisutu-master-import-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .qisutu-master-import-upload,
    .qisutu-master-import-metrics {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .qisutu-dashboard-chart-grid {
        grid-template-columns: 1fr;
    }

    .qisutu-dashboard-chart-wide {
        grid-column: auto;
    }
}

@media (max-width: 720px) {
    .qisutu-live-dashboard-header {
        align-items: stretch;
        flex-direction: column;
    }

    .qisutu-dashboard-update {
        justify-content: flex-start;
    }

    .qisutu-dashboard-filter {
        grid-template-columns: 1fr;
    }

    .qisutu-dashboard-custom-dates {
        grid-column: auto;
        grid-template-columns: 1fr;
    }

    .qisutu-dashboard-filter-queue {
        min-width: 0;
    }

    .qisutu-dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .qisutu-dashboard-metric {
        min-height: 104px;
    }

    .qisutu-dashboard-chart-wrap,
    .qisutu-dashboard-chart-wrap-compact {
        height: 250px;
    }

    .qisutu-dashboard-attention-table thead {
        display: none;
    }

    .qisutu-dashboard-attention-table,
    .qisutu-dashboard-attention-table tbody,
    .qisutu-dashboard-attention-table tr,
    .qisutu-dashboard-attention-table td {
        display: block;
        width: 100%;
    }

    .qisutu-dashboard-attention-table tr {
        border-bottom: 1px solid var(--qisutu-border);
        padding: 10px 0;
    }

    .qisutu-dashboard-attention-table td {
        border: 0;
        display: grid;
        gap: 10px;
        grid-template-columns: minmax(110px, .45fr) minmax(0, 1fr);
        padding: 5px 0;
    }

    .qisutu-dashboard-attention-table td::before {
        color: var(--qisutu-muted);
        content: attr(data-label);
        font-size: 11px;
        font-weight: 800;
        letter-spacing: .03em;
        text-transform: uppercase;
    }

    .qisutu-dashboard-ticket-title {
        max-width: none;
        white-space: normal;
    }
}

@media (max-width: 460px) {
    .qisutu-dashboard-metrics {
        grid-template-columns: 1fr;
    }
}

/* CMDB */
.qisutu-cmdb-filter {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(220px, 1.5fr) repeat(2, minmax(160px, 1fr)) auto auto auto;
}

.qisutu-cmdb-filter .qisutu-form-field {
    margin: 0;
}

.qisutu-cmdb-type-badge,
.qisutu-cmdb-number {
    color: var(--qisutu-primary);
    font-weight: 800;
}

.qisutu-cmdb-type-card-icon {
    align-items: center;
    background: var(--qisutu-primary);
    border-radius: 12px;
    color: #fff;
    display: inline-flex;
    font-weight: 800;
    height: 42px;
    justify-content: center;
    min-width: 42px;
    padding: 0 10px;
}

.qisutu-cmdb-checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 16px 0;
}

.qisutu-cmdb-assignment {
    margin-top: 18px;
}

.qisutu-cmdb-customer-selection {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.qisutu-cmdb-detail-grid {
    align-items: start;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
}

.qisutu-cmdb-detail-grid > div,
.qisutu-cmdb-detail-grid > aside {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.qisutu-cmdb-core-data {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.qisutu-cmdb-core-data > div {
    background: var(--qisutu-surface-muted, #f4f7fa);
    border-radius: 8px;
    padding: 10px;
}

.qisutu-cmdb-core-data dt,
.qisutu-cmdb-core-data dd {
    margin: 0;
}

.qisutu-cmdb-core-data dt {
    color: var(--qisutu-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.qisutu-cmdb-history,
.qisutu-cmdb-relation-list {
    display: grid;
    gap: 10px;
}

.qisutu-cmdb-history article {
    display: grid;
    gap: 10px;
    grid-template-columns: 12px minmax(0, 1fr);
}

.qisutu-cmdb-history-marker {
    background: var(--qisutu-primary);
    border-radius: 50%;
    height: 10px;
    margin-top: 5px;
    width: 10px;
}

.qisutu-cmdb-history header,
.qisutu-cmdb-relation-list article {
    align-items: start;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    justify-content: space-between;
}

.qisutu-cmdb-history p,
.qisutu-cmdb-history small {
    display: block;
    margin: 3px 0;
}

.qisutu-cmdb-ticket-ci {
    border: 1px solid var(--qisutu-border);
    border-radius: 8px;
    display: grid;
    gap: 5px;
    margin-bottom: 8px;
    padding: 9px;
}

.qisutu-cmdb-ticket-ci a,
.qisutu-cmdb-ticket-ci a span {
    display: block;
}

.qisutu-overlay {
    align-items: flex-start;
    background: rgba(15, 23, 42, .5);
    display: flex;
    inset: 0;
    justify-content: center;
    overflow-y: auto;
    padding: 6vh 18px;
    position: fixed;
    z-index: 1200;
}

.qisutu-overlay[hidden] {
    display: none;
}

.qisutu-overlay-dialog {
    background: var(--qisutu-surface);
    border: 1px solid var(--qisutu-border);
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
    max-width: 760px;
    padding: 20px;
    width: min(100%, 760px);
}

.qisutu-overlay-header {
    align-items: flex-start;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.qisutu-overlay-header h2,
.qisutu-overlay-header p {
    margin: 0 0 5px;
}

.qisutu-overlay-close {
    align-items: center;
    background: transparent;
    border: 1px solid var(--qisutu-border);
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    font-size: 24px;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.qisutu-cmdb-customer-results,
.qisutu-cmdb-ticket-results {
    display: grid;
    gap: 4px;
    max-height: 52vh;
    overflow: auto;
}

.qisutu-cmdb-customer-result {
    align-items: center;
    background: var(--qisutu-surface);
    border: 1px solid var(--qisutu-border);
    border-radius: 6px;
    color: var(--qisutu-text);
    cursor: pointer;
    display: grid;
    gap: 3px 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px 10px;
    text-align: left;
    width: 100%;
}

.qisutu-cmdb-customer-result:hover,
.qisutu-cmdb-customer-result:focus-visible,
.qisutu-overlay-close:hover,
.qisutu-overlay-close:focus-visible {
    background: var(--qisutu-primary);
    border-color: var(--qisutu-primary);
    color: #fff;
}

/* Knowledge base */
.qisutu-knowledge,
.qisutu-knowledge > .qisutu-panel,
.qisutu-knowledge .qisutu-table-wrap {
    min-width: 0;
    max-width: 100%;
}

.qisutu-knowledge-filter {
    display: grid;
    grid-template-columns: minmax(15rem, 2fr) repeat(2, minmax(10rem, 1fr)) auto auto;
    gap: 0.85rem;
    align-items: end;
}

.qisutu-knowledge-table {
    table-layout: fixed;
}

.qisutu-knowledge-table th,
.qisutu-knowledge-table td {
    white-space: normal;
    overflow-wrap: anywhere;
}

.qisutu-knowledge-table th:nth-child(1) { width: 13%; }
.qisutu-knowledge-table th:nth-child(2) { width: 43%; }
.qisutu-knowledge-table th:nth-child(3) { width: 16%; }
.qisutu-knowledge-table th:nth-child(4) { width: 8%; }
.qisutu-knowledge-table th:nth-child(5) { width: 12%; }
.qisutu-knowledge-table th:nth-child(6) { width: 8%; }

.qisutu-knowledge-table-summary {
    display: block;
    margin-top: 2px;
    color: var(--qisutu-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
}

.qisutu-knowledge-filter-customer {
    grid-template-columns: minmax(16rem, 2fr) minmax(12rem, 1fr) auto auto;
}

.qisutu-knowledge-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: 0.9rem;
}

.qisutu-knowledge-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    padding: 1rem;
    color: var(--qisutu-text, #1f2937);
    text-decoration: none;
    border: 1px solid #d6e0e8;
    border-radius: 0.7rem;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.qisutu-knowledge-card:hover,
.qisutu-knowledge-card:focus-visible {
    border-color: #00627a;
    box-shadow: 0 0.55rem 1.25rem rgba(15, 53, 67, 0.12);
    transform: translateY(-1px);
}

.qisutu-knowledge-card p {
    margin: 0;
    color: #607083;
}

.qisutu-knowledge-card-category,
.qisutu-knowledge-number {
    color: #00627a;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.qisutu-knowledge-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0 1rem;
}

.qisutu-knowledge-meta span {
    padding: 0.25rem 0.55rem;
    color: #355064;
    font-size: 0.8rem;
    border-radius: 999px;
    background: #edf3f6;
}

.qisutu-knowledge-article .qisutu-rich-content {
    max-width: 70rem;
    line-height: 1.6;
}

.qisutu-knowledge-queue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 0.45rem 1rem;
    max-height: 16rem;
    overflow: auto;
    padding: 0.65rem;
    border: 1px solid #d6e0e8;
    border-radius: 0.55rem;
}

.qisutu-knowledge-insert-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.55rem;
}

.qisutu-knowledge-insert-dialog {
    width: min(72rem, calc(100vw - 2rem));
    max-height: min(50rem, calc(100vh - 2rem));
    overflow: hidden;
}

.qisutu-knowledge-insert-search {
    display: grid;
    grid-template-columns: auto minmax(12rem, 1fr);
    gap: 0.65rem;
    align-items: center;
    margin: 1rem 0 0.5rem;
}

.qisutu-knowledge-insert-search input {
    width: 100%;
}

.qisutu-knowledge-insert-status {
    min-height: 1.4rem;
    color: #607083;
    font-size: 0.88rem;
}

.qisutu-knowledge-insert-layout {
    display: grid;
    grid-template-columns: minmax(16rem, 0.8fr) minmax(20rem, 1.2fr);
    gap: 0.85rem;
    min-height: 22rem;
    max-height: calc(100vh - 15rem);
}

.qisutu-knowledge-results,
.qisutu-knowledge-preview {
    min-width: 0;
    overflow: auto;
    border: 1px solid #d6e0e8;
    border-radius: 0.6rem;
    background: #fff;
}

.qisutu-knowledge-result {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.75rem;
    color: #1f2937;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #e1e8ed;
    background: #fff;
    cursor: pointer;
}

.qisutu-knowledge-result:hover,
.qisutu-knowledge-result:focus-visible,
.qisutu-knowledge-result-active {
    background: #eaf4f7;
    box-shadow: inset 0.22rem 0 #00627a;
}

.qisutu-knowledge-result span,
.qisutu-knowledge-result small {
    color: #607083;
}

.qisutu-knowledge-result-restricted {
    background: #faf7f2;
}

.qisutu-knowledge-preview {
    padding: 1rem;
}

.qisutu-knowledge-preview h3 {
    margin: 0 0 0.25rem;
}

.qisutu-knowledge-preview-meta {
    margin: 0 0 0.8rem;
    color: #607083;
    font-size: 0.82rem;
}

.qisutu-knowledge-insert-dialog > .qisutu-form-actions {
    margin-top: 0.85rem;
}

@media (max-width: 900px) {
    .qisutu-knowledge-filter,
    .qisutu-knowledge-filter-customer,
    .qisutu-knowledge-insert-layout {
        grid-template-columns: 1fr;
    }

    .qisutu-knowledge-table {
        min-width: 760px;
    }

    .qisutu-knowledge-insert-layout {
        min-height: 0;
        max-height: calc(100vh - 16rem);
        overflow: auto;
    }

    .qisutu-knowledge-results,
    .qisutu-knowledge-preview {
        max-height: 18rem;
    }
}

.qisutu-cmdb-customer-result span {
    color: var(--qisutu-muted);
    font-size: 12px;
}

.qisutu-cmdb-customer-result:hover span,
.qisutu-cmdb-customer-result:focus-visible span {
    color: inherit;
}

@media (max-width: 1050px) {
    .qisutu-cmdb-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .qisutu-cmdb-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .qisutu-cmdb-filter {
        grid-template-columns: 1fr;
    }
    .qisutu-cmdb-customer-result {
        grid-template-columns: 1fr;
    }
}
/* REST API administration */
.qisutu-api-token-created {
    border-color: #5aa873;
    background: #f3fbf5;
}
.qisutu-api-secret-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.qisutu-api-secret-row code {
    flex: 1;
    padding: 12px;
    overflow-wrap: anywhere;
    border: 1px solid #b9d7c1;
    border-radius: 7px;
    background: #fff;
}
.qisutu-api-warning { color: #8a3c21; font-weight: 700; }
.qisutu-api-user-picker { display: flex; gap: 8px; }
.qisutu-api-user-picker input { min-width: 0; flex: 1; }
.qisutu-api-scopes {
    margin: 20px 0;
    padding: 18px;
    border: 1px solid #d6e0e8;
    border-radius: 8px;
}
.qisutu-api-scopes legend { padding: 0 8px; font-weight: 800; }
.qisutu-api-scope-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.qisutu-api-scope-grid section {
    padding: 12px;
    border: 1px solid #e0e7ed;
    border-radius: 7px;
    background: #f8fafb;
}
.qisutu-api-scope-grid h3 { margin: 0 0 10px; font-size: 15px; }
.qisutu-api-scope-grid .qisutu-form-checkbox { margin: 7px 0; }
.qisutu-api-advanced { margin: 16px 0; padding: 12px; border: 1px solid #d6e0e8; border-radius: 7px; }
.qisutu-api-advanced summary { cursor: pointer; font-weight: 700; }
.qisutu-api-scope-summary { max-width: 360px; font-size: 13px; }
.qisutu-api-doc-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 15px; }
.qisutu-api-doc-grid > div { display: grid; gap: 7px; }
.qisutu-api-doc-grid code,
.qisutu-api-doc-grid pre { margin: 0; padding: 10px; overflow: auto; border-radius: 6px; background: #f2f6f8; }
.qisutu-api-log { padding: 18px; }
.qisutu-api-log > summary { cursor: pointer; }
.qisutu-api-result { display: inline-block; min-width: 42px; padding: 3px 7px; text-align: center; border-radius: 999px; font-weight: 800; }
.qisutu-api-result.is-success { color: #176b36; background: #e6f6eb; }
.qisutu-api-result.is-error { color: #a52b24; background: #fdeceb; }
.qisutu-api-user-modal { width: min(760px, calc(100vw - 32px)); }
.qisutu-api-user-results { max-height: 390px; overflow: auto; border: 1px solid #d7e0e7; border-radius: 7px; }
.qisutu-api-user-result {
    display: grid;
    width: 100%;
    padding: 9px 12px;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #e3e9ee;
    background: #fff;
    cursor: pointer;
}
.qisutu-api-user-result:hover,
.qisutu-api-user-result:focus { color: #fff; background: #00617a; }
.qisutu-api-user-result span { margin-top: 2px; font-size: 12px; }
@media (max-width: 720px) {
    .qisutu-api-secret-row,
    .qisutu-api-user-picker { align-items: stretch; flex-direction: column; }
}

/* Flexible reports */
.qisutu-reports,
.qisutu-report-designer,
.qisutu-report-builder-grid,
.qisutu-report-step,
.qisutu-report-meta-panel {
    min-width: 0;
}
.qisutu-report-list-table td:first-child small {
    display: block;
    margin-top: 3px;
    color: #647387;
}
.qisutu-report-designer {
    display: grid;
    gap: 24px;
}
.qisutu-report-builder-grid {
    display: grid;
    gap: 24px;
}
.qisutu-reports .qisutu-report-meta-panel,
.qisutu-reports .qisutu-report-step,
.qisutu-reports .qisutu-report-actions-panel,
.qisutu-reports .qisutu-report-preview-panel {
    padding: 26px;
}
.qisutu-report-meta-panel .qisutu-panel-header {
    margin-bottom: 22px;
}
.qisutu-reports .qisutu-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    align-items: start;
    gap: 20px 24px;
}
.qisutu-reports .qisutu-form-grid > label,
.qisutu-report-step > label,
.qisutu-report-sharing-field {
    display: grid;
    min-width: 0;
    margin: 0;
    gap: 8px;
    color: var(--qisutu-text);
    font-weight: 700;
}
.qisutu-reports .qisutu-form-grid > .qisutu-hidden {
    display: none;
}
.qisutu-reports .qisutu-form-grid-wide {
    grid-column: 1 / -1;
}
.qisutu-report-sharing-control {
    position: relative;
    min-width: 0;
}
.qisutu-report-sharing-toggle {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    padding: 8px 11px;
    border: 1px solid var(--qisutu-border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--qisutu-text);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    gap: 12px;
}
.qisutu-report-sharing-toggle > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.qisutu-report-sharing-toggle:hover {
    border-color: #9fb3c2;
}
.qisutu-report-sharing-toggle:focus {
    border-color: var(--qisutu-primary);
    outline: 3px solid rgba(0, 97, 122, 0.12);
    outline-offset: 0;
}
.qisutu-report-sharing-chevron {
    flex: 0 0 auto;
    color: #647387;
    font-size: 14px;
    transition: transform 0.15s ease;
}
.qisutu-report-sharing-toggle[aria-expanded="true"] .qisutu-report-sharing-chevron {
    transform: rotate(180deg);
}
.qisutu-report-sharing-menu {
    position: absolute;
    z-index: 60;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    display: grid;
    max-height: 320px;
    overflow-y: auto;
    padding: 7px;
    border: 1px solid #cbd8e2;
    border-radius: 9px;
    background: #ffffff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
    gap: 3px;
}
.qisutu-report-sharing-menu.qisutu-hidden {
    display: none;
}
.qisutu-report-sharing-private,
.qisutu-report-sharing-group {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--qisutu-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.qisutu-report-sharing-private {
    font-weight: 700;
}
.qisutu-report-sharing-menu-label {
    padding: 9px 10px 5px;
    border-top: 1px solid #e1e8ed;
    color: #647387;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}
.qisutu-report-sharing-group {
    display: grid;
    gap: 2px;
}
.qisutu-report-sharing-group small {
    overflow-wrap: anywhere;
    color: #647387;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
}
.qisutu-report-sharing-private:hover,
.qisutu-report-sharing-group:hover {
    background: #edf7fa;
}
.qisutu-report-sharing-private.is-selected,
.qisutu-report-sharing-group[aria-selected="true"] {
    border-color: rgba(0, 97, 122, 0.3);
    background: var(--qisutu-primary-soft);
    color: var(--qisutu-primary);
}
.qisutu-report-sharing-group[aria-selected="true"] small {
    color: inherit;
}
.qisutu-report-designer input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.qisutu-report-designer select,
.qisutu-report-designer textarea {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    border: 1px solid var(--qisutu-border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--qisutu-text);
    font: inherit;
}
.qisutu-report-designer input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.qisutu-report-designer select:not([multiple]) {
    min-height: 42px;
    padding: 8px 11px;
}
.qisutu-report-designer textarea {
    min-height: 92px;
    padding: 10px 11px;
    line-height: 1.45;
    resize: vertical;
}
.qisutu-report-designer select[multiple] {
    min-height: 118px;
    padding: 7px;
}
.qisutu-report-designer input:focus,
.qisutu-report-designer select:focus,
.qisutu-report-designer textarea:focus {
    border-color: var(--qisutu-primary);
    outline: 3px solid rgba(0, 97, 122, 0.12);
    outline-offset: 0;
}
.qisutu-report-designer label > small {
    color: #647387;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
}
.qisutu-reports .qisutu-report-step {
    position: relative;
    padding-top: 30px;
}
.qisutu-report-step > h2 + p {
    margin-top: 7px;
}
.qisutu-report-step > p + label,
.qisutu-report-step > p + .qisutu-form-grid {
    margin-top: 20px;
}
.qisutu-report-step-number {
    position: absolute;
    top: -15px;
    left: 24px;
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #00617a;
    box-shadow: 0 5px 12px rgba(0, 75, 94, 0.2);
    color: #ffffff;
    font-weight: 800;
}
.qisutu-report-source-description {
    margin-top: 13px;
    color: #647387;
    line-height: 1.5;
}
.qisutu-report-filter-logic {
    display: grid;
    max-width: 420px;
    margin: 20px 0 16px;
    gap: 8px;
}
.qisutu-report-filter-list {
    display: grid;
    gap: 12px;
}
.qisutu-report-filter-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.1fr) minmax(145px, 0.8fr) minmax(220px, 1.6fr) auto;
    align-items: center;
    padding: 12px;
    border: 1px solid #dce5ec;
    border-radius: 9px;
    background: #f8fbfd;
    gap: 12px;
}
.qisutu-report-filter-value {
    display: flex;
    min-width: 0;
    gap: 9px;
}
.qisutu-report-filter-value > * { min-width: 0; flex: 1; }
.qisutu-report-filter-empty {
    line-height: 1.5;
}
.qisutu-report-step .qisutu-form-grid {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
}
.qisutu-report-choice-fieldset {
    min-width: 0;
    margin-top: 24px;
    padding: 20px;
    border: 1px solid #d6e0e8;
    border-radius: 10px;
    background: #fbfdfe;
}
.qisutu-report-choice-fieldset legend {
    padding: 0 8px;
    font-weight: 800;
}
.qisutu-report-choice-fieldset legend small {
    color: #647387;
    font-weight: 400;
}
.qisutu-report-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 20px;
}
.qisutu-report-choice-grid .qisutu-form-checkbox {
    min-width: 0;
    min-height: 34px;
    margin: 0;
    padding: 6px 8px;
    border-radius: 7px;
    line-height: 1.35;
}
.qisutu-report-choice-grid .qisutu-form-checkbox:hover {
    background: #edf7fa;
}
.qisutu-report-choice-grid input[type="checkbox"] {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    margin: 0;
    accent-color: var(--qisutu-primary);
}
.qisutu-report-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}
.qisutu-report-preview-duration { color: #647387; font-variant-numeric: tabular-nums; }
.qisutu-report-chart-wrap { position: relative; height: 370px; margin-bottom: 18px; }
.qisutu-report-detail-table { min-width: 850px; }
.qisutu-report-loading { padding: 30px; text-align: center; color: #00617a; font-weight: 800; }
.qisutu-report-option-dialog { width: min(720px,calc(100vw - 32px)); }
.qisutu-report-option-dialog > label { display: grid; padding: 0 18px 12px; gap: 6px; }
.qisutu-report-option-results { max-height: 360px; margin: 0 18px; overflow: auto; border: 1px solid #d6e0e8; border-radius: 7px; }
.qisutu-report-option-item { display: flex; align-items: center; padding: 9px 11px; gap: 9px; border-bottom: 1px solid #e4eaef; cursor: pointer; }
.qisutu-report-option-item:last-child { border-bottom: 0; }
.qisutu-report-option-item:hover { background: #edf7fa; }
.qisutu-report-option-actions { display: flex; justify-content: flex-end; padding: 14px 18px 18px; gap: 8px; }
@media (max-width: 1100px) {
    .qisutu-report-step .qisutu-form-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}
@media (max-width: 800px) {
    .qisutu-reports .qisutu-form-grid,
    .qisutu-report-step .qisutu-form-grid {
        grid-template-columns: 1fr;
    }
    .qisutu-reports .qisutu-form-grid-wide {
        grid-column: auto;
    }
    .qisutu-report-filter-row { grid-template-columns: 1fr; }
    .qisutu-report-filter-row > button { justify-self: end; }
    .qisutu-report-chart-wrap { height: 290px; }
}
@media (max-width: 560px) {
    .qisutu-reports .qisutu-report-meta-panel,
    .qisutu-reports .qisutu-report-step,
    .qisutu-reports .qisutu-report-actions-panel,
    .qisutu-reports .qisutu-report-preview-panel {
        padding-right: 18px;
        padding-left: 18px;
    }
    .qisutu-report-choice-fieldset {
        padding: 16px 12px;
    }
    .qisutu-report-actions {
        align-items: stretch;
        flex-direction: column;
    }
}
.qisutu-inline-form{display:inline;margin:0;padding:0}.qisutu-link-button{appearance:none;border:0;background:transparent;font:inherit;cursor:pointer;padding:0;text-align:left;color:inherit}

/* Communication log */
.qisutu-communication-filter { padding-bottom: 18px; }
.qisutu-communication-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    padding: 0 20px 12px;
    gap: 12px;
}
.qisutu-communication-search { grid-column: span 2; }
.qisutu-communication-kpis {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    margin: 18px 0;
    gap: 12px;
}
.qisutu-communication-kpi {
    min-width: 0;
    padding: 15px;
    border: 1px solid #d7e1e8;
    border-top: 4px solid #00617a;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(24, 47, 65, .05);
}
.qisutu-communication-kpi.is-success { border-top-color: #27824c; }
.qisutu-communication-kpi.is-warning { border-top-color: #c8871c; }
.qisutu-communication-kpi.is-error { border-top-color: #bd342d; }
.qisutu-communication-kpi span { display: block; margin-bottom: 6px; color: #647387; font-size: 12px; }
.qisutu-communication-kpi strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.qisutu-communication-list { min-width: 0; padding: 0 20px 18px; }
.qisutu-communication-list-head,
.qisutu-communication-list-row {
    display: grid;
    grid-template-columns: 72px 125px 105px minmax(170px, 1fr) minmax(145px, .8fr) minmax(145px, .8fr) 86px;
    min-width: 0;
    align-items: center;
    gap: 10px;
}
.qisutu-communication-list-head {
    min-height: 34px;
    padding: 0 10px;
    border-bottom: 1px solid #cfdbe3;
    color: #647387;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.qisutu-communication-list-row {
    min-height: 52px;
    padding: 7px 10px;
    border-bottom: 1px solid #dce5eb;
    color: #1f2d38;
    text-decoration: none;
    transition: background-color .15s ease, box-shadow .15s ease;
}
.qisutu-communication-list-row:nth-child(odd) { background: #f8fafb; }
.qisutu-communication-list-row:hover,
.qisutu-communication-list-row:focus-visible {
    position: relative;
    z-index: 1;
    outline: 0;
    background: #e6f2f6;
    box-shadow: inset 4px 0 #00617a;
}
.qisutu-communication-list-row > span { min-width: 0; overflow-wrap: anywhere; }
.qisutu-communication-list-row strong,
.qisutu-communication-list-row small { display: block; }
.qisutu-communication-list-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qisutu-communication-list-row small { margin-top: 2px; overflow: hidden; color: #647387; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.qisutu-communication-list-status { display: flex; align-items: center; gap: 7px; }
.qisutu-communication-list-status i {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    place-items: center;
    border-radius: 50%;
    color: #315263;
    background: #e9f1f5;
    font-style: normal;
    font-weight: 900;
}
.qisutu-communication-list-status em { overflow: hidden; font-size: 11px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.qisutu-communication-list-row.is-success .qisutu-communication-list-status i { color: #176b36; background: #e5f5e9; }
.qisutu-communication-list-row.is-warning .qisutu-communication-list-status i { color: #855307; background: #fff1d5; }
.qisutu-communication-list-row.is-error .qisutu-communication-list-status i { color: #9d2b25; background: #fdebea; }
.qisutu-communication-list-row.is-running .qisutu-communication-list-status i { color: #075f7b; background: #e2f3f8; }
.qisutu-communication-list-direction strong { font-size: 20px; line-height: 1; }
.qisutu-communication-list-time,
.qisutu-communication-list-duration { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qisutu-communication-pagination {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}
.qisutu-communication-pagination a,
.qisutu-communication-pagination strong {
    display: grid;
    min-width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid #cedae2;
    border-radius: 5px;
    color: #005a73;
    background: #fff;
    text-decoration: none;
}
.qisutu-communication-pagination a:hover { color: #fff; border-color: #00617a; background: #00617a; }
.qisutu-communication-pagination strong { color: #fff; border-color: #00617a; background: #00617a; }
.qisutu-communication-pagination span { margin-left: 5px; color: #647387; font-size: 12px; white-space: nowrap; }
.qisutu-communication-pagination-bottom { padding: 0 20px 18px; }
.qisutu-communication-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 9px;
    border-radius: 999px;
    color: #315263;
    background: #e9f1f5;
    font-size: 12px;
    font-weight: 800;
}
.qisutu-communication-status.is-success { color: #176b36; background: #e5f5e9; }
.qisutu-communication-status.is-warning { color: #855307; background: #fff1d5; }
.qisutu-communication-status.is-error { color: #9d2b25; background: #fdebea; }
.qisutu-communication-status.is-running { color: #075f7b; background: #e2f3f8; }
.qisutu-communication-detail-backdrop {
    position: fixed;
    z-index: 2000;
    inset: 0 0 0 248px;
    display: grid;
    padding: 16px;
    overflow: hidden;
    place-items: center;
    background: rgba(20, 36, 49, .55);
}
html.qisutu-sidebar-collapsed .qisutu-communication-detail-backdrop { left: 68px; }
.qisutu-communication-detail {
    display: flex;
    width: min(1040px, 100%);
    height: min(780px, calc(100vh - 32px));
    max-height: calc(100vh - 32px);
    flex-direction: column;
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(0, 0, 0, .28);
}
.qisutu-communication-detail .qisutu-modal-header {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 22px;
    border-bottom: 1px solid #d7e1e8;
    gap: 18px;
}
.qisutu-communication-detail .qisutu-modal-header h2 { margin: 0 0 4px; }
.qisutu-communication-detail .qisutu-modal-header p { margin: 0; color: #647387; }
.qisutu-communication-detail .qisutu-modal-close {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border: 1px solid #d0dce4;
    border-radius: 50%;
    color: #405465;
    background: #fff;
    font-size: 26px;
    line-height: 1;
    text-decoration: none;
}
.qisutu-communication-detail .qisutu-modal-close:hover { color: #fff; background: #00617a; }
.qisutu-communication-detail-content {
    min-height: 0;
    flex: 1 1 auto;
    padding: 18px 22px 22px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.qisutu-communication-detail-context {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 0;
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #dbe5eb;
    border-radius: 8px;
    background: #f6f9fa;
}
.qisutu-communication-detail-context > .qisutu-communication-status { margin-right: 14px; }
.qisutu-communication-detail-context > span {
    min-width: 120px;
    padding: 0 14px;
    border-left: 1px solid #d8e2e8;
}
.qisutu-communication-detail-context small,
.qisutu-communication-detail-context b { display: block; }
.qisutu-communication-detail-context small { margin-bottom: 2px; color: #647387; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.qisutu-communication-detail-context b { overflow-wrap: anywhere; font-size: 13px; }
.qisutu-communication-detail-context .qisutu-communication-detail-result { min-width: 230px; flex: 1 1 230px; }
.qisutu-communication-protocol-details { min-width: 0; }
.qisutu-communication-detail-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 16px;
}
.qisutu-communication-detail-section-head h3 { margin: 0; }
.qisutu-communication-detail-section-head p { margin: 3px 0 0; color: #647387; font-size: 13px; }
.qisutu-communication-step-count {
    display: grid;
    min-width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #00617a;
    font-size: 12px;
}
.qisutu-communication-detail-extra {
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid #dbe5eb;
    border-radius: 7px;
    background: #fff;
}
.qisutu-communication-detail-extra > summary {
    padding: 11px 13px;
    color: #15384a;
    background: #f6f9fa;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}
.qisutu-communication-detail-extra[open] > summary { border-bottom: 1px solid #dbe5eb; }
.qisutu-communication-message-meta { margin-bottom: 0; }
.qisutu-communication-message-meta dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); margin: 0; }
.qisutu-communication-message-meta dt,
.qisutu-communication-message-meta dd { margin: 0; padding: 7px 9px; border-bottom: 1px solid #e1e8ed; overflow-wrap: anywhere; }
.qisutu-communication-message-meta dt { color: #647387; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.qisutu-communication-processing-summary > div {
    display: grid;
    grid-template-columns: repeat(8, minmax(75px, 1fr));
    padding: 10px;
    gap: 8px;
}
.qisutu-communication-processing-summary span { min-width: 0; padding: 9px; border-radius: 6px; background: #f2f6f8; }
.qisutu-communication-processing-summary small { display: block; overflow: hidden; color: #647387; font-size: 10px; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.qisutu-communication-processing-summary strong { display: block; margin-top: 4px; font-size: 17px; font-variant-numeric: tabular-nums; }
.qisutu-communication-timeline { display: grid; margin: 0; padding: 0; list-style: none; gap: 7px; }
.qisutu-communication-timeline li { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr); margin: 0; overflow: hidden; border: 1px solid #dce5eb; border-left: 5px solid #7893a3; border-radius: 7px; background: #fff; }
.qisutu-communication-timeline li.is-child-operation { background: #f7fafb; }
.qisutu-communication-timeline li.is-success { border-left-color: #27824c; }
.qisutu-communication-timeline li.is-warning { border-left-color: #c8871c; }
.qisutu-communication-timeline li.is-error { border-left-color: #bd342d; }
.qisutu-communication-step-number { display: grid; place-items: center; border-right: 1px solid #dce5eb; color: #647387; font-size: 11px; font-weight: 800; }
.qisutu-communication-step-body { min-width: 0; padding: 8px 10px; }
.qisutu-communication-step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 14px; }
.qisutu-communication-step-head time { min-width: 185px; color: #647387; font-variant-numeric: tabular-nums; }
.qisutu-communication-step-head strong { min-width: 160px; }
.qisutu-communication-step-head b { font-size: 12px; }
.qisutu-communication-step-head span { margin-left: auto; color: #647387; font-size: 12px; }
.qisutu-communication-timeline p { margin: 4px 0 0; }
.qisutu-communication-timeline details { margin-top: 5px; }
.qisutu-communication-timeline summary { width: max-content; color: #00617a; cursor: pointer; font-size: 12px; font-weight: 700; }
.qisutu-communication-timeline pre { margin: 8px 0 0; padding: 10px; overflow: auto; border-radius: 5px; background: #f3f6f8; white-space: pre-wrap; overflow-wrap: anywhere; }
.qisutu-communication-timeline pre:empty { display: none; }
.qisutu-communication-connection-technical dl { display: grid; grid-template-columns: 170px minmax(0, 1fr); margin: 0; }
.qisutu-communication-connection-technical dt,
.qisutu-communication-connection-technical dd { margin: 0; padding: 8px 11px; border-bottom: 1px solid #e1e8ed; overflow-wrap: anywhere; }
.qisutu-communication-connection-technical dt { color: #647387; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.qisutu-communication-detail-actions {
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
    padding: 12px 22px;
    border-top: 1px solid #d7e1e8;
    background: #fff;
}
@media (max-width: 1100px) {
    .qisutu-communication-filter-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
    .qisutu-communication-kpis { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
    .qisutu-communication-list-head,
    .qisutu-communication-list-row { grid-template-columns: 62px 110px 90px minmax(150px, 1fr) minmax(130px, .8fr) 76px; }
    .qisutu-communication-list-head > :nth-child(6),
    .qisutu-communication-list-row > :nth-child(6) { display: none; }
    .qisutu-communication-processing-summary > div { grid-template-columns: repeat(4, minmax(75px, 1fr)); }
}
@media (max-width: 900px) {
    .qisutu-communication-detail-backdrop,
    html.qisutu-sidebar-collapsed .qisutu-communication-detail-backdrop { left: 0; }
}
@media (max-width: 650px) {
    .qisutu-communication-filter-grid { grid-template-columns: 1fr; }
    .qisutu-communication-search { grid-column: auto; }
    .qisutu-communication-kpis { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
    .qisutu-communication-list { padding: 0 12px 14px; }
    .qisutu-communication-list-head { display: none; }
    .qisutu-communication-list-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; gap: 8px 12px; }
    .qisutu-communication-list-row > span,
    .qisutu-communication-list-row > :nth-child(6) { display: block; }
    .qisutu-communication-list-row > span::before { display: block; margin-bottom: 2px; color: #647387; content: attr(data-label); font-size: 10px; font-weight: 800; text-transform: uppercase; }
    .qisutu-communication-list-status { display: flex !important; }
    .qisutu-communication-list-status::before { display: none !important; }
    .qisutu-communication-pagination span { display: none; }
    .qisutu-communication-processing-summary > div { grid-template-columns: repeat(2, minmax(75px, 1fr)); }
    .qisutu-communication-detail-backdrop { padding: 8px; }
    .qisutu-communication-detail { width: 100%; height: calc(100vh - 16px); max-height: calc(100vh - 16px); }
    .qisutu-communication-detail .qisutu-modal-header { padding: 14px; }
    .qisutu-communication-detail-content { padding: 14px; }
    .qisutu-communication-detail-context { align-items: stretch; }
    .qisutu-communication-detail-context > .qisutu-communication-status { align-self: flex-start; }
    .qisutu-communication-detail-context > span { width: 100%; padding: 4px 0 0; border-top: 1px solid #d8e2e8; border-left: 0; }
    .qisutu-communication-message-meta dl { grid-template-columns: 1fr; }
    .qisutu-communication-message-meta dt { border-bottom: 0; padding-bottom: 0; }
    .qisutu-communication-connection-technical dl { grid-template-columns: 1fr; }
    .qisutu-communication-connection-technical dt { border-bottom: 0; padding-bottom: 0; }
    .qisutu-communication-step-head time,
    .qisutu-communication-step-head strong { min-width: 0; }
    .qisutu-communication-detail-actions { padding: 10px 14px; }
}

/* Mail transport certificate checks and S/MIME administration. */
.qisutu-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
}
.qisutu-form-inline {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}
.qisutu-form-inline label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
}
.qisutu-ticket-article-label.is-success { background: #e5f5e9; color: #176b36; }
.qisutu-ticket-article-label.is-warning { background: #fff1d5; color: #855307; }
.qisutu-ticket-article-label.is-error { background: #fdebea; color: #9d2b25; }
