/* ============================================================================
   Support ticket conversation (email-style thread) + reply composer.
   Shared by the internal Support module and the client portal so the ticket
   thread looks identical in both. Loaded globally from App.razor because a
   single component (TicketThread) is reused across pages in both portals.
   ============================================================================ */

/* ----- Ticket header meta (detail pages) ----- */
.tk-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 2rem;
    margin: 0;
}

.tk-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.tk-meta-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8592a6;
    font-weight: 600;
}

.tk-meta-value {
    font-size: 0.95rem;
    color: #fff;
    font-weight: 600;
}

/* ----- Thread ----- */
.tk-thread {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    padding: 0.25rem 0;
}

.tk-msg {
    display: flex;
    gap: 0.7rem;
    max-width: 82%;
}

.tk-msg-client {
    align-self: flex-start;
}

/* Staff replies mirror to the right (avatar on the trailing edge). */
.tk-msg-staff {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.tk-avatar {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 1px 2px rgba(16, 30, 54, 0.18);
}

.tk-avatar-client {
    background: #435ebe;
}

.tk-avatar-staff {
    background: #2da44e;
}

.tk-bubble {
    background: #fff;
    border: 1px solid #e4e9f2;
    border-radius: 0.75rem;
    padding: 0.7rem 0.9rem;
    box-shadow: 0 1px 2px rgba(16, 30, 54, 0.05);
    min-width: 0;
}

.tk-msg-staff .tk-bubble {
    background: #f0f7f2;
    border-color: #cfe8d7;
}

.tk-bubble-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.35rem;
}

.tk-author {
    font-weight: 700;
    font-size: 0.88rem;
    color: #1f2d3d;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.tk-role {
    font-size: 0.62rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    vertical-align: middle;
}

.tk-time {
    font-size: 0.74rem;
    color: #97a2b4;
    white-space: nowrap;
}

.tk-body {
    font-size: 0.92rem;
    line-height: 1.5;
    color: #2b3648;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ----- Attachment chips ----- */
.tk-attach {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.6rem;
}

.tk-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 220px;
    padding: 0.28rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #133a63;
    background: #eef3fb;
    border: 1px solid #d7e2f2;
    border-radius: 0.5rem;
    text-decoration: none;
}

.tk-chip:hover {
    background: #e2ecfa;
}

.tk-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ----- Reply composer ----- */
.tk-compose-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.tk-file-row {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.78rem;
    background: #f4f6fa;
    border: 1px solid #e1e6f0;
    border-radius: 0.5rem;
}

.tk-file-remove {
    border: 0;
    background: transparent;
    color: #b23b3b;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

/* ----- Status badges (shared status vocabulary) ----- */
.tk-status {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 0.5rem;
    display: inline-block;
}

.tk-status-new        { background: #e7f0ff; color: #1d4ed8; }
.tk-status-ack        { background: #fff4e0; color: #b26a00; }
.tk-status-progress   { background: #e6f4ea; color: #1a7f37; }
.tk-status-await      { background: #f3e8ff; color: #7e22ce; }
.tk-status-resolved   { background: #d8f5e3; color: #0f7b3a; }
.tk-status-closed     { background: #eceff3; color: #5b6b82; }

/* ----- Client confirmation prompt ----- */
.tk-confirm {
    border: 1px solid #e4c9f2;
    background: #faf3ff;
    border-radius: 0.75rem;
    padding: 1rem 1.1rem;
    margin-top: 1rem;
}

.tk-confirm-title {
    font-weight: 700;
    color: #6b21a8;
    margin: 0 0 0.25rem;
}

.tk-confirm-sub {
    color: #6b5b7a;
    font-size: 0.9rem;
    margin: 0 0 0.75rem;
}

@media (max-width: 640px) {
    .tk-msg { max-width: 100%; }
}

/* ----- Client portal launcher cards (dashboard) ----- */
.cp-launch {
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.cp-launch:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 30, 54, 0.10);
}

.cp-launch-icon {
    width: 52px;
    height: 52px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex: 0 0 auto;
}
