/* RetracM Roman, Regular 400 */
@font-face {
	font-family: 'RetracM';
	src: url('fonts/RetracM-Roman.ttf') format('truetype');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
/* Дизайн в стиле reg.ru: светлая тема, белые карточки с крупным скруглением, зелёный акцент */
:root {
	--bg: #f5f6fa;
	--card: #ffffff;
	--text: #1c1f26;
	--muted: #6b7280;
	--primary: #1fd36f;
	--primary-600: #17b95e;
	--primary-ink: #0b8a45;
	--dark: #2b2d33;
	--danger: #e5484d;
	--border: #e6e8ee;
	--soft: #f2f4f8;
	--radius: 24px;
	--shadow: 0 4px 24px rgba(28, 31, 38, 0.06);
	--font-ui: 'RetracM', 'Inter', 'Segoe UI', Roboto, system-ui, Arial,
		sans-serif;
}

* {
	box-sizing: border-box;
}
html,
body {
	height: 100%;
	overflow-x: hidden;
}
body {
	margin: 0;
	font-family: 'Inter', 'Segoe UI', Roboto, system-ui, -apple-system, Arial,
		sans-serif;
	font-size: 15px;
	line-height: 1.45;
	background: var(--bg);
	color: var(--text);
	display: flex;
	flex-direction: column;
}
body > main {
	flex: 1 0 auto;
}

.container {
	width: 100%;
	max-width: min(1440px, 100%);
	margin: 0 auto;
	padding: 0 24px;
}

/* ===== Шапка ===== */
.site-header {
	position: sticky;
	top: 0;
	z-index: 10;
	background: #fff;
	box-shadow: 0 2px 12px rgba(28, 31, 38, 0.07);
}
.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 64px;
}
.logo {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-weight: 800;
	font-size: 24px;
	letter-spacing: -0.5px;
	color: var(--text);
}
.logo img {
	width: auto;
	max-width: 120px;
	height: 36px;
	object-fit: contain;
	border-radius: 10px;
}
.main-nav ul {
	display: flex;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.main-nav a {
	display: inline-block;
	color: var(--text);
	text-decoration: none;
	padding: 8px 14px;
	border-radius: 999px;
	font-size: 15px;
	transition: background 0.15s;
}
.main-nav a:hover,
.main-nav a.active {
	background: var(--soft);
}
.nav-toggle {
	display: none;
}

main {
	padding: 32px 0;
}

/* ===== Карточки ===== */
.card {
	background: var(--card);
	border-radius: var(--radius);
	padding: 32px;
	box-shadow: var(--shadow);
}
.card h1 {
	margin: 0 0 20px;
	font-size: 28px;
	font-weight: 700;
	letter-spacing: -0.3px;
}
main > .card:only-child {
	max-width: 560px;
	margin: 24px auto;
}
main > .card.app-shell {
	max-width: none;
	margin: 0;
	padding: 0;
	background: transparent;
	box-shadow: none;
}
.app-shell > h1 {
	font-size: 30px;
}

/* ===== Кабинет ===== */
.dashboard {
	display: grid;
	grid-template-columns: 240px 1fr;
	gap: 24px;
	align-items: start;
}
.sidebar {
	position: sticky;
	top: 88px;
	background: #fff;
	border-radius: var(--radius);
	padding: 16px 12px;
	box-shadow: var(--shadow);
}
.tabs {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.tab {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	text-align: left;
	background: transparent;
	color: var(--text);
	border: 0;
	border-radius: 14px;
	padding: 12px 14px;
	font: inherit;
	cursor: pointer;
	transition: background 0.15s;
}
.tab::before {
	content: '';
	width: 22px;
	height: 22px;
	flex: none;
	background: var(--muted);
	-webkit-mask: var(--icon) center / contain no-repeat;
	mask: var(--icon) center / contain no-repeat;
}
.tab[data-tab='campaigns'] {
	--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='3'/%3E%3Cpath d='m4 7 8 6 8-6'/%3E%3C/svg%3E");
}
.tab[data-tab='queue'] {
	--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h10'/%3E%3C/svg%3E");
}
.tab[data-tab='statistics'] {
	--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V10M10 20V4M16 20v-7M22 20H2'/%3E%3C/svg%3E");
}
.tab[data-tab='builder'] {
	--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E");
}
.tab[data-tab='smtp'] {
	--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='6' rx='2'/%3E%3Crect x='3' y='14' width='18' height='6' rx='2'/%3E%3Cpath d='M7 7h.01M7 17h.01'/%3E%3C/svg%3E");
}
.tab:hover {
	background: var(--soft);
}
.tab.active {
	background: var(--soft);
	font-weight: 600;
	box-shadow: inset 3px 0 0 var(--primary);
}
.tab.active::before {
	background: var(--primary-ink);
}

.content {
	min-width: 0;
}
.content > #welcome {
	margin: 4px 0 16px;
	color: var(--muted);
}
.tab-panel {
	background: #fff;
	border-radius: var(--radius);
	padding: 32px;
	box-shadow: var(--shadow);
}
.tab-panel.hidden,
.hidden {
	display: none;
}
.content h2 {
	margin: 0 0 20px;
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -0.2px;
}
.content h3,
.content h4 {
	color: var(--text);
}

/* ===== Формы ===== */
.form-row {
	margin-bottom: 16px;
}
.form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}
.campaign-variants-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-bottom: 16px;
}
.variant-column {
	border: 1px solid var(--border);
	border-radius: 20px;
	padding: 20px;
	min-width: 0;
	background: #fff;
}
.variant-title {
	margin: 0 0 16px;
	font-size: 18px;
	font-weight: 700;
	color: var(--text);
}
.campaign-variants-hint {
	color: var(--muted);
	font-size: 0.92em;
	margin: 0 0 16px;
	padding: 12px 16px;
	background: var(--soft);
	border-radius: 14px;
}

