/* ── Return-ticket e-mails panel (Components/ReturnTicketEmails.razor) ──
   Sits inside the ticket dialogs and the posting dialog, so it borrows
   their scale: 13px text, soft borders, one accent for the actions. */

.rte-panel {
    border: 1px solid #e2e5ea;
    border-radius: 10px;
    background: #fbfbfc;
    padding: 10px 12px;
    margin: 10px 0 4px;
    font-family: 'Segoe UI', Roboto, Tahoma, sans-serif;
    font-size: 13px;
    color: #24292f;
}

.rte-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.rte-head-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.rte-head-left > i,
.rte-item-icon {
    width: 16px;
    height: 16px;
    color: #4b5563;
    flex: 0 0 auto;
}

.rte-title {
    font-weight: 600;
    letter-spacing: .01em;
}

.rte-count {
    display: inline-block;
    min-width: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #1f3864;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    font-weight: 600;
}

.rte-linked {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #4b5563;
    font-size: 12px;
    white-space: nowrap;
}

.rte-linked i { width: 13px; height: 13px; }

.rte-empty,
.rte-muted {
    color: #6b7280;
    font-size: 12.5px;
    line-height: 1.4;
}

.rte-empty { padding: 4px 0 2px; }

.rte-list,
.rte-hits {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rte-item,
.rte-hit {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 6px;
    border-top: 1px solid #eceef2;
}

/* The e-mail row wraps so its file list can sit on a line of its own. */
.rte-item { flex-wrap: wrap; }

.rte-item:first-child { border-top: 0; }

.rte-item-body,
.rte-hit-body {
    flex: 1 1 auto;
    min-width: 0;
}

/* The ticket dialog's left column is narrow. Without a floor the sender and
   date get squeezed into a one-word-per-line ribbon; with it the buttons wrap
   underneath instead, which is the readable way to lose the space. */
.rte-item-body { min-width: 190px; }

.rte-item-actions { margin-left: auto; }

.rte-item-subject,
.rte-hit-subject {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rte-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    color: #6b7280;
    font-size: 12px;
    margin-top: 2px;
}

.rte-dot { color: #c0c4cc; }

.rte-pending { color: #b45309; font-style: italic; }

.rte-mini-icon { width: 12px; height: 12px; }

.rte-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

/* Files carried inside an e-mail. Indented under it and set quieter than the
   message itself — they belong to the row above, not beside it. */
.rte-files {
    list-style: none;
    margin: 6px 0 0 26px;
    padding: 6px 0 0;
    border-top: 1px dashed #e5e8ec;
    /* 0 0 100% — not 1 1 100%. A shrinkable basis lets the list ride up beside
       the message when the row is tight, which is exactly where it must not. */
    flex: 0 0 100%;
    min-width: 0;
}

.rte-file-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 3px 0;
    min-width: 0;
}

.rte-file-icon {
    width: 14px;
    height: 14px;
    color: #6b7280;
    flex: 0 0 auto;
}

.rte-file-name {
    color: #1f3864;
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.rte-file-name:hover {
    text-decoration: underline;
    color: #17294a;
}

.rte-file-size {
    color: #9099a6;
    font-size: 11.5px;
    flex: 0 0 auto;
}

/* Buttons – one shape, three intents. */
.rte-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 7px;
    border: 1px solid transparent;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .12s ease, border-color .12s ease;
}

.rte-btn i { width: 14px; height: 14px; }

.rte-btn:disabled { opacity: .55; cursor: default; }

.rte-btn-primary {
    background: #1f3864;
    color: #fff;
}

.rte-btn-primary:hover:not(:disabled) { background: #17294a; color: #fff; }

.rte-btn-ghost {
    background: #fff;
    border-color: #d5d9e0;
    color: #24292f;
}

.rte-btn-ghost:hover:not(:disabled) { background: #f1f3f6; }

.rte-btn-danger {
    background: #fff;
    border-color: #f0c9c9;
    color: #b42318;
    padding: 5px 7px;
}

.rte-btn-danger:hover:not(:disabled) { background: #fdf2f2; }

/* Attach area */
.rte-attach {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #d5d9e0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rte-attach-label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-weight: 600;
    margin-bottom: 6px;
}

.rte-attach-label i { width: 14px; height: 14px; }

.rte-attach-label .rte-muted { font-weight: 400; }

.rte-search-row {
    display: flex;
    gap: 6px;
}

.rte-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 6px 10px;
    border: 1px solid #d5d9e0;
    border-radius: 7px;
    font: inherit;
    font-size: 13px;
    background: #fff;
}

.rte-input:focus {
    outline: none;
    border-color: #1f3864;
    box-shadow: 0 0 0 2px rgba(31, 56, 100, .15);
}

.rte-hits {
    margin-top: 6px;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid #e2e5ea;
    border-radius: 8px;
    background: #fff;
}

.rte-hit { border-top-color: #f0f1f4; }
.rte-hit:first-child { border-top: 0; }

.rte-hit-preview {
    color: #6b7280;
    font-size: 12px;
    margin-top: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rte-file { font-size: 12.5px; }

.rte-status {
    padding: 6px 10px;
    border-radius: 7px;
    background: #ecfdf3;
    color: #067647;
    font-size: 12.5px;
}

.rte-status-error {
    background: #fdf2f2;
    color: #b42318;
}

@keyframes rte-rotate { to { transform: rotate(360deg); } }
.rte-spin { animation: rte-rotate .9s linear infinite; }
