.support-tickets-container {
    padding: 20px;
}

/* Support-ticket bulk selection */
.support-ticket-select-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    min-height: 24px;
    margin: 0 auto;
}

#supportTicketsTable .support-ticket-select,
#selectAllSupportTickets {
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    margin: 0 !important;
    float: none !important;
    position: static !important;
    transform: none !important;
    cursor: pointer;
    accent-color: var(--primary, #0d6efd);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#selectAllSupportTickets:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.support-ticket-selection-help {
    font-size: 0.9rem;
}

/* ── Ticket Details modal ── */

.support-ticket-modal .modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.support-ticket-modal-header {
    background: var(--primary);
    color: #fff;
    border-bottom: none;
    padding: 1rem 1.5rem;
    flex-shrink: 0;
}

.support-ticket-modal-title-wrap {
    min-width: 0;
}

.support-ticket-modal-eyebrow {
    display: block;
    font-size: .72rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .75);
    margin-bottom: .15rem;
}

.support-ticket-modal-header .modal-title {
    color: #fff;
    font-weight: 600;
    margin-bottom: 0;
    max-width: 420px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.support-ticket-modal-header-actions {
    display: flex;
    align-items: center;
    gap: .85rem;
    flex-shrink: 0;
}

.support-ticket-modal-body {
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.5rem;
    /* Safety net: the description and conversation panes scroll on their own
       for the common case, but if their combined minimum heights ever exceed
       the available space (long subject + resolver controls + several
       attachments on a short viewport), the body scrolls too rather than
       letting the Reply button get clipped and become unreachable. */
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.support-ticket-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .6rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.support-ticket-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #f4f6f9;
    color: #495057;
    border-radius: 999px;
    padding: .3rem .7rem;
    font-size: .8rem;
}

.support-ticket-meta-chip i {
    color: var(--primary);
    font-size: .75rem;
}

.support-ticket-panel {
    flex-shrink: 0;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.support-ticket-panel-header {
    background: #f8f9fa;
    padding: .5rem .9rem;
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #6c757d;
    border-bottom: 1px solid #e9ecef;
}

.support-ticket-description-scroll {
    max-height: 180px;
    overflow-y: auto;
    padding: .85rem .9rem;
    color: #495057;
    font-size: .92rem;
    line-height: 1.55;
}

.support-ticket-resolved-alert,
.support-ticket-resolver-controls {
    flex-shrink: 0;
    margin-bottom: 1rem;
}

.support-ticket-resolver-controls {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px;
}

/* ── Conversation pane: own scroll region, independent of the description ── */

.support-ticket-conversation {
    flex: 1 1 auto;
    /* No overflow: hidden here (and no min-height: 0) — this box must never clip or get squeezed
       shorter than its children's natural height. It used to clip via overflow: hidden, so when
       the reply composer grew taller (e.g. after attaching files), whatever didn't fit — the
       Reply button included — was cut off instead of reachable by scrolling.
       .support-ticket-modal-body's own overflow-y: auto is the intended safety net for that case;
       it only works if nothing in between silently eats the overflow. The rounded-corner look
       this used to get from clipping is recreated below via border-radius directly on the header
       (top corners) and the reply composer (bottom corners) instead. */
    display: flex;
    flex-direction: column;
    border: 1px solid #e9ecef;
    border-radius: 10px;
}

.support-ticket-conversation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    padding: .6rem .9rem;
    font-weight: 600;
    font-size: .85rem;
    border-bottom: 1px solid #e9ecef;
    border-top-left-radius: 9px;
    border-top-right-radius: 9px;
    flex-shrink: 0;
}

.support-ticket-conversation-header i {
    color: var(--primary);
    margin-right: .4rem;
}

.support-ticket-conversation-scroll {
    flex: 1 1 auto;
    min-height: 80px;
    overflow-y: auto;
    padding: .9rem;
    background: #fff;
}

.support-ticket-conversation-scroll .list-group-item {
    border-left: none;
    border-right: none;
}

.support-ticket-reply-message {
    color: #1c1f23;
    font-size: .92rem;
    line-height: 1.55;
    white-space: pre-wrap;
}

.support-ticket-reply-actions {
    display: flex;
    align-items: center;
    gap: .9rem;
    flex-shrink: 0;
}

.support-ticket-quote-preview-wrap:not(:empty) {
    padding: 0 .9rem;
    flex-shrink: 0;
}

.support-ticket-reply-composer {
    flex-shrink: 0;
    border-top: 1px solid #e9ecef;
    border-bottom-left-radius: 9px;
    border-bottom-right-radius: 9px;
    padding: .75rem .9rem;
    background: #fbfbfc;
}

.support-ticket-reply-composer textarea {
    border-radius: 8px;
    resize: vertical;
    max-height: 100px;
}

.support-ticket-quoted-block {
    background: #f4f6f9;
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
}

/* --- Attachments dropzone (same pattern as .af-dropzone in css/autobiz/approval_flow.css) --- */

.st-dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-align: center;
    padding: 1.5rem 1rem;
    border: 2px dashed #c7cbe0;
    border-radius: 10px;
    background: #f8f9fb;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.st-dropzone:hover {
    border-color: var(--primary);
}

.st-dropzone--active {
    border-color: var(--primary);
    background: #eef0fc;
}

.st-dropzone-icon {
    font-size: 1.5rem;
    color: var(--primary);
}

.st-dropzone-text {
    font-size: 0.88rem;
    color: #6b7280;
}

.st-dropzone-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Compact variant for the reply composer, where the dropzone sits under a textarea rather
   than owning the whole field. */
.st-dropzone--compact {
    flex-direction: row;
    justify-content: flex-start;
    padding: 0.6rem 0.8rem;
    gap: 0.5rem;
}

.st-dropzone--compact .st-dropzone-icon {
    font-size: 1.1rem;
}

.st-attachment-grid,
.st-file-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.st-attachment-thumb,
.st-file-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dee2e6;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.st-attachment-thumb img,
.st-file-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.st-attachment-file {
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.4rem 0.3rem;
    background: #fff;
}

.st-attachment-file span {
    font-size: 0.72rem;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.st-remove-chip {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    padding: 0;
    line-height: 1;
    border: 2px solid #fff;
}

.st-remove-chip i {
    font-size: 0.55rem;
}

/* Bounded so a handful of attached files can never push the Reply button out of view. */
#st-reply-attachment-preview-list {
    max-height: 96px;
    overflow-y: auto;
}
