/* Complaint page styles are global because the page is split into child components. */
.complaints-panel {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #ababf2;
    border-radius: 25px;
    width: 100%;
    overflow: hidden;
}

/*.complaint-action {
    display: flex;
    justify-content: center;
    align-items: center;
}
*/
.complaint-dialog-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 30, 0.55);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.complaint-dialog {
    width: min(1100px, 96vw);
    max-height: min(92vh, 920px);
    overflow: hidden;
    background: #f7f8ff;
    border-radius: 24px;
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.28);
    direction: rtl;
    display: flex;
    flex-direction: column;
}

.complaint-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    color: #fff;
    background: linear-gradient(90deg, #1f2aa5, #596de8);
}

    .complaint-dialog-header h3 {
        margin: 0 0 0.35rem 0;
        font-size: 1.35rem;
    }

    .complaint-dialog-header p {
        margin: 0;
        opacity: 0.95;
    }

.complaint-dialog-close {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
}

    .complaint-dialog-close:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.complaint-dialog-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: clamp(0.8rem, 1.25vw, 1.5rem);
    overscroll-behavior: contain;
}

.dialog-state {
    border-radius: 15px;
    background: #eef1ff;
    color: #24358c;
    padding: .1rem 1rem;
    /*    text-align: center;
    min-width: max-content;*/
    height: fit-content;
}

.dialog-error {
    background: #ffe9e9;
    color: #a10000;
    margin-top: 10px;
    padding: 5px;
    text-align: right;
}

.dialog-empty {
    background: #f3f4fb;
    color: #647095;
}

.complaint-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.summary-card,
.target-card {
    background: #fff;
    border: 1px solid #e2e5ff;
    border-radius: 15px;
    padding: 0.9rem;
    box-shadow: 0 6px 18px rgba(40, 47, 120, 0.08);
}

    .summary-card span,
    .target-card span {
        /*    display: block;*/
        display: inline;
        color: #6872a9;
        font-size: 0.82rem;
        margin-bottom: 0.35rem;
    }

    .summary-card strong,
    .target-card strong {
        color: #14277e;
        font-weight: 600;
    }

.complaint-section {
    background: #fff;
    border: 1px solid #e2e5ff;
    border-radius: 15px;
    padding: 1rem;
    margin-top: 1rem;
}

    .complaint-section h4 {
        margin: 0 0 0.8rem 0;
        color: #14277e;
        font-size: 1.05rem;
    }

.complaint-description {
    margin: 0;
    color: #263055;
    line-height: 2;
    white-space: pre-wrap;
}

.target-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 0.8rem;
}

.target-card {
    display: grid;
    gap: 0.7rem;
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.message-card {
    border-radius: 15px;
    padding: 0.9rem 1rem;
    border: 1px solid #e3e6fb;
}

.message-customer {
    background: #eef2ff;
}

.message-system {
    background: #f7f7f7;
}

.message-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: #14277e;
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
}

.message-card p {
    margin: 0;
    color: #263055;
    line-height: 1.9;
    white-space: pre-wrap;
}

.message-compose {
    margin-top: 1rem;
    border-top: 1px solid #e3e6fb;
    padding-top: 1rem;
}

    .message-compose label {
        display: block;
        color: #14277e;
        margin-bottom: 0.5rem;
        font-weight: 600;
    }

    .message-compose textarea {
        width: 100%;
        resize: vertical;
        min-height: 110px;
        border: 1px solid #cfd5ff;
        border-radius: 15px;
        padding: 0.8rem;
        font-family: inherit;
        color: #14277e;
        background: #fff;
        outline: none;
    }

        .message-compose textarea:focus {
            border-color: #596de8;
            box-shadow: 0 0 0 3px rgba(89, 109, 232, 0.15);
        }

.message-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.btn-send-message {
    min-width: 130px;
    min-height: 42px;
    border: 0;
    border-radius: 15px;
    background: #2b24ba;
    color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
}

    .btn-send-message:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.create-complaint-dialog {
    width: min(1180px, 97vw);
}

.create-section {
    background: #fff;
    border: 1px solid #e2e5ff;
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 1rem;
}

    .create-section h4 {
        margin: 0 0 0.85rem 0;
        color: #14277e;
        font-size: 1.05rem;
    }

.contract-search-row {
    display: grid;
    grid-template-columns: 1fr 140px;
    gap: 0.75rem;
}

    .contract-search-row input,
    .create-form-grid input,
    .create-form-grid select,
    .create-form-grid textarea {
        width: 100%;
        border: 1px solid #cfd5ff;
        border-radius: 15px;
        padding: 0.75rem 0.85rem;
        font-family: inherit;
        color: #14277e;
        background: #fff;
        outline: none;
    }

        .contract-search-row input:focus,
        .create-form-grid input:focus,
        .create-form-grid select:focus,
        .create-form-grid textarea:focus {
            border-color: #596de8;
            box-shadow: 0 0 0 3px rgba(89, 109, 232, 0.15);
        }

