/* Client Requests + Chat Modal */

.tp-client-requests-chat-modal[hidden] {
    display: none !important;
}

.tp-client-requests-chat-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    direction: rtl;
    isolation: isolate;
}

.tp-client-requests-chat-modal .tp-crc-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(3px);
    z-index: 0;
}

.tp-client-requests-chat-modal .tp-crc-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(980px, calc(100% - 30px));
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #ffffff;
    box-shadow: 0 20px 55px rgba(2, 6, 23, 0.3);
    z-index: 1;
}

.tp-client-requests-chat-modal .tp-crc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.tp-client-requests-chat-modal .tp-crc-head-text h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.tp-client-requests-chat-modal .tp-crc-meta {
    margin-top: 4px;
    color: #334155;
    font-size: 12px;
}

.tp-client-requests-chat-modal .tp-crc-meta span {
    margin: 0 6px;
    opacity: 0.6;
}

.tp-client-requests-chat-modal .tp-crc-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tp-client-requests-chat-modal .tp-crc-btn {
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: #ffffff;
    color: #0f172a;
    border-radius: 10px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.tp-client-requests-chat-modal .tp-crc-close {
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: #ffffff;
    color: #334155;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.tp-client-requests-chat-modal .tp-crc-tabs {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.24);
    background: #ffffff;
}

.tp-client-requests-chat-modal .tp-crc-tab {
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: #f8fafc;
    color: #334155;
    border-radius: 10px;
    padding: 7px 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
}

.tp-client-requests-chat-modal .tp-crc-tab.is-active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.tp-client-requests-chat-modal .tp-crc-body {
    padding: 14px;
    overflow: auto;
    background: #f8fafc;
    min-height: 320px;
}

.tp-client-requests-chat-modal .tp-crc-pane {
    display: none;
}

.tp-client-requests-chat-modal .tp-crc-pane.is-active {
    display: block;
}

.tp-client-requests-chat-modal .tp-crc-content {
    display: grid;
    gap: 10px;
}

.tp-client-requests-chat-modal .tp-crc-card {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 12px;
    background: #ffffff;
    padding: 12px;
}

.tp-client-requests-chat-modal .tp-crc-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.tp-client-requests-chat-modal .tp-crc-card-head h4 {
    margin: 0;
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
}

.tp-client-requests-chat-modal .tp-crc-status {
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 700;
}

.tp-client-requests-chat-modal .tp-crc-card-meta {
    display: grid;
    gap: 5px;
    color: #475569;
    font-size: 12px;
}

.tp-client-requests-chat-modal .tp-crc-msg {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 12px;
    background: #ffffff;
    padding: 10px;
}

.tp-client-requests-chat-modal .tp-crc-msg-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 12px;
}

.tp-client-requests-chat-modal .tp-crc-msg-head strong {
    color: #0f172a;
}

.tp-client-requests-chat-modal .tp-crc-msg-head span {
    color: #64748b;
}

.tp-client-requests-chat-modal .tp-crc-msg-body {
    color: #1e293b;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
}

.tp-client-requests-chat-modal .tp-crc-attachment {
    display: inline-flex;
    margin-top: 7px;
    font-size: 12px;
    color: #1d4ed8;
    text-decoration: none;
}

.tp-client-requests-chat-modal .tp-crc-attachment:hover {
    text-decoration: underline;
}

.tp-client-requests-chat-modal .tp-crc-empty,
.tp-client-requests-chat-modal .tp-crc-error {
    border: 1px dashed rgba(148, 163, 184, 0.5);
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    color: #475569;
    font-size: 13px;
}

.tp-client-requests-chat-modal .tp-crc-error {
    color: #991b1b;
    border-color: rgba(239, 68, 68, 0.5);
    background: #fef2f2;
}

body.tp-crc-open {
    overflow: hidden;
}
