.ticket-thread {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ticket-message {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.ticket-message.is-staff {
    border-color: rgba(255, 61, 119, .3);
    background: var(--bg-featured);
}

.ticket-message .msg-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
}

.ticket-message .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--glass-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}

.ticket-message.is-staff .avatar {
    background: var(--gradient-brand-135);
}

.ticket-message .msg-author {
    font-size: 14px;
    color: #fff;
    font-weight: 600;
}

.ticket-message .msg-date {
    font-size: 12px;
    color: var(--text-dim);
}

.ticket-message .msg-body {
    padding: 22px;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.8;
    word-wrap: break-word;
}

.ticket-message .msg-body p {
    margin-bottom: 14px;
}

.ticket-message .msg-body p:last-child {
    margin-bottom: 0;
}

.ticket-message .msg-attachments {
    padding: 14px 22px;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--glass);
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    padding: 7px 16px;
    font-size: 12px;
    color: var(--text-muted);
    transition: all .2s var(--ease);
    max-width: 100%;
}

.attachment-chip:hover {
    background: var(--glass-strong);
    color: #fff;
    border-color: rgba(255, 61, 119, .4);
}

.attachment-chip i {
    color: var(--rose);
}

.attachment-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-header-card {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px 26px;
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.ticket-header-card h1 {
    font-family: var(--font-display);
    font-size: 20px;
    margin-bottom: 10px;
}

.ticket-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-dim);
}

.ticket-meta strong {
    color: var(--text-muted);
    font-weight: 500;
}

.priority-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: 1px;
}

.priority-high { background: var(--danger); }
.priority-medium { background: var(--warning); }
.priority-low { background: var(--success); }

.reply-box {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 22px;
}

.reply-box h3 {
    font-size: 15px;
    margin-bottom: 18px;
}

.dropzone {
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    padding: 26px;
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
    cursor: pointer;
    transition: all .2s var(--ease);
    background: rgba(255, 255, 255, .02);
}

.dropzone:hover,
.dropzone.is-dragover {
    border-color: var(--rose);
    background: rgba(255, 61, 119, .06);
    color: var(--text-muted);
}

.dropzone i {
    font-size: 22px;
    display: block;
    margin-bottom: 10px;
    color: var(--rose);
}

.dropzone input[type="file"] {
    display: none;
}

.file-list {
    list-style: none;
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: var(--glass);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    font-size: 12px;
    color: var(--text-muted);
}

.file-list li button {
    background: none;
    border: 0;
    color: var(--danger);
    cursor: pointer;
    font-size: 13px;
}

.dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.dept-card {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 26px 24px;
    display: block;
    transition: transform var(--transition), border-color var(--transition);
}

.dept-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 61, 119, .3);
}

.dept-card i {
    font-size: 22px;
    color: var(--rose);
    margin-bottom: 14px;
    display: block;
}

.dept-card h3 {
    font-size: 15px;
    color: #fff;
    margin-bottom: 6px;
}

.dept-card p {
    font-size: 12px;
    color: var(--text-dim);
}

.ticket-status-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.ticket-status-filter a {
    padding: 7px 16px;
    border-radius: 18px;
    border: 1px solid var(--line-strong);
    font-size: 12px;
    color: var(--text-muted);
}

.ticket-status-filter a:hover {
    background: var(--glass);
    color: #fff;
}

.ticket-status-filter a.active {
    background: var(--gradient-brand);
    border-color: transparent;
    color: #fff;
}

.rating-stars {
    display: inline-flex;
    gap: 6px;
    direction: rtl;
}

.rating-stars input {
    display: none;
}

.rating-stars label {
    color: var(--line-strong);
    font-size: 20px;
    cursor: pointer;
    transition: color .2s var(--ease);
}

.rating-stars input:checked ~ label,
.rating-stars label:hover,
.rating-stars label:hover ~ label {
    color: var(--warning);
}

.kb-suggestions {
    background: var(--info-bg);
    border: 1px solid rgba(92, 184, 255, .3);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin-bottom: 20px;
}

.kb-suggestions h4 {
    font-size: 13px;
    color: var(--info);
    margin-bottom: 12px;
    font-family: var(--font-body);
    font-weight: 600;
}

.kb-suggestions ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}