.btn-search-contract,
.btn-submit-complaint {
    border: 0;
    border-radius: 15px;
    background: #2b24ba;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    min-height: 44px;
    padding: 0 1rem;
}

    .btn-search-contract:disabled,
    .btn-submit-complaint:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.contract-result-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.contract-result-card {
    text-align: right;
    border: 1px solid #d9defd;
    border-radius: 15px;
    background: #f8f9ff;
    padding: 0.9rem;
    cursor: pointer;
    display: grid;
    gap: 0.35rem;
    font-family: inherit;
    color: #14277e;
}

    .contract-result-card:hover {
        border-color: #596de8;
        background: #eef2ff;
    }

    .contract-result-card.selected {
        border-color: #2b24ba;
        background: #e7ebff;
        box-shadow: 0 0 0 3px rgba(43, 36, 186, 0.13);
    }

    .contract-result-card span {
        color: #34438f;
    }

    .contract-result-card small {
        color: #6872a9;
        line-height: 1.8;
    }

.create-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 1rem;
}

.create-form-grid-single {
    grid-template-columns: 1fr;
}

.create-form-grid label {
    display: grid;
    gap: 0.45rem;
    color: #14277e;
    font-weight: 600;
}

.create-form-grid textarea {
    resize: vertical;
    min-height: 130px;
}

.create-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.btn-submit-complaint {
    min-width: 150px;
}

.test-picker-field {
    display: grid;
    gap: 1rem;
    color: #14277e;
    font-weight: 600;
}

.test-picker {
    display: flex;
    gap: 1rem;
}

.test-picker-title {
    display: block;
    color: #14277e;
}

.test-option-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(207px, 1fr));
    gap: 0.75rem;
}

.test-option-card {
    text-align: right;
    border: 1px solid #d9defd;
    border-radius: 15px;
    background: #f8f9ff;
    padding: clamp(0.55rem, 0.85vw, 0.85rem);
    cursor: pointer;
    display: grid;
    gap: 0.35rem;
    font-family: inherit;
    color: #14277e;
}

    .test-option-card:hover {
        border-color: #596de8;
        background: #eef2ff;
    }

    .test-option-card.selected {
        border-color: #2b24ba;
        background: #e7ebff;
        box-shadow: 0 0 0 3px rgba(43, 36, 186, 0.13);
    }

    .test-option-card span {
        color: #34438f;
        font-size: 0.9rem;
    }

    .test-option-card small {
        color: #6872a9;
        line-height: 1.7;
    }

    .test-option-card:disabled {
        opacity: 0.65;
        cursor: not-allowed;
    }

.contract-result-card.blocked {
    opacity: 0.72;
    cursor: not-allowed;
    background: #fff1f1;
    border-color: #ffc7c7;
}

    .contract-result-card.blocked:hover {
        background: #fff1f1;
        border-color: #ffc7c7;
    }

.open-complaint-warning {
    color: #a10000 !important;
    font-weight: 700;
}

.attachment-list {
    display: grid;
    gap: 0.75rem;
}

.attachment-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #f8f9ff;
    border: 1px solid #d9defd;
    border-radius: 15px;
    padding: 0.85rem 1rem;
}

.attachment-info {
    display: grid;
    gap: 0.25rem;
    color: #14277e;
}

    .attachment-info strong {
        color: #14277e;
        font-weight: 700;
    }

    .attachment-info span {
        color: #34438f;
        font-size: 0.9rem;
    }

    .attachment-info small {
        color: #6872a9;
    }

.btn-download-attachment,
.btn-upload-attachment {
    min-width: 110px;
    min-height: 40px;
    border: 0;
    border-radius: 15px;
    background: #2b24ba;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0 1rem;
}

    .btn-download-attachment:disabled,
    .btn-upload-attachment:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.attachment-upload-box {
    margin-top: 1rem;
    border-top: 1px solid #e3e6fb;
    padding-top: 1rem;
}

    .attachment-upload-box h5 {
        margin: 0 0 0.85rem 0;
        color: #14277e;
        font-size: 1rem;
    }

.attachment-upload-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1rem;
}

    .attachment-upload-grid label {
        display: grid;
        gap: 0.45rem;
        color: #14277e;
        font-weight: 600;
    }

    .attachment-upload-grid select,
    .attachment-upload-grid input[type="file"] {
        width: 100%;
        border: 1px solid #cfd5ff;
        border-radius: 15px;
        padding: 0.7rem 0.85rem;
        font-family: inherit;
        color: #14277e;
        background: #fff;
        outline: none;
    }

        .attachment-upload-grid select:focus,
        .attachment-upload-grid input[type="file"]:focus {
            border-color: #596de8;
            box-shadow: 0 0 0 3px rgba(89, 109, 232, 0.15);
        }

.selected-attachment-file {
    margin-top: 0.85rem;
    background: #eef2ff;
    border: 1px solid #d9defd;
    border-radius: 15px;
    color: #14277e;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

    .selected-attachment-file span {
        color: #6872a9;
    }

.attachment-upload-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.85rem;
}