label {
	display: block;
	margin-bottom: 6px;
	color: var(--muted);
	font-size: 14px;
}
input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='search'],
input[type='url'],
textarea,
select {
	width: 100%;
	padding: 13px 16px;
	border-radius: 14px;
	border: 1px solid #d5d9e2;
	background: #fff;
	color: var(--text);
	font: inherit;
	outline: none;
	transition:
		border-color 0.15s,
		box-shadow 0.15s;
}
input[type='file'] {
	max-width: 100%;
	font: inherit;
	color: var(--muted);
}
input::placeholder,
textarea::placeholder {
	color: #a3a9b6;
}
input:focus,
textarea:focus,
select:focus {
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(31, 211, 111, 0.2);
}
input:disabled {
	background: var(--soft);
}
input[type='checkbox'],
input[type='radio'] {
	accent-color: var(--primary-600);
}
small {
	color: var(--muted);
}

.checkbox-row {
	margin-top: 6px;
}
.checkbox {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	user-select: none;
	color: var(--text);
}
.checkbox input {
	width: 18px;
	height: 18px;
}

/* ===== Кнопки ===== */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 46px;
	padding: 0 24px;
	border-radius: 999px;
	border: 0;
	background: var(--soft);
	color: var(--text);
	font: inherit;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
	transition:
		background 0.15s,
		filter 0.15s;
}
.btn:hover {
	filter: brightness(0.96);
}
.btn.primary {
	background: var(--primary);
	color: #0a2e18;
}
.btn.primary:hover {
	background: var(--primary-600);
	filter: none;
}
.btn[style*='background: #f44336'],
.btn[style*='background:#f44336'],
.btn[style*='background: #ffa500'],
.btn[style*='background: #4CAF50'] {
	color: #fff;
}

.field-error {
	color: var(--danger);
	font-size: 13px;
	min-height: 18px;
	margin: 6px 0 0;
}
.form-note {
	color: var(--muted);
	font-size: 14px;
}
.form-note a,
.content a {
	color: var(--primary-ink);
}

/* Тёмные инлайн-стили из разметки/JS приводим к светлой теме */
[style*='#0d1320'] {
	background: #fff !important;
	color: var(--text) !important;
	border: 1px solid #d5d9e2 !important;
	border-radius: 14px !important;
	padding: 13px 16px !important;
}
[style*='#1a1a1a'] {
	background: #fff !important;
	border: 1px solid var(--border) !important;
	border-radius: 18px !important;
	box-shadow: var(--shadow);
}
[style*='#2a1a1a'] {
	background: #fff1f1 !important;
	border-radius: 14px !important;
}
[style*='#2a2a2a'],
[style*='background: #333;'] {
	background: #e9ecf2 !important;
}
button[style*='background: #333'] {
	background: var(--soft) !important;
	color: var(--text) !important;
	border: 1px solid var(--border) !important;
	border-radius: 8px !important;
}
[style*='linear-gradient(90deg, #4caf50'] {
	background: linear-gradient(90deg, #1fd36f, #7be8ab) !important;
	border-radius: 4px;
}
#queueStatsSummary {
	padding: 14px 18px !important;
}

