/*
 * Account and SaaS share the Support queue, ticket dialog, and composer styles.
 * Viewport and motion overrides live in ateam-account-responsive.css.
 */

/* ==========================================================================
   Support scope indicator and client/administrator tabs
   ========================================================================== */

.support-admin-badge {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    padding: 6px 10px;
    color: #087ce5;
    background: #fff;
    border: 1px solid #cfe6fa;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
}

.support-scope-tabs {
    display: flex;
    gap: 6px;
    padding: 6px;
    margin-bottom: 24px;
    width: fit-content;
    max-width: 100%;
    background: #eaf1f8;
    border-radius: 12px;
}

.support-scope-tabs button {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 11px 22px;
    background: transparent;
    color: #61758b;
    border: 1px solid transparent;
    border-radius: 9px;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

.support-scope-tabs button.is-selected {
    background: #fff;
    color: #087ce5;
    border-color: #dce6f0;
    box-shadow: 0 3px 10px #082b5608;
}

/* ==========================================================================
   Ticket summary metrics
   ========================================================================== */

.support-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.support-summary-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
    padding: 23px 20px;
    border: 1px solid #dce6f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 18px #082b5603;
}

.support-summary-icon {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    height: 44px;
    background: #eaf4ff;
    color: #087ce5;
    border-radius: 12px;
    font-size: 19px;
}

.support-summary-icon.is-support {
    background: #fff5e4;
    color: #d09127;
}

.support-summary-icon.is-client {
    background: #e9f2ff;
    color: #3588da;
}

.support-summary-icon.is-solved {
    background: #e8f8f1;
    color: #209776;
}

.support-summary-card p {
    margin: 0 0 8px;
    color: #61758b;
    font-size: 12px;
    font-weight: 600;
}

.support-summary-card strong {
    display: block;
    color: #082b56;
    font-size: 29px;
    line-height: 1;
}

.support-summary-card small {
    display: block;
    margin-top: 10px;
    color: #8797a8;
    font-size: 10px;
    line-height: 1.5;
}

/* ==========================================================================
   Ticket queue panel and product filters
   ========================================================================== */

.support-panel {
    overflow: hidden;
    background: #fff;
    border: 1px solid #dce6f0;
    border-radius: 17px;
    box-shadow: 0 6px 24px #082b5604;
}

.support-panel-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 26px 26px 20px;
}

.support-panel-heading h2 {
    margin: 0;
    color: #082b56;
    font-size: 18px;
}

.support-panel-heading > span {
    color: #61758b;
    font-size: 12px;
}

.support-products {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0 26px 22px;
}

.support-product-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 13px;
    background: #fff;
    border: 1px solid #dce6f0;
    border-radius: 8px;
    color: #61758b;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.support-product-filter.is-selected {
    background: #eef7ff;
    border-color: #72b8f1;
    color: #087ce5;
}

.support-product-filter > span:last-child {
    border-radius: 5px;
    padding: 2px 6px;
    color: #61758b;
    background: #edf2f7;
    font-size: 11px;
}

.support-product-filter.is-selected > span:last-child {
    background: #dcebfb;
    color: #087ce5;
}

.support-product-logo {
    display: block;
    width: auto;
    height: 22px;
    max-width: none;
    object-fit: contain;
}

/* Compensate for the transparent padding in the PROPOSALS asset, as on Products. */

.support-product-logo[src$="proposals-logo.png"] {
    height: 24px;
}

.support-product-name {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 650;
    color: #61758b;
}

/* ==========================================================================
   Queue search, priority/status filters and refresh action
   ========================================================================== */

.support-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 26px;
    background: #f9fbfe;
    border-block: 1px solid #e7edf4;
}

.support-search {
    flex: 1;
    min-width: 140px;
    position: relative;
}

.support-search > i {
    position: absolute;
    left: 13px;
    top: 14px;
    color: #8ea0b1;
    font-size: 13px;
}

.support-search input {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px 10px 36px;
    border: 1px solid #dce6f0;
    border-radius: 8px;
    background: #fff;
    color: #183451;
    font: inherit;
    font-size: 12px;
}

.support-search input::placeholder {
    color: #8ea0b1;
}

.support-filter {
    min-width: 130px;
    max-width: 200px;
}

.support-filter .account-select,
.support-pagination .account-select,
.support-field .account-select {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 10px 30px 10px 12px;
    border: 1px solid #dce6f0;
    border-radius: 8px;
    background: #fff;
    color: #183451;
    font: inherit;
    font-size: 12px;
}

.support-toolbar .button {
    width: auto;
    flex: 0 0 auto;
    margin-left: auto;
    min-height: 42px;
    white-space: nowrap;
    font-size: 12px;
}

/* ==========================================================================
   Scrollable ticket table with extra width for author and organization details
   ========================================================================== */

.support-table-scroll {
    overflow-x: auto;
}