.attachment-help {
    margin: 0.75rem 0 0 0;
    color: #6872a9;
    font-size: 0.88rem;
    line-height: 1.8;
}

/* Create complaint attachment UI */

.create-attachment-upload-box {
    margin-top: 1.1rem;
    padding: 1rem;
    border: 1px solid #dfe4ff;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
}

.create-attachment-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

    .create-attachment-header h5 {
        margin: 0 0 0.35rem 0;
        color: #14277e;
        font-size: 1rem;
    }

    .create-attachment-header p {
        margin: 0;
        color: #6872a9;
        font-size: 0.88rem;
        line-height: 1.8;
    }

.attachment-count-badge {
    flex: 0 0 auto;
    border-radius: 999px;
    background: #eef2ff;
    border: 1px solid #cfd5ff;
    color: #14277e;
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.create-attachment-picker {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1rem;
    align-items: stretch;
}

.attachment-type-field {
    display: grid;
    gap: 0.45rem;
    color: #14277e;
    font-weight: 700;
}

    .attachment-type-field select {
        width: 100%;
        min-height: 52px;
        border: 1px solid #cfd5ff;
        border-radius: 16px;
        padding: 0 0.9rem;
        font-family: inherit;
        color: #14277e;
        background: #fff;
        outline: none;
    }

        .attachment-type-field select:focus {
            border-color: #596de8;
            box-shadow: 0 0 0 3px rgba(89, 109, 232, 0.15);
        }

.file-picker-card {
    position: relative;
    min-height: 52px;
    border: 1px dashed #aeb9ff;
    border-radius: 16px;
    background: #ffffff;
    color: #14277e;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

    .file-picker-card:hover {
        border-color: #596de8;
        background: #f3f6ff;
        box-shadow: 0 8px 20px rgba(40, 47, 120, 0.08);
    }

    .file-picker-card input[type="file"] {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        cursor: pointer;
    }

        .file-picker-card input[type="file"]:disabled {
            cursor: not-allowed;
        }

.hidden-input {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-picker-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: #2b24ba;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    line-height: 1;
    font-weight: 700;
    flex: 0 0 auto;
}

.file-picker-content {
    display: grid;
    gap: 0.15rem;
}

    .file-picker-content strong {
        color: #14277e;
        font-size: 0.95rem;
    }

    .file-picker-content small {
        color: #6872a9;
        font-size: 0.82rem;
    }

.create-attachment-list {
    margin-top: 1rem;
}

.create-pending-attachment-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 96px;
    align-items: center;
    gap: 0.9rem;
    background: #ffffff;
    border-color: #dfe4ff;
    box-shadow: 0 8px 22px rgba(40, 47, 120, 0.07);
}

.attachment-file-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #eef2ff;
    border: 1px solid #cfd5ff;
    color: #14277e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    flex: 0 0 auto;
}

.create-pending-attachment-card .attachment-info {
    min-width: 0;
}

    .create-pending-attachment-card .attachment-info strong {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.attachment-meta-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-top: 0.2rem;
}

    .attachment-meta-row span,
    .attachment-meta-row small {
        color: #6872a9;
        font-size: 0.84rem;
    }

.btn-remove-attachment {
    min-width: 88px;
    min-height: 40px;
    border: 0;
    border-radius: 14px;
    background: #2b24ba;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0 1rem;
}

    .btn-remove-attachment:hover {
        background: #201a9a;
    }

    .btn-remove-attachment:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.attachment-error-box {
    margin-top: 1rem;
}

/* Complaint details attachment groups */

.complaint-attachments-section {
    display: grid;
    gap: 1rem;
}

.complaint-section-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

    .complaint-section-title-row h4 {
        margin-bottom: 0.3rem;
    }

    .complaint-section-title-row p {
        margin: 0;
        color: #6872a9;
        font-size: 0.88rem;
        line-height: 1.8;
    }

.attachment-total-badge {
    flex: 0 0 auto;
    border-radius: 999px;
    background: #eef2ff;
    border: 1px solid #cfd5ff;
    color: #14277e;
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.attachment-group-list {
    display: grid;
    gap: 1rem;
}

.attachment-type-group {
    border: 1px solid #dfe4ff;
    border-radius: 18px;
    background: #ffffff;
    padding: 0.9rem;
}

.attachment-type-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eef1ff;
    margin-bottom: 0.75rem;
}

    .attachment-type-header strong {
        display: block;
        color: #14277e;
        font-size: 0.98rem;
    }

    .attachment-type-header span {
        display: block;
        margin-top: 0.25rem;
        color: #6872a9;
        font-size: 0.84rem;
        line-height: 1.7;
    }

    .attachment-type-header small {
        flex: 0 0 auto;
        color: #14277e;
        background: #eef2ff;
        border: 1px solid #cfd5ff;
        border-radius: 999px;
        padding: 0.25rem 0.65rem;
        font-weight: 700;
        white-space: nowrap;
    }

