/* Тикеты техподдержки */

.support-card--narrow {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* ---- Список тикетов ---- */
.support-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.support-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid #e6e9ed;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease;
}
.support-row:hover {
    border-color: #c4ccd4;
    background-color: #f7f9fb;
    text-decoration: none;
    color: inherit;
}

.support-dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 14px;
    background-color: #adb5bd;
}
/* Единая гамма состояний */
.support-dot.is-red    { background-color: #ff5252; } /* непрочитано */
.support-dot.is-orange { background-color: #fd7e14; } /* не отвечено */
.support-dot.is-black  { background-color: #343a40; } /* открыт (прочитан, отвечён) */
.support-dot.is-grey   { background-color: #adb5bd; } /* закрыт */
.support-dot.is-accent { background-color: #17a2b8; } /* (устар.) */

.support-row-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.support-subject {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.support-subject--empty {
    font-style: italic;
    color: #98a2ad;
    font-weight: 400;
}
.support-row-date {
    font-size: 12px;
    color: #98a2ad;
    margin-top: 2px;
}
.support-unanswered { color: #fd7e14; } /* не отвечено — оранжевый */
.support-count-unread { color: #ff5252; } /* непрочитано — красный */
.support-last-msg {
    font-size: 12px;
    color: #98a2ad;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Бейдж статуса — «пилюля» */
.support-status {
    flex: 0 0 auto;
    margin-left: 12px;
    padding: 2px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
/* Пилюли в единой гамме */
.support-status--open   { background-color: #eceef0; color: #343a40; } /* открыт — чёрный/нейтральный */
.support-status--closed { background-color: #eceef0; color: #98a2ad; } /* закрыт — серый */
.support-status--new    { background-color: #ffebee; color: #ff5252; } /* непрочитано — красный */
.support-status--unanswered { background-color: #fff3e6; color: #fd7e14; } /* не отвечено — оранжевый */

.support-chevron {
    flex: 0 0 auto;
    margin-left: 10px;
    color: #c4ccd4;
}

/* Пустое состояние */
.support-empty {
    text-align: center;
    padding: 40px 0;
}

/* ====== Страница тикета (мессенджер) ====== */
.support-ticket-card { overflow: hidden; }
.support-ticket { display: flex; flex-direction: column; height: calc(100vh - 160px); min-height: 420px; }

.sm-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid #e6e9ed;
}
.sm-header .sm-back { padding: 0 4px; color: #6c757d; }
.sm-subject {
    font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 50%;
}
.sm-new-subject { flex: 1 1 auto; max-width: 420px; }
.sm-subject-edit { padding: 0 4px; color: #98a2ad; }
.sm-subject-edit:hover { color: #6c757d; }
/* во время правки темы снимаем обрезку и даём место полю + кнопкам */
.sm-subject.sm-editing {
    max-width: none;
    overflow: visible;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
}
.sm-subject-input { width: 280px; max-width: 50vw; }

/* Лента */
.sm-feed {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #fbfcfd;
}
.sm-loading { text-align: center; padding: 20px; }

.sm-msg { display: flex; flex-direction: column; max-width: 88%; }
.sm-msg.sm-other { align-self: flex-start; align-items: flex-start; }
.sm-msg.sm-mine  { align-self: flex-end; align-items: flex-end; }

.sm-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; font-size: 12px; color: #98a2ad; }
.sm-msg.sm-mine .sm-meta { flex-direction: row-reverse; }
.sm-avatar {
    width: 24px; height: 24px; border-radius: 50%;
    background: #c4ccd4; color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600; flex: 0 0 auto;
}
.sm-author { font-weight: 500; }
.sm-actions { display: inline-flex; align-items: center; gap: 8px; opacity: 0; transition: opacity .12s; }
.sm-msg:hover .sm-actions { opacity: 1; }
.sm-actions .sm-reply-link { color: #98a2ad; font-size: 12px; }
.sm-actions .sm-edit, .sm-actions .sm-del { cursor: pointer; color: #98a2ad; }
.sm-actions .sm-del:hover { color: #dc3545; }

.sm-bubble {
    padding: 8px 12px;
    border-radius: 12px;
    background: #eceef0;
    color: #2b2f33;
    word-wrap: break-word;
}
.sm-msg.sm-mine .sm-bubble { background: #d7e9f5; color: #1b3a4b; }
.sm-msg.sm-highlight .sm-bubble { background: #fff3cd; transition: background .3s; }

.sm-quote {
    border-left: 3px solid #adb5bd;
    background: rgba(0,0,0,.04);
    padding: 4px 8px;
    margin-bottom: 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.sm-quote-author { display: block; font-weight: 600; color: #6c757d; }
.sm-quote-text {
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden;
}
.sm-img {
    max-height: 200px; max-width: 280px;
    border-radius: 8px; cursor: pointer; display: block; margin-bottom: 4px;
}
.sm-text-body { white-space: pre-wrap; }
.sm-foot { font-size: 11px; color: #98a2ad; text-align: right; margin-top: 4px; }
.sm-edited { font-style: italic; }

.sm-edit-text { margin-bottom: 6px; }
.sm-edit-actions { text-align: right; }

/* Поле ввода */
.sm-composer { border-top: 1px solid #e6e9ed; padding: 10px 16px; background: #fff; }
.sm-reply-bar, .sm-attach-preview { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sm-reply-info { flex: 1 1 auto; color: #6c757d; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-reply-cancel, .sm-attach-remove { background: none; border: none; color: #98a2ad; cursor: pointer; }
.sm-attach-preview { position: relative; }
.sm-attach-img { height: 72px; border-radius: 6px; }

.sm-input-row { display: flex; align-items: flex-end; gap: 8px; }
.sm-text { resize: none; min-height: 38px; max-height: 120px; overflow-y: auto; }
.sm-closed-bar { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 6px 0; }

/* Лайтбокс */
.sm-lightbox {
    position: fixed; inset: 0; z-index: 1080;
    background: rgba(0,0,0,.85);
    align-items: center; justify-content: center;
}
.sm-lightbox-img { max-width: 92vw; max-height: 92vh; }
.sm-lightbox-close {
    position: absolute; top: 18px; right: 22px;
    background: none; border: none; color: #fff; font-size: 22px; cursor: pointer;
}

/* Бейдж техподдержки в верхней панели. Порт инлайновых стилей zzd-php/_nav-top.php:17-19. */
.support-group.has-admin {
    border: 1px solid #e0e0e0;
    border-radius: 100px;
    padding: 1px 14px 1px 2px;
}
.support-admin-counts {
    font-weight: 800;
    font-size: 13px;
    white-space: nowrap;
    text-decoration: none;
}
.support-group .ml-10,
.support-group.ml-10 {
    margin-left: 10px;
}
