/* ============================================================
   Admin Tickets  (at-* prefix)
   ============================================================ */

/* ── Filter bar ── */
.at-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.at-filter-btn {
    padding: 5px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1.5px solid #d1d5db;
    border-radius: 20px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.at-filter-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.at-filter-btn.active {
    background: var(--bg-main);
    color: #fff;
    border-color: var(--info-color);
}

/* ── Ticket card ── */
.at-ticket-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.at-ticket-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    text-align: left;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.at-ticket-card:hover {
    border-color: var(--info-color);
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.08);
}

.at-ticket-meta {
    flex: 1;
    min-width: 0;
}

.at-ticket-number {
    font-size: 0.72rem;
    color: #6b7280;
    margin-bottom: 2px;
}

.at-ticket-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.at-ticket-info {
    font-size: 0.75rem;
    color: #6b7280;
}

.at-ticket-unread {
    font-size: 0.72rem;
    color: #f59e0b;
    margin-top: 2px;
}

/* ── Detail overlay ── */
.at-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1050;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

@media (min-width: 768px) {
    .at-detail-overlay {
        align-items: center;
    }
}

.at-detail-card {
    background: #fff;
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: atSlideUp 0.22s ease;
}

@media (min-width: 768px) {
    .at-detail-card {
        border-radius: 16px;
        max-height: 85vh;
    }
}

@keyframes atSlideUp {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}

.at-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.at-detail-header-left {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.at-detail-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #111827;
    line-height: 1.3;
}

.at-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
}

/* ── Status select ── */
.at-status-select {
    font-size: 0.78rem;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1.5px solid #d1d5db;
    background: #fff;
    color: #374151;
    cursor: pointer;
    margin-top: 4px;
}

.at-status-select:focus {
    outline: none;
    border-color: var(--info-color);
}

/* ── Messages ── */
.at-messages-panel {
    flex: 1;
    overflow-y: auto;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.at-msg-bubble {
    max-width: 80%;
    border-radius: 12px;
    padding: 9px 13px;
    font-size: 0.85rem;
    line-height: 1.45;
}

.at-msg-theirs {
    align-self: flex-start;
    background: #f3f4f6;
    color: #111827;
}

.at-msg-mine {
    align-self: flex-end;
    background: var(--bg-main);
    color: #fff;
}

.at-msg-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.68rem;
    opacity: 0.75;
    margin-bottom: 3px;
}

/* ── Reply panel ── */
.at-reply-panel {
    padding: 12px 18px 16px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.at-reply-input {
    resize: none;
    font-size: 0.85rem;
    border-radius: 10px;
}

/* ── Empty state ── */
.at-empty {
    text-align: center;
    padding: 48px 16px;
    color: #9ca3af;
}