.attachment-empty-small {
    color: #6872a9;
    background: #f8f9ff;
    border: 1px dashed #d9defd;
    border-radius: 14px;
    padding: 0.75rem 0.9rem;
    font-size: 0.88rem;
}

.attachment-list-polished {
    gap: 0.65rem;
}

.attachment-card-polished {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 110px;
    align-items: center;
    background: #f8f9ff;
    border: 1px solid #d9defd;
    box-shadow: 0 8px 22px rgba(40, 47, 120, 0.05);
}

.attachment-file-type {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #eef2ff;
    border: 1px solid #cfd5ff;
    color: #14277e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-info-polished {
    min-width: 0;
}

    .attachment-info-polished strong {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.attachment-meta-line {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

    .attachment-meta-line span {
        color: #6872a9;
        font-size: 0.82rem;
    }

.details-attachment-upload-box {
    margin-top: 0;
    padding: 1rem;
    border: 1px solid #dfe4ff;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
}

.details-attachment-upload-header {
    margin-bottom: 1rem;
}

    .details-attachment-upload-header h5 {
        margin: 0 0 0.35rem 0;
        color: #14277e;
        font-size: 1rem;
    }

    .details-attachment-upload-header p {
        margin: 0;
        color: #6872a9;
        font-size: 0.88rem;
        line-height: 1.8;
    }

.selected-attachment-file-polished {
    align-items: center;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(40, 47, 120, 0.06);
}

    .selected-attachment-file-polished > div:last-child {
        display: grid;
        gap: 0.2rem;
        min-width: 0;
    }

    .selected-attachment-file-polished strong {
        color: #14277e;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .selected-attachment-file-polished span {
        color: #6872a9;
        font-size: 0.84rem;
    }

/* Create complaint submit hint */

.create-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.create-submit-hint {
    color: #6872a9;
    background: #f8f9ff;
    border: 1px dashed #d9defd;
    border-radius: 14px;
    padding: 0.65rem 0.85rem;
    font-size: 0.86rem;
    line-height: 1.8;
}

    .create-submit-hint.ready {
        color: #146c43;
        background: #eefbf4;
        border-color: #bfe8d0;
    }

.btn-submit-complaint:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Complaint message compose UX */

.message-compose-polished {
    border: 1px solid #dfe4ff;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
    padding: 1rem;
}

.message-compose-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.55rem;
}

    .message-compose-header label {
        color: #14277e;
        font-weight: 800;
    }

.message-counter {
    color: #6872a9;
    background: #eef2ff;
    border: 1px solid #cfd5ff;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.message-compose-polished textarea {
    width: 100%;
    border: 1px solid #cfd5ff;
    border-radius: 16px;
    padding: 0.85rem 1rem;
    font-family: inherit;
    color: #14277e;
    background: #ffffff;
    outline: none;
    resize: vertical;
    line-height: 1.9;
}

    .message-compose-polished textarea:focus {
        border-color: #596de8;
        box-shadow: 0 0 0 3px rgba(89, 109, 232, 0.15);
    }

    .message-compose-polished textarea:disabled {
        background: #f2f4ff;
        cursor: not-allowed;
    }

.message-error-box {
    margin-top: 0.8rem;
}

.message-actions-polished {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-top: 0.9rem;
}

.message-submit-hint {
    color: #6872a9;
    background: #f8f9ff;
    border: 1px dashed #d9defd;
    border-radius: 14px;
    padding: 0.65rem 0.85rem;
    font-size: 0.86rem;
    line-height: 1.8;
}

    .message-submit-hint.ready {
        color: #146c43;
        background: #eefbf4;
        border-color: #bfe8d0;
    }

.btn-send-message:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
/* The btn-create-complaint class is applied to the header button itself, not to the icon.
   Keep the button dimensions controlled by DynamicHeader and only style the inner icon. */
.dynamic-header-button.btn-create-complaint {
    width: auto;
    height: auto;
    filter: none;
}

    .dynamic-header-button.btn-create-complaint .dynamic-header-icon-right {
        width: 32px;
        height: 32px;
        filter: brightness(0) invert(1);
    }
/* Dialog operation guard */
.dialog-operation-bar {
    background: #fff8e6;
    color: #7a4b00;
    border-bottom: 1px solid #f2d28b;
    padding: 0.65rem 1.2rem;
    font-size: 0.88rem;
    line-height: 1.8;
    text-align: center;
    font-weight: 700;
}

.complaint-dialog-close:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Complaint list filters */

.complaint-list-toolbar {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 220px) auto;
    align-items: end;
    gap: clamp(0.5rem, 0.9vw, 0.9rem);
    margin: clamp(0.45rem, 1vh, 1rem) 0;
    padding: clamp(0.6rem, 1vw, 1rem);
    border: 1px solid #dfe4ff;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
}