/* ===== Статистика ===== */
.analytics-shell {
	background: transparent !important;
	padding: 0 !important;
	min-height: 0 !important;
	color: var(--text);
	font-family: inherit !important;
}
.analytics-shell .analytics-head h2 {
	font-size: 24px;
	color: var(--text);
}
.analytics-shell .analytics-head p {
	margin: 8px 0 0;
	color: var(--muted);
	font-size: 14px;
}
.analytics-actions {
	display: flex;
	gap: 8px;
}
.analytics-shell .analytics-icon-button,
.analytics-shell .analytics-text-button {
	height: 42px;
	border: 0;
	border-radius: 999px;
	background: var(--soft);
	color: var(--text);
	font-weight: 600;
	cursor: pointer;
}
.analytics-shell .analytics-icon-button {
	width: 42px;
}
.analytics-shell .analytics-text-button {
	padding: 0 18px;
}
.analytics-shell .analytics-text-button.danger {
	background: #fff0f0;
	color: var(--danger);
}
.analytics-shell .analytics-filters {
	grid-template-columns: repeat(4, minmax(0, 1fr)) auto !important;
	max-width: none !important;
	gap: 12px !important;
	margin-bottom: 24px !important;
}
.analytics-shell .analytics-filters select,
.analytics-shell .analytics-filter-input {
	height: 46px !important;
	border-radius: 14px !important;
	border: 1px solid #d5d9e2 !important;
	padding: 0 16px !important;
	font-size: 14px !important;
}
.analytics-shell .analytics-apply {
	height: 46px !important;
	padding: 0 28px !important;
	border-radius: 999px !important;
	background: var(--primary) !important;
	color: #0a2e18 !important;
	font-weight: 600;
}
.analytics-shell .analytics-apply:hover {
	background: var(--primary-600) !important;
}
.analytics-shell .analytics-kpis {
	max-width: none !important;
	padding: 28px;
	margin: 8px 0 24px !important;
	background: #fff;
	border-radius: 20px;
	border: 1px solid var(--border);
}
.analytics-shell .analytics-ring {
	--ring-color: var(--primary) !important;
	width: 88px !important;
	height: 88px !important;
	background: conic-gradient(var(--ring-color) 0 72%, #e9ecf2 72% 100%) !important;
}
.analytics-shell .analytics-ring b {
	color: var(--text);
}
.analytics-shell .analytics-segments button {
	border-radius: 999px !important;
	background: var(--soft) !important;
	color: var(--text) !important;
}
.analytics-shell .analytics-segments button.active {
	background: var(--dark) !important;
	color: #fff !important;
}
.analytics-shell .analytics-chart-panel,
.analytics-shell .analytics-subjects {
	max-width: none !important;
	border-top: 0;
	padding: 24px;
	margin-top: 24px;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: 20px;
}
.analytics-shell .analytics-bar {
	background: linear-gradient(180deg, #7be8ab, #1fd36f) !important;
	opacity: 1 !important;
}
.analytics-shell .legend-magenta {
	background: var(--primary) !important;
}
.analytics-shell .legend-amber {
	background: #f5a524 !important;
}
.analytics-shell .analytics-bars {
	background: repeating-linear-gradient(
		to bottom,
		transparent 0,
		transparent 53px,
		#eef0f4 54px
	) !important;
}
.analytics-content table {
	width: 100%;
	border-collapse: collapse;
}
.analytics-content th,
.analytics-content td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--border);
	text-align: left;
}

