.sidebar-nav button[data-view-target="agent-customers"] span {
    white-space: normal;
    line-height: 1.25;
}

.workspace-view[data-workspace-view="agent-customers"] {
    width: 100%;
}

.agent-customer-panel {
    min-width: 0;
}

.agent-customer-panel-head {
    align-items: flex-start;
}

.agent-customer-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.agent-customer-actions .button {
    text-decoration: none;
}

.agent-customer-sale-status {
    display: block;
    min-height: 15px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

.agent-customer-sale-status.error {
    color: var(--red);
}

.agent-customer-recognize {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 16px;
    padding: 0 0 16px;
    border-bottom: 1px solid #e5ebf1;
}

.agent-customer-recognize[hidden] {
    display: none;
}

.agent-customer-recognize-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.agent-customer-recognize-copy strong {
    color: #35465a;
    font-size: 12px;
}

.agent-customer-recognize-copy small,
.agent-customer-recognize-status {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

.agent-customer-recognize-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.agent-customer-recognize-actions .button {
    margin: 0;
    text-decoration: none;
}

.agent-customer-recognize-picker {
    position: relative;
    overflow: hidden;
}

.agent-customer-recognize-picker input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.agent-customer-recognize-picker.is-disabled {
    cursor: not-allowed;
    opacity: .55;
}

.agent-customer-recognize-picker.is-disabled input {
    cursor: not-allowed;
}

.agent-customer-recognize-status {
    grid-column: 1 / -1;
    min-height: 15px;
}

.agent-customer-recognize-status.error {
    color: var(--red);
}

.agent-customer-filter-form {
    margin: 0 0 14px;
    padding: 12px;
    border: 1px solid #e2e8ef;
    border-radius: 6px;
    background: #f8fafc;
}

.agent-customer-filter-grid {
    display: grid;
    grid-template-columns: minmax(180px, 2fr) repeat(3, minmax(120px, 1fr)) repeat(3, minmax(140px, 1fr)) auto;
    align-items: end;
    gap: 10px;
}

.agent-customer-filter-grid label {
    display: grid;
    gap: 5px;
    min-width: 0;
    color: #536174;
    font-size: 11px;
}

.agent-customer-filter-grid input,
.agent-customer-filter-grid select {
    width: 100%;
    min-width: 0;
    height: 35px;
    padding: 0 9px;
    border: 1px solid #d5dee8;
    border-radius: 6px;
    outline: none;
    color: var(--ink);
    background: #fff;
}

.agent-customer-filter-grid input:focus,
.agent-customer-filter-grid select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(36, 120, 211, .1);
}

.agent-customer-filter-grid .button {
    height: 35px;
    white-space: nowrap;
}

.agent-customer-table-wrap {
    min-height: 180px;
}

.agent-customer-table {
    min-width: 980px;
}

.agent-customer-table td {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-customer-table td:nth-child(4),
.agent-customer-table td:nth-child(7) {
    max-width: 220px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.agent-customer-blacklist-warning {
    display: block;
    margin-top: 5px;
    color: var(--red);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.agent-customer-empty {
    padding: 42px 16px !important;
    color: var(--muted);
    text-align: center !important;
}

.agent-customer-pagination {
    min-height: 29px;
}

.agent-customer-dialog {
    width: min(620px, calc(100vw - 32px));
}

.agent-customer-edit-dialog {
    width: min(1060px, calc(100vw - 32px));
    height: min(780px, calc(100vh - 48px));
    min-height: 0;
    overflow: clip;
}

.agent-customer-import-form,
.agent-customer-edit-form {
    min-height: 0;
    max-height: calc(100vh - 170px);
    overflow: auto;
    padding: 18px 20px 20px;
}

.agent-customer-edit-dialog .opening-confirm-panel {
    height: 100%;
    min-height: 0;
    overflow: clip;
}

.agent-customer-edit-dialog .agent-customer-edit-form {
    height: 100%;
    max-height: none;
}

.agent-customer-import-form .dialog-actions,
.agent-customer-edit-form .dialog-actions {
    position: sticky;
    bottom: -20px;
    z-index: 1;
    margin: 0 -20px -20px;
    padding: 14px 20px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.agent-customer-file-zone {
    min-height: 110px;
}

.agent-customer-edit-form textarea {
    resize: vertical;
    min-height: 64px;
}

.agent-customer-upload-section,
.agent-customer-evidence-section {
    padding: 16px 0;
    border-top: 1px solid #e5ebf1;
}

.agent-customer-upload-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.agent-customer-upload-section-head strong,
.agent-customer-evidence-title,
.agent-customer-image-field > strong {
    color: #35465a;
    font-size: 12px;
}

.agent-customer-upload-section-head small,
.agent-customer-image-status {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

.agent-customer-image-status {
    display: block;
    min-height: 15px;
    margin-top: 7px;
}

.agent-customer-image-status.error {
    color: var(--red);
}

.agent-customer-evidence-section {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 18px;
}

.agent-customer-evidence-title {
    padding-top: 7px;
    line-height: 1.5;
}

.agent-customer-evidence-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

.agent-customer-image-field {
    display: grid;
    grid-column: 1 / -1;
    gap: 7px;
    min-width: 0;
}

.agent-customer-image-row {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.agent-customer-image-picker {
    position: relative;
    display: grid;
    place-items: center;
    align-content: center;
    flex: 0 0 108px;
    width: 108px;
    height: 108px;
    gap: 5px;
    padding: 8px;
    border: 1px dashed #9fb5cc;
    border-radius: 6px;
    color: #52667d;
    background: #f8fafc;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.agent-customer-image-picker:hover,
.agent-customer-image-picker:focus-within,
.agent-customer-image-picker.is-dragging {
    border-color: var(--blue);
    background: #edf6ff;
    box-shadow: 0 0 0 3px rgba(36, 120, 211, .1);
}

.agent-customer-image-picker.is-uploading {
    cursor: wait;
    opacity: .68;
}

.agent-customer-image-picker input {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.agent-customer-image-picker > span {
    color: #73879d;
    font-size: 25px;
    line-height: 1;
}

.agent-customer-image-picker > strong {
    color: #52667d;
    font-size: 11px;
    font-weight: 500;
}

.agent-customer-image-list {
    display: flex;
    flex: 1 1 240px;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.agent-customer-image-list:empty {
    display: none;
}

.agent-customer-image-item {
    position: relative;
    flex: 0 0 108px;
    width: 108px;
    height: 108px;
    overflow: hidden;
    border: 1px solid #d5dee8;
    border-radius: 6px;
    background: #f4f7fa;
}

.agent-customer-image-open {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.agent-customer-image-open img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-customer-image-open span {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    padding: 8px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.agent-customer-image-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .76);
    border-radius: 50%;
    color: #fff;
    background: rgba(24, 36, 51, .78);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.agent-customer-image-preview-dialog {
    width: min(920px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 7px;
    background: #111820;
    box-shadow: 0 24px 64px rgba(10, 18, 27, .42);
}

.agent-customer-image-preview-dialog::backdrop {
    background: rgba(14, 24, 36, .74);
}

.agent-customer-image-preview-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: min(680px, calc(100vh - 40px));
    max-height: calc(100vh - 40px);
}

.agent-customer-image-preview-panel > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 16px;
    color: #eef4fa;
    background: #1a2531;
}

.agent-customer-image-preview-panel > header > div {
    display: grid;
    gap: 3px;
}

.agent-customer-image-preview-panel > header strong {
    font-size: 13px;
}

.agent-customer-image-preview-panel > header small {
    color: #9fb1c3;
    font-size: 10px;
}

.agent-customer-image-preview-panel .icon-button {
    color: #dce7f1;
}

.agent-customer-image-preview-viewer {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    min-height: 0;
    padding: 18px 10px;
}

.agent-customer-image-preview-viewer img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 130px);
    margin: auto;
    object-fit: contain;
}

.agent-customer-image-preview-nav {
    display: grid;
    place-items: center;
    width: 40px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 6px;
    color: #eef4fa;
    background: rgba(255, 255, 255, .08);
    font-size: 28px;
    cursor: pointer;
}

.agent-customer-image-preview-nav:disabled {
    cursor: default;
    opacity: .28;
}

.agent-customer-detail-dialog {
    width: min(820px, calc(100vw - 32px));
}

.agent-customer-detail-list {
    max-height: calc(100vh - 180px);
}

.agent-customer-detail-list span {
    white-space: pre-wrap;
}

.agent-customer-detail-list a {
    color: var(--blue);
    overflow-wrap: anywhere;
}

.agent-customer-sync-panel {
    grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.agent-customer-sync-status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 19px 0;
    padding: 12px 14px;
    border: 1px solid #cdd9e6;
    border-radius: 6px;
    color: #405166;
    background: #f7f9fb;
    font-size: 12px;
    line-height: 1.55;
}

.agent-customer-sync-status[hidden] {
    display: none;
}

.agent-customer-sync-status-icon {
    display: grid;
    flex: 0 0 20px;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.agent-customer-sync-status-message {
    min-width: 0;
    overflow-wrap: anywhere;
}

.agent-customer-sync-status.is-loading .agent-customer-sync-status-icon {
    border: 2px solid #c8d6e5;
    border-top-color: var(--blue);
    animation: agent-customer-sync-spin .8s linear infinite;
}

.agent-customer-sync-status.is-success {
    border-color: #b9ddca;
    color: #176a43;
    background: #f1faf5;
}

.agent-customer-sync-status.is-success .agent-customer-sync-status-icon {
    color: #fff;
    background: #25855a;
}

.agent-customer-sync-status.is-warning {
    border-color: #e5c46b;
    color: #75520b;
    background: #fff9e8;
}

.agent-customer-sync-status.is-warning .agent-customer-sync-status-icon {
    color: #fff;
    background: #a8730a;
}

.agent-customer-sync-status.is-error {
    border-color: #efc2c2;
    color: #a53434;
    background: #fff5f5;
}

.agent-customer-sync-status.is-error .agent-customer-sync-status-icon {
    color: #fff;
    background: #c94b4b;
}

.agent-customer-sync-panel .icon-button:disabled {
    cursor: not-allowed;
    opacity: .38;
}

@keyframes agent-customer-sync-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .agent-customer-sync-status.is-loading .agent-customer-sync-status-icon {
        animation: none;
    }
}

@media (max-width: 1200px) {
    .agent-customer-filter-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .agent-customer-filter-grid label:first-child {
        grid-column: span 2;
    }
}

@media (max-width: 680px) {
    .agent-customer-recognize {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
    }

    .agent-customer-recognize-actions {
        justify-content: flex-start;
    }

    .agent-customer-panel-head {
        display: grid;
        gap: 10px;
    }

    .agent-customer-actions {
        justify-content: flex-start;
    }

    .agent-customer-filter-grid,
    .agent-customer-evidence-fields {
        grid-template-columns: 1fr;
    }

    .agent-customer-evidence-section {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .agent-customer-evidence-title {
        padding-top: 0;
    }

    .agent-customer-image-field {
        grid-column: auto;
    }

    .agent-customer-upload-section-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .agent-customer-image-picker,
    .agent-customer-image-item {
        flex-basis: 96px;
        width: 96px;
        height: 96px;
    }

    .agent-customer-image-preview-viewer {
        grid-template-columns: 38px minmax(0, 1fr) 38px;
        padding-right: 4px;
        padding-left: 4px;
    }

    .agent-customer-image-preview-nav {
        width: 34px;
    }

    .agent-customer-filter-grid label:first-child {
        grid-column: auto;
    }

    .agent-customer-filter-grid .button {
        width: 100%;
    }

    .agent-customer-edit-form,
    .agent-customer-import-form {
        padding-right: 14px;
        padding-left: 14px;
    }

    .agent-customer-edit-form .dialog-actions,
    .agent-customer-import-form .dialog-actions {
        margin-right: -14px;
        margin-left: -14px;
        padding-right: 14px;
        padding-left: 14px;
    }
}