.complaint-search-box,
.complaint-status-filter {
    display: grid;
    gap: 0.45rem;
}

    .complaint-search-box label,
    .complaint-status-filter label {
        color: #14277e;
        font-size: 0.88rem;
        font-weight: 800;
    }

    .complaint-search-box input,
    .complaint-status-filter select {
        width: 100%;
        min-height: 46px;
        border: 1px solid #cfd5ff;
        border-radius: 15px;
        padding: 0 0.85rem;
        font-family: inherit;
        color: #14277e;
        background: #fff;
        outline: none;
    }

        .complaint-search-box input:focus,
        .complaint-status-filter select:focus {
            border-color: #596de8;
            box-shadow: 0 0 0 3px rgba(89, 109, 232, 0.15);
        }

        .complaint-search-box input:disabled,
        .complaint-status-filter select:disabled {
            background: #f2f4ff;
            cursor: not-allowed;
        }

.complaint-filter-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

    .complaint-filter-summary span {
        color: #14277e;
        background: #eef2ff;
        border: 1px solid #cfd5ff;
        border-radius: 999px;
        padding: 0.45rem 0.8rem;
        font-size: 0.84rem;
        font-weight: 800;
        white-space: nowrap;
    }

.btn-clear-complaint-filters {
    min-height: 42px;
    border: 0;
    border-radius: 14px;
    background: #2b24ba;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88rem;
    padding: 0 1rem;
    white-space: nowrap;
}

    .btn-clear-complaint-filters:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

/* Complaint status badges inside table */

.complaint-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.4;
    white-space: nowrap;
    border: 1px solid transparent;
}

    .complaint-status-badge.registered {
        color: #1f3a8a;
        background: #eaf0ff;
        border-color: #c7d4ff;
    }

    .complaint-status-badge.under-review {
        color: #7a4b00;
        background: #fff8e6;
        border-color: #f2d28b;
    }

    .complaint-status-badge.answered {
        color: #155e75;
        background: #e9fbff;
        border-color: #aee9f5;
    }

    .complaint-status-badge.waiting-feedback {
        color: #6d28d9;
        background: #f3e8ff;
        border-color: #d8b4fe;
    }

    .complaint-status-badge.closed-satisfied {
        color: #146c43;
        background: #eefbf4;
        border-color: #bfe8d0;
    }

    .complaint-status-badge.closed-not-satisfied {
        color: #a10000;
        background: #ffe9e9;
        border-color: #ffc7c7;
    }

    .complaint-status-badge.escalated {
        color: #9a3412;
        background: #fff1e8;
        border-color: #fdba74;
    }

    .complaint-status-badge.unknown {
        color: #475569;
        background: #f1f5f9;
        border-color: #cbd5e1;
    }

/* Complaint summary cards */

.complaint-summary-cards {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: clamp(0.45rem, 0.8vw, 0.75rem);
    margin: clamp(0.45rem, 1vh, 1rem) 0;
}