/* ===== SMTP сервера ===== */
.smtp-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}
.smtp-head h2 {
	margin: 0;
}
.smtp-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}
.smtp-updated {
	color: var(--muted);
	font-size: 13px;
}
.smtp-legend {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	color: var(--muted);
	font-size: 14px;
	margin: 12px 0;
}
.smtp-legend .smtp-dot {
	margin-left: 12px;
}
.smtp-legend .smtp-dot:first-child {
	margin-left: 0;
}
.smtp-total {
	margin-bottom: 16px;
	font-weight: 600;
}
.smtp-list {
	display: grid;
	gap: 12px;
}
.smtp-row {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 20px;
	border: 1px solid var(--border);
	border-radius: 18px;
	background: var(--card);
}
.smtp-info {
	flex: 1;
	min-width: 0;
	display: grid;
	gap: 2px;
}
.smtp-name {
	font-weight: 700;
	font-size: 16px;
}
.smtp-info small {
	overflow-wrap: anywhere;
}
.smtp-note {
	color: var(--danger);
}
.smtp-count {
	text-align: right;
	display: grid;
}
.smtp-count b {
	font-size: 28px;
	line-height: 1.1;
}
.smtp-dot {
	display: inline-block;
	flex: none;
	width: 16px;
	height: 16px;
	border-radius: 50%;
}
.smtp-row .smtp-dot {
	width: 20px;
	height: 20px;
}
.smtp-dot.ok {
	background: radial-gradient(circle at 35% 30%, #8cf2b8, #1fd36f 70%);
	box-shadow: 0 0 8px rgba(31, 211, 111, 0.6);
}
.smtp-dot.error {
	background: radial-gradient(circle at 35% 30%, #ff9a9d, #e5484d 70%);
	box-shadow: 0 0 8px rgba(229, 72, 77, 0.6);
}
.smtp-dot.idle {
	background: radial-gradient(circle at 35% 30%, #ffe08a, #f5a524 70%);
}

/* ===== Подвал ===== */
.site-footer {
	margin-top: 16px;
	background: #fff;
}
.site-footer .container {
	display: flex;
	height: 64px;
	align-items: center;
	color: var(--muted);
	font-size: 14px;
}
.site-footer p {
	margin: 0;
}

.visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	border: 0;
	padding: 0;
	clip: rect(0 0 0 0);
	overflow: hidden;
}

img,
video {
	max-width: 100%;
	height: auto;
}
textarea {
	width: 100%;
	max-width: 100%;
}

/* ===== Адаптив ===== */
@media (max-width: 900px) {
	.campaign-variants-grid {
		grid-template-columns: 1fr;
	}
	.analytics-shell .analytics-filters {
		grid-template-columns: 1fr 1fr !important;
	}
}
@media (max-width: 960px) {
	.header-inner {
		height: 56px;
	}
	.dashboard {
		grid-template-columns: 1fr;
	}
	.sidebar {
		display: none;
	}
}
@media (max-width: 768px) {
	.header-inner {
		height: auto;
		padding: 8px 0;
		flex-wrap: wrap;
		gap: 8px;
	}
	.nav-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		order: 2;
		width: 40px;
		height: 40px;
		border-radius: 12px;
		border: 0;
		background: var(--soft);
		color: var(--text);
		font-size: 20px;
		cursor: pointer;
	}
	.logo {
		order: 1;
	}
	.main-nav {
		order: 3;
		width: 100%;
		display: none;
	}
	.main-nav.is-open {
		display: block;
		background: #fff;
		padding: 8px;
		border-radius: 16px;
		box-shadow: var(--shadow);
	}
	.main-nav ul {
		flex-direction: column;
		gap: 4px;
	}
	.main-nav .mobile-tabs {
		display: none !important;
	}
	.main-nav.is-open .mobile-tabs {
		display: flex !important;
		flex-direction: column;
		gap: 4px;
		margin-top: 8px;
	}
	.container {
		padding: 0 12px;
	}
	.card,
	.tab-panel {
		padding: 20px;
	}
}
@media (max-width: 640px) {
	.form-grid {
		grid-template-columns: 1fr;
	}
	.analytics-shell .analytics-filters {
		grid-template-columns: 1fr !important;
	}
	.analytics-shell .analytics-kpis {
		display: grid;
		grid-template-columns: 1fr 1fr !important;
		padding: 16px;
	}
}
@media (max-width: 480px) {
	.logo img {
		height: 30px;
	}
	.card h1 {
		font-size: 22px;
	}
	.btn {
		width: 100%;
	}
}

/* ===== Переключатель темы ===== */
.theme-toggle {
	margin-left: auto;
	margin-right: 8px;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: var(--soft);
	color: var(--text);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}
.theme-toggle:hover {
	filter: brightness(0.95);
}
.language-toggle {
	width: 48px;
	height: 40px;
	border: 0;
	border-radius: 20px;
	background: var(--soft);
	color: var(--text);
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
}
.language-toggle:hover {
	filter: brightness(0.95);
}
@media (max-width: 768px) {
	.theme-toggle {
		order: 2;
		margin-left: auto;
	}
	.language-toggle {
		order: 2;
	}
}

/* ===== Тёмная тема ===== */
html[data-theme='dark'] {
	color-scheme: dark;
	--bg: #121418;
	--card: #1c1f26;
	--text: #e8eaee;
	--muted: #9aa1ae;
	--primary-ink: #3be58a;
	--border: #2d313b;
	--soft: #272b34;
	--shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}
html[data-theme='dark'] .site-header,
html[data-theme='dark'] .site-footer,
html[data-theme='dark'] .sidebar,
html[data-theme='dark'] .tab-panel,
html[data-theme='dark'] .variant-column,
html[data-theme='dark'] .main-nav.is-open {
	background: var(--card);
}
html[data-theme='dark'] .site-header {
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
html[data-theme='dark'] input[type='text'],
html[data-theme='dark'] input[type='email'],
html[data-theme='dark'] input[type='password'],
html[data-theme='dark'] input[type='number'],
html[data-theme='dark'] input[type='search'],
html[data-theme='dark'] input[type='url'],
html[data-theme='dark'] textarea,
html[data-theme='dark'] select {
	background: #14161b;
	border-color: #343945;
	color: var(--text);
}
html[data-theme='dark'] input::placeholder,
html[data-theme='dark'] textarea::placeholder {
	color: #6c7380;
}
html[data-theme='dark'] .btn.primary {
	color: #06220f;
}
html[data-theme='dark'] [style*='#0d1320'] {
	background: #14161b !important;
	border-color: #343945 !important;
}
html[data-theme='dark'] [style*='#1a1a1a'] {
	background: var(--card) !important;
	border-color: var(--border) !important;
}
html[data-theme='dark'] [style*='#2a1a1a'] {
	background: #2d1b1d !important;
}
html[data-theme='dark'] [style*='#2a2a2a'],
html[data-theme='dark'] [style*='background: #333;'] {
	background: #343945 !important;
}
html[data-theme='dark'] button[style*='background: #333'] {
	background: var(--soft) !important;
	color: var(--text) !important;
	border-color: var(--border) !important;
}
html[data-theme='dark'] .analytics-shell,
html[data-theme='dark'] .analytics-shell h2,
html[data-theme='dark'] .analytics-shell h3,
html[data-theme='dark'] .analytics-shell .analytics-head h2,
html[data-theme='dark'] .analytics-shell .analytics-kpi,
html[data-theme='dark'] .analytics-shell .analytics-ring b {
	color: var(--text) !important;
}
html[data-theme='dark'] .analytics-shell .analytics-head p,
html[data-theme='dark'] .analytics-shell p,
html[data-theme='dark'] .analytics-shell small,
html[data-theme='dark'] .analytics-shell .analytics-legend,
html[data-theme='dark'] .analytics-shell .analytics-bar-wrap {
	color: var(--muted) !important;
}
html[data-theme='dark'] .analytics-shell .analytics-kpis,
html[data-theme='dark'] .analytics-shell .analytics-chart-panel,
html[data-theme='dark'] .analytics-shell .analytics-subjects {
	background: var(--card) !important;
	border-color: var(--border);
}
html[data-theme='dark'] .analytics-shell .analytics-filters select,
html[data-theme='dark'] .analytics-shell .analytics-filter-input {
	background: #14161b !important;
	border-color: #343945 !important;
	color: var(--text) !important;
}
html[data-theme='dark'] .analytics-shell .analytics-icon-button,
html[data-theme='dark'] .analytics-shell .analytics-text-button,
html[data-theme='dark'] .analytics-shell .analytics-segments button {
	background: var(--soft) !important;
	color: var(--text) !important;
}
html[data-theme='dark'] .analytics-shell .analytics-text-button.danger {
	background: #3a2024 !important;
	color: #ff8a8f !important;
}
html[data-theme='dark'] .analytics-shell .analytics-segments button.active {
	background: var(--primary) !important;
	color: #06220f !important;
}
html[data-theme='dark'] .analytics-shell .analytics-ring {
	background: conic-gradient(var(--ring-color) 0 72%, #343945 72% 100%) !important;
}
html[data-theme='dark'] .analytics-shell .analytics-ring::before {
	background: var(--card) !important;
}
html[data-theme='dark'] .analytics-shell .analytics-bars {
	background: repeating-linear-gradient(
		to bottom,
		transparent 0,
		transparent 53px,
		#2d313b 54px
	) !important;
	border-bottom-color: #343945 !important;
}
html[data-theme='dark'] .analytics-shell .analytics-subjects li,
html[data-theme='dark'] .analytics-content th,
html[data-theme='dark'] .analytics-content td {
	border-bottom-color: var(--border) !important;
}
html[data-theme='dark'] .analytics-content table,
html[data-theme='dark'] .analytics-content th,
html[data-theme='dark'] .analytics-content td {
	color: var(--text);
	background: transparent;
}

/* ===== Главная ===== */
.sale-bar{background:#fff3c4;color:#5c4400;text-align:center;padding:10px 16px;font-size:14px;font-weight:600;border-bottom:1px solid #f1dc86}
.sale-bar a{color:#5c4400;text-decoration:underline}
html[data-theme='dark'] .sale-bar{background:#3a3115;color:#ffe08a;border-color:#5a4a1c}
html[data-theme='dark'] .sale-bar a{color:#ffe08a}
.home{padding-top:28px;padding-bottom:40px}
.home-head{display:flex;justify-content:space-between;align-items:center;gap:24px;flex-wrap:wrap;margin-bottom:24px}
.home-head h1{margin:0 0 8px;font-size:34px;line-height:1.15}
.home-head p{margin:0;color:var(--muted);max-width:640px}
.home-cta{display:flex;gap:12px;flex-wrap:wrap}
.promo-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:20px}
.promo{display:flex;justify-content:space-between;gap:16px;background:var(--card);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:28px;overflow:hidden;min-height:320px}
.promo-text{flex:1 1 55%;display:flex;flex-direction:column;align-items:flex-start}
.promo-icon{width:34px;height:34px;fill:none;stroke:var(--text);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;margin-bottom:12px}
.promo h2{margin:0 0 10px;font-size:22px;line-height:1.2}
.promo p{margin:0 0 12px;color:var(--muted);font-size:15px}
.promo-list{list-style:none;margin:0 0 18px;padding:0;display:grid;gap:6px;font-size:14px}
.promo-list li{position:relative;padding-left:22px}
.promo-list li::before{content:'';position:absolute;left:0;top:4px;width:12px;height:7px;border-left:2px solid var(--primary-600);border-bottom:2px solid var(--primary-600);transform:rotate(-45deg)}
.promo-link{margin-top:auto;display:inline-flex;align-items:center;gap:10px;font-weight:600;color:var(--text);text-decoration:none}
.promo-arrow{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;background:#ffd84d;color:#1b1b1b;font-size:18px;transition:transform .15s}
.promo-link:hover .promo-arrow{transform:translateX(4px)}
.promo-art{flex:0 0 38%;border-radius:18px;display:flex;align-items:center;justify-content:center;padding:14px;min-height:200px}
.art-green{background:#cdf5dd}.art-sand{background:#fde7c9}.art-dark{background:#1f2a24}.art-light{background:#e8f0ff}
html[data-theme='dark'] .art-green{background:#1d4a33}html[data-theme='dark'] .art-sand{background:#4a3a22}html[data-theme='dark'] .art-light{background:#223552}
.art-mail,.art-chart,.art-phone,.art-servers{background:#fff;border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.15);padding:12px;width:100%;max-width:170px;display:grid;gap:8px}
.art-mail i,.art-phone i{display:block;border-radius:6px;background:#e3e8e5}
.a-bar{height:10px;width:40%;background:#1fd36f!important}.a-img{height:50px}.a-line{height:8px}.a-line.s{width:60%}.a-btn{height:16px;width:50%;background:#1fd36f!important;border-radius:99px!important}
.art-chart b{font-size:26px;color:#111}
.c-bars{display:flex;align-items:flex-end;gap:6px;height:60px}
.c-bars i{flex:1;background:#1fd36f;border-radius:4px 4px 0 0}
.c-bars i:nth-child(1){height:30%}.c-bars i:nth-child(2){height:50%}.c-bars i:nth-child(3){height:40%}.c-bars i:nth-child(4){height:75%}.c-bars i:nth-child(5){height:100%}
.art-phone{max-width:110px;border-radius:20px;border:4px solid #222}
.p-top{height:8px;width:40%;margin:0 auto}.p-card{height:46px}.p-line{height:8px}.p-line.s{width:60%}
.art-servers span{display:flex;align-items:center;gap:8px;background:#f2f5f4;border-radius:8px;padding:8px}
.art-servers b{flex:1;height:8px;border-radius:4px;background:#d5dcd9}
.art-servers .dot{width:12px;height:12px;border-radius:50%;display:inline-block}
.art-servers .dot.g{background:#1fd36f}.art-servers .dot.r{background:#e5484d}
@media(max-width:900px){.promo-grid{grid-template-columns:1fr}}
@media(max-width:520px){.promo{flex-direction:column;padding:20px}.promo-art{flex:none}.home-head h1{font-size:26px}}
.home a,.site-header a{text-decoration:none}

/* ===== Подсветка кнопок при наведении ===== */
button, .btn, a.btn, input[type='button'], input[type='submit'], .promo-arrow, .nav-toggle, .theme-toggle {
	transition: background-image .2s ease, box-shadow .2s ease, transform .15s ease;
}
button:hover:not(:disabled),
.btn:hover:not(:disabled),
input[type='button']:hover:not(:disabled),
input[type='submit']:hover:not(:disabled),
.promo-link:hover .promo-arrow {
	background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.12) 45%, rgba(255, 255, 255, 0) 100%) !important;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
html:not([data-theme='dark']) button:not(.primary):not([class*='primary']):hover:not(:disabled),
html:not([data-theme='dark']) .btn:not(.primary):hover:not(:disabled) {
	background-image: linear-gradient(to bottom, rgba(31, 211, 111, 0.22) 0%, rgba(31, 211, 111, 0.06) 55%, rgba(31, 211, 111, 0) 100%) !important;
}
/* ===== Очередь: темы по письмам ===== */
.queue-variant{margin:8px 0;padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:var(--soft)}
.queue-variant-title{font-weight:700;color:var(--primary-600);margin-bottom:6px}
.queue-subjects{margin:0;padding-left:22px;display:grid;gap:3px;font-size:13px}
/* ===== Шрифт RetracM везде в интерфейсе ===== */
body, button, input, select, textarea, h1, h2, h3, h4, h5, h6, table, th, td, label, .btn, .analytics-shell {
	font-family: var(--font-ui) !important;
}

/* ===== Отчёт по кампаниям ===== */
[data-panel='statistics'] {
	padding: 0;
	background: transparent;
	box-shadow: none;
}
.stats-board {
	--stats-card: #111d3a;
	--stats-border: #263353;
	--stats-text: #f3f5ff;
	--stats-muted: #a4afc8;
	padding: 28px;
	border: 1px solid #263353;
	border-radius: 22px;
	color: var(--stats-text);
	background: radial-gradient(ellipse at 82% 0, #1a1850 0, transparent 38%), #080f24;
}
.stats-head,
.stats-section-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}
.stats-head h2,
.stats-board h3 {
	margin: 0;
	color: var(--stats-text);
}
.stats-head h2 {
	margin-top: 6px;
	font-size: 28px;
}
.stats-head p,
.stats-board p {
	margin: 8px 0 0;
	color: var(--stats-muted);
	font-size: 13px;
	line-height: 1.5;
}
.stats-eyebrow {
	color: #a89cff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
}
.stats-actions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}
.stats-action,
.stats-apply {
	min-height: 42px;
	border: 1px solid var(--stats-border);
	border-radius: 11px;
	color: var(--stats-text);
	background: #182440;
	font: inherit;
	cursor: pointer;
}
.stats-action {
	min-width: 42px;
	padding: 0 13px;
	font-size: 17px;
}
.stats-action-danger {
	color: #ff9aaf;
	font-size: 13px;
}
.stats-action:hover,
.stats-apply:hover {
	border-color: #9281ff;
}
.stats-board button:focus-visible,
.stats-board input:focus-visible,
.stats-board select:focus-visible {
	outline: 2px solid #b5a9ff;
	outline-offset: 2px;
}
.stats-filters {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
	align-items: end;
	gap: 12px;
	margin: 24px 0;
}
.stats-filters label {
	display: grid;
	gap: 7px;
	margin: 0;
	color: var(--stats-muted);
	font-size: 12px;
}
.stats-filters input,
.stats-filters select {
	width: 100%;
	min-width: 0;
	height: 44px;
	padding: 0 12px;
	border: 1px solid var(--stats-border);
	border-radius: 10px;
	background: #111b35;
	color: var(--stats-text);
	font: inherit;
	font-size: 13px;
}
.stats-filters input::placeholder {
	color: #8290ad;
}
.stats-apply {
	height: 44px;
	padding: 0 22px;
	border-color: #7459f1;
	background: #6747e6;
	font-size: 13px;
	font-weight: 700;
}
.stats-cards {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
}
.stats-card {
	min-width: 0;
	padding: 20px;
	border: 1px solid var(--stats-border);
	border-radius: 16px;
	background: linear-gradient(145deg, #162440, var(--stats-card));
}
.stats-kpi {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	min-height: 185px;
}
.stats-kpi-icon {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	margin-bottom: 5px;
	border-radius: 12px;
	color: #fff;
	font-family: Arial, sans-serif;
	font-size: 23px;
	font-weight: 700;
	box-shadow: 0 8px 20px #0003;
}
.stats-icon-violet { background: linear-gradient(135deg, #9747ff, #5935e8); }
.stats-icon-blue { background: linear-gradient(135deg, #6986ff, #3156d8); }
.stats-icon-pink { background: linear-gradient(135deg, #ff54c1, #d92082); }
.stats-icon-cyan { background: linear-gradient(135deg, #24c7d7, #1572c9); }
.stats-kpi-label {
	color: #d3d9ec;
	font-size: 13px;
}
.stats-kpi strong {
	color: #fff;
	font-size: 29px;
	line-height: 1.1;
	overflow-wrap: anywhere;
}
.stats-kpi small,
.stats-board small {
	color: var(--stats-muted);
	font-size: 12px;
}
.stats-insights {
	display: grid;
	grid-template-columns: minmax(0, 1.7fr) minmax(170px, 0.8fr) minmax(190px, 0.9fr);
	gap: 14px;
	margin-top: 14px;
}
.stats-board h3 {
	font-size: 15px;
}
.stats-legend {
	display: flex;
	gap: 16px;
	margin-top: 18px;
	color: var(--stats-muted);
	font-size: 12px;
}
.stats-dot,
.stats-region-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-right: 7px;
	border-radius: 50%;
}
.stats-dot-opens { background: #8270ff; }
.stats-dot-clicks { background: #f345aa; }
.stats-chart-area {
	display: flex;
	align-items: stretch;
	gap: 12px;
	height: 180px;
	margin-top: 18px;
	padding: 0 6px;
	border-bottom: 1px solid #394361;
	background: repeating-linear-gradient(to top, transparent 0, transparent 44px, #2b3652 45px);
}
.stats-bar-group {
	display: flex;
	flex: 1;
	min-width: 0;
	flex-direction: column;
	text-align: center;
	color: var(--stats-muted);
	font-size: 10px;
}
.stats-bar-group > span {
	overflow: hidden;
	text-overflow: ellipsis;
}
.stats-bar-pair {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	gap: 3px;
	flex: 1;
	min-height: 0;
}
.stats-bar {
	width: min(18px, 42%);
	border-radius: 4px 4px 0 0;
}
.stats-bar-opens { background: linear-gradient(#a59aff, #6047ea); }
.stats-bar-clicks { background: linear-gradient(#ff79c9, #d92991); }
.stats-summary ul,
.stats-regions ul,
.stats-subjects ul {
	padding: 0;
	margin: 14px 0 0;
	list-style: none;
}
.stats-summary li,
.stats-regions li,
.stats-subjects li {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px;
	padding: 10px 0;
	border-bottom: 1px solid #2b3652;
	color: var(--stats-muted);
	font-size: 12px;
}
.stats-summary b,
.stats-regions b,
.stats-subjects b {
	flex-shrink: 0;
	color: var(--stats-text);
}
.stats-regions li > span,
.stats-subjects li > span {
	min-width: 0;
	overflow-wrap: anywhere;
}
.stats-region-0 { background: #a969ff; }
.stats-region-1 { background: #f345aa; }
.stats-region-2 { background: #567bff; }
.stats-region-3 { background: #28c6d9; }
.stats-region-4 { background: #d69dff; }
.stats-details {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
	gap: 14px;
	margin-top: 14px;
}
.stats-table-wrap {
	overflow-x: auto;
}
.stats-board table {
	width: 100%;
	margin-top: 12px;
	border-collapse: collapse;
	color: var(--stats-text);
	text-align: left;
	font-size: 12px;
}
.stats-board th,
.stats-board td {
	padding: 12px 10px;
	border-bottom: 1px solid #2b3652;
	vertical-align: middle;
}
.stats-board th {
	color: var(--stats-muted);
	font-weight: 400;
	white-space: nowrap;
}
.stats-board td strong {
	display: block;
	max-width: 190px;
	overflow: hidden;
	text-overflow: ellipsis;
}
.stats-board td small {
	display: block;
	margin-top: 3px;
}
.stats-status {
	display: inline-block;
	padding: 4px 8px;
	border-radius: 7px;
	color: #c9c7ff;
	background: #352f67;
	white-space: nowrap;
}
.stats-status-completed { color: #8fe9c0; background: #17473c; }
.stats-status-failed { color: #ffb1be; background: #592a3c; }
.stats-status-processing { color: #a7ccff; background: #203d72; }
.stats-empty,
.stats-board .stats-error {
	color: var(--stats-muted);
	font-size: 13px;
}
.stats-board .stats-error { color: #ff9aaf; }
.stats-board .stats-footnote {
	margin: 16px 2px 0;
	font-size: 12px;
}
@media (max-width: 1100px) {
	.stats-insights { grid-template-columns: 1fr 1fr; }
	.stats-chart { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
	.stats-board { padding: 18px; }
	.stats-head { flex-wrap: wrap; }
	.stats-filters { grid-template-columns: 1fr 1fr; }
	.stats-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.stats-details { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
	.stats-filters, .stats-insights { grid-template-columns: 1fr; }
	.stats-chart { grid-column: auto; }
	.stats-kpi { padding: 15px; }
	.stats-kpi strong { font-size: 23px; }
}