.support-table {
    width: 100%;
    min-width: 810px;
    border-collapse: collapse;
    text-align: left;
    font-size: 12px;
}

.support-table.is-administration {
    min-width: 1070px;
}

.support-table thead {
    background: #f8fbfe;
}

.support-table thead th {
    padding: 15px 13px;
    color: #61758b;
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
    border-bottom: 1px solid #e5edf5;
}

.support-table thead th:first-child,
.support-table tbody th {
    padding-left: 26px;
}

.support-table td,
.support-table tbody th {
    padding: 19px 13px;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
}

.support-table tbody th {
    width: 31%;
    font-weight: 400;
}

.support-table.is-administration tbody th {
    width: 25%;
}

.support-table tbody tr:hover {
    background: #fbfdff;
}

.support-topic-button {
    display: block;
    border: 0;
    padding: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: #183451;
    max-width: 360px;
}

.support-topic-button strong {
    display: block;
    margin-bottom: 7px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    font-size: 12px;
    font-weight: 650;
}

.support-topic-button > span {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #8293a6;
    font-size: 10px;
}

.support-topic-meta {
    color: #8fa2b6;
    font-size: 10px;
}

.support-topic-button:hover strong {
    color: #087ce5;
}

.support-author {
    min-width: 145px;
}

.support-author strong {
    display: block;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 7px;
}

.support-author small {
    display: block;
    color: #8293a6;
    font-size: 10px;
}

.support-author small i {
    margin-right: 3px;
}

/* ==========================================================================
   Ticket lifecycle and priority badges
   ========================================================================== */

.support-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 650;
    white-space: nowrap;
    background: #edf2f7;
    color: #61758b;
}

.support-status.is-support {
    color: #bd8121;
    background: #fff5df;
}

.support-status.is-client {
    color: #087ce5;
    background: #eaf4ff;
}

.support-status.is-solved {
    color: #20886a;
    background: #e8f7ef;
}

.support-priority {
    white-space: nowrap;
    font-size: 11px;
    color: #8fa0b1;
}

.support-priority i {
    margin-right: 5px;
    font-size: 7px;
}

.support-priority.is-medium {
    color: #5c89b6;
}

.support-priority.is-high {
    color: #d99d39;
}

.support-priority.is-urgent {
    color: #d65b61;
}

.support-priority.is-urgent i {
    font-size: 11px;
}

.support-table time {
    color: #61758b;
    white-space: nowrap;
    font-size: 11px;
}

/* ==========================================================================
   Shared compact ticket controls and queue pagination
   ========================================================================== */

.support-open,
.support-page,
.support-dialog-close {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid #dce6f0;
    border-radius: 7px;
    background: #fff;
    color: #7991aa;
    cursor: pointer;
}

.support-open {
    border-color: transparent;
}

.support-open:hover,
.support-page:hover,
.support-dialog-close:hover {
    color: #087ce5;
    background: #eef7ff;
}

.support-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 26px;
    color: #8293a6;
    font-size: 11px;
}

.support-pagination p {
    margin: 0;
}

.support-pagination > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.support-pagination .account-select {
    font-size: 11px;
    padding: 7px 26px 7px 10px;
    min-height: 34px;
}

.support-page:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ==========================================================================
   Queue guidance, loading/empty feedback and errors
   ========================================================================== */

.support-info {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
    margin: 21px 0 0;
    color: #8293a6;
    font-size: 11px;
    line-height: 1.7;
}

.support-info i {
    color: #76a9d4;
}

.support-preview-note {
    text-align: center;
    color: #8fa0b1;
    font-size: 10px;
    margin-top: 16px;
}

.support-empty {
    text-align: center;
    padding: 45px 24px;
    color: #61758b;
    font-size: 13px;
    line-height: 1.7;
}

.support-empty > i {
    color: #b7d7f0;
    font-size: 32px;
}

.support-empty h3 {
    color: #183451;
    margin-bottom: 0;
}

