/* Request revision workflow and embedded chat preview */
.request-detail-primary-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
    margin: -0.25rem 0 1rem;
}

.completion-approval-actions {
    display: grid;
    gap: 12px;
}

.completion-approval-actions form {
    margin: 0;
}

.completion-approval-option {
    display: grid;
    width: 100%;
    gap: 4px;
    padding: 16px 18px;
    border: 1px solid rgba(37, 99, 235, 0.28);
    border-radius: 8px;
    background: #f8fbff;
    color: #173b73;
    text-align: left;
    transition:
        border-color 0.16s ease,
        background-color 0.16s ease,
        box-shadow 0.16s ease;
}

.completion-approval-option:hover,
.completion-approval-option:focus-visible {
    border-color: #2563eb;
    background: #eef5ff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
}

.completion-approval-option strong {
    font-size: 14px;
}

.completion-approval-option span {
    color: #52677f;
    font-size: 12px;
}

.completion-approval-option--secondary {
    border-color: rgba(71, 85, 105, 0.28);
    background: #f8fafc;
    color: #334155;
}

.completion-approval-option--secondary:hover,
.completion-approval-option--secondary:focus-visible {
    border-color: #64748b;
    background: #f1f5f9;
    box-shadow: 0 8px 20px rgba(71, 85, 105, 0.1);
}

.request-revision-banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(19, 53, 104, 0.08);
}

.request-revision-banner--active {
    color: #674400;
    background: linear-gradient(135deg, #fff8dc, #fff1b8);
    border-color: #f1cf69;
}

.request-revision-banner--completed {
    color: #0c5a42;
    background: linear-gradient(135deg, #eafbf4, #d7f5e8);
    border-color: #94dec4;
}

.request-revision-banner-icon {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: #d39716;
    font-size: 1.2rem;
    font-weight: 800;
}

.request-revision-banner--completed .request-revision-banner-icon {
    background: #15956f;
}

.request-revision-banner strong,
.request-revision-banner small {
    display: block;
}

.request-revision-banner p {
    margin: 0.35rem 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.request-file-group--revision {
    padding: 1rem;
    border: 1px solid #efcb68;
    border-radius: 16px;
    background: linear-gradient(135deg, #fffaf0, #fff5d6);
}

.request-file-group--revision h3,
.request-file-group--revision h6 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    color: #694700;
}

.request-file-group-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    color: #694700;
    background: #ffe18a;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.request-revision-file-list {
    display: grid;
    gap: 0.55rem;
}

.request-file-item--revision {
    border-color: #e8c45e;
    background: rgba(255, 255, 255, 0.82);
}

.request-file-item--revision > span:nth-child(2) {
    display: grid;
    min-width: 0;
}

.request-file-item--revision strong {
    overflow-wrap: anywhere;
}

.request-file-item--revision small {
    color: #7b6a42;
}

.request-supplier-name {
    display: inline-block;
    min-width: 9rem;
    max-width: 18rem;
    overflow-wrap: anywhere;
}

.chat-preview-modal .modal-dialog {
    width: min(1120px, calc(100vw - 2rem));
    max-width: none;
}

.chat-preview-modal .modal-content {
    display: flex;
    flex-direction: column;
    height: min(820px, calc(100vh - 2rem));
    overflow: hidden;
    border: 0;
    border-radius: 22px;
    box-shadow: 0 28px 80px rgba(7, 30, 70, 0.28);
}

.chat-preview-modal .modal-header {
    flex: 0 0 auto;
    border-bottom-color: #dbe5f2;
}

.chat-preview-modal .modal-body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.chat-preview-frame {
    display: block;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    background: #f4f7fb;
}

.embedded-chat-body {
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    background: #f4f7fb;
}

.embedded-chat-body > main {
    height: 100%;
    min-height: 0;
}

.chat-detail-page--embedded {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0.75rem;
    width: 100%;
    max-width: none;
    height: 100vh;
    min-height: 0;
    padding: 0.9rem;
    margin: 0;
    overflow: hidden;
}

.chat-detail-page--embedded .chat-messages-panel {
    min-height: 0;
    max-height: none;
    height: auto;
    margin: 0;
    overflow-y: auto;
    border-radius: 18px;
}

.chat-detail-page--embedded .chat-compose-panel {
    position: relative;
    flex: 0 0 auto;
    margin: 0;
    border-radius: 18px;
}

.chat-detail-page--embedded .chat-compose-file-list {
    top: auto;
    bottom: calc(100% + 0.6rem);
    width: min(380px, calc(100vw - 2rem));
    max-height: min(220px, 35vh);
    padding: 0.55rem;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid var(--app-slate-200);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
}

.chat-detail-page--embedded .chat-compose-file-list:empty {
    display: none;
}

.chat-detail-page--embedded .chat-compose-file-list .file-upload-item {
    min-width: 0;
    margin-bottom: 0.45rem;
    box-shadow: none;
}

.chat-detail-page--embedded .chat-compose-file-list .file-upload-item:last-child {
    margin-bottom: 0;
}

.chat-detail-page--embedded .chat-compose-file-list .file-upload-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 576px) {
    .request-detail-primary-actions {
        justify-content: stretch;
    }

    .request-detail-primary-actions .btn {
        flex: 1 1 100%;
    }

    .chat-preview-modal .modal-dialog {
        width: 100%;
        height: 100%;
        margin: 0;
    }

    .chat-preview-modal .modal-content {
        height: 100%;
        border-radius: 0;
    }

    .chat-preview-modal .modal-header {
        align-items: flex-start;
    }
}
.request-suspension-notice {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid #ecd7a3;
    border-left: 4px solid #c88a1b;
    border-radius: 18px;
    background: #fff9ec;
    color: #674815;
}

.request-suspension-notice__icon {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    height: 42px;
    border-radius: 12px;
    background: #fae9bc;
    font-weight: 800;
}

.request-suspension-notice > div { min-width: 0; }
.request-suspension-notice strong { font-size: 1.1rem; }
.request-suspension-notice__label { margin-top: .6rem; font-weight: 700; }
.request-suspension-notice p { white-space: pre-wrap; overflow-wrap: anywhere; margin: .35rem 0 .6rem; }
