/* Email Log table and event metadata */
.subin-email-log-summary {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.subin-log-table-card {
	margin-top: 16px;
	overflow-x: auto;
	background: #fff;
	border: 1px solid #d8e2ee;
	border-radius: 16px;
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.subin-log-table {
	margin: 0;
	border: 0;
	border-collapse: collapse;
}

.subin-log-table th {
	padding: 12px;
	color: #64748b;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	background: #f8fafc;
	border-bottom: 1px solid #e4edf7;
}

.subin-log-table td {
	padding: 12px;
	vertical-align: top;
	border-bottom: 1px solid #edf2f7;
}

.subin-log-table tr:last-child td {
	border-bottom: 0;
}

.subin-row-failed td:first-child {
	border-left: 3px solid #ef4444;
}

.subin-source-pill {
	display: inline-flex;
	align-items: center;
	min-height: 24px;
	padding: 3px 9px;
	color: #334155;
	background: #f8fafc;
	border: 1px solid #d8e2ee;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 650;
	white-space: nowrap;
}

.subin-event-type-pill {
	display: inline-flex;
	align-items: center;
	min-height: 22px;
	margin-top: 5px;
	padding: 2px 8px;
	color: #0f766e;
	background: #ecfdf5;
	border: 1px solid #99f6e4;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	white-space: nowrap;
}

.subin-event-type-pill::before {
	content: "\f466";
	margin-right: 4px;
	font-family: dashicons;
	font-size: 13px;
	line-height: 1;
}

.subin-related-lead {
	font-weight: 650;
	text-decoration: none;
}

.subin-log-error {
	display: inline-block;
	max-width: 280px;
	padding: 6px 8px;
	color: #991b1b;
	background: #fff7f7;
	border: 1px solid #fecaca;
	border-radius: 8px;
	overflow-wrap: anywhere;
}

.subin-log-subject {
	display: block;
	max-width: 320px;
	color: #172033;
	font-weight: 650;
	overflow-wrap: anywhere;
}

.subin-log-subtext {
	display: block;
	margin-top: 3px;
	color: #94a3b8;
	font-size: 12px;
}

/* Email Health dashboard */
.subin-status-alert {
	margin-top: 16px;
	padding: 20px;
	background: #fff;
	border: 1px solid #d8e2ee;
	border-radius: 18px;
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.subin-status-alert--danger {
	border-color: #f0b9b3;
}

.subin-status-alert--success {
	border-color: #bbf7d0;
}

.subin-status-alert h2 {
	margin: 0 0 6px;
	color: #172033;
}

.subin-status-alert p {
	max-width: 820px;
	margin: 0;
	color: #475569;
	line-height: 1.5;
}

.subin-status-alert__code {
	display: block;
	max-width: 920px;
	margin: 14px 0 0;
	padding: 12px;
	overflow: auto;
	color: #7f1d1d;
	background: #fff7f7;
	border: 1px solid #fecaca;
	border-radius: 12px;
	white-space: pre-wrap;
}

.subin-status-alert__actions,
.subin-source-card__head,
.subin-issue-card__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.subin-status-alert__actions {
	justify-content: flex-start;
	margin-top: 14px;
}

.subin-status-summary-grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 12px;
	margin: 20px 0;
}

.subin-status-summary-card,
.subin-source-card,
.subin-issue-card {
	background: #fff;
	border: 1px solid #d8e2ee;
	border-radius: 16px;
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.subin-status-summary-card {
	padding: 16px;
}

.subin-source-grid,
.subin-issue-list {
	display: grid;
	gap: 14px;
}

.subin-source-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.subin-source-card,
.subin-issue-card {
	padding: 18px;
}

.subin-source-card--danger,
.subin-issue-card--danger {
	border-color: #f0b9b3;
}

.subin-source-card h3,
.subin-issue-card h3 {
	margin: 0;
	color: #172033;
	font-size: 17px;
}

.subin-source-metrics {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;
	margin-top: 14px;
}

.subin-source-metrics span {
	padding: 10px;
	color: #64748b;
	background: #f8fafc;
	border: 1px solid #e4edf7;
	border-radius: 12px;
	font-size: 12px;
}

.subin-source-metrics strong {
	display: block;
	margin-top: 3px;
	color: #172033;
	font-size: 18px;
}

.subin-source-error {
	margin-top: 14px;
	padding: 12px;
	background: #fff7f7;
	border: 1px solid #fecaca;
	border-radius: 12px;
}

.subin-source-error span {
	display: block;
	margin-bottom: 5px;
	color: #991b1b;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
}

.subin-source-error code {
	display: block;
	color: #7f1d1d;
	white-space: pre-wrap;
}

.subin-issue-card p {
	margin: 8px 0 0;
	color: #475569;
	line-height: 1.5;
}

.subin-issue-card__head p {
	margin: 4px 0 0;
}

.subin-issue-meta {
	display: grid;
	gap: 7px;
	margin-top: 12px;
	color: #64748b;
}

.subin-issue-meta strong {
	color: #172033;
}

/* Email Health card icons */
.subin-email-status-page .subin-status-summary-card {
    position: relative;
    overflow: hidden;
    padding-left: 62px;
}

.subin-email-status-page .subin-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    font-size: 18px;
    line-height: 1;
}

.subin-email-status-page .subin-status-summary-card > .subin-status-icon {
    position: absolute;
    top: 18px;
    left: 18px;
}

.subin-email-status-page .subin-status-icon::before {
    width: auto;
    height: auto;
    font-size: inherit;
    line-height: 1;
}

.subin-email-status-page .subin-status-icon--total {
    background: #eef5ff;
    color: #2563eb;
}

.subin-email-status-page .subin-status-icon--sent {
    background: #ecf8ee;
    color: #2f7d3b;
}

.subin-email-status-page .subin-status-icon--failed {
    background: #fff1f0;
    color: #b42318;
}

.subin-email-status-page .subin-status-icon--no_email_generated {
    background: #fff7ed;
    color: #b45309;
}

.subin-email-status-page .subin-status-icon--unknown {
    background: #f1f5f9;
    color: #64748b;
}

.subin-email-status-page .subin-source-card__title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.subin-email-status-page .subin-source-card__title h3 {
    margin: 0;
}

.subin-email-status-page .subin-source-card__title .subin-status-icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    background: #eef5ff;
    color: #2563eb;
}

.subin-email-status-page .subin-source-card--danger .subin-source-card__title .subin-status-icon {
    background: #fff7ed;
    color: #b45309;
}

@media (max-width: 760px) {
    .subin-email-status-page .subin-status-summary-card {
        padding-left: 56px;
    }

    .subin-email-status-page .subin-status-summary-card > .subin-status-icon {
        left: 14px;
    }
}

/* Email Health source metrics */
.subin-email-status-page .subin-source-metrics span {
    border-color: #dbe6f4;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.subin-email-status-page .subin-source-metrics span strong {
    color: #172033;
}

.subin-email-status-page .subin-source-metrics span:nth-child(1) strong {
    color: #2f7d3b;
}

.subin-email-status-page .subin-source-metrics span:nth-child(2) strong,
.subin-email-status-page .subin-source-metrics span:nth-child(3) strong,
.subin-email-status-page .subin-source-metrics span:nth-child(4) strong {
    color: #172033;
}

.subin-email-status-page .subin-source-card--danger .subin-source-metrics span:nth-child(2) {
    border-color: #f0c4c1;
    background: linear-gradient(180deg, #ffffff 0%, #fff8f8 100%);
}

.subin-email-status-page .subin-source-card--danger .subin-source-metrics span:nth-child(2) strong {
    color: #b42318;
}

.subin-email-status-page .subin-source-card--danger .subin-source-metrics span:nth-child(3) {
    border-color: #f2d8ae;
    background: linear-gradient(180deg, #ffffff 0%, #fffaf2 100%);
}

.subin-email-status-page .subin-source-card--danger .subin-source-metrics span:nth-child(3) strong {
    color: #b45309;
}

.subin-email-status-page .subin-source-card--danger .subin-source-metrics span:nth-child(4) {
    border-color: #d6e1ee;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.subin-email-status-page .subin-source-card--danger .subin-source-metrics span:nth-child(4) strong {
    color: #475569;
}

/* Email Log summary icons */
.subin-email-log-page .subin-email-log-summary .subin-summary-card {
    position: relative;
    overflow: hidden;
    padding-left: 62px;
}

.subin-email-log-page .subin-email-log-summary .subin-status-icon {
    position: absolute;
    top: 18px;
    left: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    font-size: 18px;
    line-height: 1;
}

.subin-email-log-page .subin-email-log-summary .subin-status-icon::before {
    width: auto;
    height: auto;
    font-size: inherit;
    line-height: 1;
}

.subin-email-log-page .subin-status-icon--total {
    background: #eef5ff;
    color: #2563eb;
}

.subin-email-log-page .subin-status-icon--sent {
    background: #ecf8ee;
    color: #2f7d3b;
}

.subin-email-log-page .subin-status-icon--failed {
    background: #fff1f0;
    color: #b42318;
}

.subin-email-log-page .subin-status-icon--unknown {
    background: #f1f5f9;
    color: #64748b;
}

@media (max-width: 760px) {
    .subin-email-log-page .subin-email-log-summary .subin-summary-card {
        padding-left: 56px;
    }

    .subin-email-log-page .subin-email-log-summary .subin-status-icon {
        left: 14px;
    }
}

/* Email pages responsive layout */
@media (max-width: 900px) {
	.subin-email-status-page .subin-status-summary-grid,
	.subin-email-status-page .subin-source-grid,
	.subin-email-status-page .subin-source-metrics,
	.subin-email-log-page .subin-email-log-summary {
		grid-template-columns: 1fr;
	}
}