.support-feedback {
    margin: 14px 26px;
    padding: 12px 15px;
    background: #f1f7fd;
    border: 1px solid #dceafb;
    border-radius: 8px;
    color: #456786;
    font-size: 12px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.support-feedback[hidden] {
    display: none;
}

/* ==========================================================================
   Ticket dialog heading, introduction and metadata
   ========================================================================== */

/* The shared dialog frame scrolls the header, conversation, and composer together. */

.account-dialog.support-dialog {
    --dialog-width: 820px;
    --dialog-padding: 28px 30px;
    color: #183451;
}

.support-dialog-header {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
}

.support-dialog .support-dialog-header h2 {
    margin: 8px 0 0;
    color: #082b56;
    font-size: 23px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.support-dialog-close {
    flex-shrink: 0;
}

.support-dialog-intro {
    margin: 20px 0 15px;
    font-size: 13px;
    color: #61758b;
    line-height: 1.7;
}

.support-ticket-metadata {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 15px 17px;
    border: 1px solid #e3ecf5;
    border-radius: 10px;
    background: #f8fbfe;
    font-size: 11px;
    color: #61758b;
}

.support-ticket-metadata > span:last-child {
    margin-left: auto;
}

/* ==========================================================================
   Conversation toolbar, messages and sender details
   ========================================================================== */

.support-thread-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 20px 0 15px;
}

.support-thread-toolbar h3 {
    margin: 0;
    font-size: 14px;
}

.support-thread-toolbar > div {
    display: flex;
    gap: 8px;
}

.support-thread-toolbar .button {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 11px;
    white-space: nowrap;
}

.support-thread {
    display: grid;
    gap: 18px;
    padding: 3px 3px 14px 0;
    margin-bottom: 16px;
}

.support-message {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.support-message-avatar {
    flex: 0 0 34px;
    height: 34px;
    display: grid;
    place-items: center;
    background: #eef3f9;
    color: #71869d;
    border-radius: 10px;
    font-size: 13px;
}

.support-message.is-support .support-message-avatar {
    background: #e1f1ff;
    color: #087ce5;
}

.support-message-body {
    min-width: 0;
    flex: 1;
    padding: 14px 16px;
    background: #f7f9fc;
    border: 1px solid #e9eff6;
    border-radius: 12px;
}

.support-message.is-support .support-message-body {
    background: #f0f8ff;
    border-color: #ddebfa;
}

.support-message-body header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    font-size: 11px;
}

.support-message-body header strong {
    font-weight: 650;
}

.support-sender {
    color: #8293a6;
    font-size: 10px;
}

.support-message-body time {
    margin-left: auto;
    color: #8293a6;
    font-size: 10px;
}

.support-message-text {
    font-size: 12px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.support-message-text a {
    color: #087ce5;
}

/* ==========================================================================
   New-ticket and reply composer fields
   ========================================================================== */

.support-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 12px;
    font-weight: 650;
}

.support-field input,
.support-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dce6f0;
    border-radius: 9px;
    background: #fff;
    color: #183451;
    font: inherit;
    font-size: 13px;
    font-weight: 400;
}

.support-field textarea {
    min-height: 110px;
    resize: vertical;
    line-height: 1.7;
}

.support-field input::placeholder,
.support-field textarea::placeholder {
    color: #8fa0b1;
}

.support-create-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

/* ==========================================================================
   Attachments, file input and upload feedback
   ========================================================================== */

.support-attachments {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.support-attachment {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    padding: 7px 10px;
    border: 1px solid #dce6f0;
    border-radius: 7px;
    background: #fff;
    color: #7295b6;
    font-size: 11px;
}

.support-attachment a {
    color: #087ce5;
    overflow-wrap: anywhere;
}

.support-attachment button {
    border: 0;
    background: transparent;
    color: #8293a6;
    cursor: pointer;
    padding: 3px;
}

.support-composer-tools {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-top: 14px;
}

.support-composer-tools small {
    color: #8a9aad;
    font-size: 10px;
}

.support-upload {
    position: relative;
    width: auto;
    flex: 0 0 auto;
    overflow: hidden;
    cursor: pointer;
    font-size: 11px;
    min-height: 36px;
    white-space: nowrap;
}

.support-upload input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.support-upload.is-disabled {
    opacity: 0.5;
    cursor: default;
}

.support-upload:focus-within {
    outline: 3px solid #88c9f5;
    outline-offset: 2px;
}

/* ==========================================================================
   Submit controls, read-only notice, and copyable unsent message
   ========================================================================== */

.support-dialog-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid #e5edf5;
}

.support-dialog-footer > span {
    max-width: 340px;
    font-size: 11px;
    color: #8293a6;
    line-height: 1.7;
}

.support-dialog-footer .button {
    width: auto;
    flex-shrink: 0;
    margin-left: auto;
    white-space: nowrap;
}

.support-dialog .support-feedback {
    margin: 15px 0 0;
}

.support-readonly {
    padding: 17px;
    border-radius: 10px;
    background: #eef8f4;
    color: #39866e;
    font-size: 12px;
    line-height: 1.7;
}

.support-readonly i {
    margin-right: 6px;
}

.support-unsent-message {
    width: 100%;
    min-height: 100px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #dce6f0;
    border-radius: 8px;
    font: inherit;
}

.support-dialog button:disabled {
    opacity: 0.5;
    cursor: default;
}

.support-dialog :focus-visible,
.support-panel :focus-visible,
.support-scope-tabs :focus-visible {
    outline: 3px solid #88c9f5;
    outline-offset: 3px;
}

/* Reserve space after the message count for the workflow-based reply dot. */
.support-topic-meta .workspace-unanswered-dot { margin-left: 5px; }
