/* Notifications page: fixed columns, wrap long text, no column bleed */

.notifications-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.notifications-table {
    width: 100%;
    table-layout: fixed;
    min-width: 720px;
}

.notifications-table.notifications-push-table {
    min-width: 880px;
}

.notifications-table th,
.notifications-table td {
    vertical-align: middle;
    overflow: hidden;
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: none;
}

.notifications-table td:has(.dash-row-actions),
.notifications-table td:has(.product-row-actions) {
    overflow: visible;
}

.notifications-table .notification-title,
.notifications-table .notification-message {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

.notifications-table .notification-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-weight: 500;
}

.notifications-table .notification-message {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: var(--fs-sm);
}

.notifications-table .notification-meta,
.notifications-table .notification-status-cell,
.notifications-table .notification-actions-cell {
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notifications-table .notification-actions-cell {
    white-space: nowrap !important;
    overflow: visible;
}

.notifications-table .notification-actions-cell .category-inline-actions,
.notifications-table .notification-actions-cell .table-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.notifications-table .notification-open-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    max-width: 100%;
}

.notifications-table .notification-open-link .notification-open-label {
    font-size: var(--fs-xs);
    font-weight: 600;
}

/* Inbox column widths: Title | Message | Created | Status | Actions */
.notifications-inbox-table th:nth-child(1),
.notifications-inbox-table td:nth-child(1) {
    width: 22%;
}

.notifications-inbox-table th:nth-child(2),
.notifications-inbox-table td:nth-child(2) {
    width: 40%;
}

.notifications-inbox-table th:nth-child(3),
.notifications-inbox-table td:nth-child(3) {
    width: 14%;
}

.notifications-inbox-table th:nth-child(4),
.notifications-inbox-table td:nth-child(4) {
    width: 10%;
}

.notifications-inbox-table th:nth-child(5),
.notifications-inbox-table td:nth-child(5) {
    width: 14%;
}

/* Push history: Title | Audience | Target | Status | Delivery | Created | Actions */
.notifications-push-table th:nth-child(1),
.notifications-push-table td:nth-child(1) {
    width: 24%;
}

.notifications-push-table th:nth-child(2),
.notifications-push-table td:nth-child(2) {
    width: 12%;
}

.notifications-push-table th:nth-child(3),
.notifications-push-table td:nth-child(3) {
    width: 12%;
}

.notifications-push-table th:nth-child(4),
.notifications-push-table td:nth-child(4) {
    width: 10%;
}

.notifications-push-table th:nth-child(5),
.notifications-push-table td:nth-child(5) {
    width: 12%;
}

.notifications-push-table th:nth-child(6),
.notifications-push-table td:nth-child(6) {
    width: 14%;
}

.notifications-push-table th:nth-child(7),
.notifications-push-table td:nth-child(7) {
    width: 10%;
}

.notifications-table tr.table-row-unread {
    background: color-mix(in srgb, var(--primary-light) 55%, transparent);
}

.notifications-table tr.table-row-unread:hover {
    background: color-mix(in srgb, var(--primary-light) 75%, transparent);
}

.dash-notification-detail-body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dash-notification-detail-body .detail-label {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.dash-notification-detail-body .detail-block {
    margin-bottom: var(--space-4);
}

.dash-notification-detail-body .detail-message {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.5;
}

[dir="rtl"] .notifications-table .notification-title,
[dir="rtl"] .notifications-table .notification-message,
[dir="rtl"] .dash-notification-detail-body {
    text-align: right;
}

[dir="ltr"] .notifications-table .notification-title,
[dir="ltr"] .notifications-table .notification-message,
[dir="ltr"] .dash-notification-detail-body {
    text-align: left;
}

[dir="rtl"] .notifications-table .notification-meta,
[dir="rtl"] .notifications-table .notification-status-cell,
[dir="ltr"] .notifications-table .notification-meta,
[dir="ltr"] .notifications-table .notification-status-cell {
    text-align: start;
}

[dir="rtl"] .notifications-table .notification-actions-cell,
[dir="ltr"] .notifications-table .notification-actions-cell {
    text-align: end;
}

/* Override products table nowrap / sticky bleed for this page */
.notifications-table-wrapper.products-table-wrap .notifications-table th,
.notifications-table-wrapper.products-table-wrap .notifications-table td {
    white-space: normal;
}

.notifications-table-wrapper.products-table-wrap .notifications-table {
    min-width: 720px;
}

.notifications-table-wrapper.products-table-wrap .notifications-push-table {
    min-width: 880px;
}

@media (max-width: 768px) {
    .notifications-table.notifications-inbox-table,
    .notifications-table.notifications-push-table {
        min-width: 640px;
    }
}