.complaint-summary-tile {
    min-height: clamp(82px, 10vh, 118px);
    border: 1px solid #dfe4ff;
    border-radius: 18px;
    background: #ffffff;
    padding: clamp(0.55rem, 0.85vw, 0.85rem);
    cursor: pointer;
    font-family: inherit;
    text-align: right;
    display: grid;
    align-content: space-between;
    gap: 0.35rem;
    box-shadow: 0 8px 22px rgba(40, 47, 120, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

    .complaint-summary-tile:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 30px rgba(40, 47, 120, 0.10);
        border-color: #aeb9ff;
    }

    .complaint-summary-tile:disabled {
        opacity: 0.65;
        cursor: not-allowed;
        transform: none;
    }

    .complaint-summary-tile span {
        color: #14277e;
        font-size: 0.86rem;
        font-weight: 800;
    }

    .complaint-summary-tile strong {
        color: #14277e;
        font-size: clamp(1.15rem, 1.5vw, 1.65rem);
        font-weight: 900;
        line-height: 1.2;
    }

    .complaint-summary-tile small {
        color: #6872a9;
        font-size: 0.7rem;
        line-height: 1.6;
    }

    .complaint-summary-tile.active {
        border-color: #2b24ba;
        box-shadow: 0 0 0 3px rgba(43, 36, 186, 0.12), 0 12px 28px rgba(40, 47, 120, 0.10);
    }

    .complaint-summary-tile.total {
        background: linear-gradient(180deg, #ffffff 0%, #f4f6ff 100%);
    }

    .complaint-summary-tile.registered {
        background: linear-gradient(180deg, #ffffff 0%, #eaf0ff 100%);
    }

    .complaint-summary-tile.under-review {
        background: linear-gradient(180deg, #ffffff 0%, #fff8e6 100%);
    }

    .complaint-summary-tile.answered {
        background: linear-gradient(180deg, #ffffff 0%, #e9fbff 100%);
    }

    .complaint-summary-tile.waiting-feedback {
        background: linear-gradient(180deg, #ffffff 0%, #f3e8ff 100%);
    }

    .complaint-summary-tile.closed {
        background: linear-gradient(180deg, #ffffff 0%, #eefbf4 100%);
    }

    .complaint-summary-tile.escalated {
        background: linear-gradient(180deg, #ffffff 0%, #fff1e8 100%);
    }

/* Complaint empty / no-result state */

.complaint-empty-state {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0 0 0;
    padding: 1.1rem;
    border: 1px solid #dfe4ff;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
    box-shadow: 0 10px 26px rgba(40, 47, 120, 0.07);
}

    .complaint-empty-state.no-result {
        background: linear-gradient(180deg, #ffffff 0%, #fffdf7 100%);
        border-color: #f2d28b;
    }

.complaint-empty-icon {
    width: 62px;
    height: 62px;
    border-radius: 20px;
    background: #eef2ff;
    border: 1px solid #cfd5ff;
    color: #14277e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.92rem;
    font-weight: 900;
    text-align: center;
}

.complaint-empty-state.no-result .complaint-empty-icon {
    background: #fff8e6;
    border-color: #f2d28b;
    color: #7a4b00;
}

.complaint-empty-content {
    min-width: 0;
}

    .complaint-empty-content h3 {
        margin: 0 0 0.35rem 0;
        color: #14277e;
        font-size: 1.05rem;
    }

    .complaint-empty-content p {
        margin: 0;
        color: #6872a9;
        font-size: 0.9rem;
        line-height: 1.9;
    }

.complaint-empty-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-empty-primary,
.btn-empty-secondary {
    min-height: 42px;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0 1rem;
    white-space: nowrap;
}

.btn-empty-primary {
    background: #2b24ba;
    color: #fff;
}

    .btn-empty-primary:hover {
        background: #201a9a;
    }

.btn-empty-secondary {
    background: #eef2ff;
    color: #14277e;
    border: 1px solid #cfd5ff;
}

    .btn-empty-secondary:hover {
        background: #e1e7ff;
    }

/* Customer feedback section */

.complaint-feedback-section {
    display: grid;
    gap: 1rem;
}

.customer-feedback-form {
    display: grid;
    gap: 1rem;
    border: 1px solid #dfe4ff;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
    padding: 1rem;
}

.feedback-choice-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.feedback-choice-button {
    min-height: 44px;
    border-radius: 15px;
    border: 1px solid #cfd5ff;
    background: #ffffff;
    color: #14277e;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 800;
    padding: 0 1rem;
}

    .feedback-choice-button:hover {
        background: #f3f6ff;
    }

    .feedback-choice-button.active {
        box-shadow: 0 0 0 3px rgba(43, 36, 186, 0.12);
    }

    .feedback-choice-button.satisfied.active {
        color: #146c43;
        background: #eefbf4;
        border-color: #bfe8d0;
    }

    .feedback-choice-button.not-satisfied.active {
        color: #a10000;
        background: #ffe9e9;
        border-color: #ffc7c7;
    }

    .feedback-choice-button:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.feedback-text-box {
    display: grid;
    gap: 0.55rem;
}

    .feedback-text-box textarea {
        width: 100%;
        border: 1px solid #cfd5ff;
        border-radius: 16px;
        padding: 0.85rem 1rem;
        font-family: inherit;
        color: #14277e;
        background: #ffffff;
        outline: none;
        resize: vertical;
        line-height: 1.9;
    }

        .feedback-text-box textarea:focus {
            border-color: #596de8;
            box-shadow: 0 0 0 3px rgba(89, 109, 232, 0.15);
        }

        .feedback-text-box textarea:disabled {
            background: #f2f4ff;
            cursor: not-allowed;
        }

.feedback-actions {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.btn-submit-feedback {
    min-height: 44px;
    border: 0;
    border-radius: 15px;
    background: #2b24ba;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 800;
    padding: 0 1rem;
    white-space: nowrap;
}

    .btn-submit-feedback:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.feedback-submit-hint {
    color: #6872a9;
    background: #f8f9ff;
    border: 1px dashed #d9defd;
    border-radius: 14px;
    padding: 0.65rem 0.85rem;
    font-size: 0.86rem;
    line-height: 1.8;
}

    .feedback-submit-hint.ready {
        color: #146c43;
        background: #eefbf4;
        border-color: #bfe8d0;
    }

.feedback-error-box {
    margin-top: 0;
}

.feedback-waiting-box {
    min-width: 0;
    padding: 0.85rem 1rem;
}

.customer-feedback-result {
    display: grid;
    gap: 0.75rem;
    border-radius: 18px;
    padding: 1rem;
    border: 1px solid #dfe4ff;
    background: #f8f9ff;
}

    .customer-feedback-result.satisfied {
        background: #eefbf4;
        border-color: #bfe8d0;
    }

    .customer-feedback-result.not-satisfied {
        background: #ffe9e9;
        border-color: #ffc7c7;
    }

    .customer-feedback-result strong {
        display: block;
        color: #14277e;
        font-size: 0.98rem;
        margin-bottom: 0.25rem;
    }

    .customer-feedback-result span {
        color: #6872a9;
        font-size: 0.84rem;
    }

    .customer-feedback-result p {
        margin: 0;
        color: #263055;
        line-height: 1.9;
        white-space: pre-wrap;
    }

.summary-card-spaced {
    margin-bottom: 1.2rem;
}

/* Fixed custom dropdown for sample / variety */
.create-sample-field {
    display: grid;
    gap: 0.45rem;
    color: #14277e;
    font-weight: 600;
    min-width: 0;
}

.sample-select-wrapper {
    position: relative;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.sample-select-trigger {
    width: 100%;
    height: 52px;
    min-height: 52px;
    max-height: 52px;
    max-width: 100%;
    border: 1px solid #cfd5ff;
    border-radius: 15px;
    padding: 0 0.85rem 0 .3rem;
    font-family: inherit;
    color: #14277e;
    background: #fff;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    text-align: right;
    direction: rtl;
    box-sizing: border-box;
    overflow: hidden;
}

    .sample-select-trigger:focus {
        border-color: #596de8;
        box-shadow: 0 0 0 3px rgba(89, 109, 232, 0.15);
    }

    .sample-select-trigger:disabled {
        background: #f2f4ff;
        cursor: not-allowed;
    }

.sample-select-trigger-text {
    flex: 1 1 auto;
    min-width: 0;
    color: #14277e;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

    .sample-select-trigger-text span {
        display: block;
        width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.sample-select-placeholder {
    color: #6872a9;
    white-space: nowrap;
}

.sample-select-arrow {
    flex: 0 0 18px;
    width: 8px;
    height: 8px;
    min-width: 8px;
    max-width: 8px;
    min-height: 8px;
    max-height: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    font-size: 0;
    line-height: 1;
    box-sizing: border-box;
    position: relative;
}

    .sample-select-arrow::before {
        content: "";
        width: 5px;
        height: 5px;
        border-inline-end: 1.8px solid #14277e;
        border-bottom: 1.8px solid #14277e;
        transform: rotate(-45deg);
        margin-top: -3px;
    }

.sample-select-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #ffffff;
    border: 1px solid #cfd5ff;
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(20, 39, 126, 0.18);
    padding: 0.35rem;
    direction: rtl;
    z-index: 3000;
    box-sizing: border-box;
}

.sample-select-option {
    width: 100%;
    max-width: 100%;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #14277e;
    cursor: pointer;
    display: block;
    font-family: inherit;
    font-size: 0.86rem;
    line-height: 1.75;
    margin: 0.15rem 0;
    padding: 0.5rem 0.65rem;
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    box-sizing: border-box;
}

    .sample-select-option:hover,
    .sample-select-option:focus {
        background: #eef2ff;
        outline: none;
    }

    .sample-select-option.selected {
        background: #e7ebff;
        color: #14277e;
        font-weight: 800;
        box-shadow: inset -3px 0 0 #2b24ba;
    }

.sample-select-option-placeholder {
    color: #6872a9;
}


/* ===== Media queries: large to small ===== */

@media (max-width: 1300px) {
    .complaint-summary-cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .complaint-list-toolbar {
        grid-template-columns: 1fr 220px;
    }

    .complaint-filter-summary {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 900px) {
    .complaint-summary {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
    }

    .target-list {
        grid-template-columns: 1fr;
    }

    .contract-search-row {
        grid-template-columns: 1fr;
    }

    .contract-result-list {
        grid-template-columns: 1fr;
    }

    .create-form-grid {
        grid-template-columns: 1fr;
    }

    .test-option-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .attachment-card {
        align-items: stretch;
        flex-direction: column;
    }

    .attachment-upload-grid {
        grid-template-columns: 1fr;
    }

    .btn-download-attachment,
    .btn-upload-attachment {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .create-attachment-header {
        flex-direction: column;
    }

    .create-attachment-picker {
        grid-template-columns: 1fr;
    }

    .create-pending-attachment-card {
        grid-template-columns: 42px minmax(0, 1fr);
    }

        .create-pending-attachment-card .btn-remove-attachment {
            grid-column: 1 / -1;
            width: 100%;
        }
}

@media (max-width: 900px) {
    .complaint-section-title-row,
    .attachment-type-header {
        flex-direction: column;
    }

    .attachment-card-polished {
        grid-template-columns: 46px minmax(0, 1fr);
    }

        .attachment-card-polished .btn-download-attachment {
            grid-column: 1 / -1;
            width: 100%;
        }
}

@media (max-width: 900px) {
    .complaint-summary-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .complaint-empty-state {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .complaint-empty-icon {
        margin: 0 auto;
    }

    .complaint-empty-actions {
        justify-content: center;
    }
}

@media (max-width: 900px) {
    .sample-select-menu {
        max-height: 220px;
    }

    .complaints-panel .dynamic-header-button {
        justify-content: center;
    }
}

@media (max-width: 760px) {
    .complaint-list-toolbar {
        grid-template-columns: 1fr;
    }

    .complaint-filter-summary,
    .complaint-filter-summary span,
    .btn-clear-complaint-filters {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .create-actions,
    .message-compose-header,
    .message-actions-polished {
        align-items: stretch;
        flex-direction: column;
    }

        .create-actions .btn-submit-complaint,
        .create-submit-hint,
        .message-counter,
        .message-actions-polished .btn-send-message,
        .message-submit-hint {
            width: 100%;
        }
}

@media (max-width: 700px) {
    .feedback-choice-group,
    .feedback-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .feedback-choice-button,
    .btn-submit-feedback,
    .feedback-submit-hint {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .complaint-summary-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .complaint-empty-actions,
    .btn-empty-primary,
    .btn-empty-secondary {
        width: 100%;
    }
}

/* ===== Phase 9 responsive complaint page ===== */
@media (max-width: 1120px), (max-height: 760px) {
    .complaints-panel {
        height: auto;
        min-height: auto;
        overflow: visible;
    }

    .complaint-dialog-backdrop {
        align-items: stretch;
        padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem max(0.75rem, env(safe-area-inset-bottom));
    }

    .complaint-dialog {
        width: min(100%, 1100px);
        max-height: calc(100dvh - 1.5rem);
    }

    .complaint-summary-cards {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .complaint-dialog-backdrop {
        padding: 0;
    }

    .complaint-dialog {
        width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }

    .complaint-dialog-header {
        padding: 0.9rem 1rem;
    }

        .complaint-dialog-header h3 {
            font-size: 1.05rem;
        }

    .complaint-dialog-body {
        padding: 0.8rem;
    }

    .complaint-summary-cards {
        grid-template-columns: 1fr;
    }

    /*    .complaint-summary-tile {
        display: flex;
        min-height: 40px;
        height: fit-content;
        gap: 1rem;
    }*/

    .complaint-summary-tile {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 3.5rem minmax(0, 1fr);
        grid-template-areas: "hint value title";
        align-items: center;
        min-height: 44px;
        height: auto;
        gap: 0.5rem;
        padding: 0.45rem 0.75rem;
        direction: ltr;
    }

        .complaint-summary-tile span {
            grid-area: title;
            justify-self: end;
            text-align: right;
            direction: rtl;
            white-space: nowrap;
        }

        .complaint-summary-tile strong {
            grid-area: value;
            justify-self: center;
            width: 3.5rem;
            text-align: center;
            direction: ltr;
            font-variant-numeric: tabular-nums;
            line-height: 1;
        }

        .complaint-summary-tile small {
            grid-area: hint;
            justify-self: start;
            text-align: left;
            direction: rtl;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 100%;
        }

    .message-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}

@media (max-height: 760px) {
    /* Compact complaint page for short laptop screens.
       Keep this block at the very end of the file so it overrides earlier media queries. */

    .complaints-panel {
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .complaint-list-toolbar {
        margin: 0.35rem 0;
        padding: 0.45rem 0.6rem;
        gap: 0.45rem;
        border-radius: 14px;
    }

    .complaint-search-box,
    .complaint-status-filter {
        gap: 0.25rem;
    }

        .complaint-search-box label,
        .complaint-status-filter label {
            font-size: 0.78rem;
        }

        .complaint-search-box input,
        .complaint-status-filter select {
            min-height: 36px;
            border-radius: 12px;
            padding: 0 0.65rem;
            font-size: 0.84rem;
        }

    .complaint-filter-summary span,
    .btn-clear-complaint-filters {
        min-height: 34px;
        padding: 0.28rem 0.65rem;
        font-size: 0.78rem;
    }

    .complaint-summary-cards {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 0.4rem;
        margin: 0.35rem 0;
    }

    .complaint-summary-tile {
        min-height: 58px;
        border-radius: 14px;
        padding: 0.42rem 0.55rem;
        gap: 0.18rem;
        box-shadow: 0 5px 14px rgba(40, 47, 120, 0.05);
    }

        .complaint-summary-tile:hover {
            transform: none;
        }

        .complaint-summary-tile span {
            font-size: 0.74rem;
            line-height: 1.25;
        }

        .complaint-summary-tile strong {
            font-size: 1.05rem;
            line-height: 1.05;
        }

        .complaint-summary-tile small {
            font-size: 0.62rem;
            line-height: 1.3;
        }

    .table-scroll-container.complaint-table-scroll-container,
    .complaints-panel .table-scroll-container {
        flex: 1 1 auto;
        min-height: 0;
        max-height: calc(100dvh - 265px);
        overflow: auto;
    }

    .complaints-panel table th,
    .complaints-panel table td {
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
        font-size: 0.82rem;
        line-height: 1.45;
    }

    .complaint-status-badge {
        min-width: 82px;
        padding: 0.22rem 0.55rem;
        font-size: 0.72rem;
    }
}

@media (max-height: 680px) {
    .complaint-summary-tile {
        min-height: 50px;
        padding: 0.35rem 0.5rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

        .complaint-summary-tile small {
            display: none;
        }

    .table-scroll-container.complaint-table-scroll-container,
    .complaints-panel .table-scroll-container {
        max-height: calc(100dvh - 220px);
    }
}
