/**
 * Sendy Newsletter admin UI
 * Version: 0.4.0
 */

.SendyPage-header {
	gap: 1rem;
	margin: 0 0 1.25rem;
}

.SendyPage-heading h2 {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 650;
	letter-spacing: -0.02em;
}

.SendyPage-meta {
	margin: 0.25rem 0 0;
	font-size: 0.9rem;
}

.SendyPage-actions .uk-button,
.SendyPage-actions .ui-button {
	margin: 0;
}

.SendyAlert {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	border-radius: 8px;
}

.SendyAlert .fa {
	margin-top: 0.2em;
}

.SendyStats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 0.75rem;
	margin: 0 0 1.25rem;
}

.SendyStat {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	min-width: 0;
	padding: 0.9rem 1rem;
	background: var(--pw-blocks-background, #fff);
	border: 1px solid var(--pw-border-color, #e2e8f0);
	border-left: 3px solid #cbd5e1;
	border-radius: 8px;
}

.SendyStat.is-good { border-left-color: #38a169; }
.SendyStat.is-warn { border-left-color: #d69e2e; }
.SendyStat.is-bad { border-left-color: #e53e3e; }

.SendyStat-value {
	font-size: 1.6rem;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.02em;
	color: var(--pw-text-color, #1a202c);
	overflow-wrap: anywhere;
}

.SendyStat.is-good .SendyStat-value { color: #276749; }
.SendyStat.is-warn .SendyStat-value { color: #8a5b00; }
.SendyStat.is-bad .SendyStat-value { color: #c53030; }

.SendyStat-label {
	color: var(--pw-muted-color, #718096);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

/* Legacy uiStat() markup renders the value before the label. */
.SendyStat > .SendyStat-value:first-child + .SendyStat-label {
	margin-top: 0.1rem;
}

.SendyStat-sub {
	color: var(--pw-muted-color, #718096);
	font-size: 0.78rem;
	line-height: 1.35;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.SendyBadge {
	display: inline-block;
	padding: 0.12em 0.65em;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 650;
	line-height: 1.6;
	letter-spacing: 0.02em;
	text-transform: capitalize;
	background: rgba(120, 120, 120, 0.16);
	color: var(--pw-text-color, inherit);
	white-space: nowrap;
}

.SendyBadge--draft,
.SendyBadge--sending {
	background: rgba(120, 120, 120, 0.18);
}

.SendyBadge--scheduled {
	background: rgba(214, 158, 46, 0.22);
	color: #8a5b00;
}

.SendyBadge--sent,
.SendyBadge--subscribed {
	background: rgba(56, 161, 105, 0.22);
	color: #276749;
}

.SendyBadge--unsubscribed,
.SendyBadge--danger {
	background: rgba(229, 62, 62, 0.18);
	color: #c53030;
}

html.pw-dark .SendyBadge--scheduled {
	color: #f6c177;
}
html.pw-dark .SendyBadge--sent,
html.pw-dark .SendyBadge--subscribed {
	color: #9ae6b4;
}
html.pw-dark .SendyBadge--unsubscribed,
html.pw-dark .SendyBadge--danger {
	color: #feb2b2;
}

.SendyEmpty {
	border: 1px dashed var(--pw-border-color, rgba(0, 0, 0, 0.18));
	border-radius: 12px;
	padding: 2.75rem 1.5rem;
	text-align: center;
	background: var(--pw-inputs-background, transparent);
}

.SendyEmpty-icon {
	font-size: 1.75rem;
	color: var(--pw-muted-color, #888);
	margin-bottom: 0.65rem;
}

.SendyEmpty h3 {
	margin: 0 0 0.35rem;
	font-size: 1.1rem;
}

.SendyEmpty p {
	margin: 0 auto 1rem;
	max-width: 36rem;
}

.SendyCode {
	font-size: 0.78em;
	padding: 0.12em 0.4em;
	border-radius: 4px;
	background: var(--pw-code-background, rgba(0, 0, 0, 0.06));
	color: var(--pw-code-color, inherit);
	word-break: break-all;
}

.SendyLink {
	word-break: break-all;
}

.SendySection {
	margin-top: 1.25rem;
}

.SendySection-title {
	margin: 0 0 0.6rem;
	font-size: 0.95rem;
	font-weight: 650;
}

.SendyPreviewActions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.SendyPreviewFrame {
	margin: 0 0 1.5rem;
	border: 1px solid var(--pw-border-color, rgba(0, 0, 0, 0.12));
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
}

.SendyPreviewFrame iframe {
	display: block;
	width: 100%;
	height: 640px;
	border: 0;
	background: #fff;
}

.SendyCreateList {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem 1rem;
	margin: 0 0 0.75rem;
}

.SendyCreateList-url {
	color: var(--pw-muted-color, #666);
	font-size: 0.85rem;
	word-break: break-all;
}

.SendyTableWrap {
	overflow-x: auto;
	background: var(--pw-blocks-background, #fff);
	border: 1px solid var(--pw-border-color, #e2e8f0);
	border-radius: 8px;
	margin-bottom: 1rem;
}

table.SendyTable {
	width: 100%;
	margin: 0 !important;
	border: 0 !important;
	border-collapse: collapse;
	background: transparent;
}

table.SendyTable thead th {
	padding: 0.65rem 0.9rem !important;
	background: #f7fafc !important;
	border: 0 !important;
	border-bottom: 1px solid var(--pw-border-color, #e2e8f0) !important;
	color: var(--pw-muted-color, #718096) !important;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-align: left;
	white-space: nowrap;
}

table.SendyTable tbody td {
	padding: 0.7rem 0.9rem !important;
	border: 0 !important;
	border-bottom: 1px solid #edf2f7 !important;
	background: transparent !important;
	vertical-align: middle;
}

table.SendyTable--index tbody td:not(:first-child) {
	white-space: nowrap;
}

table.SendyTable--index tbody td:has(.SendyChip) {
	white-space: normal;
	min-width: 9rem;
}

table.SendyTable--index tbody td:first-child {
	min-width: 16rem;
}

table.SendyTable tbody tr:last-child td {
	border-bottom: 0 !important;
}

table.SendyTable tbody tr:hover td {
	background: #f9fbfd !important;
}

table.SendyTable--index td:last-child {
	text-align: right;
	white-space: nowrap;
}

.SendyRow-title {
	font-weight: 600;
	color: var(--pw-text-color, #1a202c);
	text-decoration: none;
}

.SendyRow-title:hover {
	text-decoration: underline;
}

.SendyRow-sub {
	margin-top: 0.15rem;
	color: var(--pw-muted-color, #718096);
	font-size: 0.78rem;
	line-height: 1.35;
}

.SendyRow-sub .SendyCode {
	font-size: 0.72rem;
}

.SendyMuted {
	color: var(--pw-muted-color, #a0aec0);
	font-size: 0.85em;
}

.SendyNowrap {
	white-space: nowrap;
}

.SendyDelta.is-good {
	color: #276749;
	font-weight: 600;
}

.SendyDelta.is-bad {
	color: #c53030;
	font-weight: 600;
}

.SendyChip {
	display: inline-block;
	margin: 0.1rem 0.25rem 0.1rem 0;
	padding: 0.1rem 0.55rem;
	border: 1px solid var(--pw-border-color, #e2e8f0);
	border-radius: 999px;
	font-size: 0.75rem;
	color: var(--pw-text-color, #4a5568);
	text-decoration: none;
	white-space: nowrap;
}

.SendyChip:hover {
	border-color: #a0aec0;
	background: #f7fafc;
}

.SendyIconBtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border: 1px solid var(--pw-border-color, #e2e8f0);
	border-radius: 6px;
	color: #4a5568;
	text-decoration: none;
}

.SendyIconBtn:hover {
	border-color: #a0aec0;
	background: #f7fafc;
	color: #1a202c;
}

.SendyRate {
	min-width: 6.5rem;
}

.SendyRate > span:first-child {
	font-weight: 600;
}

.SendyRate-bar {
	display: block;
	height: 4px;
	margin: 0.25rem 0 0.1rem;
	border-radius: 2px;
	background: #edf2f7;
	overflow: hidden;
}

.SendyRate-bar > span {
	display: block;
	height: 100%;
	background: #4299e1;
}

.SendyDbDebug {
	align-items: flex-start;
}

.SendyDebugTable {
	margin: 0.75rem 0;
	width: 100%;
	max-width: 52rem;
}

.SendyDebugTable th {
	width: 11rem;
	padding: 0.25rem 0.75rem 0.25rem 0;
	font-weight: 600;
	text-align: left;
	vertical-align: top;
	white-space: nowrap;
}

.SendyDebugTable td {
	padding: 0.25rem 0;
	word-break: break-all;
}

#ProcessSendyCampaigns .WireTabs,
#ProcessSendyLists .WireTabs {
	margin-top: 0.25rem;
}

@media (max-width: 640px) {
	.SendyStat-value {
		font-size: 1.35rem;
	}
	.SendyStats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.SendyPreviewFrame iframe {
		height: 420px;
	}
}
