@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&display=swap');

:root {
	--primary-color: #ff7a59;
	--primary-strong: #ff5a3d;
	--success-color: #35c48b;
	--danger-color: #ff6b6b;
	--warning-color: #ffb45a;
	--light-color: #1f2430;
	--dark-color: #0f141c;
	--border-color: #e5e8f0;
	--body-bg: #edf1f7;
	--surface: #ffffff;
	--surface-alt: #f7f8fc;
	--muted-color: #7b8191;
	--card-shadow: 0 24px 50px rgba(23, 30, 50, 0.08);
	--card-shadow-soft: 0 12px 30px rgba(23, 30, 50, 0.08);
	--accent-blue: #3b6df6;
	--accent-peach: #ffd2b8;
	--accent-mint: #b8f4e5;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}
.bm {
	display: none;
}
#burger {
	display: none;
}
body {
	font-family: 'Sora', 'Manrope', sans-serif;
	background-color: var(--body-bg);
	color: var(--light-color);
	line-height: 1.65;
	padding: 24px;
	background-image: radial-gradient(
			circle at 12% -10%,
			rgba(255, 205, 160, 0.55),
			transparent 45%
		),
		radial-gradient(
			circle at 88% 8%,
			rgba(180, 210, 255, 0.45),
			transparent 52%
		),
		linear-gradient(180deg, #f7f8fc 0%, #eef1f7 100%);
	background-attachment: fixed;
}

.container {
	max-width: 80%;
	margin: 0 auto;
	background: var(--surface);
	padding: 30px;
	border-radius: 18px;
	box-shadow: var(--card-shadow);
}

h1 {
	text-align: center;
	margin-bottom: 30px;
	color: var(--light-color);
}

h2 {
	color: var(--primary-color);
	border-bottom: 2px solid var(--border-color);
	padding-bottom: 10px;
	margin-bottom: 20px;
}

h3 {
	margin-bottom: 15px;
	color: var(--light-color);
}

h4 {
	margin-top: 20px;
	margin-bottom: 10px;
	color: var(--light-color);
}

.settings-section {
	margin-bottom: 40px;
}

.form-group {
	margin-bottom: 20px;
}

.form-group label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: var(--light-color);
}

.form-group input[type='text'],
.form-group input[type='url'],
.form-group input[type='password'],
.form-group input[type='number'],
.form-group input[type='datetime-local'],
.form-group select,
.form-group textarea {
	width: 100%;
	padding: 12px;
	border: 1px solid var(--border-color);
	border-radius: 5px;
	font-size: 16px;
	transition: border-color 0.2s, box-shadow 0.2s;
	background-color: #343a40;
	color: var(--light-color);
}

.form-group textarea {
	resize: vertical;
	min-height: 80px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
	outline: none;
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.25);
}

.form-group-checkbox {
	display: flex;
	align-items: center;
	margin-top: 15px;
}

.form-group-checkbox input[type='checkbox'] {
	width: 18px;
	height: 18px;
	margin-right: 10px;
}

.form-group-checkbox label {
	margin-bottom: 0;
	font-weight: normal;
	color: var(--light-color);
}

.password-wrapper {
	position: relative;
}

.toggle-password {
	position: absolute;
	top: 42.5%;
	right: 0px;
	height: calc(57.5%);
	width: 50px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	background: #495057;
	cursor: pointer;
	border-radius: 5px;
	font-size: 20px;
	padding: 0;
	color: var(--light-color);
}

.toggle-password:hover {
	background: #5c636a;
}

.button {
	display: inline-block;
	padding: 12px 25px;
	font-size: 16px;
	font-weight: 600;
	text-align: center;
	cursor: pointer;
	border: none;
	border-radius: 5px;
	transition: background-color 0.2s, transform 0.1s;
	color: #fff;
	text-decoration: none;
}

.button:active {
	transform: translateY(1px);
}

.button-primary {
	background-color: var(--primary-color);
}
.button-primary:hover {
	background-color: #339af0;
}

.button-start {
	background-color: var(--success-color);
}
.button-start:hover {
	background-color: #37b24d;
}

.button-stop {
	background-color: var(--warning-color);
}
.button-stop:hover {
	background-color: #fa5252;
}

.button-danger {
	background-color: var(--danger-color);
}
.button-danger:hover {
	background-color: #fa5252;
}

.button-warning {
	background-color: var(--warning-color);
}
.button-warning:hover {
	background-color: #fa5252;
}

.button-disabled {
	background-color: #6c757d;
	cursor: not-allowed;
	opacity: 0.7;
}

.button-small {
	padding: 8px 15px;
	font-size: 14px;
}

.button-tiny {
	padding: 2px 8px;
	font-size: 12px;
	line-height: 1.5;
}

.flash {
	padding: 15px;
	margin-bottom: 20px;
	border: 1px solid transparent;
	border-radius: 5px;
}

.flash-success {
	color: var(--light-color);
	background-color: #2f6b3b;
	border-color: #3e874b;
}

.flash-danger {
	color: var(--light-color);
	background-color: #7a2e34;
	border-color: #943b42;
}

.flash-error {
	color: var(--light-color);
	background-color: #7a2e34;
	border-color: #943b42;
}

.flash-warning {
	color: #212529;
	background-color: #ffd43b;
	border-color: #f1c40f;
}

.flash-info {
	color: #212529;
	background-color: #74c0fc;
	border-color: #4dabf7;
}

.user-session-controls {
	display: flex;
	align-items: center;
	gap: 15px;
}

.button-logout {
	background-color: #6c757d;
	padding: 8px 15px;
	font-size: 14px;
}
.button-logout:hover {
	background-color: #5a6268;
}

body.login-page {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100vh;
	padding: 0;
}

.login-container {
	width: 100%;
	max-width: 400px;
	padding: 30px 40px;
	background: #2d3238;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.login-container h1 {
	text-align: center;
	margin-bottom: 25px;
	color: var(--light-color);
}

.main-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid var(--border-color);
	padding-bottom: 15px;
	margin-bottom: 20px;
}

.navigation .nav-link {
	font-size: 1.1em;
	font-weight: 500;
	color: var(--light-color);
	text-decoration: none;
	margin-right: 25px;
	padding: 5px 0;
	transition: color 0.2s;
}

.navigation .nav-link:hover,
.navigation .nav-link.active {
	color: var(--primary-color);
	border-bottom: 2px solid var(--primary-color);
}

.header-controls {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 20px;
}

.main-footer {
	margin-top: 40px;
	padding-top: 20px;
	border-top: 1px solid var(--border-color);
}

.stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 20px;
	margin-bottom: 30px;
}

.stat-card {
	background-color: #2d3238;
	padding: 25px;
	border-radius: 8px;
	text-align: center;
	border: 1px solid var(--border-color);
}

.stat-card h3 {
	margin-top: 0;
	margin-bottom: 5px;
	color: #adb5bd;
	font-size: 1em;
	font-weight: 500;
	text-transform: uppercase;
}

.stat-card .stat-number {
	font-size: 2.5em;
	font-weight: bold;
	color: var(--light-color);
	line-height: 1.2;
}

.stat-card .stat-number small {
	font-size: 0.4em;
	font-weight: normal;
	color: #adb5bd;
}

.settings-container {
	display: flex;
	flex-wrap: wrap;
	gap: 30px;
}

.settings-column-left {
	flex: 2;
	min-width: 380px;
}

.settings-column-right {
	flex: 3;
	min-width: 450px;
}

.host-card {
	background-color: #2d3238;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 20px;
}

.host-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid var(--border-color);
	padding-bottom: 10px;
	margin-bottom: 15px;
}

.host-header h3 {
	margin: 0;
	color: var(--light-color);
}

.plans-section h4,
.plans-section h5 {
	color: var(--light-color);
	border: none;
}

.plan-list {
	list-style: none;
	padding: 0;
	margin-bottom: 20px;
}

.plan-list li {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px;
	border-bottom: 1px solid #495057;
}

.plan-list li:last-child {
	border-bottom: none;
}

.form-inline {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.form-inline input {
	flex: 1;
	min-width: 80px;
	padding: 8px;
	font-size: 14px;
}

.form-inline select {
	flex: 1;
	min-width: 160px;
	padding: 8px;
	font-size: 14px;
}

.form-inline button {
	flex-shrink: 0;
}

.bot-control {
	display: flex;
	align-items: center;
	gap: 15px;
	border-right: 1px solid var(--border-color);
	padding-right: 20px;
}

.bot-control p {
	margin: 0;
	font-size: 1em;
	white-space: nowrap;
	color: var(--light-color);
}

.status-running {
	color: var(--success-color);
}

.status-stopped {
	color: #adb5bd;
}

.status-warning {
	color: var(--warning-color);
	font-size: 0.9em;
}

.dashboard-container {
	display: flex;
	flex-wrap: wrap;
	gap: 30px;
}

.dashboard-column-left {
	flex: 3;
	min-width: 400px;
}

.dashboard-column-right {
	flex: 2;
	min-width: 350px;
}

.chart-container {
	background-color: #2d3238;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	margin-bottom: 30px;
	max-width: 716px;
	max-height: 423px;
	padding: 20px 20px 50px;
}

.transaction-list {
	list-style: none;
	padding: 0;
}

.transaction-item {
	background-color: #2d3238;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	padding: 15px;
	margin-bottom: 15px;
}

.transaction-item p {
	margin: 0 0 8px 0;
	font-size: 0.95em;
	color: var(--light-color);
}

.transaction-item p strong {
	color: var(--light-color);
	display: inline-block;
	width: 130px;
}

.transaction-item .user-info {
	color: var(--primary-color);
	font-weight: bold;
}

.transactions-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 20px;
}

.transactions-table th,
.transactions-table td {
	border: 1px solid var(--border-color);
	padding: 10px 12px;
	text-align: left;
	font-size: 0.9em;
	color: var(--light-color);
}

.transactions-table thead {
	background-color: #343a40;
}

.transactions-table th {
	font-weight: 600;
}

.pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-top: 30px;
	gap: 5px;
}

.pagination a {
	color: var(--primary-color);
	background-color: #2d3238;
	border: 1px solid var(--border-color);
	padding: 8px 14px;
	text-decoration: none;
	border-radius: 5px;
	transition: background-color 0.2s, color 0.2s;
}

.pagination a:hover {
	background-color: #495057;
}

.pagination a.active {
	background-color: var(--primary-color);
	color: #fff;
	border-color: var(--primary-color);
	cursor: default;
}

.pagination a.disabled {
	color: #6c757d;
	background-color: #343a40;
	border-color: #495057;
	pointer-events: none;
}

.user-link {
	color: var(--primary-color);
	text-decoration: none;
}

.user-link:hover {
	text-decoration: underline;
}

.pagination .page-jump-form {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-left: 6px;
}

.pagination .page-jump-label {
	color: #adb5bd;
	font-size: 0.9em;
}

.pagination .page-jump-input {
	width: 70px;
	padding: 8px 10px;
	border: 1px solid var(--border-color);
	border-radius: 5px;
	background-color: #343a40;
	color: var(--light-color);
	text-align: center;
}

.pagination .page-jump-input:focus {
	outline: none;
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.25);
}

.legacy-admin .users-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 20px;
}

.legacy-admin .users-table th,
.legacy-admin .users-table td {
	border: 1px solid var(--border-color);
	padding: 10px 12px;
	text-align: left;
	vertical-align: middle;
	color: var(--light-color);
}

.legacy-admin .users-table thead {
	background-color: #343a40;
}

.legacy-admin .users-table th {
	font-weight: 600;
}

.legacy-admin .users-table .actions-cell {
	width: 250px;
	text-align: right;
}

.legacy-admin .actions-cell form {
	display: inline-block;
	margin-left: 5px;
}

.legacy-admin .status-badge {
	display: inline-block;
	padding: 4px 8px;
	border-radius: 12px;
	font-size: 0.8em;
	font-weight: 600;
	color: #fff;
}

.status-banned {
	background-color: var(--danger-color);
}

.status-active {
	background-color: var(--success-color);
}

.status-expired {
	background-color: #adb5bd;
	color: #212529;
}

.status-disabled {
	background-color: #ffa94d;
	color: #212529;
}

.status-soon {
	background-color: #ff922b;
	color: #212529;
}

.status-missing {
	background-color: #ffd43b;
	color: #212529;
}

.status-neutral {
	background-color: #6c757d;
}

@media (max-width: 1256px) {
	.navigation {
		display: flex;
		justify-content: flex-start;
		flex-wrap: wrap;
	}
	.header-controls {
		flex-wrap: wrap;
	}
	.bot-control {
		padding-right: 0;
	}
	li {
		list-style-type: none;
	}
	.bm {
		display: block;
		input + label {
			position: fixed;
			top: 40px;
			right: 40px;
			z-index: 5;
			span {
				position: absolute;
				width: 100%;
				height: 2px;
				top: 50%;
				margin-top: -1px;
				left: 0;
				display: block;
				transition: 0.5s;
			}
			span:first-child {
				top: 3px;
			}
			span:last-child {
				top: 16px;
			}
		}
		label:hover {
			cursor: pointer;
		}
		input:checked + label {
			span {
				opacity: 0;
				top: 50%;
			}
			span:first-child {
				opacity: 1;
				transform: rotate(405deg);
			}
			span:last-child {
				opacity: 1;
				transform: rotate(-405deg);
			}
		}
		input ~ nav {
			background: rgba(45, 50, 56, 0.9);
			position: fixed;
			top: 0;
			right: 0;
			width: 330px;
			height: 0px;
			z-index: 3;
			transition: 0.5s;
			transition-delay: 0.5s;
			overflow: hidden;

			> ul {
				position: absolute;
				top: 100px;
				right: 10%;
				> li {
					opacity: 0;
					transition: 0.5s;
					transition-delay: 0s;
					text-align: right;
					> a {
						font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
							'Helvetica Neue', Arial, sans-serif;
						color: var(--light-color);
						line-height: 1.6;
						text-decoration: none;
						font-size: 2em;
					}
				}
			}
		}
		input:checked ~ nav {
			height: 100%;
			transition-delay: 0s;
			> ul {
				> li {
					opacity: 1;
					transition-delay: 0.5s;
					margin-bottom: 30px;
				}
			}
		}
	}
	.navigation {
		display: none;
	}
	.burger_img {
		background: url('../img/burger.png');
		background-size: max(32px, 32px);
		height: 32px;
		width: 32px;
	}
	.main-header {
		justify-content: flex-start;
	}
	.container {
		max-width: 93%;
		padding: 20px;
	}
	.bm {
		input + label {
			top: 20px;
			right: 10px;
		}
	}
}

@media (max-width: 772px) {
	.header-controls {
		justify-content: flex-start;
	}
}
@media (max-width: 620px) {
	.chart-container {
		max-width: 100%;
		min-height: 300px;
	}
	.container {
		width: 100%;
	}
	.dashboard-column-left {
		min-width: 10px;
	}
	.dashboard-column-right {
		min-width: 460px;
	}
}
@media (max-width: 570px) {
	.dashboard-column-right {
		min-width: 415px;
	}
}
@media (max-width: 475px) {
	.dashboard-column-right {
		min-width: 330px;
	}
	h2 {
		font-size: 1em;
	}
	h1 {
		font-size: 1.5em;
	}
}
@media (max-width: 455px) {
	.chart-container {
		h3 {
			font-size: 1em;
		}
	}
}
@media (max-width: 430px) {
	.dashboard-column-right {
		min-width: 283px;
	}
}
@media (max-width: 380px) {
	.dashboard-column-right {
		min-width: 240px;
	}
}

@media (max-width: 600px) {
	h1 {
		font-size: 1.4em;
		margin-bottom: 15px;
	}

	.settings-container {
		flex-direction: column;
	}

	.settings-column-left,
	.settings-column-right {
		flex: 1 1 100%;
		min-width: 0;
	}

	/* Адаптация секции хостов */
	.host-card {
		padding: 15px;
		margin-bottom: 15px;
	}

	.host-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}

	.host-header h3 {
		margin-bottom: 5px;
	}

	.host-header form {
		margin-top: 5px;
	}

	.plan-list li {
		flex-direction: column;
		align-items: flex-start;
		gap: 5px;
		padding: 8px;
	}

	.plan-list li form {
		margin-top: 5px;
	}

	/* Адаптация форм */
	.form-group {
		margin-bottom: 15px;
	}

	.form-group label {
		font-size: 0.9em;
	}

	.form-group input[type='text'],
	.form-group input[type='url'],
	.form-group input[type='password'],
	.form-group input[type='number'],
	.form-group select,
	.form-group textarea {
		font-size: 14px;
		padding: 10px;
	}

	.form-group textarea {
		min-height: 60px;
	}

	.toggle-password {
		top: 40%;
		width: 40px;
		font-size: 18px;
	}

	.form-inline {
		flex-direction: column;
		gap: 8px;
	}

	.form-inline input {
		min-width: 100%;
	}

	.form-inline select {
		min-width: 100%;
	}

	.button {
		padding: 10px 20px;
		font-size: 14px;
	}

	.button-small {
		padding: 6px 12px;
		font-size: 12px;
	}

	.button-tiny {
		padding: 2px 6px;
		font-size: 10px;
	}
}

@media (max-width: 480px) {
	h1 {
		font-size: 1.2em;
	}

	.host-card {
		padding: 10px;
	}

	.form-group input[type='text'],
	.form-group input[type='url'],
	.form-group input[type='password'],
	.form-group input[type='number'],
	.form-group select,
	.form-group textarea {
		font-size: 12px;
		padding: 8px;
	}

	.toggle-password {
		width: 35px;
		font-size: 16px;
	}

	.button {
		padding: 8px 15px;
		font-size: 12px;
	}
}

@media (max-width: 375px) {
	h1 {
		font-size: 1em;
	}

	.host-card {
		padding: 8px;
	}

	.form-group input[type='text'],
	.form-group input[type='url'],
	.form-group input[type='password'],
	.form-group input[type='number'],
	.form-group select,
	.form-group textarea {
		font-size: 10px;
		padding: 6px;
	}

	.toggle-password {
		width: 30px;
		font-size: 14px;
	}

	.button {
		padding: 6px 10px;
		font-size: 10px;
	}

	.plan-list li {
		padding: 6px;
	}
}
/* ========= Дополнительные стили для нового Dashboard ========= */

.page-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	margin-bottom: 24px;
}

.user-page-header {
	flex-wrap: wrap;
	gap: 16px;
}

.user-search-form {
	margin-left: auto;
}

.promo-search-form {
	margin-left: auto;
}

.user-header-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.page-header h1 {
	margin-bottom: 4px;
}

.page-subtitle {
	color: var(--light-color);
	opacity: 0.75;
	font-size: 0.95rem;
}

.section-helper {
	color: var(--light-color);
	opacity: 0.7;
	font-size: 0.9rem;
	margin-bottom: 12px;
}

.section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 12px;
}

.detail-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px;
}

.form-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
}

.form-row {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	margin-bottom: 16px;
}

.form-actions {
	margin-top: 10px;
}

.detail-item {
	background-color: #2d3238;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	padding: 12px 14px;
}

.detail-label {
	display: block;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #adb5bd;
}

.detail-value {
	display: block;
	margin-top: 6px;
	color: var(--light-color);
	word-break: break-word;
}

.key-note {
	margin-top: 4px;
	font-size: 0.75rem;
	color: #adb5bd;
}

.key-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: flex-end;
}

.key-actions form {
	margin: 0;
}

.key-actions input[type='number'],
.key-actions input[type='datetime-local'] {
	padding: 6px 8px;
	font-size: 12px;
	border: 1px solid var(--border-color);
	border-radius: 5px;
	background-color: #343a40;
	color: var(--light-color);
}

.key-actions input[type='number'] {
	width: 72px;
}

.key-actions input[type='datetime-local'] {
	min-width: 180px;
}

.key-actions-cell {
	min-width: 360px;
}

.promo-table .actions-cell {
	min-width: 280px;
}

.stat-card .stat-helper {
	margin-top: 6px;
	font-size: 0.8rem;
	color: #adb5bd;
}

.dashboard-container {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1.7fr);
	gap: 24px;
	margin-top: 24px;
}

@media (max-width: 900px) {
	.dashboard-container {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 768px) {
	.user-page-header {
		align-items: flex-start;
	}

	.user-search-form {
		width: 100%;
	}

	.promo-search-form {
		width: 100%;
	}

	.user-search-form input {
		min-width: 180px;
	}

	.promo-search-form input {
		min-width: 180px;
	}

	.user-header-actions {
		width: 100%;
	}
}

.admin-account {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 2px;
	padding: 6px 10px;
	border: 1px solid var(--ds-border);
	border-radius: var(--ds-radius-sm);
	background: #101d36;
	min-width: 120px;
}

.admin-account .admin-name {
	font-size: 13px;
	font-weight: 600;
	color: var(--ds-text);
	line-height: 1.2;
}

.admin-account .admin-role {
	font-size: 11px;
	color: var(--ds-text-soft);
	line-height: 1.2;
}

.permission-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 8px 12px;
	margin: 12px 0 18px;
}

.permission-grid.is-disabled {
	opacity: 0.62;
}

.permission-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border: 1px solid var(--ds-border);
	border-radius: 8px;
	background: rgba(15, 23, 42, 0.35);
	font-size: 13px;
	color: var(--ds-text);
}

.permission-item input[type='checkbox'] {
	flex-shrink: 0;
}

.permission-matrix-table td:not(:first-child),
.permission-matrix-table th:not(:first-child) {
	text-align: center;
}

@media (max-width: 768px) {
	.admin-account {
		align-items: flex-start;
	}
}

.chart-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
}

.chart-card {
	background: #2d3238;
	border-radius: 8px;
	padding: 16px;
	border: 1px solid var(--border-color);
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.chart-card-header {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.chart-card-header h3 {
	margin: 0;
}

.chart-label {
	font-size: 0.8rem;
	color: #adb5bd;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.chart-card-body {
	position: relative;
	height: 240px;
}

.muted {
	color: #adb5bd;
	font-size: 0.8rem;
}
/* ========= Новый layout админ-панели ========= */

.layout {
	display: flex;
	min-height: 100vh;
	background-color: var(--body-bg);
	color: var(--light-color);
	font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
		sans-serif;
}

.sidebar {
	width: 240px;
	background: #181b1f;
	border-right: 1px solid var(--border-color);
	padding: 16px 14px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	position: sticky;
	top: 0;
	align-self: flex-start;
	max-height: 100vh;
}

.sidebar-logo {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.95rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #dee2e6;
}

.logo-mark {
	background: var(--primary-color);
	color: #0b1014;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 0.8rem;
}

.logo-text {
	font-weight: 500;
}

.sidebar-nav {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-top: 4px;
}

.sidebar-link {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 8px;
	font-size: 0.9rem;
	color: #ced4da;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link .icon {
	width: 18px;
	text-align: center;
}

.sidebar-link:hover {
	background: #22252b;
	color: #f8f9fa;
}

.sidebar-link.active {
	background: #343a40;
	color: #f8f9fa;
}

.sidebar-footer {
	margin-top: auto;
	font-size: 0.8rem;
	color: #adb5bd;
}

.sidebar-warning {
	padding: 8px 10px;
	border-radius: 8px;
	background: #3b1f1f;
	border: 1px solid #f03e3e;
}

.sidebar-ok {
	padding: 8px 10px;
	border-radius: 8px;
	background: #15392a;
	border: 1px solid #2f9e44;
}

.main-area {
	flex: 1;
	display: flex;
	flex-direction: column;
	padding: 16px 24px;
}

.topbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
	gap: 16px;
}

.topbar-project {
	font-size: 0.95rem;
	opacity: 0.85;
}

.bot-status-list {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.bot-status-item {
	display: flex;
	align-items: center;
	gap: 8px;
}

.bot-status-label {
	font-size: 0.85rem;
	opacity: 0.8;
}

.status-pill {
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 0.8rem;
	border: 1px solid transparent;
}

.status-pill-ok {
	background: #15392a;
	border-color: #2f9e44;
	color: #b2f2bb;
}

.status-pill-bad {
	background: #3b1f1f;
	border-color: #f03e3e;
	color: #ffc9c9;
}

.flash-container {
	margin-bottom: 12px;
}

.main-content {
	flex: 1;
}

/* Заголовки страниц и подзаголовки */

.page-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	margin-bottom: 24px;
	gap: 16px;
}

.page-header h1 {
	margin-bottom: 4px;
}

.page-subtitle {
	color: var(--light-color);
	opacity: 0.75;
	font-size: 0.95rem;
}

/* Адаптив под мобильные */

@media (max-width: 900px) {
	.layout {
		flex-direction: column;
	}

	.sidebar {
		position: static;
		width: 100%;
		flex-direction: column;      /* ВАЖНО: было row */
		align-items: stretch;        /* растягиваем по ширине */
		gap: 8px;                    /* немного расстояния между блоками */
		border-right: none;
		border-bottom: 1px solid var(--border-color);
		padding: 10px 14px;
	}

	.main-area {
		padding: 12px 14px 20px;
	}

	.bot-status-list {
		justify-content: flex-start;
	}
}


/* --- Тюним шапку и кнопки статуса ботов --- */

.topbar {
	align-items: flex-start;
	flex-wrap: wrap;
}

.topbar-right {
	display: flex;
	justify-content: flex-end;
	flex: 1;
}

.bot-status-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.bot-status-item {
	background: #20242a;
	padding: 6px 8px;
	border-radius: 999px;
	border: 1px solid #343a40;
}

.bot-status-item form {
	margin-left: 4px;
}

.button.button-small {
	padding: 3px 10px;
	font-size: 0.8rem;
	line-height: 1.2;
}

/* На маленьких экранах каждая «плашка» со статусом — в свою строку */

@media (max-width: 768px) {
	.topbar {
		flex-direction: column;
		align-items: flex-start;
	}

	.topbar-right {
		width: 100%;
	}

	.topbar-left {
		width: 100%;
	}

	.topbar-search {
		width: 100%;
	}

	.topbar-search input {
		width: 100%;
		min-width: 0;
	}

	.bot-status-list {
		width: 100%;
		flex-direction: column;
		align-items: stretch;
	}

	.bot-status-item {
		justify-content: space-between;
		display: flex;
	}
}
/* --- Обёртка для горизонтального скролла таблиц --- */

.table-wrapper {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* Таблицы админки чуть компактнее */

.legacy-admin .users-table,
.legacy-admin .transactions-table {
	width: 100%;
	font-size: 0.9rem;
}

/* На очень узких экранах ещё уменьшаем и позволяем скролл */

@media (max-width: 768px) {
	.legacy-admin .users-table,
	.legacy-admin .transactions-table {
		min-width: 600px;
		font-size: 0.8rem;
	}
}


.pagination .page-info {
	padding: 0 10px;
	color: #adb5bd;
}

/* === Stack Theme Overrides === */

h1,
h2,
h3,
h4 {
	color: #1f2430;
}

h2 {
	border-bottom: 1px solid rgba(31, 36, 48, 0.08);
	color: #1f2430;
}

body {
	color: var(--light-color);
}

.layout {
	background: var(--surface-alt);
	border-radius: 28px;
	box-shadow: var(--card-shadow);
	overflow: hidden;
	max-width: 1400px;
	margin: 0 auto;
	position: relative;
}

.sidebar {
	background: #fdfdff;
	border-right: 1px solid var(--border-color);
	box-shadow: inset -1px 0 0 rgba(229, 232, 240, 0.9);
}

.sidebar-logo {
	text-transform: none;
	letter-spacing: 0.02em;
	color: #3c4257;
	font-weight: 600;
	gap: 12px;
}

.logo-image {
	width: 44px;
	height: 44px;
	border-radius: 14px;
	background: #ffffff;
	box-shadow: 0 12px 24px rgba(255, 122, 89, 0.18);
	object-fit: cover;
}

.logo-text-group {
	display: flex;
	flex-direction: column;
}

.logo-title {
	font-size: 0.95rem;
	font-weight: 600;
	color: #2c3041;
}

.logo-mark {
	background: linear-gradient(135deg, #ff7a59 0%, #ffb45a 100%);
	color: #fff;
	box-shadow: 0 10px 18px rgba(255, 122, 89, 0.25);
}

.sidebar-link {
	color: #6b7280;
	border-radius: 12px;
}

.sidebar-link:hover {
	background: rgba(255, 122, 89, 0.12);
	color: #ff6a4d;
}

.sidebar-link.active {
	background: linear-gradient(90deg, rgba(255, 122, 89, 0.2), rgba(255, 255, 255, 0));
	color: #ff6a4d;
	box-shadow: inset 0 0 0 1px rgba(255, 122, 89, 0.12);
}

.sidebar-footer {
	color: var(--muted-color);
}

.sidebar-warning {
	background: rgba(255, 122, 89, 0.12);
	border-color: rgba(255, 122, 89, 0.35);
	color: #c1543c;
}

.sidebar-ok {
	background: rgba(53, 196, 139, 0.14);
	border-color: rgba(53, 196, 139, 0.35);
	color: #227a57;
}

.main-area {
	position: relative;
	padding: 26px 30px 34px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(247, 248, 252, 0.95));
}

.main-area::before,
.main-area::after {
	content: '';
	position: absolute;
	pointer-events: none;
	z-index: 0;
}

.main-area::before {
	top: -120px;
	left: -160px;
	width: 360px;
	height: 360px;
	background: radial-gradient(circle, rgba(255, 205, 160, 0.55), transparent 65%);
	opacity: 0.8;
}

.main-area::after {
	bottom: -180px;
	right: -200px;
	width: 420px;
	height: 420px;
	background: radial-gradient(circle, rgba(180, 210, 255, 0.45), transparent 70%);
	opacity: 0.8;
}

.topbar,
.flash-container,
.main-content {
	position: relative;
	z-index: 1;
}

.topbar {
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid rgba(229, 232, 240, 0.8);
	border-radius: 18px;
	padding: 12px 16px;
	box-shadow: var(--card-shadow-soft);
	backdrop-filter: blur(10px);
}

.topbar-project {
	font-weight: 600;
	color: #3c4257;
	opacity: 1;
}

.topbar-left {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.topbar-search {
	display: flex;
	align-items: center;
}

.topbar-search input {
	min-width: 240px;
	padding: 8px 14px;
	border-radius: 999px;
	border: 1px solid rgba(229, 232, 240, 0.9);
	background: #ffffff;
	color: #1f2430;
	box-shadow: var(--card-shadow-soft);
}

.topbar-search input:focus {
	outline: none;
	border-color: rgba(255, 122, 89, 0.45);
	box-shadow: 0 0 0 4px rgba(255, 122, 89, 0.18);
}

.topbar-right {
	display: flex;
	gap: 16px;
	align-items: center;
	flex: 1;
	justify-content: flex-end;
}

.theme-toggle {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 6px 10px;
	border-radius: 999px;
	background: #ffffff;
	border: 1px solid rgba(229, 232, 240, 0.9);
	box-shadow: var(--card-shadow-soft);
}

.theme-toggle-label {
	font-size: 0.75rem;
	color: var(--muted-color);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.theme-switch {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.theme-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.theme-slider {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	border-radius: 999px;
	background: #e8ecf4;
	transition: background 0.2s ease;
}

.theme-slider::before {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #ffffff;
	box-shadow: 0 6px 10px rgba(31, 36, 48, 0.12);
	transition: transform 0.2s ease;
}

.theme-switch input:checked + .theme-slider {
	background: linear-gradient(135deg, #1c2333 0%, #2c364a 100%);
}

.theme-switch input:checked + .theme-slider::before {
	transform: translateX(20px);
}

.bot-status-item {
	background: #ffffff;
	border: 1px solid rgba(229, 232, 240, 0.85);
	box-shadow: var(--card-shadow-soft);
}

.bot-status-label {
	color: var(--muted-color);
}

.status-pill {
	border-radius: 999px;
	font-weight: 600;
}

.status-pill-ok {
	background: rgba(53, 196, 139, 0.16);
	border-color: rgba(53, 196, 139, 0.35);
	color: #1d7a57;
}

.status-pill-bad {
	background: rgba(255, 107, 107, 0.18);
	border-color: rgba(255, 107, 107, 0.35);
	color: #b74444;
}

.page-subtitle,
.section-helper,
.muted,
.chart-label {
	color: var(--muted-color);
	opacity: 1;
}

.stat-card,
.chart-card,
.detail-item,
.chart-container,
.transaction-item,
.host-card,
.login-container {
	background: var(--surface);
	border: 1px solid rgba(229, 232, 240, 0.9);
	border-radius: 18px;
	box-shadow: var(--card-shadow-soft);
}

.stat-card {
	position: relative;
	overflow: hidden;
}

.stat-card::after {
	content: '';
	position: absolute;
	right: -40px;
	top: -40px;
	width: 140px;
	height: 140px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255, 205, 160, 0.45), transparent 70%);
}

.stat-card:nth-child(2n)::after {
	background: radial-gradient(circle, rgba(180, 210, 255, 0.45), transparent 70%);
}

.stat-card:nth-child(3n)::after {
	background: radial-gradient(circle, rgba(184, 244, 229, 0.45), transparent 70%);
}

.stat-card .stat-number {
	color: #1f2430;
}

.stat-card .stat-helper {
	color: var(--muted-color);
}

.chart-card-header h3 {
	color: #2c3041;
}

.chart-card {
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chart-card:hover,
.stat-card:hover,
.detail-item:hover,
.host-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--card-shadow);
}

.dashboard-container {
	display: grid;
	grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.1fr);
	gap: 28px;
	margin-top: 20px;
}

@media (max-width: 1024px) {
	.dashboard-container {
		grid-template-columns: 1fr;
	}
}

.form-group input[type='text'],
.form-group input[type='url'],
.form-group input[type='password'],
.form-group input[type='number'],
.form-group select,
.form-group textarea,
.form-inline input,
.form-inline select,
.key-actions input[type='number'],
.key-actions input[type='datetime-local'],
.pagination .page-jump-input {
	background-color: #ffffff;
	color: #1f2430;
	border: 1px solid rgba(223, 227, 237, 0.9);
	box-shadow: 0 10px 18px rgba(31, 36, 48, 0.04);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.pagination .page-jump-input:focus {
	border-color: rgba(255, 122, 89, 0.5);
	box-shadow: 0 0 0 4px rgba(255, 122, 89, 0.18);
}

.button {
	border-radius: 999px;
	box-shadow: 0 8px 16px rgba(54, 69, 96, 0.14);
}

.button-primary {
	background: linear-gradient(135deg, #ff9c85 0%, #ffc7a5 100%);
}

.button-primary:hover {
	background: linear-gradient(135deg, #ff9078 0%, #ffbc98 100%);
}

.button-secondary {
	background: #ffffff;
	color: #5c6475;
	border: 1px solid rgba(229, 232, 240, 0.9);
	box-shadow: none;
}

.button-secondary:hover {
	background: #f4f6fb;
}

.button-outline {
	background: #ffffff;
	color: #5c6475;
	border: 1px solid rgba(229, 232, 240, 0.9);
	box-shadow: none;
}

.button-outline:hover {
	background: #f4f6fb;
}

.button-start {
	background: linear-gradient(135deg, #6bc9a8 0%, #a6e3cf 100%);
	box-shadow: 0 8px 16px rgba(65, 165, 136, 0.18);
}

.button-warning {
	background: linear-gradient(135deg, #f2c27a 0%, #f7ddb5 100%);
	box-shadow: 0 8px 16px rgba(186, 132, 60, 0.18);
	color: #4a3620;
}

.button-danger {
	background: linear-gradient(135deg, #f28b8b 0%, #f7b3b3 100%);
	box-shadow: 0 8px 16px rgba(188, 96, 96, 0.18);
}

.flash {
	border-radius: 14px;
	box-shadow: var(--card-shadow-soft);
}

.flash-success {
	background: rgba(53, 196, 139, 0.15);
	color: #1d7a57;
	border-color: rgba(53, 196, 139, 0.35);
}

.flash-danger,
.flash-error {
	background: rgba(255, 107, 107, 0.18);
	color: #b74444;
	border-color: rgba(255, 107, 107, 0.35);
}

.flash-warning {
	background: rgba(255, 180, 90, 0.2);
	color: #7a4b16;
	border-color: rgba(255, 180, 90, 0.35);
}

.flash-info {
	background: rgba(59, 109, 246, 0.14);
	color: #2f4fa6;
	border-color: rgba(59, 109, 246, 0.3);
}

.button-logout {
	background: #ffffff;
	color: #5c6475;
	border: 1px solid rgba(229, 232, 240, 0.9);
	box-shadow: none;
}

.button-logout:hover {
	background: #f4f6fb;
}

.legacy-admin .status-badge {
	border-radius: 999px;
	padding: 4px 10px;
}

.status-active {
	background-color: rgba(53, 196, 139, 0.18);
	color: #1d7a57;
}

.status-banned {
	background-color: rgba(255, 107, 107, 0.2);
	color: #b74444;
}

.status-expired {
	background-color: rgba(127, 134, 154, 0.2);
	color: #5c6475;
}

.status-disabled,
.status-soon {
	background-color: rgba(255, 180, 90, 0.22);
	color: #7a4b16;
}

.status-missing {
	background-color: rgba(255, 215, 125, 0.25);
	color: #7a5c16;
}

.status-neutral {
	background-color: rgba(123, 129, 145, 0.18);
	color: #5c6475;
}

.table-wrapper {
	background: transparent;
}

.legacy-admin .users-table,
.legacy-admin .transactions-table {
	border-collapse: separate;
	border-spacing: 0 10px;
}

.legacy-admin .users-table thead,
.legacy-admin .transactions-table thead {
	background: transparent;
}

.legacy-admin .users-table th,
.legacy-admin .transactions-table th {
	border: none;
	color: var(--muted-color);
	font-weight: 600;
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 6px 12px;
}

.legacy-admin .users-table td,
.legacy-admin .transactions-table td {
	border: none;
	padding: 14px 16px;
	color: #1f2430;
}

.legacy-admin .users-table tbody tr,
.legacy-admin .transactions-table tbody tr {
	background: var(--surface);
	box-shadow: var(--card-shadow-soft);
}

.legacy-admin .users-table tbody tr td:first-child,
.legacy-admin .transactions-table tbody tr td:first-child {
	border-radius: 16px 0 0 16px;
}

.legacy-admin .users-table tbody tr td:last-child,
.legacy-admin .transactions-table tbody tr td:last-child {
	border-radius: 0 16px 16px 0;
}

.pagination a {
	background: #ffffff;
	border: 1px solid rgba(229, 232, 240, 0.9);
	color: #6b7280;
	border-radius: 999px;
	padding: 6px 12px;
	box-shadow: var(--card-shadow-soft);
}

.pagination a.active {
	background: linear-gradient(135deg, #ff7a59 0%, #ff9f6a 100%);
	color: #ffffff;
	border-color: transparent;
	box-shadow: 0 12px 24px rgba(255, 122, 89, 0.28);
}

.pagination a.disabled {
	opacity: 0.5;
	box-shadow: none;
}

.pagination .page-info {
	color: var(--muted-color);
}

@keyframes float-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.stat-card,
.chart-card,
.detail-item,
.transaction-item,
.host-card {
	animation: float-in 0.5s ease both;
}

body.login-page {
	background: var(--body-bg);
}

.login-container h1 {
	color: #1f2430;
}

.stat-card:nth-child(2),
.chart-card:nth-child(2),
.detail-item:nth-child(2) {
	animation-delay: 0.05s;
}

.stat-card:nth-child(3),
.chart-card:nth-child(3),
.detail-item:nth-child(3) {
	animation-delay: 0.1s;
}

.stat-card:nth-child(4),
.chart-card:nth-child(4),
.detail-item:nth-child(4) {
	animation-delay: 0.15s;
}

@media (max-width: 900px) {
	body {
		padding: 12px;
	}

	.layout {
		border-radius: 20px;
	}

	.main-area {
		padding: 20px 18px 26px;
	}
}

@media (max-width: 620px) {
	body {
		padding: 0;
	}

	.layout {
		border-radius: 0;
		box-shadow: none;
	}
}

/* === Dark Theme === */

:root[data-theme='dark'] {
	--primary-color: #ff8f6a;
	--primary-strong: #ff7a59;
	--success-color: #3fd6a1;
	--danger-color: #ff6b6b;
	--warning-color: #ffc470;
	--light-color: #e6ebf5;
	--dark-color: #0b0f16;
	--border-color: #232b38;
	--body-bg: #0e1219;
	--surface: #141a24;
	--surface-alt: #111722;
	--muted-color: #9aa4b2;
	--card-shadow: 0 24px 50px rgba(5, 8, 12, 0.45);
	--card-shadow-soft: 0 14px 30px rgba(5, 8, 12, 0.35);
}

:root[data-theme='dark'] body {
	background-image: radial-gradient(
			circle at 12% -10%,
			rgba(255, 122, 89, 0.18),
			transparent 45%
		),
		radial-gradient(
			circle at 88% 8%,
			rgba(59, 109, 246, 0.18),
			transparent 52%
		),
		linear-gradient(180deg, #0e1219 0%, #121822 100%);
	color: var(--light-color);
}

:root[data-theme='dark'] .layout {
	background: rgba(18, 23, 34, 0.95);
}

:root[data-theme='dark'] .sidebar {
	background: #0f141d;
	border-right-color: rgba(35, 43, 56, 0.9);
}

:root[data-theme='dark'] .sidebar-logo {
	color: #d5d9e4;
}

:root[data-theme='dark'] .logo-title {
	color: #e6ebf5;
}

:root[data-theme='dark'] .logo-image {
	background: #141a24;
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

:root[data-theme='dark'] .sidebar-link {
	color: #9aa4b2;
}

:root[data-theme='dark'] .sidebar-link:hover {
	background: rgba(255, 122, 89, 0.16);
	color: #ffb199;
}

:root[data-theme='dark'] .sidebar-link.active {
	background: linear-gradient(90deg, rgba(255, 122, 89, 0.2), rgba(17, 23, 34, 0));
	color: #ffb199;
	box-shadow: inset 0 0 0 1px rgba(255, 122, 89, 0.2);
}

:root[data-theme='dark'] .main-area {
	background: linear-gradient(180deg, rgba(20, 26, 36, 0.9), rgba(17, 23, 34, 0.98));
}

:root[data-theme='dark'] .topbar {
	background: rgba(20, 26, 36, 0.9);
	border-color: rgba(35, 43, 56, 0.9);
}

:root[data-theme='dark'] .topbar-project {
	color: #e6ebf5;
}

:root[data-theme='dark'] .topbar-search input {
	background: #0f141d;
	border-color: rgba(35, 43, 56, 0.9);
	color: #e6ebf5;
}

:root[data-theme='dark'] .theme-toggle,
:root[data-theme='dark'] .bot-status-item {
	background: #141a24;
	border-color: rgba(35, 43, 56, 0.9);
}

:root[data-theme='dark'] .theme-toggle-label {
	color: #9aa4b2;
}

:root[data-theme='dark'] .theme-slider {
	background: #2a3240;
}

:root[data-theme='dark'] .stat-card,
:root[data-theme='dark'] .chart-card,
:root[data-theme='dark'] .detail-item,
:root[data-theme='dark'] .chart-container,
:root[data-theme='dark'] .transaction-item,
:root[data-theme='dark'] .host-card,
:root[data-theme='dark'] .login-container,
:root[data-theme='dark'] .users-table tbody tr,
:root[data-theme='dark'] .transactions-table tbody tr {
	background: #141a24;
	border-color: rgba(35, 43, 56, 0.9);
	box-shadow: var(--card-shadow-soft);
}

:root[data-theme='dark'] .stat-card .stat-number,
:root[data-theme='dark'] .users-table td,
:root[data-theme='dark'] .transactions-table td {
	color: #e6ebf5;
}

:root[data-theme='dark'] h1,
:root[data-theme='dark'] h2,
:root[data-theme='dark'] h3,
:root[data-theme='dark'] h4 {
	color: #e6ebf5;
}

:root[data-theme='dark'] .form-group input[type='text'],
:root[data-theme='dark'] .form-group input[type='url'],
:root[data-theme='dark'] .form-group input[type='password'],
:root[data-theme='dark'] .form-group input[type='number'],
:root[data-theme='dark'] .form-group select,
:root[data-theme='dark'] .form-group textarea,
:root[data-theme='dark'] .form-inline input,
:root[data-theme='dark'] .form-inline select,
:root[data-theme='dark'] .key-actions input[type='number'],
:root[data-theme='dark'] .key-actions input[type='datetime-local'],
:root[data-theme='dark'] .pagination .page-jump-input {
	background-color: #0f141d;
	color: #e6ebf5;
	border-color: rgba(35, 43, 56, 0.9);
}

:root[data-theme='dark'] .pagination a {
	background: #141a24;
	border-color: rgba(35, 43, 56, 0.9);
	color: #c7ceda;
}

:root[data-theme='dark'] .pagination a.active {
	color: #0f141d;
}

:root[data-theme='dark'] .button-outline,
:root[data-theme='dark'] .button-secondary,
:root[data-theme='dark'] .button-logout {
	background: #141a24;
	color: #c7ceda;
	border-color: rgba(35, 43, 56, 0.9);
}

:root[data-theme='dark'] h2 {
	border-bottom-color: rgba(35, 43, 56, 0.9);
}

/* === Admin Panel Layout Fixes === */

.layout {
	width: 100%;
	max-width: 1520px;
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
	width: auto;
	min-width: 0;
}

.main-area,
.main-content,
.dashboard-column-left,
.dashboard-column-right {
	min-width: 0;
}

.topbar {
	display: grid;
	grid-template-columns: minmax(300px, 1fr) auto;
	align-items: center;
	column-gap: 14px;
	row-gap: 12px;
}

.topbar-left {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	min-width: 0;
}

.topbar-search {
	flex: 1 1 340px;
	min-width: 220px;
}

.topbar-search input {
	width: 100%;
	min-width: 0;
}

.topbar-right {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 12px;
	min-width: 0;
}

.bot-status-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(240px, 1fr));
	gap: 10px;
	width: min(100%, 620px);
}

.bot-status-item {
	display: grid;
	grid-template-columns: auto auto auto;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
}

.bot-status-item form {
	margin-left: 0;
}

.button.button-small {
	white-space: nowrap;
}

.stats-grid {
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.dashboard-container {
	grid-template-columns: minmax(0, 1.9fr) minmax(340px, 1fr);
}

.table-wrapper {
	overflow-x: auto;
	overflow-y: hidden;
	padding-bottom: 2px;
}

.transactions-table {
	min-width: 640px;
}

.transactions-table th,
.transactions-table td {
	white-space: nowrap;
}

.transactions-table td:first-child {
	min-width: 220px;
	white-space: normal;
}

@media (max-width: 1200px) {
	.topbar {
		grid-template-columns: 1fr;
	}

	.topbar-right {
		justify-content: flex-start;
	}

	.bot-status-list {
		width: 100%;
	}

	.dashboard-container {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 900px) {
	.layout {
		grid-template-columns: 1fr;
	}

	.sidebar {
		position: static;
		border-right: none;
		border-bottom: 1px solid var(--border-color);
	}

	.main-area {
		padding: 16px 14px 24px;
	}

	.topbar-left,
	.topbar-right,
	.topbar-search {
		width: 100%;
	}

	.bot-status-list {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 620px) {
	.topbar {
		padding: 12px;
	}

	.topbar-project {
		width: 100%;
	}

	.bot-status-item {
		grid-template-columns: 1fr;
		justify-items: start;
		border-radius: 14px;
	}

	.bot-status-item form,
	.bot-status-item form button {
		width: 100%;
	}
}

/* === Admin Panel Cross-Page Polish === */

.page-header h1 {
	font-size: clamp(2rem, 3vw, 3rem);
	line-height: 1.1;
}

.page-subtitle {
	max-width: 78ch;
}

.user-page-header {
	align-items: flex-end;
}

.user-page-header .form-inline,
.user-page-header .user-header-actions {
	margin-left: auto;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-end;
}

.user-search-form,
.promo-search-form {
	width: min(100%, 820px);
}

.user-page-header .form-inline input,
.user-page-header .form-inline select {
	min-height: 42px;
}

.user-page-header .form-inline input {
	flex: 1 1 260px;
}

.user-page-header .form-inline select {
	flex: 0 1 260px;
}

.user-page-header .form-inline .button,
.user-header-actions .button {
	min-height: 42px;
}

.stats-grid {
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.table-wrapper {
	border-radius: 16px;
}

.legacy-admin .users-table td,
.legacy-admin .transactions-table td {
	vertical-align: top;
}

.legacy-admin .actions-cell {
	min-width: 290px;
	white-space: normal;
}

.legacy-admin .actions-cell form,
.legacy-admin .actions-cell > a {
	display: inline-flex;
	margin: 0 6px 6px 0;
	vertical-align: top;
}

.dashboard-column-right .transactions-table {
	min-width: 0;
	width: 100%;
	table-layout: fixed;
	border-spacing: 0 8px;
}

.dashboard-column-right .transactions-table th,
.dashboard-column-right .transactions-table td {
	font-size: 0.85rem;
	padding: 11px 10px;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.dashboard-column-right .transactions-table th:nth-child(1),
.dashboard-column-right .transactions-table td:nth-child(1) {
	width: 36%;
}

.dashboard-column-right .transactions-table th:nth-child(2),
.dashboard-column-right .transactions-table td:nth-child(2) {
	width: 23%;
}

.dashboard-column-right .transactions-table th:nth-child(3),
.dashboard-column-right .transactions-table td:nth-child(3) {
	width: 17%;
}

.dashboard-column-right .transactions-table th:nth-child(4),
.dashboard-column-right .transactions-table td:nth-child(4) {
	width: 14%;
}

.dashboard-column-right .transactions-table th:nth-child(5),
.dashboard-column-right .transactions-table td:nth-child(5) {
	width: 10%;
}

.dashboard-column-right .transactions-table td .muted {
	display: inline-block;
	margin-top: 2px;
}

.infra-table th,
.infra-table td {
	white-space: nowrap;
}

.infra-url-cell {
	max-width: 420px;
}

.host-url-value {
	display: inline-block;
	max-width: 100%;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: break-word;
	line-height: 1.35;
}

.promo-form .form-grid {
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

input[type='datetime-local'] {
	min-height: 42px;
}

.settings-container {
	display: grid;
	grid-template-columns: minmax(320px, 1.05fr) minmax(360px, 1.25fr);
	gap: 24px;
	align-items: start;
}

.settings-column-left,
.settings-column-right {
	min-width: 0;
}

.host-card p {
	margin: 6px 0;
	color: var(--muted-color);
}

.inline-form {
	margin: 10px 0 2px;
}

.form-group-inline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.form-group-inline input[type='number'] {
	width: 120px;
}

.form-group-inline .button {
	min-height: 38px;
}

.update-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 10px;
	margin-top: 6px;
}

.update-actions form {
	margin: 0;
}

.password-wrapper input {
	padding-right: 56px;
}

.toggle-password {
	top: auto;
	right: 6px;
	bottom: 6px;
	width: 42px;
	height: 38px;
	border-radius: 10px;
	background: rgba(238, 241, 247, 0.95);
	border: 1px solid rgba(223, 227, 237, 0.9);
	color: #5f6778;
}

.toggle-password:hover {
	background: #f4f6fb;
}

:root[data-theme='dark'] .toggle-password {
	background: #1a2230;
	border-color: rgba(35, 43, 56, 0.9);
	color: #c7ceda;
}

:root[data-theme='dark'] .toggle-password:hover {
	background: #222b3a;
}

.pagination {
	flex-wrap: wrap;
	gap: 8px;
}

.pagination .page-jump-form {
	margin-left: auto;
}

@media (max-width: 1200px) {
	.user-page-header {
		align-items: flex-start;
	}

	.user-page-header .form-inline,
	.user-page-header .user-header-actions {
		margin-left: 0;
		justify-content: flex-start;
		width: 100%;
	}

	.user-search-form,
	.promo-search-form {
		width: 100%;
	}
}

@media (max-width: 1024px) {
	.settings-container {
		grid-template-columns: 1fr;
	}

	.actions-cell {
		min-width: 250px;
	}
}

@media (max-width: 900px) {
	.page-header h1 {
		font-size: clamp(1.6rem, 7vw, 2.1rem);
	}

	.users-table,
	.transactions-table {
		min-width: 760px;
	}

	.dashboard-column-right .transactions-table {
		min-width: 640px;
	}
}

@media (max-width: 620px) {
	.user-page-header .form-inline {
		flex-direction: column;
		align-items: stretch;
	}

	.user-page-header .form-inline input,
	.user-page-header .form-inline select,
	.user-page-header .form-inline .button,
	.user-header-actions > *,
	.pagination .page-jump-form {
		width: 100%;
	}

	.pagination .page-jump-form {
		margin-left: 0;
	}

	.actions-cell {
		min-width: 230px;
	}
}

/* === Unified Design System 2026 === */

:root,
:root[data-theme='dark'] {
	--ds-bg: #0f172a;
	--ds-surface: #111b31;
	--ds-surface-soft: #15213b;
	--ds-border: #223152;
	--ds-border-strong: #31446d;
	--ds-text: #e5edf8;
	--ds-text-soft: #9fafc9;
	--ds-primary: #3b82f6;
	--ds-primary-hover: #2563eb;
	--ds-success: #22c55e;
	--ds-error: #ef4444;
	--ds-warning: #f59e0b;
	--ds-radius-sm: 8px;
	--ds-radius: 10px;
	--ds-radius-lg: 12px;
	--ds-gap-1: 4px;
	--ds-gap-2: 8px;
	--ds-gap-3: 12px;
	--ds-gap-4: 16px;
	--ds-gap-5: 20px;
	--ds-gap-6: 24px;
	--ds-gap-8: 32px;
}

* {
	scrollbar-width: thin;
	scrollbar-color: #334a77 transparent;
}

.material-symbols-rounded {
	font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 20;
}

body {
	font-family: 'Inter', sans-serif;
	background: var(--ds-bg);
	color: var(--ds-text);
	line-height: 1.5;
	padding: 0;
	min-height: 100vh;
}

h1,
h2,
h3,
h4 {
	color: var(--ds-text);
}

h1,
.page-header h1 {
	font-size: clamp(28px, 3vw, 32px);
	font-weight: 700;
	line-height: 1.2;
	margin: 0;
}

h2 {
	font-size: clamp(20px, 2.3vw, 24px);
	font-weight: 700;
	margin-bottom: 12px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--ds-border);
}

h3 {
	font-size: 16px;
	font-weight: 600;
}

.page-subtitle,
.section-helper,
.muted,
.chart-label,
.bot-status-label,
.theme-toggle-label,
.pagination .page-info {
	color: var(--ds-text-soft);
	font-size: 13px;
}

.layout {
	width: 100%;
	max-width: none;
	margin: 0;
	display: grid;
	grid-template-columns: 240px minmax(0, 1fr);
	background: var(--ds-surface);
	border: none;
	border-radius: 0;
	overflow: clip;
	min-height: 100vh;
	box-shadow: none;
}

.sidebar {
	background: #0f1a2f;
	border-right: 1px solid var(--ds-border);
	padding: var(--ds-gap-6) var(--ds-gap-4);
	gap: var(--ds-gap-6);
}

.sidebar-logo {
	gap: var(--ds-gap-3);
}

.logo-image {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	box-shadow: none;
	background: #122242;
}

.logo-title {
	font-size: 18px;
	font-weight: 700;
	color: var(--ds-text);
}

.sidebar-nav {
	gap: var(--ds-gap-2);
}

.sidebar-link {
	min-height: 40px;
	padding: 0 12px;
	border-radius: var(--ds-radius-sm);
	color: var(--ds-text-soft);
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	border: 1px solid transparent;
}

.sidebar-link:hover {
	background: #122242;
	color: var(--ds-text);
	border-color: #1f3560;
}

.sidebar-link.active {
	background: rgba(59, 130, 246, 0.15);
	border-color: rgba(59, 130, 246, 0.45);
	color: #cfe0ff;
	box-shadow: none;
}

.sidebar-link .icon {
	width: 20px;
	height: 20px;
	font-size: 20px;
	line-height: 1;
}

.sidebar-warning,
.sidebar-ok {
	border-radius: var(--ds-radius-sm);
	padding: 10px 12px;
	font-size: 12px;
}

.sidebar-warning {
	background: rgba(245, 158, 11, 0.12);
	border: 1px solid rgba(245, 158, 11, 0.4);
	color: #fcd47f;
}

.sidebar-ok {
	background: rgba(34, 197, 94, 0.12);
	border: 1px solid rgba(34, 197, 94, 0.35);
	color: #8bf3b1;
}

.main-area {
	padding: var(--ds-gap-6);
	background: var(--ds-surface);
	min-width: 0;
}

.main-content {
	width: 100%;
	max-width: none;
}

.main-area::before,
.main-area::after,
.stat-card::after {
	display: none;
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	padding: 12px 16px;
	border-radius: var(--ds-radius);
	background: var(--ds-surface-soft);
	border: 1px solid var(--ds-border);
	margin-bottom: var(--ds-gap-6);
}

.topbar-left {
	display: flex;
	align-items: center;
	gap: var(--ds-gap-3);
}

.topbar-project {
	font-size: 15px;
	font-weight: 600;
	color: var(--ds-text);
}

.sidebar-toggle {
	display: none;
	width: 40px;
	height: 40px;
	border-radius: var(--ds-radius-sm);
	border: 1px solid var(--ds-border-strong);
	background: #122242;
	color: var(--ds-text);
	cursor: pointer;
	align-items: center;
	justify-content: center;
}

.sidebar-toggle .material-symbols-rounded {
	font-size: 20px;
}

.topbar-search {
	flex: 1;
	min-width: 240px;
}

.topbar-search input {
	width: 100%;
	height: 40px;
	border-radius: var(--ds-radius-sm);
	border: 1px solid var(--ds-border-strong);
	background: #0d162a;
	color: var(--ds-text);
	padding: 0 12px;
	box-shadow: none;
}

.topbar-right {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: var(--ds-gap-3);
}

.theme-toggle {
	display: none;
}

.bot-status-list {
	display: flex;
	gap: var(--ds-gap-2);
}

.bot-status-item {
	display: flex;
	align-items: center;
	gap: var(--ds-gap-2);
	padding: 8px 10px;
	border-radius: var(--ds-radius-sm);
	background: #101d36;
	border: 1px solid var(--ds-border);
}

.bot-status-item form {
	margin: 0;
}

.stats-section,
.settings-section {
	margin-bottom: var(--ds-gap-8);
}

.referral-subtabs {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 2px 0 14px;
	padding: 4px;
	border: 1px solid var(--ds-border);
	border-radius: 12px;
	background: rgba(12, 24, 46, 0.74);
}

.referral-subtab-btn {
	display: inline-flex;
	align-items: center;
	border: 0;
	background: transparent;
	color: var(--ds-text-soft);
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	padding: 8px 12px;
	border-radius: 9px;
	cursor: pointer;
	transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.referral-subtab-btn:hover {
	color: var(--ds-text);
	background: rgba(77, 125, 220, 0.18);
}

.referral-subtab-btn.is-active {
	color: #e8f0ff;
	background: linear-gradient(180deg, rgba(63, 109, 204, 0.35) 0%, rgba(35, 73, 155, 0.28) 100%);
	box-shadow: inset 0 0 0 1px rgba(95, 143, 234, 0.42);
}

.referral-subtab-panel {
	display: none;
}

.referral-subtab-panel.is-active {
	display: block;
}

.referral-overview-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
	margin: 0 0 14px;
}

.referral-overview-card {
	padding: 12px 14px;
	border-radius: 14px;
	border: 1px solid rgba(100, 129, 180, 0.38);
	background: linear-gradient(180deg, rgba(16, 30, 57, 0.9) 0%, rgba(10, 20, 40, 0.88) 100%);
}

.referral-overview-label {
	display: block;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #95afd9;
}

.referral-overview-value {
	display: block;
	margin-top: 6px;
	font-size: 1.2rem;
	line-height: 1.25;
	color: #e5efff;
}

.referral-overview-note {
	margin: 4px 0 0;
	font-size: 12px;
	color: var(--ds-text-soft);
}

.referral-settings-layout .settings-column-left .settings-section,
.referral-settings-layout .settings-column-right .settings-section {
	margin-bottom: 12px;
}

.referral-top-list {
	display: grid;
	gap: var(--ds-gap-2);
}

.referral-top-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--ds-gap-2);
	padding: 10px 12px;
	border-radius: var(--ds-radius-sm);
	border: 1px solid var(--ds-border);
	background: var(--ds-surface-soft);
	font-weight: 600;
}

.referral-top-item .muted {
	color: var(--ds-text-soft);
	font-weight: 500;
}

@media (max-width: 1400px) {
	.referral-overview-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 768px) {
	.referral-subtabs {
		display: grid;
		grid-template-columns: 1fr 1fr;
		width: 100%;
	}

	.referral-subtab-btn {
		justify-content: center;
	}

	.referral-overview-grid {
		grid-template-columns: 1fr;
	}
}

.accordion-section {
	border: 1px solid var(--ds-border);
	border-radius: var(--ds-radius);
	padding: 0;
	overflow: hidden;
}

.accordion-toggle {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--ds-gap-2);
	padding: 12px 14px;
	background: var(--ds-surface-soft);
	border: none;
	color: var(--ds-text);
	font-size: 16px;
	font-weight: 700;
	text-align: left;
	cursor: pointer;
}

.accordion-toggle::after {
	content: '-';
	color: var(--ds-text-soft);
}

.accordion-section.is-collapsed .accordion-toggle::after {
	content: '+';
}

.accordion-section.is-collapsed > :not(.accordion-toggle) {
	display: none;
}

.page-header {
	margin-bottom: var(--ds-gap-6);
	gap: var(--ds-gap-4);
}

.page-subtitle {
	margin-top: 8px;
}

.section-header {
	margin-bottom: 16px;
}

.stats-grid {
	gap: var(--ds-gap-4);
}

.stat-card,
.chart-card,
.detail-item,
.host-card,
.transaction-item,
.chart-container {
	background: var(--ds-surface-soft);
	border: 1px solid var(--ds-border);
	border-radius: var(--ds-radius-lg);
	padding: 20px;
	box-shadow: none;
	transform: none;
	animation: none;
}

.stat-card .stat-number {
	font-size: clamp(36px, 4vw, 48px);
	font-weight: 700;
	line-height: 1.2;
}

.stat-card .stat-helper {
	font-size: 13px;
}

.dashboard-container {
	display: grid;
	grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
	gap: var(--ds-gap-6);
	margin-top: 0;
}

.chart-grid {
	gap: var(--ds-gap-4);
}

.chart-card-body {
	height: 280px;
}

.button,
.button.button-small,
.button.button-tiny {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 42px;
	min-height: 42px;
	padding: 0 14px;
	border-radius: var(--ds-radius-sm);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.15;
	text-align: center;
	vertical-align: middle;
	letter-spacing: 0;
	border: 1px solid transparent;
	box-shadow: none;
	transition: background-color 0.2s ease, border-color 0.2s ease,
		color 0.2s ease, opacity 0.2s ease;
}

.button-tiny {
	min-width: 42px;
	padding: 0 10px;
}

.button-primary {
	background: var(--ds-primary);
	border-color: var(--ds-primary);
	color: #fff;
}

.button-primary:hover {
	background: var(--ds-primary-hover);
	border-color: var(--ds-primary-hover);
}

.button-secondary,
.button-outline {
	background: transparent;
	border-color: var(--ds-primary);
	color: #bfd7ff;
}

.button-secondary:hover,
.button-outline:hover {
	background: rgba(59, 130, 246, 0.14);
}

.button-start {
	background: var(--ds-success);
	border-color: var(--ds-success);
	color: #052e16;
}

.button-start:hover {
	background: #16a34a;
	border-color: #16a34a;
	color: #ecfdf5;
}

.button-warning {
	background: transparent;
	border-color: var(--ds-warning);
	color: #fcd47f;
}

.button-warning:hover {
	background: rgba(245, 158, 11, 0.14);
}

.button-danger {
	background: transparent;
	border-color: var(--ds-error);
	color: #fecaca;
}

.button-danger:hover {
	background: rgba(239, 68, 68, 0.14);
}

.button-disabled,
.button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.status-pill,
.status-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px 8px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	border: 1px solid transparent;
	white-space: nowrap;
}

.status-pill-ok,
.status-active {
	background: rgba(34, 197, 94, 0.12);
	color: #97f2bb;
	border-color: rgba(34, 197, 94, 0.4);
}

.status-pill-bad,
.status-banned {
	background: rgba(239, 68, 68, 0.14);
	color: #fecaca;
	border-color: rgba(239, 68, 68, 0.4);
}

.status-pill-warn,
.status-soon {
	background: rgba(245, 158, 11, 0.15);
	color: #fcd47f;
	border-color: rgba(245, 158, 11, 0.4);
}

.status-pill-neutral {
	background: rgba(100, 116, 139, 0.2);
	color: #cbd5e1;
	border-color: rgba(148, 163, 184, 0.45);
}

.status-disabled,
.status-expired,
.status-neutral,
.status-missing {
	background: rgba(100, 116, 139, 0.2);
	color: #cbd5e1;
	border-color: rgba(148, 163, 184, 0.45);
}

.form-group {
	margin-bottom: 16px;
}

.form-group label {
	display: block;
	margin-bottom: 8px;
	font-size: 14px;
	font-weight: 600;
	color: var(--ds-text);
}

.form-group small,
.hint {
	color: var(--ds-text-soft);
	font-size: 12px;
	line-height: 1.45;
}

.form-group input[type='text'],
.form-group input[type='url'],
.form-group input[type='password'],
.form-group input[type='number'],
.form-group input[type='datetime-local'],
.form-group select,
.form-group textarea,
.form-inline input,
.form-inline select,
.topbar-search input,
.key-actions input[type='number'],
.key-actions input[type='datetime-local'],
.pagination .page-jump-input {
	height: 40px;
	padding: 0 12px;
	border-radius: var(--ds-radius-sm);
	border: 1px solid var(--ds-border-strong);
	background: #0d162a;
	color: var(--ds-text);
	box-shadow: none;
}

.form-group textarea {
	height: auto;
	min-height: 96px;
	padding: 10px 12px;
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.topbar-search input::placeholder {
	color: #8ea0c3;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.topbar-search input:focus,
.pagination .page-jump-input:focus {
	outline: none;
	border-color: var(--ds-primary);
	box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.password-wrapper {
	position: relative;
}

.password-wrapper input {
	padding-right: 48px;
}

.toggle-password {
	position: absolute;
	right: 6px;
	bottom: 6px;
	width: 28px;
	height: 28px;
	min-height: 28px;
	padding: 0;
	border-radius: 6px;
	border: 1px solid var(--ds-border-strong);
	background: #122242;
	color: var(--ds-text-soft);
	font-size: 18px;
}

.users-table,
.transactions-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	background: transparent;
}

.table-wrapper {
	overflow-x: auto;
	overflow-y: auto;
	max-height: none;
	border: 1px solid var(--ds-border);
	border-radius: var(--ds-radius);
}

.users-table thead th,
.transactions-table thead th {
	position: sticky;
	top: 0;
	z-index: 2;
	background: #15213b;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #afc0df;
	border: none;
	padding: 12px 14px;
}

.users-table td,
.transactions-table td {
	border: none;
	border-bottom: 1px solid rgba(49, 68, 109, 0.55);
	padding: 12px 14px;
	font-size: 14px;
	color: var(--ds-text);
	white-space: normal;
}

.users-table tbody tr,
.transactions-table tbody tr {
	background: transparent;
	box-shadow: none;
}

.users-table tbody tr:hover,
.transactions-table tbody tr:hover {
	background: rgba(59, 130, 246, 0.08);
}

.dashboard-column-right .transactions-table {
	min-width: 100%;
	table-layout: auto;
	border-spacing: 0;
}

.dashboard-column-right .transactions-table th,
.dashboard-column-right .transactions-table td {
	font-size: 13px;
	padding: 10px 12px;
	white-space: nowrap;
	overflow-wrap: normal;
	word-break: normal;
}

.dashboard-column-right .transactions-table td:first-child {
	white-space: normal;
}

.users-table tbody tr td:first-child,
.users-table tbody tr td:last-child,
.transactions-table tbody tr td:first-child,
.transactions-table tbody tr td:last-child {
	border-radius: 0;
}

.actions-cell {
	min-width: 240px;
}

.actions-cell form,
.actions-cell > a {
	margin: 0 8px 8px 0;
}

.date-cell {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.infra-url-cell {
	max-width: 520px;
}

.host-url-value {
	white-space: normal;
	word-break: break-word;
}

.settings-container {
	gap: 24px;
}

.queue-status-legacy {
	display: none;
}

.queue-status-section > h2 {
	margin-bottom: 12px;
}

.queue-status-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
	padding: 12px 14px;
	border: 1px solid var(--ds-border);
	border-radius: var(--ds-radius);
	background: rgba(17, 27, 49, 0.42);
}

.queue-status-head .section-helper {
	margin: 0;
	max-width: 760px;
	line-height: 1.45;
	color: var(--ds-text-soft);
}

.queue-status-summary {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 18px;
}

.queue-status-chip {
	padding: 15px 16px 16px;
	border: 1px solid var(--ds-border);
	border-radius: var(--ds-radius);
	background: rgba(14, 22, 40, 0.82);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.queue-status-chip span {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ds-text-soft);
}

.queue-status-chip strong {
	display: block;
	margin-top: 8px;
	font-size: 34px;
	font-weight: 700;
	color: var(--ds-text);
	line-height: 1;
}

.queue-table-wrapper {
	margin-top: 4px;
	border: 1px solid var(--ds-border);
	border-radius: var(--ds-radius);
	overflow: hidden;
	background: rgba(13, 21, 38, 0.82);
}

.queue-jobs-table {
	margin-bottom: 0;
}

.queue-jobs-table th:first-child,
.queue-jobs-table td:first-child {
	width: 32%;
}

.queue-jobs-table th:nth-child(2),
.queue-jobs-table td:nth-child(2),
.queue-jobs-table th:nth-child(3),
.queue-jobs-table td:nth-child(3),
.queue-jobs-table th:nth-child(4),
.queue-jobs-table td:nth-child(4),
.queue-jobs-table th:nth-child(5),
.queue-jobs-table td:nth-child(5) {
	white-space: nowrap;
}

.queue-job-name strong {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--ds-text);
	line-height: 1.35;
}

.queue-job-time {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.queue-job-id {
	display: inline-flex;
	align-items: center;
	font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: #9ec5ff;
	text-decoration: none;
	padding: 6px 10px;
	border-radius: 999px;
	background: rgba(27, 45, 79, 0.72);
}

.queue-job-id:hover {
	text-decoration: underline;
}

.queue-subtitle {
	margin: 18px 0 12px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ds-text-soft);
}

.queue-empty {
	margin-top: 8px;
}

.status-pill-success {
	background: rgba(34, 197, 94, 0.12);
	color: #97f2bb;
	border-color: rgba(34, 197, 94, 0.4);
}

.status-pill-danger {
	background: rgba(239, 68, 68, 0.14);
	color: #fecaca;
	border-color: rgba(239, 68, 68, 0.4);
}

.status-pill-warning {
	background: rgba(245, 158, 11, 0.15);
	color: #fcd47f;
	border-color: rgba(245, 158, 11, 0.4);
}

.status-pill-info,
.status-pill-muted {
	background: rgba(59, 130, 246, 0.15);
	color: #bfd7ff;
	border-color: rgba(59, 130, 246, 0.4);
}

.update-center-section {
	gap: 18px;
}

.update-overview-grid,
.update-diagnostics-grid,
.update-summary-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
}

.update-overview-grid,
.update-diagnostics-grid {
	margin-top: 16px;
}

.update-overview-card,
.update-diagnostic-card,
.update-summary-card,
.update-panel {
	border: 1px solid var(--ds-border);
	border-radius: var(--ds-radius);
	background: rgba(13, 21, 38, 0.82);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.update-overview-card,
.update-diagnostic-card,
.update-summary-card {
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.update-overview-label,
.update-diagnostic-card span,
.update-summary-card span,
.update-list-block h4,
.update-panel-head p,
.update-overview-meta {
	font-size: 12px;
	color: var(--ds-text-soft);
}

.update-overview-value,
.update-diagnostic-card strong,
.update-summary-card strong {
	font-size: 26px;
	font-weight: 700;
	color: var(--ds-text);
	line-height: 1.1;
}

.update-actions-extended {
	margin-top: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	align-items: stretch;
}

.update-upload-form {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 14px;
	padding: 14px 16px;
	border: 1px solid var(--ds-border);
	border-radius: var(--ds-radius);
	background: rgba(13, 21, 38, 0.82);
}

.update-upload-field {
	flex: 1 1 360px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: min(100%, 320px);
}

.update-upload-field label {
	font-size: 12px;
	font-weight: 600;
	color: var(--ds-text-soft);
}

.update-upload-field small {
	font-size: 12px;
	color: var(--ds-text-soft);
}

.update-upload-form input[type="file"] {
	width: 100%;
	margin: 0;
	color: var(--ds-text-soft);
}

.update-upload-form input[type="file"]::file-selector-button {
	margin-right: 12px;
	padding: 10px 14px;
	border: 1px solid var(--ds-border-strong);
	border-radius: 10px;
	background: #122242;
	color: #dce8ff;
	font-weight: 600;
	cursor: pointer;
}

.update-upload-form .button {
	min-width: 170px;
	height: 46px;
}

.update-quick-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.update-quick-actions form {
	margin: 0;
}

.update-quick-actions .button {
	min-height: 44px;
}

.update-panel {
	margin-top: 18px;
	padding: 16px;
}

.update-panel-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.update-panel-head h3,
.update-list-block h4 {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--ds-text);
}

.update-panel-head p {
	margin: 4px 0 0;
}

.update-summary-grid {
	margin-bottom: 14px;
}

.update-chip-row,
.update-inline-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.update-chip,
.update-inline-list span {
	display: inline-flex;
	align-items: center;
	padding: 6px 10px;
	border-radius: 999px;
	background: rgba(27, 45, 79, 0.72);
	color: #bfd7ff;
	font-size: 12px;
	font-weight: 600;
}

.update-list-block + .update-list-block {
	margin-top: 16px;
}

.update-check-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin-top: 10px;
}

.update-check-card {
	padding: 12px 14px;
	border-radius: var(--ds-radius);
	border: 1px solid var(--ds-border);
	background: rgba(17, 27, 49, 0.42);
}

.update-check-ok {
	border-color: rgba(34, 197, 94, 0.35);
}

.update-check-warning {
	border-color: rgba(245, 158, 11, 0.35);
}

.update-check-error {
	border-color: rgba(239, 68, 68, 0.35);
}

.update-check-head,
.update-stage-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.update-check-card p,
.update-stage-card p {
	margin: 8px 0 0;
	font-size: 13px;
	line-height: 1.45;
	color: var(--ds-text-soft);
}

.update-release-notes {
	margin: 10px 0 0;
	padding: 14px;
	border-radius: var(--ds-radius);
	border: 1px solid var(--ds-border);
	background: rgba(9, 15, 28, 0.9);
	color: var(--ds-text);
	font-size: 13px;
	line-height: 1.5;
	white-space: pre-wrap;
}

.update-stage-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.update-stage-card {
	padding: 12px 14px;
	border-radius: var(--ds-radius);
	border: 1px solid var(--ds-border);
	background: rgba(17, 27, 49, 0.42);
}

.stage-done {
	border-color: rgba(34, 197, 94, 0.28);
}

.stage-active {
	border-color: rgba(59, 130, 246, 0.32);
}

.stage-failed {
	border-color: rgba(239, 68, 68, 0.35);
}

.update-history-wrapper {
	margin-top: 8px;
	border: 1px solid var(--ds-border);
	border-radius: var(--ds-radius);
	overflow: hidden;
	background: rgba(13, 21, 38, 0.82);
}

.update-history-table {
	margin-bottom: 0;
}

.update-history-table td:last-child {
	max-width: 420px;
	line-height: 1.45;
}

@media (max-width: 900px) {
	.queue-status-head {
		flex-direction: column;
		align-items: flex-start;
	}

	.queue-status-summary {
		grid-template-columns: 1fr;
	}

	.update-overview-grid,
	.update-diagnostics-grid,
	.update-summary-grid,
	.update-check-grid,
	.update-stage-list {
		grid-template-columns: 1fr;
	}

	.update-upload-form {
		align-items: stretch;
	}

	.update-upload-form .button,
	.update-quick-actions .button {
		width: 100%;
	}

	.update-quick-actions {
		flex-direction: column;
	}
}

.form-grid,
.detail-grid {
	gap: 16px;
}

.pagination {
	margin-top: 20px;
	justify-content: flex-start;
	gap: 8px;
}

.pagination a {
	height: 40px;
	min-width: 40px;
	padding: 0 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	border: 1px solid var(--ds-border-strong);
	background: #122242;
	color: #bfd7ff;
	box-shadow: none;
}

.pagination a.active {
	background: var(--ds-primary);
	border-color: var(--ds-primary);
	color: #fff;
}

.flash {
	border-radius: var(--ds-radius-sm);
	border: 1px solid transparent;
	padding: 12px 14px;
	box-shadow: none;
}

.flash-success {
	background: rgba(34, 197, 94, 0.12);
	color: #8bf3b1;
	border-color: rgba(34, 197, 94, 0.35);
}

.flash-danger,
.flash-error {
	background: rgba(239, 68, 68, 0.14);
	color: #fecaca;
	border-color: rgba(239, 68, 68, 0.35);
}

.flash-warning {
	background: rgba(245, 158, 11, 0.14);
	color: #fcd47f;
	border-color: rgba(245, 158, 11, 0.35);
}

.flash-info {
	background: rgba(59, 130, 246, 0.14);
	color: #bfd7ff;
	border-color: rgba(59, 130, 246, 0.35);
}

.sidebar-overlay {
	display: none;
}

@media (max-width: 1024px) {
	body {
		padding: 0;
	}

	.layout {
		max-width: 100%;
		min-height: 100vh;
	}

	.main-area {
		padding: 18px;
	}

	.dashboard-container {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 768px) {
	.layout {
		grid-template-columns: 1fr;
		border-radius: 0;
		min-height: 100vh;
	}

	.sidebar {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		width: 240px;
		height: 100vh;
		display: flex;
		flex-direction: column;
		overflow-y: auto;
		overflow-x: hidden;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
		z-index: 40;
		transform: translateX(-104%);
		transition: transform 0.2s ease;
	}

	.layout.sidebar-open .sidebar {
		transform: translateX(0);
	}

	.sidebar-overlay {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(15, 23, 42, 0.55);
		opacity: 0;
		pointer-events: none;
		border: none;
		z-index: 35;
		transition: opacity 0.2s ease;
	}

	.layout.sidebar-open + .sidebar-overlay {
		opacity: 1;
		pointer-events: auto;
	}

	.sidebar-toggle {
		display: inline-flex;
	}

	.topbar {
		gap: 12px;
	}

	.topbar-left {
		flex-wrap: wrap;
	}

	.topbar-search {
		flex: 1 1 100%;
		min-width: 100%;
	}

	.topbar-right {
		width: 100%;
		justify-content: flex-start;
	}

	.bot-status-list {
		width: 100%;
		flex-direction: column;
	}

	.bot-status-item {
		width: 100%;
		justify-content: space-between;
	}

	.table-wrapper {
		max-height: none;
	}

	.users-table,
	.transactions-table {
		min-width: 740px;
	}

	.button,
	.button.button-small,
	.button.button-tiny,
	.actions-cell form,
	.actions-cell a,
	.user-header-actions > * {
		width: 100%;
	}

	.actions-cell form,
	.actions-cell > a {
		margin-right: 0;
	}
}

/* Mobile first adjustments */
.mobile-only {
	display: none;
}

.desktop-only {
	display: block;
}

body.no-scroll {
	overflow: hidden;
}

.list-cards {
	display: grid;
	gap: 12px;
}

.mobile-only.list-cards {
	display: none;
}

.list-card {
	position: relative;
	background: var(--ds-surface-soft);
	border: 1px solid var(--ds-border);
	border-radius: var(--ds-radius-lg);
	padding: 14px;
}

.list-card-header {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	align-items: flex-start;
}

.list-card-title {
	font-size: 15px;
	font-weight: 600;
	color: var(--ds-text);
	text-decoration: none;
}

.list-card-subtitle {
	margin-top: 4px;
	font-size: 12px;
	color: var(--ds-text-soft);
}

.list-card-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.card-rows {
	display: grid;
	gap: 8px;
	margin-top: 12px;
}

.card-row {
	display: grid;
	grid-template-columns: minmax(96px, 38%) 1fr;
	gap: 10px;
	align-items: start;
}

.card-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ds-text-soft);
}

.card-value {
	font-size: 13px;
	color: var(--ds-text);
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.card-actions form {
	margin: 0;
}

.action-menu {
	position: relative;
}

.action-menu summary {
	list-style: none;
}

.action-menu summary::-webkit-details-marker {
	display: none;
}

.action-menu summary.button {
	min-width: 40px;
}

.action-menu-panel {
	position: absolute;
	right: 0;
	bottom: 52px;
	min-width: 200px;
	width: min(90vw, 240px);
	background: var(--ds-surface);
	border: 1px solid var(--ds-border);
	border-radius: var(--ds-radius);
	padding: 10px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	box-shadow: 0 16px 32px rgba(8, 15, 30, 0.35);
	z-index: 5;
}

.action-menu-panel form {
	margin: 0;
}

.action-menu-panel .button {
	width: 100%;
}

.sticky-action-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	background: var(--ds-surface);
	border-top: 1px solid var(--ds-border);
	padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
	gap: 10px;
	align-items: center;
	z-index: 45;
}

.sticky-action-bar > a,
.sticky-action-bar > form {
	flex: 1;
}

.sticky-action-bar > form {
	display: flex;
}

.sticky-action-bar > form .button {
	width: 100%;
}

body.keyboard-open .sticky-action-bar {
	transform: translateY(100%);
	opacity: 0;
	pointer-events: none;
}

@media (max-width: 768px) {
	.mobile-only {
		display: block;
	}

	.mobile-only.list-cards {
		display: grid;
	}

	.mobile-only.sticky-action-bar {
		display: flex;
	}

	.desktop-only {
		display: none;
	}

	.main-area {
		padding: 16px;
		padding-bottom: calc(90px + env(safe-area-inset-bottom));
	}

	.sidebar {
		width: min(280px, 80vw);
	}

	.sidebar-link {
		min-height: 44px;
		padding: 10px 14px;
		font-size: 15px;
	}

	.sidebar-link.active {
		font-weight: 700;
	}

	.topbar-project {
		max-width: 60vw;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.users-table,
	.transactions-table {
		min-width: 0;
	}

	.table-wrapper {
		overflow: visible;
		border: none;
		background: transparent;
	}

	.stacked-table {
		width: 100%;
		min-width: 0;
		border-collapse: separate;
		border-spacing: 0;
	}

	.stacked-table thead {
		display: none;
	}

	.stacked-table tbody tr {
		display: block;
		background: var(--ds-surface-soft);
		border: 1px solid var(--ds-border);
		border-radius: var(--ds-radius);
		padding: 12px;
		margin-bottom: 12px;
	}

	.stacked-table tbody td {
		display: grid;
		grid-template-columns: minmax(110px, 38%) 1fr;
		gap: 10px;
		padding: 6px 0;
		border: none;
	}

	.stacked-table tbody td::before {
		content: attr(data-label);
		font-size: 11px;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		color: var(--ds-text-soft);
	}

	.stacked-table tbody td:last-child {
		padding-bottom: 0;
	}

	.stacked-table .actions-cell {
		min-width: 0;
		width: 100%;
	}

	.button,
	.button.button-small,
	.button.button-tiny {
		min-height: 44px;
		font-size: 15px;
	}

	.button.button-small {
		min-height: 40px;
	}

	.form-group input[type='text'],
	.form-group input[type='url'],
	.form-group input[type='password'],
	.form-group input[type='number'],
	.form-group input[type='datetime-local'],
	.form-group select,
	.form-group textarea,
	.form-inline input,
	.form-inline select,
	.topbar-search input {
		font-size: 16px;
		min-height: 44px;
	}

	.form-group textarea {
		min-height: 120px;
	}

	.user-page-header .form-inline {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
	}

	.user-page-header .form-inline input,
	.user-page-header .form-inline select,
	.user-page-header .form-inline .button {
		width: 100%;
	}

	.user-page-header .form-inline input,
	.user-page-header .form-inline select {
		min-height: 34px;
		height: 34px;
		padding: 0 10px;
		font-size: 16px;
		line-height: 1.2;
	}

	.user-page-header .form-inline .button {
		min-height: 34px;
		height: 34px;
		padding: 0 12px;
		font-size: 14px;
	}

	.user-header-actions > * {
		width: 100%;
	}

	.user-search-form,
	.promo-search-form {
		width: 100%;
	}

	.user-search-form input,
	.user-search-form select,
	.promo-search-form input,
	.promo-search-form select {
		min-height: 34px;
		height: 34px;
		padding: 0 10px;
		font-size: 16px;
		line-height: 1.2;
	}

	.user-search-form .button,
	.promo-search-form .button {
		min-height: 34px;
		height: 34px;
		font-size: 14px;
	}

	.stats-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.detail-actions {
		display: none;
	}

	.key-actions {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
		align-items: center;
	}

	.key-actions form {
		width: 100%;
	}

	.key-actions .button {
		min-height: 36px;
		height: 36px;
		font-size: 14px;
	}

	.key-actions input[type='number'],
	.key-actions input[type='datetime-local'] {
		min-height: 36px;
		height: 36px;
		font-size: 16px !important;
		width: 100%;
		min-width: 0;
	}

	.key-actions .key-extend-form,
	.key-actions .key-expiry-form {
		grid-column: 1 / -1;
		display: grid;
		grid-template-columns: 1fr;
		gap: 6px;
		align-items: center;
	}

	.key-actions .key-extend-form .button,
	.key-actions .key-expiry-form .button {
		width: 100%;
		justify-self: stretch;
	}

	.key-actions form:last-child {
		grid-column: 1 / -1;
	}

	.user-link,
	.user-link:visited {
		color: var(--ds-text) !important;
		text-decoration: none;
	}

	.card-actions {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: center;
		gap: 8px;
	}

	.card-actions .button,
	.card-actions .action-menu summary.button {
		width: auto;
	}

	.card-actions .action-menu {
		display: inline-flex;
		justify-self: end;
	}

	.promo-form .form-group input[type='text'],
	.promo-form .form-group input[type='url'],
	.promo-form .form-group input[type='password'],
	.promo-form .form-group input[type='number'],
	.promo-form .form-group input[type='datetime-local'],
	.promo-form .form-group select {
		min-height: 34px;
		height: 34px;
		padding: 0 10px;
		font-size: 16px !important;
	}

	.promo-form .form-group textarea {
		min-height: 84px;
		padding: 8px 10px;
		font-size: 16px !important;
	}

	.promo-form .form-actions .button {
		min-height: 34px;
		height: 34px;
	}

	.promo-form .form-group {
		margin-bottom: 12px;
	}

	.accordion-section {
		border: 1px solid var(--ds-border);
		border-radius: var(--ds-radius);
		padding: 0;
		overflow: hidden;
	}

	.accordion-toggle {
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 12px 14px;
		background: var(--ds-surface-soft);
		border: none;
		color: var(--ds-text);
		font-size: 16px;
		font-weight: 700;
		text-align: left;
		cursor: pointer;
	}

	.accordion-toggle::after {
		content: '-';
		color: var(--ds-text-soft);
	}

	.accordion-section.is-collapsed .accordion-toggle::after {
		content: '+';
	}

	.accordion-section.is-collapsed > :not(.accordion-toggle) {
		display: none;
	}
}

@media (max-width: 480px) {
	.sidebar {
		width: 88vw;
	}

	.main-area {
		padding: 14px;
		padding-bottom: calc(90px + env(safe-area-inset-bottom));
	}

	.stats-grid {
		grid-template-columns: 1fr;
	}

	.chart-card-body {
		height: 240px;
	}
}

/* === Users Page UI (canonical, scoped) === */

.users-page {
	--surface: #12203a;
	--surface-2: #172947;
	--text: var(--ds-text);
	--muted: var(--ds-text-soft);
	--border: var(--ds-border);
	--focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.22);
	--radius-lg: 14px;
	--radius-pill: 999px;
	--shadow-soft: 0 14px 28px rgba(7, 12, 24, 0.22);
}

.users-page .page-header {
	align-items: flex-end;
	gap: 16px;
}

.users-page .user-search-form.filters-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-left: auto;
	padding: 10px;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: rgba(17, 27, 49, 0.94);
}

.users-page .filters-bar .control,
.users-page .filters-bar .button {
	height: 42px;
	min-height: 42px;
}

.users-page .filters-bar .control {
	border: 1px solid var(--border);
	border-radius: 10px;
	background: #0b1529;
	color: var(--text);
	padding: 0 12px;
	box-shadow: none;
	outline: none;
}

.users-page .filters-bar .control::placeholder {
	color: var(--muted);
}

.users-page .filters-bar .control:hover {
	border-color: #365180;
}

.users-page .filters-bar .control:focus {
	border-color: var(--ds-primary);
	box-shadow: var(--focus-ring);
}

.users-page .filters-bar .control-input {
	flex: 1 1 280px;
	min-width: 220px;
}

.users-page .filters-bar .control-select {
	flex: 0 1 260px;
	min-width: 220px;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3 5.5L7 9.5L11 5.5' stroke='%239fafc9' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 36px;
}

.users-page .filters-bar .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
}

.users-page .users-list-section > h2 {
	margin-bottom: 14px;
}

.users-page .users-table-shell {
	overflow: auto;
	border: none;
	border-radius: 0;
	background: transparent;
}

.users-page .users-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0 10px;
	background: transparent;
}

.users-page .users-table thead {
	background: transparent;
}

.users-page .users-table thead th {
	background: transparent;
	border: none;
	padding: 0 14px 6px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--muted);
}

.users-page .users-table td {
	background: var(--surface);
	border-top: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
	border-left: none;
	border-right: none;
	padding: 10px 12px;
	color: var(--text);
	vertical-align: middle;
	line-height: 1.3;
}

.users-page .users-table tbody tr td:first-child {
	border-left: 1px solid var(--border);
	border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.users-page .users-table tbody tr td:last-child {
	border-right: 1px solid var(--border);
	border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.users-page .users-table tbody tr {
	box-shadow: none;
}

.users-page .users-table tbody tr:hover td {
	background: var(--surface-2);
	border-color: #2f466f;
}

.users-page .user-link,
.users-page .user-link:visited {
	color: #bfd7ff !important;
	text-decoration: none;
}

.users-page .user-link:hover {
	color: #d8e7ff !important;
	text-decoration: underline;
}

.users-page .muted {
	color: var(--muted);
}

.users-page .status-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 24px;
	padding: 2px 10px;
	border-radius: var(--radius-pill);
	border: 1px solid transparent;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.1;
	white-space: nowrap;
}

.users-page .status-active {
	background: rgba(34, 197, 94, 0.12);
	color: #9ff3be;
	border-color: rgba(34, 197, 94, 0.38);
}

.users-page .status-banned {
	background: rgba(239, 68, 68, 0.14);
	color: #fecaca;
	border-color: rgba(239, 68, 68, 0.38);
}

.users-page .status-disabled,
.users-page .status-expired,
.users-page .status-neutral,
.users-page .status-missing {
	background: rgba(148, 163, 184, 0.16);
	color: #d4dbe8;
	border-color: rgba(148, 163, 184, 0.36);
}

.users-page .status-soon {
	background: rgba(245, 158, 11, 0.16);
	color: #fcd47f;
	border-color: rgba(245, 158, 11, 0.38);
}

.users-page .status-trial-available {
	background: rgba(59, 130, 246, 0.14);
	color: #bfd7ff;
	border-color: rgba(59, 130, 246, 0.4);
}

.users-page .status-trial-used {
	background: rgba(245, 158, 11, 0.14);
	color: #fcd47f;
	border-color: rgba(245, 158, 11, 0.36);
}

.users-page .trial-reset-form {
	margin-top: 8px;
}

.users-page .trial-reset-form .button {
	width: auto;
	height: 34px;
	min-height: 34px;
	padding: 0 10px;
	border-radius: 10px;
	font-size: 13px;
	background: rgba(34, 197, 94, 0.1);
	border-color: rgba(34, 197, 94, 0.32);
	color: #a7f3c8;
}

.users-page .trial-reset-form .button:hover {
	background: rgba(34, 197, 94, 0.16);
	border-color: rgba(34, 197, 94, 0.42);
	color: #d1fae5;
}

.users-page .users-table th.actions-cell {
	width: 300px;
}

.users-page .users-table td.actions-cell {
	min-width: 300px;
	white-space: normal;
	vertical-align: middle;
}

.users-page .users-table td.actions-cell form,
.users-page .users-table td.actions-cell > a {
	margin: 0 8px 8px 0;
	display: inline-flex;
	vertical-align: top;
}

.users-page .users-table td.actions-cell .button {
	height: 34px;
	min-height: 34px;
	padding: 0 10px;
	border-radius: 10px;
	font-size: 13px;
}

.users-page .users-table td.actions-cell .button-warning {
	background: rgba(245, 158, 11, 0.1);
	border-color: rgba(245, 158, 11, 0.34);
	color: #fcd47f;
}

.users-page .users-table td.actions-cell .button-warning:hover {
	background: rgba(245, 158, 11, 0.16);
	border-color: rgba(245, 158, 11, 0.42);
}

.users-page .users-table td.actions-cell .button-danger {
	background: rgba(239, 68, 68, 0.1);
	border-color: rgba(239, 68, 68, 0.34);
	color: #fecaca;
}

.users-page .users-table td.actions-cell .button-danger:hover {
	background: rgba(239, 68, 68, 0.16);
	border-color: rgba(239, 68, 68, 0.42);
}

.users-page .users-table td.actions-cell .button-start {
	background: rgba(34, 197, 94, 0.1);
	border-color: rgba(34, 197, 94, 0.34);
	color: #a7f3c8;
}

.users-page .users-table td.actions-cell .button-start:hover {
	background: rgba(34, 197, 94, 0.16);
	border-color: rgba(34, 197, 94, 0.42);
	color: #d1fae5;
}

.users-page .users-quick-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}

.users-page .users-quick-filter {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 32px;
	padding: 0 10px;
	border-radius: 10px;
	border: 1px solid var(--border);
	background: rgba(17, 27, 49, 0.92);
	color: var(--muted);
	font-size: 12px;
	text-decoration: none;
}

.users-page .users-quick-filter:hover {
	color: var(--text);
	border-color: rgba(114, 162, 246, 0.5);
}

.users-page .users-quick-filter.active {
	color: #dbeafe;
	background: rgba(33, 74, 141, 0.34);
	border-color: rgba(96, 165, 250, 0.52);
}

.users-page .users-bulk-toolbar {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	padding: 12px;
	margin-bottom: 10px;
	border: 1px solid var(--border);
	border-radius: 14px;
	background: linear-gradient(180deg, rgba(12, 22, 42, 0.92) 0%, rgba(9, 17, 33, 0.9) 100%);
	box-shadow: inset 0 1px 0 rgba(173, 201, 247, 0.08);
}

.users-page .users-bulk-info {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 10px;
	border: 1px solid rgba(103, 137, 193, 0.35);
	background: rgba(20, 34, 64, 0.7);
	font-size: 12px;
	color: #bfd7ff;
	white-space: nowrap;
}

.users-page .users-bulk-main {
	display: grid;
	grid-template-columns: minmax(220px, 1fr) 120px 120px;
	gap: 10px;
	align-items: end;
}

.users-page .users-bulk-field {
	display: grid;
	gap: 6px;
	min-width: 0;
}

.users-page .users-bulk-label {
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #8ea9d5;
}

.users-page .users-bulk-field .control {
	height: 38px;
	min-height: 38px;
	border-radius: 10px;
}

.users-page .users-bulk-field input,
.users-page .users-bulk-field select {
	width: 100%;
	border: 1px solid rgba(102, 132, 182, 0.42);
	background: rgba(13, 24, 46, 0.96);
	color: #e7efff;
	padding: 0 11px;
	font-size: 14px;
	line-height: 1.2;
}

.users-page .users-bulk-field select {
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, #9ab9ec 50%), linear-gradient(135deg, #9ab9ec 50%, transparent 50%);
	background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
	padding-right: 30px;
}

.users-page .users-bulk-field input::placeholder {
	color: #8fa9d3;
}

.users-page .users-bulk-field input:hover,
.users-page .users-bulk-field select:hover {
	border-color: rgba(119, 163, 235, 0.58);
}

.users-page .users-bulk-field input:focus,
.users-page .users-bulk-field select:focus {
	outline: none;
	border-color: rgba(127, 184, 255, 0.82);
	box-shadow: 0 0 0 3px rgba(61, 130, 233, 0.18);
}

.users-page .users-bulk-field-compact input {
	text-align: center;
	font-weight: 600;
}

.users-page .users-bulk-submit {
	height: 38px;
	min-height: 38px;
	padding: 0 14px;
	border-color: rgba(98, 150, 232, 0.46);
	background: rgba(33, 71, 136, 0.32);
	color: #d8e6ff;
}

.users-page .users-bulk-submit:hover {
	border-color: rgba(126, 179, 255, 0.6);
	background: rgba(40, 85, 162, 0.4);
}

.users-page .users-select-col {
	width: 38px;
	text-align: center;
}

.users-page .users-row-critical td {
	background: linear-gradient(
		180deg,
		rgba(70, 20, 28, 0.6) 0%,
		rgba(38, 18, 31, 0.72) 100%
	);
}

.users-page .users-row-warning td {
	background: linear-gradient(
		180deg,
		rgba(58, 42, 12, 0.5) 0%,
		rgba(28, 24, 21, 0.72) 100%
	);
}

.users-page .users-row-critical:hover td,
.users-page .users-row-warning:hover td {
	filter: brightness(1.05);
}

.users-page .actions-cluster {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	justify-content: flex-end;
}

.users-page .users-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 18px;
}

.users-page .users-pagination a {
	height: 42px;
	min-height: 42px;
	padding: 0 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	border: 1px solid var(--border);
	background: #122242;
	color: #bfd7ff;
	text-decoration: none;
	box-shadow: none;
}

.users-page .users-pagination a:hover:not(.disabled) {
	background: #173058;
	border-color: #315289;
}

.users-page .users-pagination a.disabled {
	opacity: 0.45;
	cursor: not-allowed;
	pointer-events: none;
}

.users-page .users-pagination .page-info {
	color: var(--muted);
	padding: 0 4px;
}

.users-page .users-pagination .page-jump-form {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
	padding: 10px;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: rgba(17, 27, 49, 0.94);
}

.users-page .users-pagination .page-jump-label {
	color: var(--muted);
	font-size: 12px;
}

.users-page .users-pagination .page-jump-input {
	width: 78px;
	height: 42px;
	min-height: 42px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: #0b1529;
	color: var(--text);
	padding: 0 10px;
	text-align: center;
}

.users-page .users-pagination .page-jump-input:focus {
	outline: none;
	border-color: var(--ds-primary);
	box-shadow: var(--focus-ring);
}

.users-page .list-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-soft);
}

.users-page .action-menu summary.button {
	min-width: 42px;
	padding: 0 10px;
}

.users-page .action-menu summary:focus-visible {
	outline: none;
	box-shadow: var(--focus-ring);
	border-radius: 10px;
}

.users-page .action-menu-panel {
	background: var(--surface);
	border-color: var(--border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-soft);
}

/* Force one layout mode on Users page to avoid mixed desktop/mobile render on tablet/retina widths */
.users-page .mobile-only {
	display: none !important;
}

.users-page .desktop-only {
	display: block !important;
}

@media (min-width: 769px) {
	.users-page .users-list-section {
		padding: 16px;
		border: 1px solid var(--border);
		border-radius: 18px;
		background: rgba(17, 27, 49, 0.42);
		box-shadow: inset 0 1px 0 rgba(191, 215, 255, 0.04);
	}

	.users-page .users-list-section > h2 {
		margin-bottom: 12px;
		padding-bottom: 12px;
		border-bottom: 1px solid rgba(49, 68, 109, 0.55);
		color: var(--text);
	}

	.users-page .users-table-shell {
		padding: 4px 2px 2px;
	}

	.users-page .users-table {
		border-spacing: 0 8px;
	}

	.users-page .users-table thead th {
		padding: 0 14px 8px;
		font-size: 10px;
		letter-spacing: 0.1em;
	}

	.users-page .users-table td {
		padding: 10px 12px;
		background: rgba(18, 32, 58, 0.98);
	}

	.users-page .users-table tbody tr:not(.users-row-critical):not(.users-row-warning):hover td {
		background: rgba(23, 41, 71, 0.98);
	}

	.users-page .users-table td:nth-child(1),
	.users-page .users-table td:nth-child(2) {
		font-weight: 500;
	}

	.users-page .users-table td:nth-child(4) .muted {
		display: inline-block;
		margin-top: 2px;
		font-size: 12px;
		line-height: 1.25;
	}

	.users-page .users-table td:nth-child(5) {
		min-width: 170px;
	}

	.users-page .trial-reset-form {
		margin-top: 6px;
	}

	.users-page .users-table th.actions-cell {
		width: 320px;
	}

	.users-page .users-table td.actions-cell {
		min-width: 320px;
		padding-top: 8px;
		padding-bottom: 8px;
	}

	.users-page .actions-cluster {
		display: flex;
		flex-wrap: wrap;
		gap: 8px;
		align-items: center;
	}

	.users-page .users-table td.actions-cell form,
	.users-page .users-table td.actions-cell > a {
		margin: 0;
	}

	.users-page .users-table td.actions-cell .button {
		height: 32px;
		min-height: 32px;
		padding: 0 10px;
		border-radius: 9px;
		font-size: 12px;
		font-weight: 600;
		letter-spacing: 0;
	}

	.users-page .users-table .button-secondary {
		background: rgba(59, 130, 246, 0.08);
		border-color: rgba(59, 130, 246, 0.22);
		color: #bfd7ff;
	}

	.users-page .users-table .button-secondary:hover {
		background: rgba(59, 130, 246, 0.14);
		border-color: rgba(59, 130, 246, 0.32);
	}

	.users-page .users-pagination {
		margin-top: 14px;
		padding: 10px;
		border: 1px solid var(--border);
		border-radius: var(--radius-lg);
		background: rgba(17, 27, 49, 0.7);
	}

	.users-page .users-pagination a {
		height: 38px;
		min-height: 38px;
		border-radius: 10px;
		background: rgba(18, 34, 66, 0.9);
		border-color: rgba(49, 68, 109, 0.85);
	}

	.users-page .users-pagination .page-jump-form {
		padding: 0;
		border: none;
		background: transparent;
	}

	.users-page .users-pagination .page-jump-input {
		height: 38px;
		min-height: 38px;
	}
}

@media (max-width: 900px) {
	.users-page .user-page-header {
		align-items: stretch;
	}

	.users-page .user-search-form.filters-bar {
		width: 100%;
		margin-left: 0;
	}

	.users-page .filters-bar .control-input,
	.users-page .filters-bar .control-select {
		flex: 1 1 100%;
		min-width: 0;
	}

	.users-page .users-pagination .page-jump-form {
		margin-left: 0;
	}
}

@media (max-width: 640px) {
	.users-page .mobile-only {
		display: block !important;
	}

	.users-page .mobile-only.list-cards {
		display: grid !important;
	}

	.users-page .desktop-only {
		display: none !important;
	}

	.users-page .user-page-header {
		gap: 10px;
	}

	.users-page .users-quick-filters {
		margin-top: 4px;
	}

	.users-page .users-quick-filter {
		height: 30px;
		padding: 0 8px;
		font-size: 11px;
	}

	.users-page .users-bulk-toolbar {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.users-page .users-bulk-main {
		grid-template-columns: 1fr 1fr;
	}

	.users-page .users-bulk-field:first-child {
		grid-column: 1 / -1;
	}

	.users-page .users-bulk-submit {
		width: 100%;
	}

	.users-page .user-search-form.filters-bar {
		display: grid;
		grid-template-columns: 1fr;
		gap: 8px;
		width: 100%;
		margin-left: 0;
		padding: 8px;
	}

	.users-page .user-search-form.filters-bar > * {
		width: 100%;
		min-width: 0;
	}

	.users-page .filters-bar .control-input,
	.users-page .filters-bar .control-select {
		flex: none;
		min-width: 0;
	}

	.users-page .user-search-form.filters-bar .control,
	.users-page .user-search-form.filters-bar .button {
		height: 38px;
		min-height: 38px;
		padding-top: 0;
		padding-bottom: 0;
	}

	.users-page .filters-bar .control-input,
	.users-page .filters-bar .control-select {
		font-size: 16px;
		line-height: 1.2;
	}

	.users-page .user-search-form.filters-bar .button {
		font-size: 14px;
	}

	.users-page .action-menu-panel {
		width: min(88vw, 260px);
		right: 0;
	}
}

@media (min-width: 641px) and (max-width: 768px) {
	.users-page .users-table {
		min-width: 860px;
	}

	.users-page .filters-bar .button,
	.users-page .users-pagination a,
	.users-page .users-table td.actions-cell .button {
		width: auto;
	}

	.users-page .users-table td.actions-cell form,
	.users-page .users-table td.actions-cell > a {
		width: auto;
		margin: 0 8px 8px 0;
	}
}

@media (max-width: 768px) {
	.users-page .filters-bar {
		padding: 8px;
	}

	.users-page .users-bulk-toolbar {
		grid-template-columns: minmax(0, 1fr);
	}

	.users-page .users-bulk-main {
		grid-template-columns: minmax(0, 1fr);
	}

	.users-page .users-bulk-field:first-child {
		grid-column: auto;
	}

	.users-page .filters-bar .control,
	.users-page .filters-bar .button,
	.users-page .users-pagination a,
	.users-page .users-pagination .page-jump-input {
		min-height: 42px;
		height: 42px;
	}

	.users-page .card-actions {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: center;
		gap: 8px;
	}

	.users-page .card-actions .button,
	.users-page .card-actions .action-menu summary.button {
		width: auto;
	}

	.users-page .card-actions .action-menu {
		display: inline-flex;
		justify-self: end;
	}

	.users-page .users-pagination {
		gap: 8px;
	}

	.users-page .users-pagination .page-info {
		order: 3;
		width: 100%;
	}

	.users-page .users-pagination .page-jump-form {
		order: 4;
		width: 100%;
		justify-content: space-between;
	}

	.users-page .users-pagination .page-jump-input {
		width: 96px;
	}
}

/* === Promo Codes Page Polish === */

.promo-codes-page {
	--promo-surface: rgba(17, 27, 49, 0.94);
	--promo-border: var(--ds-border);
	--promo-text: var(--ds-text);
	--promo-muted: var(--ds-text-soft);
	--promo-focus: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

.promo-codes-page .promo-search-form.filters-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-left: auto;
	padding: 10px;
	border: 1px solid var(--promo-border);
	border-radius: 14px;
	background: var(--promo-surface);
}

.promo-codes-page .promo-search-form.filters-bar .control,
.promo-codes-page .promo-search-form.filters-bar .button {
	height: 42px;
	min-height: 42px;
}

.promo-codes-page .promo-search-form.filters-bar .control {
	border: 1px solid var(--promo-border);
	border-radius: 10px;
	background: #0b1529;
	color: var(--promo-text);
	padding: 0 12px;
	outline: none;
	box-shadow: none;
}

.promo-codes-page .promo-search-form.filters-bar .control::placeholder {
	color: var(--promo-muted);
}

.promo-codes-page .promo-search-form.filters-bar .control:focus {
	border-color: var(--ds-primary);
	box-shadow: var(--promo-focus);
}

.promo-codes-page .promo-search-form.filters-bar .control-input {
	flex: 1 1 280px;
	min-width: 220px;
}

.promo-codes-page .promo-search-form.filters-bar .control-select {
	flex: 0 1 220px;
	min-width: 200px;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3 5.5L7 9.5L11 5.5' stroke='%239fafc9' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 34px;
}

.promo-codes-page .promo-search-form.filters-bar .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
}

.promo-codes-page .promos-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 18px;
	padding: 10px;
	border: 1px solid var(--promo-border);
	border-radius: 14px;
	background: rgba(17, 27, 49, 0.72);
}

.promo-codes-page .promos-pagination a {
	height: 38px;
	min-height: 38px;
	padding: 0 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	border: 1px solid rgba(49, 68, 109, 0.85);
	background: rgba(18, 34, 66, 0.9);
	color: #bfd7ff;
	text-decoration: none;
	box-shadow: none;
}

.promo-codes-page .promos-pagination a:hover:not(.disabled) {
	background: #173058;
	border-color: #315289;
}

.promo-codes-page .promos-pagination a.disabled {
	opacity: 0.45;
	cursor: not-allowed;
	pointer-events: none;
}

.promo-codes-page .promos-pagination .page-info {
	color: var(--promo-muted);
}

.promo-codes-page .promos-pagination .page-jump-form {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
}

.promo-codes-page .promos-pagination .page-jump-label {
	color: var(--promo-muted);
	font-size: 12px;
}

.promo-codes-page .promos-pagination .page-jump-input {
	width: 80px;
	height: 38px;
	min-height: 38px;
	border: 1px solid var(--promo-border);
	border-radius: 10px;
	background: #0b1529;
	color: var(--promo-text);
	padding: 0 10px;
	text-align: center;
}

.promo-codes-page .promos-pagination .page-jump-input:focus {
	outline: none;
	border-color: var(--ds-primary);
	box-shadow: var(--promo-focus);
}

@media (max-width: 640px) {
	.promo-codes-page .promo-search-form.filters-bar {
		display: grid;
		grid-template-columns: 1fr;
		gap: 8px;
		width: 100%;
		margin-left: 0;
		padding: 8px;
	}

	.promo-codes-page .promo-search-form.filters-bar > * {
		width: 100%;
		min-width: 0;
	}

	.promo-codes-page .promo-search-form.filters-bar .control-input,
	.promo-codes-page .promo-search-form.filters-bar .control-select {
		flex: none;
		min-width: 0;
	}

	.promo-codes-page .promo-search-form.filters-bar .control,
	.promo-codes-page .promo-search-form.filters-bar .button {
		height: 38px;
		min-height: 38px;
		font-size: 16px;
	}

	.promo-codes-page .promo-search-form.filters-bar .button {
		font-size: 14px;
	}

	.promo-codes-page .promo-form .form-grid {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.promo-codes-page .promo-form .form-group {
		margin-bottom: 8px;
	}

	.promo-codes-page .promo-form .form-group label {
		margin-bottom: 6px;
		font-size: 13px;
	}

	.promo-codes-page .promo-form .form-group input[type='text'],
	.promo-codes-page .promo-form .form-group input[type='number'],
	.promo-codes-page .promo-form .form-group input[type='datetime-local'],
	.promo-codes-page .promo-form .form-group select {
		height: 38px;
		min-height: 38px;
		padding: 0 10px;
		font-size: 16px;
		border-radius: 10px;
	}

	.promo-codes-page .promo-form .form-group textarea {
		min-height: 74px;
		padding: 8px 10px;
		font-size: 16px;
		border-radius: 10px;
	}

	.promo-codes-page .promo-form .form-row {
		display: grid;
		grid-template-columns: 1fr;
		gap: 10px;
		margin-bottom: 10px;
	}

	.promo-codes-page .promo-form .form-group-checkbox {
		margin-top: 0;
		padding: 2px 0;
		gap: 8px;
	}

	.promo-codes-page .promo-form .form-group-checkbox input[type='checkbox'] {
		width: 18px;
		height: 18px;
		margin-right: 0;
		flex: 0 0 18px;
	}

	.promo-codes-page .promo-form .form-group-checkbox label {
		font-size: 14px;
		line-height: 1.25;
	}

	.promo-codes-page .promo-form .form-actions .button {
		height: 38px;
		min-height: 38px;
		font-size: 14px;
		border-radius: 10px;
	}

	.promo-codes-page .promos-pagination {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 8px;
		padding: 8px;
	}

	.promo-codes-page .promos-pagination .page-info {
		grid-column: 1 / -1;
		order: 1;
		text-align: center;
		font-size: 13px;
		padding: 2px 0;
	}

	.promo-codes-page .promos-pagination > a {
		height: 38px;
		min-height: 38px;
		width: 100%;
	}

	.promo-codes-page .promos-pagination > a:first-of-type {
		order: 2;
	}

	.promo-codes-page .promos-pagination > a:last-of-type {
		order: 3;
	}

	.promo-codes-page .promos-pagination .page-jump-form {
		grid-column: 1 / -1;
		order: 4;
		margin-left: 0;
		display: grid;
		grid-template-columns: auto minmax(0, 84px) 1fr;
		align-items: center;
		gap: 8px;
	}

	.promo-codes-page .promos-pagination .page-jump-label {
		font-size: 13px;
	}

	.promo-codes-page .promos-pagination .page-jump-input {
		width: 84px;
		height: 38px;
		min-height: 38px;
	}
}

/* === User Detail Mobile Polish === */

/* Panel Users cards */
.panel-users-page .panel-users-cards {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
}

.panel-users-page .panel-user-card {
	background: var(--ds-surface);
	border: 1px solid var(--ds-border);
	border-radius: var(--ds-radius-lg);
	box-shadow: var(--card-shadow-soft);
}

.panel-users-page .panel-user-details {
	padding: 0;
}

.panel-users-page .panel-user-details > summary {
	list-style: none;
	cursor: pointer;
	padding: 14px;
}

.panel-users-page .panel-user-summary {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 12px;
	align-items: flex-start;
	position: relative;
	padding-right: 34px;
}

.panel-users-page .panel-user-details > summary::-webkit-details-marker {
	display: none;
}

.panel-users-page .panel-user-details > summary.panel-user-summary::after {
	content: "";
	width: 8px;
	height: 8px;
	border-right: 2px solid var(--ds-text-soft);
	border-bottom: 2px solid var(--ds-text-soft);
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%) rotate(45deg);
	transition: transform 0.2s ease;
}

.panel-users-page .panel-user-details[open] > summary.panel-user-summary::after {
	transform: translateY(-50%) rotate(-135deg);
}

.panel-users-page .panel-user-details[open] > summary {
	border-bottom: 1px solid var(--ds-border);
}

.panel-users-page .panel-user-body {
	padding: 0 14px 14px;
}

.panel-users-page .panel-user-card .card-rows {
	margin-top: 10px;
}

.panel-users-page .panel-user-form {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--ds-border);
}

.panel-users-page .panel-user-form .form-grid {
	margin-bottom: 8px;
}

.panel-users-page .panel-user-delete-form {
	margin-top: 10px;
}

.panel-users-page .panel-user-delete-form .button {
	width: 100%;
}

.panel-users-page .panel-user-logs {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--ds-border);
}

.panel-users-page .panel-user-log-list {
	display: grid;
	gap: 10px;
	margin-top: 10px;
}

.panel-users-page .panel-user-log-item {
	padding: 10px 12px;
	border: 1px solid var(--ds-border);
	border-radius: var(--ds-radius);
	background: var(--ds-surface-soft);
}

.panel-users-page .panel-user-log-top {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	align-items: baseline;
}

.panel-users-page .panel-user-log-action {
	font-weight: 600;
	color: var(--ds-text);
}

.panel-users-page .panel-user-log-time {
	font-size: 12px;
	color: var(--ds-text-soft);
	white-space: nowrap;
}

.panel-users-page .panel-user-log-meta {
	margin-top: 4px;
	font-size: 12px;
	line-height: 1.35;
	color: var(--ds-text-soft);
	word-break: break-word;
}

@media (max-width: 640px) {
	.panel-users-page .panel-user-log-top {
		flex-direction: column;
		align-items: flex-start;
	}

	.panel-users-page .panel-user-delete-form .button,
	.panel-users-page .panel-user-form .form-actions .button {
		width: 100%;
	}
}

.user-detail-page .detail-actions > a.button,
.user-detail-page .detail-actions > form .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	white-space: nowrap;
}

.user-detail-page .detail-actions > form {
	display: inline-flex;
	margin: 0;
}

.user-detail-page .user-priority-section .dashboard-action-list {
	display: grid;
	gap: 10px;
}

.user-detail-page .user-priority-section .dashboard-action-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border-radius: 12px;
	border: 1px solid rgba(60, 84, 126, 0.52);
	background: rgba(14, 24, 43, 0.88);
	color: var(--ds-text);
	text-decoration: none;
}

.user-detail-page .user-priority-section .dashboard-action-row:hover {
	border-color: rgba(96, 165, 250, 0.52);
	background: rgba(19, 33, 58, 0.9);
}

.user-detail-page .user-priority-section .dashboard-action-row-main strong {
	display: block;
	font-size: 14px;
	line-height: 1.35;
	color: var(--ds-text);
}

.user-detail-page .user-priority-section .dashboard-action-row-main p {
	margin: 2px 0 0;
	font-size: 12px;
	line-height: 1.4;
	color: var(--ds-text-soft);
}

.user-detail-page .user-priority-section .dashboard-action-row-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 30px;
	padding: 0 10px;
	border-radius: 9px;
	border: 1px solid rgba(96, 165, 250, 0.45);
	background: rgba(37, 72, 128, 0.28);
	color: #dbeafe;
	font-size: 12px;
	font-weight: 600;
}

.user-detail-page .detail-actions .button {
	border-color: rgba(56, 78, 118, 0.58);
	background: rgba(20, 33, 57, 0.9);
	color: var(--ds-text);
}

.user-detail-page .detail-actions .button:hover {
	border-color: rgba(96, 165, 250, 0.5);
	background: rgba(28, 45, 76, 0.95);
}

.user-detail-page .detail-actions .button-warning,
.user-detail-page .detail-actions .button-start,
.user-detail-page .detail-actions .button-danger {
	border-color: rgba(56, 78, 118, 0.58);
	background: rgba(20, 33, 57, 0.9);
	color: var(--ds-text);
}

.user-detail-page .detail-actions .button-warning:hover,
.user-detail-page .detail-actions .button-start:hover,
.user-detail-page .detail-actions .button-danger:hover {
	border-color: rgba(96, 165, 250, 0.5);
	background: rgba(28, 45, 76, 0.95);
	color: #ffffff;
}

/* Readable IDs on desktop/mobile (including iOS auto-detected numeric links) */
.id-link,
.id-link:visited {
	color: var(--ds-text) !important;
	text-decoration-color: rgba(229, 237, 248, 0.45);
}

.id-link:hover {
	color: #ffffff !important;
	text-decoration-color: rgba(255, 255, 255, 0.7);
}

.id-value {
	color: var(--ds-text);
}

.id-value a,
.id-value a:visited,
.id-value a[x-apple-data-detectors],
.id-value a[href^='tel:'] {
	color: inherit !important;
	text-decoration: none !important;
	font: inherit !important;
	line-height: inherit !important;
}

.muted a[x-apple-data-detectors],
.muted a[href^='tel:'],
.card-value a[x-apple-data-detectors],
.card-value a[href^='tel:'],
.detail-value a[x-apple-data-detectors],
.detail-value a[href^='tel:'],
.list-card-subtitle a[x-apple-data-detectors],
.list-card-subtitle a[href^='tel:'] {
	color: inherit !important;
	text-decoration: inherit !important;
	font: inherit !important;
	line-height: inherit !important;
}

@media (max-width: 900px) {
	.user-detail-page .detail-actions {
		display: none !important;
	}
}

@media (max-width: 768px) {
	.user-detail-page .section-header {
		align-items: stretch;
	}

	.user-detail-page .section-header > form {
		width: 100%;
	}

	.user-detail-page .section-header > form .button {
		width: 100%;
		min-height: 40px;
		height: 40px;
		justify-content: center;
		font-size: 14px;
		border-radius: 12px;
	}

	.user-detail-page .section-header > form .button-danger {
		background: rgba(239, 68, 68, 0.12);
		border-color: rgba(239, 68, 68, 0.38);
		color: #fecaca;
	}

	.user-detail-page .section-header > form .button-danger:hover {
		background: rgba(239, 68, 68, 0.18);
		border-color: rgba(239, 68, 68, 0.48);
	}

	.user-detail-page .key-table.stacked-table tbody tr {
		padding: 12px 12px 10px;
		border-radius: 14px;
	}

	.user-detail-page .key-table.stacked-table tbody td {
		grid-template-columns: 78px minmax(0, 1fr);
		gap: 8px;
		padding: 5px 0;
	}

	.user-detail-page .key-table.stacked-table tbody td::before {
		font-size: 10px;
		letter-spacing: 0.06em;
		line-height: 1.2;
		padding-top: 2px;
	}

	.user-detail-page .key-table.stacked-table tbody td > .status-badge {
		justify-self: start;
		width: auto;
		max-width: 100%;
	}

	.user-detail-page .key-table.stacked-table tbody td.actions-cell {
		display: block;
		padding-top: 10px;
		margin-top: 4px;
		border-top: 1px dashed rgba(49, 68, 109, 0.5);
	}

	.user-detail-page .key-table.stacked-table tbody td.actions-cell::before {
		display: block;
		margin-bottom: 8px;
	}

	.user-detail-page .key-actions {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
		align-items: start;
	}

	.user-detail-page .key-actions form {
		width: 100%;
		margin: 0;
	}

	.user-detail-page .key-actions .button {
		width: 100%;
		min-height: 38px;
		height: 38px;
		padding: 0 10px;
		font-size: 14px;
		border-radius: 10px;
	}

	.user-detail-page .key-actions .button-start {
		background: rgba(34, 197, 94, 0.12);
		border-color: rgba(34, 197, 94, 0.34);
		color: #a7f3c8;
	}

	.user-detail-page .key-actions .button-start:hover {
		background: rgba(34, 197, 94, 0.18);
		border-color: rgba(34, 197, 94, 0.44);
		color: #d1fae5;
	}

	.user-detail-page .key-actions .button-danger {
		background: rgba(239, 68, 68, 0.12);
		border-color: rgba(239, 68, 68, 0.34);
		color: #fecaca;
	}

	.user-detail-page .key-actions .button-danger:hover {
		background: rgba(239, 68, 68, 0.18);
		border-color: rgba(239, 68, 68, 0.44);
	}

	.user-detail-page .key-actions input[type='number'],
	.user-detail-page .key-actions input[type='datetime-local'] {
		width: 100%;
		min-width: 0;
		min-height: 38px;
		height: 38px;
		padding: 0 10px;
		border-radius: 10px;
		font-size: 16px;
	}

	.user-detail-page .key-actions .key-extend-form,
	.user-detail-page .key-actions .key-expiry-form {
		grid-column: 1 / -1;
		display: grid;
		grid-template-columns: 1fr;
		gap: 6px;
	}

	.user-detail-page .key-actions .key-expiry-form input[type='datetime-local'] {
		font-size: 15px;
	}

	.user-detail-page .key-actions form:last-child {
		grid-column: 1 / -1;
		margin-top: 2px;
	}

	.user-detail-page .sticky-action-bar {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 56px;
		gap: 8px;
		align-items: center;
		padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
	}

	.user-detail-page .sticky-action-bar > a,
	.user-detail-page .sticky-action-bar > form {
		flex: initial;
		width: auto;
	}

	.user-detail-page .sticky-action-bar > form {
		display: block;
	}

	.user-detail-page .sticky-action-bar > details.action-menu {
		width: 56px;
		justify-self: end;
	}

	.user-detail-page .sticky-action-bar .button {
		width: 100%;
		min-height: 42px;
		height: 42px;
		padding: 0 12px;
		border-radius: 12px;
		font-size: 14px;
		white-space: nowrap;
	}

	.user-detail-page .sticky-action-bar > details.action-menu summary.button {
		width: 56px;
		min-width: 56px;
		padding: 0;
		justify-content: center;
	}

	.user-detail-page .sticky-action-bar .button-warning {
		background: rgba(245, 158, 11, 0.1);
		border-color: rgba(245, 158, 11, 0.4);
		color: #fcd47f;
	}

	.user-detail-page .sticky-action-bar .button-warning:hover {
		background: rgba(245, 158, 11, 0.16);
		border-color: rgba(245, 158, 11, 0.5);
	}
}

.funnels-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 12px;
}

.funnels-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-start;
	margin-right: auto;
}

.funnels-periods {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-left: auto;
}

.funnels-range {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 10px;
	margin-left: 12px;
}

.funnels-texts {
	display: grid;
	gap: 12px;
}

.funnels-texts-group h3 {
	margin: 12px 0 4px;
	font-size: 1rem;
	color: var(--ds-text);
}

.funnel-text-item .funnel-text-form {
	display: none;
	margin-top: 10px;
}

.funnel-text-item.is-editing .funnel-text-form {
	display: block;
}

.funnel-text-item.is-editing .funnel-text-preview,
.funnel-text-item.is-editing .funnel-text-actions [data-funnel-edit] {
	display: none;
}

.funnel-text-form textarea {
	width: 100%;
	min-height: 120px;
	border-radius: 10px;
	padding: 10px 12px;
	background: rgba(15, 23, 42, 0.4);
	border: 1px solid var(--ds-border);
	color: var(--ds-text);
	font-family: inherit;
	resize: vertical;
}

.funnel-text-actions {
	margin-top: 8px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.funnels-summary {
	margin-top: 10px;
	color: var(--ds-text-soft);
}

.funnels-glossary {
	border: 1px solid var(--ds-border);
	border-radius: 14px;
	padding: 12px 16px;
	background: rgba(15, 23, 42, 0.35);
}

.funnels-glossary summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--ds-text);
}

.funnels-glossary[open] summary {
	margin-bottom: 10px;
}

.funnels-glossary-body {
	display: grid;
	gap: 12px;
}

.funnels-page {
	max-width: 1320px;
	margin: 0 auto;
	padding: 4px 28px 56px;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.funnels-page h1 {
	text-align: left;
	font-size: 34px;
	line-height: 1.15;
	letter-spacing: 0.2px;
}

.funnels-page h2 {
	border-bottom: none;
	margin-bottom: 12px;
	font-size: 22px;
}

.funnels-page .page-header {
	margin-bottom: 6px;
}

.funnels-page .page-subtitle {
	color: var(--ds-text-soft);
	max-width: 720px;
}

.funnels-page .settings-section {
	margin-bottom: 28px;
}

.funnels-page .funnels-toolbar {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas:
		'tabs periods'
		'range range';
	gap: 16px 24px;
	align-items: center;
	padding: 16px;
	border-radius: 16px;
	border: 1px solid var(--ds-border);
	background: rgba(12, 22, 40, 0.55);
}

.funnels-page .funnels-tabs {
	grid-area: tabs;
	margin: 0;
	gap: 10px;
}

.funnels-page .funnels-periods {
	grid-area: periods;
	margin: 0;
	justify-content: flex-end;
	gap: 8px;
}

.funnels-page .funnels-range {
	grid-area: range;
	margin: 0;
	justify-content: flex-end;
	gap: 12px;
}

.funnels-page .funnels-tabs .button,
.funnels-page .funnels-periods .button {
	height: 38px;
	min-height: 38px;
	padding: 0 14px;
	font-size: 13px;
}

.funnels-page .funnels-range .control input {
	height: 38px;
	min-height: 38px;
	padding: 0 12px;
}

.funnels-page .funnels-range .button {
	height: 38px;
	min-height: 38px;
}

.funnels-page .stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
}

.funnels-page .stat-card {
	min-height: 148px;
	padding: 18px 20px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.funnels-page .stat-card h3 {
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--ds-text-soft);
}

.funnels-page .stat-card .stat-number {
	margin: 4px 0 6px;
}

.funnels-page .stat-card .stat-helper {
	color: var(--ds-text-soft);
}

.funnels-page .funnels-summary {
	margin-top: 8px;
}

.funnels-page .table-wrapper {
	border: 1px solid var(--ds-border);
	border-radius: 16px;
	overflow: hidden;
	background: rgba(12, 22, 40, 0.35);
}

.funnels-page .users-table {
	width: 100%;
	border-collapse: collapse;
}

.funnels-page .users-table th {
	padding: 12px 14px;
	font-size: 13px;
	font-weight: 600;
	color: var(--ds-text-soft);
	background: rgba(14, 24, 42, 0.8);
	border-bottom: 1px solid var(--ds-border);
	text-transform: none;
}

.funnels-page .users-table td {
	padding: 12px 14px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.funnels-page .users-table th:not(:first-child),
.funnels-page .users-table td:not(:first-child) {
	text-align: right;
}

.funnels-page .users-table tbody tr:hover td {
	background: rgba(72, 123, 252, 0.06);
}

@media (max-width: 1100px) {
	.funnels-page .funnels-toolbar {
		grid-template-columns: 1fr;
		grid-template-areas:
			'tabs'
			'periods'
			'range';
		justify-items: start;
	}

	.funnels-page .funnels-periods,
	.funnels-page .funnels-range {
		justify-content: flex-start;
	}
}

@media (max-width: 720px) {
	.funnels-page {
		padding: 4px 18px 48px;
	}

	.funnels-page .funnels-range {
		flex-direction: column;
		align-items: stretch;
	}
}

.glossary-item {
	border: 1px dashed var(--ds-border);
	border-radius: 12px;
	padding: 12px;
	background: rgba(15, 23, 42, 0.55);
}

.glossary-code {
	font-weight: 700;
	color: var(--ds-accent, #8bb2ff);
	margin-bottom: 6px;
}

.glossary-desc {
	color: var(--ds-text-soft);
	margin-bottom: 8px;
}

.glossary-text {
	line-height: 1.5;
	margin-bottom: 8px;
}

.glossary-buttons {
	color: var(--ds-text-soft);
}

.system-metrics-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 16px;
}

.system-metric-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 16px;
	border-radius: var(--ds-radius-lg);
	border: 1px solid var(--ds-border);
	background: var(--ds-surface-soft);
}

.system-gauge {
	--value: 0;
	--gauge-color: #5f8dff;
	width: 92px;
	height: 92px;
	border-radius: 50%;
	background: conic-gradient(
		var(--gauge-color) calc(var(--value) * 1%),
		rgba(255, 255, 255, 0.08) 0
	);
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}

.system-gauge::before {
	content: '';
	position: absolute;
	inset: 9px;
	border-radius: 50%;
	background: rgba(10, 16, 30, 0.9);
	border: 1px solid rgba(255, 255, 255, 0.06);
}

.system-gauge span {
	position: relative;
	font-size: 13px;
	font-weight: 600;
	color: var(--ds-text);
}

.system-gauge-cpu {
	--gauge-color: #22c55e;
}

.system-gauge-mem {
	--gauge-color: #60a5fa;
}

.system-gauge-disk {
	--gauge-color: #f59e0b;
}

.system-metric-label {
	font-size: 13px;
	color: var(--ds-text-soft);
	text-align: center;
}

/* Shared CRUD surface inspired by Ads page */

.crudx-page {
	--crudx-surface: #0f1b33;
	--crudx-surface-soft: #0b162b;
	--crudx-border: rgba(120, 147, 196, 0.16);
	--crudx-text: #e7edf8;
	--crudx-muted: #98a7c7;
	--crudx-primary: #2563eb;
	--crudx-primary-hover: #1d4ed8;
	--crudx-danger: #dc2626;
	--crudx-shadow: 0 18px 42px rgba(3, 11, 25, 0.28);
	color: var(--crudx-text);
}

.crudx-page .page-header,
.crudx-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
	flex-wrap: wrap;
}

.crudx-page .page-header h1,
.crudx-title {
	margin: 0;
	padding: 0;
	border: 0;
	color: var(--crudx-text);
	font-size: 32px;
	line-height: 1.1;
}

.crudx-page .page-subtitle,
.crudx-subtitle {
	margin-top: 8px;
	max-width: 760px;
	color: var(--crudx-muted);
	font-size: 15px;
}

.crudx-stats,
.crudx-page .stats-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
}

.crudx-stat,
.crudx-page .stat-card {
	background: var(--crudx-surface);
	border: 1px solid var(--crudx-border);
	border-radius: 18px;
	padding: 20px;
	box-shadow: var(--crudx-shadow);
}

.crudx-page .stat-card h3,
.crudx-page .stat-card .stat-helper,
.crudx-page .stat-card .stat-number,
.crudx-page .stat-card .stat-number small {
	color: inherit;
}

.crudx-page .stat-card h3 {
	color: var(--crudx-muted);
	font-size: 14px;
	font-weight: 600;
}

.crudx-page .stat-card .stat-number {
	margin-top: 10px;
	font-size: 20px;
	font-weight: 700;
	color: var(--crudx-text);
}

.crudx-page .stat-card .stat-helper {
	color: var(--crudx-muted);
}

.crudx-panel {
	display: grid;
	gap: 18px;
	background: var(--crudx-surface);
	border: 1px solid var(--crudx-border);
	border-radius: 20px;
	padding: 20px;
	box-shadow: var(--crudx-shadow);
}

.crudx-panel-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	flex-wrap: wrap;
}

.crudx-panel-title {
	margin: 0;
	color: var(--crudx-text);
	font-size: 20px;
	font-weight: 700;
}

.crudx-panel-note {
	margin-top: 6px;
	color: var(--crudx-muted);
	font-size: 14px;
}

.crudx-toolbar {
	display: grid;
	grid-template-columns: minmax(220px, 1fr) 180px 180px auto;
	gap: 12px;
}

.crudx-toolbar.crudx-toolbar-wide {
	grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(160px, 220px)) auto;
}

.crudx-input,
.crudx-select,
.crudx-page .promo-search-form.filters-bar .control,
.crudx-page .form-group input[type='text'],
.crudx-page .form-group input[type='number'],
.crudx-page .form-group input[type='datetime-local'],
.crudx-page .form-group input[type='password'],
.crudx-page .form-group select,
.crudx-page .form-group textarea {
	width: 100%;
	padding: 12px 14px;
	border-radius: 12px;
	border: 1px solid var(--crudx-border);
	background: var(--crudx-surface-soft);
	color: var(--crudx-text);
	font-size: 14px;
	outline: none;
	box-shadow: none;
}

.crudx-input::placeholder,
.crudx-page .form-group textarea::placeholder {
	color: var(--crudx-muted);
}

.crudx-input:focus,
.crudx-select:focus,
.crudx-page .promo-search-form.filters-bar .control:focus,
.crudx-page .form-group input:focus,
.crudx-page .form-group select:focus,
.crudx-page .form-group textarea:focus {
	border-color: var(--crudx-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.crudx-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 16px;
	border-radius: 12px;
	border: 1px solid transparent;
	text-decoration: none;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.crudx-page .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 16px;
	border-radius: 12px;
	border: 1px solid transparent;
	font-size: 14px;
	font-weight: 600;
	box-shadow: none;
}

.crudx-page .button-small {
	padding: 9px 14px;
	border-radius: 11px;
}

.crudx-button:hover {
	transform: translateY(-1px);
}

.crudx-page .button:hover {
	transform: translateY(-1px);
}

.crudx-button-primary {
	background: var(--crudx-primary);
	color: #fff;
}

.crudx-page .button-primary,
.crudx-page .button-start {
	background: var(--crudx-primary);
	color: #fff;
}

.crudx-button-primary:hover {
	background: var(--crudx-primary-hover);
}

.crudx-page .button-primary:hover,
.crudx-page .button-start:hover {
	background: var(--crudx-primary-hover);
}

.crudx-button-secondary {
	background: rgba(15, 27, 51, 0.75);
	border-color: var(--crudx-border);
	color: var(--crudx-text);
}

.crudx-page .button-secondary,
.crudx-page .button-outline,
.crudx-page .button-warning {
	background: rgba(15, 27, 51, 0.75);
	border-color: var(--crudx-border);
	color: var(--crudx-text);
}

.crudx-button-danger {
	background: var(--crudx-danger);
	color: #fff;
}

.crudx-page .button-danger,
.crudx-page .button-stop {
	background: var(--crudx-danger);
	color: #fff;
}

.crudx-toolbar-actions,
.crudx-row-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}

.crudx-form-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.crudx-page .form-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.crudx-checkbox-row {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	align-items: center;
}

.crudx-page .form-group-checkbox label,
.crudx-page .form-group label {
	color: var(--crudx-muted);
}

.crudx-table-wrap,
.crudx-page .table-wrapper {
	overflow: auto;
	border: 1px solid var(--crudx-border);
	border-radius: 16px;
	background: rgba(11, 22, 43, 0.56);
}

.crudx-table,
.crudx-page .users-table,
.crudx-page .transactions-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 960px;
	background: transparent;
}

.crudx-table th,
.crudx-table td,
.crudx-page .users-table th,
.crudx-page .users-table td,
.crudx-page .transactions-table th,
.crudx-page .transactions-table td {
	padding: 14px 16px;
	border-bottom: 1px solid var(--crudx-border);
	text-align: left;
	vertical-align: top;
	color: var(--crudx-text);
}

.crudx-table th,
.crudx-page .users-table th,
.crudx-page .transactions-table th {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--crudx-muted);
	background: rgba(11, 22, 43, 0.92);
}

.crudx-page .users-table tbody tr:hover td,
.crudx-page .transactions-table tbody tr:hover td,
.crudx-table tbody tr:hover td {
	background: rgba(20, 37, 69, 0.9);
}

.crudx-detail-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.crudx-page .detail-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.crudx-detail-item {
	padding: 14px 16px;
	border-radius: 14px;
	border: 1px solid var(--crudx-border);
	background: rgba(11, 22, 43, 0.72);
}

.crudx-page .detail-item {
	padding: 14px 16px;
	border-radius: 14px;
	border: 1px solid var(--crudx-border);
	background: rgba(11, 22, 43, 0.72);
}

.crudx-detail-label {
	display: block;
	color: var(--crudx-muted);
	font-size: 12px;
}

.crudx-page .detail-label {
	display: block;
	color: var(--crudx-muted);
	font-size: 12px;
}

.crudx-detail-value {
	display: block;
	margin-top: 6px;
	color: var(--crudx-text);
	font-size: 15px;
	font-weight: 600;
}

.crudx-page .detail-value {
	display: block;
	margin-top: 6px;
	color: var(--crudx-text);
	font-size: 15px;
	font-weight: 600;
}

.crudx-empty {
	display: grid;
	place-items: center;
	gap: 10px;
	padding: 44px 20px;
	text-align: center;
	border: 1px dashed var(--crudx-border);
	border-radius: 16px;
	color: var(--crudx-muted);
}

.crudx-page .section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.crudx-page .section-helper,
.crudx-page .muted,
.crudx-page .key-note,
.crudx-page .list-card-subtitle,
.crudx-page .card-label {
	color: var(--crudx-muted);
}

.crudx-page .list-card,
.crudx-page .panel-user-card {
	background: var(--crudx-surface);
	border: 1px solid var(--crudx-border);
	border-radius: 18px;
	box-shadow: var(--crudx-shadow);
}

.crudx-page .list-card-title,
.crudx-page .user-link {
	color: #cfe0ff;
}

.crudx-page .status-badge {
	border-color: var(--crudx-border);
}

/* Promo list compact mode */
.promo-codes-page .crudx-table th,
.promo-codes-page .crudx-table td {
	padding: 10px 12px;
	font-size: 13px;
	line-height: 1.35;
}

.promo-codes-page .promo-table td {
	vertical-align: middle;
}

.promo-codes-page .promo-table .key-note {
	display: block;
	margin-top: 2px;
	font-size: 11px;
}

.promo-codes-page .promo-table .actions-cell {
	min-width: 170px;
}

.promo-codes-page .promo-table .actions-cell form,
.promo-codes-page .promo-table .actions-cell > a {
	display: inline-flex;
	margin: 0 4px 4px 0;
}

.promo-codes-page .promo-table .actions-cell .button {
	min-height: 30px;
	height: 30px;
	padding: 0 10px;
	font-size: 12px;
	border-radius: 9px;
}

.promo-codes-page .promo-note-cell {
	max-width: 280px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.promo-codes-page .mobile-only.list-cards {
	gap: 10px;
}

.promo-codes-page .list-card {
	padding: 10px 12px;
	border-radius: 14px;
}

.promo-codes-page .card-rows {
	gap: 8px;
}

.promo-codes-page .card-row {
	padding: 6px 0;
}

.promo-codes-page .card-actions {
	margin-top: 8px;
}

.promo-codes-page .card-actions .button {
	min-height: 32px;
	height: 32px;
	padding: 0 10px;
	font-size: 12px;
}

.crudx-modal[hidden] {
	display: none;
}

.crudx-modal {
	position: fixed;
	inset: 0;
	z-index: 2000;
	display: grid;
	place-items: center;
	padding: 16px;
	background: rgba(4, 10, 24, 0.72);
	backdrop-filter: blur(6px);
}

.crudx-modal-card {
	width: min(620px, calc(100vw - 32px));
	max-height: calc(100vh - 32px);
	overflow: auto;
	background: #0b162b;
	border: 1px solid var(--crudx-border);
	border-radius: 20px;
	padding: 22px;
	box-shadow: var(--crudx-shadow);
}

.crudx-modal-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
}

.crudx-modal-title {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	color: var(--crudx-text);
}

.crudx-modal-note {
	margin-top: 4px;
	font-size: 14px;
	color: var(--crudx-muted);
}

.crudx-close {
	border: 0;
	background: transparent;
	color: var(--crudx-muted);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.crudx-form-stack {
	display: grid;
	gap: 16px;
	margin-top: 18px;
}

.crudx-form-title {
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var(--crudx-muted);
}

.crudx-readonly {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 14px;
	border: 1px solid var(--crudx-border);
	border-radius: 12px;
	background: var(--crudx-surface-soft);
	color: var(--crudx-text);
}

.crudx-modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	flex-wrap: wrap;
}

@media (max-width: 1100px) {
	.crudx-stats,
	.crudx-page .stats-grid,
	.crudx-detail-grid,
	.crudx-page .detail-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.crudx-toolbar,
	.crudx-toolbar.crudx-toolbar-wide,
	.crudx-form-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.crudx-stats,
	.crudx-page .stats-grid,
	.crudx-detail-grid,
	.crudx-page .detail-grid {
		grid-template-columns: 1fr;
	}

	.crudx-button {
		width: 100%;
	}

	.crudx-toolbar-actions,
	.crudx-row-actions {
		width: 100%;
	}

	.crudx-toolbar-actions > *,
	.crudx-row-actions > * {
		flex: 1 1 100%;
	}

	.crudx-modal-actions,
	.crudx-readonly {
		flex-direction: column;
		align-items: stretch;
	}
}

.analytics-page .dashboard-column-right {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.analytics-page .analytics-compact-wrap {
	overflow: visible;
}

.analytics-page .analytics-compact-table {
	min-width: 0;
	table-layout: auto;
}

.analytics-page .analytics-compact-table th,
.analytics-page .analytics-compact-table td {
	white-space: normal;
}

.dashboard-column-right .dashboard-compact-wrap {
	overflow: visible;
}

.dashboard-column-right .dashboard-compact-table {
	min-width: 0;
	width: 100%;
	table-layout: auto;
}

.dashboard-column-right .dashboard-compact-table th,
.dashboard-column-right .dashboard-compact-table td {
	padding: 10px 12px;
	white-space: normal;
	word-break: normal;
	overflow-wrap: break-word;
	vertical-align: top;
}

.dashboard-column-right .dashboard-compact-table th {
	font-size: 12px;
}

.dashboard-column-right .dashboard-compact-table th:nth-child(1),
.dashboard-column-right .dashboard-compact-table td:nth-child(1) {
	width: 34%;
	min-width: 180px;
}

.dashboard-column-right .dashboard-compact-table th:nth-child(2),
.dashboard-column-right .dashboard-compact-table td:nth-child(2) {
	width: 21%;
}

.dashboard-column-right .dashboard-compact-table th:nth-child(3),
.dashboard-column-right .dashboard-compact-table td:nth-child(3) {
	width: 17%;
}

.dashboard-column-right .dashboard-compact-table th:nth-child(4),
.dashboard-column-right .dashboard-compact-table td:nth-child(4) {
	width: 12%;
	min-width: 82px;
}

.dashboard-column-right .dashboard-compact-table th:nth-child(5),
.dashboard-column-right .dashboard-compact-table td:nth-child(5) {
	width: 16%;
	min-width: 124px;
}

.dashboard-column-right .dashboard-compact-table td:nth-child(4),
.dashboard-column-right .dashboard-compact-table td:nth-child(5),
.dashboard-column-right .dashboard-compact-table .date-cell {
	white-space: nowrap;
	word-break: keep-all;
	overflow-wrap: normal;
	font-variant-numeric: tabular-nums;
}

.dashboard-column-right .dashboard-compact-table td .muted {
	display: inline-block;
	margin-top: 4px;
	font-size: 12px;
}

.dashboard-page .page-header {
	margin-bottom: 24px;
}

.dashboard-page .dashboard-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
}

.dashboard-page .dashboard-overline {
	display: inline-flex;
	align-items: center;
	padding: 6px 10px;
	margin-bottom: 12px;
	border-radius: 999px;
	background: rgba(96, 165, 250, 0.12);
	border: 1px solid rgba(96, 165, 250, 0.2);
	color: #93c5fd;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.dashboard-page .dashboard-head-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
}

.dashboard-page .dashboard-hero-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px;
	margin-bottom: 20px;
}

.dashboard-page .dashboard-hero-card {
	position: relative;
	padding: 22px 22px 20px;
	border-radius: 22px;
	border: 1px solid rgba(59, 130, 246, 0.14);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
	overflow: hidden;
	transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-page .dashboard-hero-card:hover,
.dashboard-page .dashboard-quick-card:hover,
.dashboard-page .dashboard-kpi-chip:hover,
.dashboard-page .chart-card:hover,
.dashboard-page .dashboard-transactions-panel:hover,
.dashboard-page .dashboard-chart-panel:hover {
	transform: translateY(-3px);
}

.dashboard-page .dashboard-hero-card::after {
	content: '';
	position: absolute;
	inset: auto -24px -38px auto;
	width: 120px;
	height: 120px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	filter: blur(8px);
}

.dashboard-page .dashboard-hero-card-primary {
	background: linear-gradient(135deg, #12264a, #091a33);
}

.dashboard-page .dashboard-hero-card-accent {
	background: linear-gradient(135deg, #1e1b4b, #0f172a);
	border-color: rgba(129, 140, 248, 0.22);
}

.dashboard-page .dashboard-hero-card-success {
	background: linear-gradient(135deg, #0d2b2b, #0f172a);
	border-color: rgba(34, 197, 94, 0.18);
}

.dashboard-page .dashboard-hero-card-warn {
	background: linear-gradient(135deg, #2a203f, #0f172a);
	border-color: rgba(56, 189, 248, 0.16);
}

.dashboard-page .dashboard-hero-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

.dashboard-page .dashboard-hero-label {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: rgba(226, 232, 240, 0.78);
}

.dashboard-page .dashboard-hero-trend {
	display: inline-flex;
	align-items: center;
	padding: 6px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
}

.dashboard-page .dashboard-hero-trend-positive {
	background: rgba(34, 197, 94, 0.16);
	color: #86efac;
}

.dashboard-page .dashboard-hero-trend-neutral {
	background: rgba(96, 165, 250, 0.16);
	color: #93c5fd;
}

.dashboard-page .dashboard-hero-value {
	font-size: clamp(28px, 3vw, 40px);
	font-weight: 800;
	line-height: 1;
	color: #f8fafc;
}

.dashboard-page .dashboard-hero-value small {
	font-size: 14px;
	font-weight: 700;
	color: rgba(191, 219, 254, 0.84);
}

.dashboard-page .dashboard-hero-note {
	margin-top: 12px;
	font-size: 13px;
	line-height: 1.55;
	color: rgba(191, 219, 254, 0.78);
}

.dashboard-page .dashboard-kpi-strip {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	margin-bottom: 20px;
}

.dashboard-page .dashboard-kpi-chip {
	padding: 18px 18px 16px;
	background: rgba(9, 20, 40, 0.88);
	border: 1px solid rgba(59, 130, 246, 0.12);
	border-radius: 18px;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
	transition: transform 0.18s ease, border-color 0.18s ease;
}

.dashboard-page .dashboard-kpi-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
	font-size: 13px;
	font-weight: 700;
	color: rgba(191, 219, 254, 0.78);
}

.dashboard-page .dashboard-kpi-head strong {
	font-size: 20px;
	color: #f8fafc;
}

.dashboard-page .dashboard-kpi-progress {
	height: 10px;
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.92);
	overflow: hidden;
}

.dashboard-page .dashboard-kpi-progress span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, #38bdf8, #818cf8);
	box-shadow: 0 0 24px rgba(56, 189, 248, 0.28);
}

.dashboard-page .dashboard-kpi-note,
.dashboard-page .dashboard-kpi-meta {
	margin-top: 10px;
	font-size: 13px;
	line-height: 1.5;
	color: rgba(191, 219, 254, 0.76);
}

.dashboard-page .dashboard-kpi-meta {
	display: flex;
	align-items: center;
	gap: 8px;
}

.dashboard-page .dashboard-dot {
	width: 8px;
	height: 8px;
	border-radius: 999px;
	flex: 0 0 auto;
}

.dashboard-page .dashboard-dot-success {
	background: #22c55e;
	box-shadow: 0 0 12px rgba(34, 197, 94, 0.45);
}

.dashboard-page .dashboard-quick-actions {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	margin-bottom: 20px;
}

.dashboard-page .dashboard-quick-card {
	display: block;
	padding: 18px 18px 16px;
	border-radius: 18px;
	border: 1px solid rgba(59, 130, 246, 0.12);
	background: rgba(9, 20, 40, 0.86);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
	text-decoration: none;
	transition: transform 0.18s ease, border-color 0.18s ease;
}

.dashboard-page .dashboard-quick-card:hover {
	border-color: rgba(96, 165, 250, 0.34);
}

.dashboard-page .dashboard-quick-eyebrow {
	display: block;
	margin-bottom: 8px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #60a5fa;
}

.dashboard-page .dashboard-quick-title {
	display: block;
	font-size: 17px;
	font-weight: 700;
	color: #f8fafc;
}

.dashboard-page .dashboard-quick-note {
	display: block;
	margin-top: 8px;
	font-size: 13px;
	line-height: 1.5;
	color: rgba(191, 219, 254, 0.76);
}

.dashboard-page .dashboard-system-section,
.dashboard-page .dashboard-kpi-section {
	margin-bottom: 24px;
}

.dashboard-page .system-metric-card {
	background: var(--crudx-surface);
	border: 1px solid var(--crudx-border);
	border-radius: 18px;
	box-shadow: var(--crudx-shadow);
}

.dashboard-page .system-metric-label {
	color: var(--crudx-muted);
}

.dashboard-page .dashboard-crudx-layout {
	display: grid;
	grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
	gap: 18px;
}

.dashboard-page .dashboard-chart-panel,
.dashboard-page .dashboard-transactions-panel {
	background: var(--crudx-surface);
	border: 1px solid var(--crudx-border);
	border-radius: 20px;
	box-shadow: var(--crudx-shadow);
}

.dashboard-page .dashboard-panel-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 14px;
	margin-bottom: 18px;
}

.dashboard-page .dashboard-panel-head h2 {
	margin-bottom: 8px;
}

.dashboard-page .dashboard-period-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.dashboard-page .dashboard-period-pills-header {
	margin-right: 2px;
}

.dashboard-page .dashboard-period-pills a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	padding: 0 14px;
	border-radius: 999px;
	border: 1px solid rgba(59, 130, 246, 0.14);
	background: rgba(8, 18, 38, 0.88);
	color: rgba(191, 219, 254, 0.8);
	text-decoration: none;
	font-size: 13px;
	font-weight: 700;
}

.dashboard-page .dashboard-period-pills a.active {
	background: linear-gradient(135deg, #2563eb, #1d4ed8);
	border-color: rgba(147, 197, 253, 0.35);
	color: #eff6ff;
}

.dashboard-page .dashboard-chart-kpis {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
	margin-bottom: 16px;
}

.dashboard-page .dashboard-chart-kpi {
	padding: 16px;
	border-radius: 16px;
	background: rgba(9, 20, 40, 0.78);
	border: 1px solid rgba(59, 130, 246, 0.12);
}

.dashboard-page .dashboard-chart-kpi-label {
	display: block;
	margin-bottom: 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: rgba(191, 219, 254, 0.72);
}

.dashboard-page .dashboard-chart-kpi-value {
	display: block;
	font-size: 28px;
	font-weight: 800;
	line-height: 1;
	color: #f8fafc;
}

.dashboard-page .dashboard-chart-kpi-note {
	display: block;
	margin-top: 8px;
	font-size: 13px;
	color: rgba(191, 219, 254, 0.76);
}

.dashboard-page .chart-card {
	background: rgba(7, 17, 35, 0.92);
	border: 1px solid rgba(59, 130, 246, 0.12);
	border-radius: 18px;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.dashboard-page .chart-card-header h3,
.dashboard-page .chart-label,
.dashboard-page .section-helper,
.dashboard-page .pagination .disabled {
	color: var(--crudx-muted);
}

.dashboard-page .pagination a {
	border-radius: 12px;
}

.dashboard-page .dashboard-money {
	font-weight: 700;
	color: #f8fafc;
}

@media (max-width: 1100px) {
	.dashboard-page .dashboard-head,
	.dashboard-page .dashboard-panel-head {
		flex-direction: column;
		align-items: stretch;
	}

	.dashboard-page .dashboard-hero-grid,
	.dashboard-page .dashboard-kpi-strip,
	.dashboard-page .dashboard-quick-actions,
	.dashboard-page .dashboard-chart-kpis {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.dashboard-page .dashboard-crudx-layout {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 720px) {
	.dashboard-page .dashboard-hero-grid,
	.dashboard-page .dashboard-kpi-strip,
	.dashboard-page .dashboard-quick-actions,
	.dashboard-page .dashboard-chart-kpis {
		grid-template-columns: 1fr;
	}

	.dashboard-page .dashboard-hero-card,
	.dashboard-page .dashboard-kpi-chip,
	.dashboard-page .dashboard-quick-card {
		padding: 18px;
	}
}

.broadcast-page .settings-container {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr);
	gap: 18px;
	align-items: start;
}

.broadcast-page .promo-search-form.filters-bar {
	margin-top: 14px;
}

.funnels-page .funnels-toolbar {
	background: transparent;
	border: 0;
	padding: 0;
}

.search-page .stats-section {
	margin-bottom: 18px;
}

@media (max-width: 980px) {
	.broadcast-page .settings-container {
		grid-template-columns: 1fr;
	}
}

.dashboard-v2 {
	--dashboard-surface: rgba(8, 15, 31, 0.82);
	--dashboard-border: rgba(116, 141, 187, 0.18);
	--dashboard-text: #e8eefc;
	--dashboard-muted: #92a1c0;
	--dashboard-success: #6ee7b7;
	--dashboard-danger: #fb7185;
}

.dashboard-v2 .dashboard-v2-head,
.dashboard-v2 .dashboard-v2-topline,
.dashboard-v2 .dashboard-v2-kpis,
.dashboard-v2 .dashboard-v2-secondary-grid,
.dashboard-v2 .dashboard-v2-business-grid,
.dashboard-v2 .dashboard-v2-ops-grid,
.dashboard-v2 .dashboard-v2-infra,
.dashboard-v2 .dashboard-v2-charts {
	margin-bottom: 24px;
}

.dashboard-v2 .crudx-panel,
.dashboard-v2 .dashboard-v2-kpi,
.dashboard-v2 .dashboard-host-card {
	background: linear-gradient(180deg, rgba(14, 24, 46, 0.96) 0%, rgba(8, 15, 31, 0.92) 100%);
	border: 1px solid var(--dashboard-border);
	box-shadow: 0 20px 55px rgba(0, 0, 0, 0.2);
}

.dashboard-v2 .dashboard-v2-topline,
.dashboard-v2 .dashboard-v2-secondary-grid,
.dashboard-v2 .dashboard-v2-business-grid,
.dashboard-v2 .dashboard-v2-ops-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

.dashboard-v2 .dashboard-v2-kpis {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 16px;
}

.dashboard-v2 .dashboard-v2-kpi {
	border-radius: 20px;
	padding: 18px;
	min-height: 160px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.dashboard-v2 .dashboard-v2-kpi-head,
.dashboard-v2 .dashboard-host-head,
.dashboard-v2 .dashboard-mini-table-head,
.dashboard-v2 .dashboard-mini-table-row,
.dashboard-v2 .dashboard-referral-summary,
.dashboard-v2 .dashboard-v2-infra-summary,
.dashboard-v2 .dashboard-host-metrics {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.dashboard-v2 .dashboard-v2-kpi-head span:first-child,
.dashboard-v2 .dashboard-v2-stat-label,
.dashboard-v2 .dashboard-referral-metric span,
.dashboard-v2 .dashboard-host-head p,
.dashboard-v2 .dashboard-empty,
.dashboard-v2 .dashboard-mini-table small {
	color: var(--dashboard-muted);
}

.dashboard-v2 .dashboard-v2-kpi-value {
	font-size: clamp(1.8rem, 2vw, 2.5rem);
	line-height: 1;
	font-weight: 700;
	color: var(--dashboard-text);
}

.dashboard-v2 .dashboard-v2-kpi-note,
.dashboard-v2 .dashboard-v2-kpi-sub,
.dashboard-v2 .dashboard-v2-stat-note,
.dashboard-v2 .dashboard-referral-metric strong,
.dashboard-v2 .dashboard-mini-table-row strong {
	color: var(--dashboard-text);
}

.dashboard-v2 .dashboard-v2-kpi-note,
.dashboard-v2 .dashboard-v2-kpi-sub,
.dashboard-v2 .dashboard-v2-stat-note,
.dashboard-v2 .dashboard-empty {
	font-size: 0.92rem;
}

.dashboard-v2 .dashboard-v2-trend {
	display: inline-flex;
	align-items: center;
	padding: 6px 10px;
	border-radius: 999px;
	font-size: 0.82rem;
	font-weight: 700;
}

.dashboard-v2 .dashboard-v2-trend-up {
	background: rgba(110, 231, 183, 0.14);
	color: var(--dashboard-success);
}

.dashboard-v2 .dashboard-v2-trend-down {
	background: rgba(251, 113, 133, 0.14);
	color: var(--dashboard-danger);
}

.dashboard-v2 .dashboard-v2-trend-neutral {
	background: rgba(148, 163, 184, 0.14);
	color: #cbd5e1;
}

.dashboard-v2 .dashboard-alert-list,
.dashboard-v2 .dashboard-action-grid,
.dashboard-v2 .dashboard-v2-secondary-cards,
.dashboard-v2 .dashboard-v2-chart-grid,
.dashboard-v2 .dashboard-v2-host-grid {
	display: grid;
	gap: 14px;
}

.dashboard-v2 .dashboard-action-grid,
.dashboard-v2 .dashboard-v2-secondary-cards,
.dashboard-v2 .dashboard-v2-host-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-v2 .dashboard-v2-chart-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-v2 .dashboard-alert {
	padding: 14px 16px;
	border-radius: 16px;
	border: 1px solid rgba(148, 163, 184, 0.15);
}

.dashboard-v2 .dashboard-alert strong {
	display: block;
	margin-bottom: 4px;
}

.dashboard-v2 .dashboard-alert p {
	margin: 0;
	color: var(--dashboard-muted);
}

.dashboard-v2 .dashboard-alert-danger { background: rgba(127, 29, 29, 0.24); }
.dashboard-v2 .dashboard-alert-warn { background: rgba(120, 53, 15, 0.24); }
.dashboard-v2 .dashboard-alert-info { background: rgba(8, 47, 73, 0.24); }
.dashboard-v2 .dashboard-alert-ok { background: rgba(6, 78, 59, 0.24); }

.dashboard-v2 .dashboard-action-card {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	border-radius: 16px;
	text-decoration: none;
	color: var(--dashboard-text);
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(116, 141, 187, 0.14);
	transition: transform 0.18s ease, border-color 0.18s ease;
}

.dashboard-v2 .dashboard-action-card:hover {
	transform: translateY(-2px);
	border-color: rgba(103, 232, 249, 0.35);
}

.dashboard-v2 .dashboard-v2-stat-card,
.dashboard-v2 .dashboard-referral-stage {
	padding: 16px;
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(116, 141, 187, 0.12);
}

.dashboard-v2 .dashboard-v2-stat-value,
.dashboard-v2 .dashboard-referral-metric strong,
.dashboard-v2 .dashboard-referral-stage strong {
	display: block;
	font-size: 1.25rem;
	font-weight: 700;
	margin-top: 6px;
}

.dashboard-v2 .dashboard-referral-funnel {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin: 16px 0;
}

.dashboard-v2 .dashboard-mini-table {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.dashboard-v2 .dashboard-mini-table-head {
	padding-bottom: 8px;
	border-bottom: 1px solid rgba(116, 141, 187, 0.12);
	font-size: 0.82rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--dashboard-muted);
}

.dashboard-v2 .dashboard-mini-table-row {
	padding: 10px 0;
	border-bottom: 1px solid rgba(116, 141, 187, 0.08);
}

.dashboard-v2 .dashboard-v2-infra-summary {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
	margin-bottom: 18px;
}

.dashboard-v2 .dashboard-host-card {
	border-radius: 18px;
	padding: 16px;
}

.dashboard-v2 .dashboard-host-head h3,
.dashboard-v2 .chart-card h3 {
	margin: 0;
}

.dashboard-v2 .dashboard-host-metrics {
	flex-wrap: wrap;
	justify-content: flex-start;
	margin: 14px 0;
	color: var(--dashboard-muted);
}

.dashboard-v2 .dashboard-host-metrics strong {
	color: var(--dashboard-text);
}

.dashboard-v2 .dashboard-host-progress {
	height: 8px;
	border-radius: 999px;
	overflow: hidden;
	background: rgba(148, 163, 184, 0.1);
}

.dashboard-v2 .dashboard-host-progress span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, #60a5fa 0%, #67e8f9 100%);
}

.dashboard-v2 .chart-card-body {
	min-height: 260px;
}

@media (max-width: 1440px) {
	.dashboard-v2 .dashboard-v2-kpis {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 1100px) {
	.dashboard-v2 .dashboard-v2-topline,
	.dashboard-v2 .dashboard-v2-secondary-grid,
	.dashboard-v2 .dashboard-v2-business-grid,
	.dashboard-v2 .dashboard-v2-ops-grid,
	.dashboard-v2 .dashboard-v2-chart-grid,
	.dashboard-v2 .dashboard-v2-host-grid,
	.dashboard-v2 .dashboard-v2-secondary-cards,
	.dashboard-v2 .dashboard-action-grid,
	.dashboard-v2 .dashboard-v2-infra-summary {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 900px) {
	.dashboard-v2 .dashboard-v2-kpis,
	.dashboard-v2 .dashboard-referral-funnel {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.dashboard-v2 .dashboard-v2-kpis,
	.dashboard-v2 .dashboard-referral-funnel {
		grid-template-columns: 1fr;
	}

	.dashboard-v2 .dashboard-v2-kpi {
		min-height: unset;
	}
}

.dashboard-v2 .dashboard-v2-firstscreen,
.dashboard-v2 .dashboard-v2-hero-kpis,
.dashboard-v2 .dashboard-v2-support-kpis {
	display: grid;
	gap: 20px;
	margin-bottom: 24px;
}

.dashboard-v2 .dashboard-v2-firstscreen,
.dashboard-v2 .dashboard-v2-topline {
	grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.95fr);
}

.dashboard-v2 .dashboard-v2-hero-kpis {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-v2 .dashboard-v2-support-kpis {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-v2 .dashboard-v2-kpi-hero {
	min-height: 190px;
	padding: 22px;
}

.dashboard-v2 .dashboard-v2-kpi-support {
	min-height: 146px;
	background: rgba(255, 255, 255, 0.03);
}

.dashboard-v2 .dashboard-v2-kpi-revenue {
	background: linear-gradient(160deg, rgba(17, 46, 78, 0.95) 0%, rgba(8, 15, 31, 0.96) 100%);
}

.dashboard-v2 .dashboard-v2-kpi-paid {
	background: linear-gradient(160deg, rgba(10, 62, 58, 0.95) 0%, rgba(8, 15, 31, 0.96) 100%);
}

.dashboard-v2 .dashboard-v2-kpi-conversion {
	background: linear-gradient(160deg, rgba(75, 52, 16, 0.95) 0%, rgba(8, 15, 31, 0.96) 100%);
}

.dashboard-v2 .dashboard-summary-grid,
.dashboard-v2 .dashboard-today-grid,
.dashboard-v2 .dashboard-ops-stack {
	display: grid;
	gap: 14px;
}

.dashboard-v2 .dashboard-summary-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-v2 .dashboard-summary-block,
.dashboard-v2 .dashboard-action-group {
	padding: 16px;
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(116, 141, 187, 0.12);
}

.dashboard-v2 .dashboard-summary-title,
.dashboard-v2 .dashboard-action-group-title {
	display: block;
	margin-bottom: 12px;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #9fb2d7;
}

.dashboard-v2 .dashboard-bullet-list {
	margin: 0;
	padding-left: 18px;
	color: var(--dashboard-text);
	display: grid;
	gap: 10px;
}

.dashboard-v2 .dashboard-alert-top {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.dashboard-v2 .dashboard-alert-badge {
	padding: 4px 9px;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	background: rgba(255, 255, 255, 0.08);
	color: #e2e8f0;
}

.dashboard-v2 .dashboard-alert-critical { background: rgba(127, 29, 29, 0.26); }
.dashboard-v2 .dashboard-alert-warning { background: rgba(120, 53, 15, 0.26); }
.dashboard-v2 .dashboard-alert-opportunity { background: rgba(6, 78, 59, 0.24); }
.dashboard-v2 .dashboard-alert-stable { background: rgba(8, 47, 73, 0.22); }

.dashboard-v2 .dashboard-alert-cta,
.dashboard-v2 .dashboard-host-link {
	display: inline-flex;
	margin-top: 10px;
	color: #d8e6ff;
	text-decoration: none;
	font-weight: 600;
}

.dashboard-v2 .dashboard-today-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-v2 .dashboard-today-card {
	padding: 16px;
	border-radius: 18px;
	text-decoration: none;
	color: var(--dashboard-text);
	border: 1px solid rgba(116, 141, 187, 0.12);
	background: rgba(255, 255, 255, 0.03);
	transition: transform 0.18s ease, border-color 0.18s ease;
}

.dashboard-v2 .dashboard-today-card:hover,
.dashboard-v2 .dashboard-mini-link:hover,
.dashboard-v2 .dashboard-interactive-table tbody tr:hover {
	transform: translateY(-2px);
}

.dashboard-v2 .dashboard-today-card-critical { border-color: rgba(251, 113, 133, 0.28); }
.dashboard-v2 .dashboard-today-card-warning { border-color: rgba(251, 191, 36, 0.28); }
.dashboard-v2 .dashboard-today-card-opportunity { border-color: rgba(110, 231, 183, 0.28); }

.dashboard-v2 .dashboard-today-count {
	font-size: 1.8rem;
	font-weight: 800;
	margin-bottom: 8px;
}

.dashboard-v2 .dashboard-action-card-secondary {
	opacity: 0.92;
}

.dashboard-v2 .dashboard-referrer-head {
	grid-template-columns: minmax(0, 1fr) auto;
}

.dashboard-v2 .dashboard-health-pill {
	display: inline-flex;
	align-items: center;
	padding: 6px 10px;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 700;
}

.dashboard-v2 .dashboard-health-pill-good {
	background: rgba(110, 231, 183, 0.14);
	color: #6ee7b7;
}

.dashboard-v2 .dashboard-health-pill-warning {
	background: rgba(251, 191, 36, 0.14);
	color: #fbbf24;
}

.dashboard-v2 .dashboard-health-pill-critical {
	background: rgba(251, 113, 133, 0.14);
	color: #fb7185;
}

.dashboard-v2 .dashboard-host-progress-warning span {
	background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
}

.dashboard-v2 .dashboard-host-progress-critical span {
	background: linear-gradient(90deg, #fb7185 0%, #ef4444 100%);
}

.dashboard-v2 .dashboard-chart-empty {
	display: none;
	margin: 0;
	color: var(--dashboard-muted);
	font-size: 0.92rem;
}

.dashboard-v2 .dashboard-mini-link {
	text-decoration: none;
	color: inherit;
}

.dashboard-v2 .dashboard-interactive-table tbody tr {
	cursor: pointer;
	transition: background-color 0.18s ease, transform 0.18s ease;
}

.dashboard-v2 .dashboard-interactive-table tbody tr:hover {
	background: rgba(255, 255, 255, 0.03);
}

@media (max-width: 1366px) {
	.dashboard-v2 .dashboard-v2-firstscreen,
	.dashboard-v2 .dashboard-v2-topline {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 1100px) {
	.dashboard-v2 .dashboard-v2-hero-kpis,
	.dashboard-v2 .dashboard-v2-support-kpis,
	.dashboard-v2 .dashboard-today-grid,
	.dashboard-v2 .dashboard-summary-grid {
		grid-template-columns: 1fr;
	}
}

.dashboard-v2 {
	--space-xs: 8px;
	--space-sm: 12px;
	--space-md: 16px;
	--space-lg: 24px;
	--dashboard-section-gap: 14px;
	--dashboard-panel-padding: 14px;
	--dashboard-card-padding: 12px;
	--dashboard-tight-gap: 12px;
	--dashboard-grid-gap: 16px;
}

.dashboard-v2 .dashboard-v2-head,
.dashboard-v2 .dashboard-v2-firstscreen,
.dashboard-v2 .dashboard-v2-hero-kpis,
.dashboard-v2 .dashboard-v2-support-kpis,
.dashboard-v2 .dashboard-v2-secondary-grid,
.dashboard-v2 .dashboard-v2-business-grid,
.dashboard-v2 .dashboard-v2-ops-grid,
.dashboard-v2 .dashboard-v2-infra,
.dashboard-v2 .dashboard-v2-charts {
	margin-bottom: var(--dashboard-section-gap);
}

.dashboard-v2 .crudx-panel,
.dashboard-v2 .dashboard-v2-kpi,
.dashboard-v2 .dashboard-host-card,
.dashboard-v2 .chart-card {
	border-radius: 18px;
}

.dashboard-v2 .crudx-panel,
.dashboard-v2 .chart-card {
	padding: var(--dashboard-panel-padding);
}

.dashboard-v2 .dashboard-panel-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--space-sm);
	margin-bottom: var(--space-sm);
}

.dashboard-v2 .dashboard-panel-head h2 {
	margin: 0;
	font-size: 1.02rem;
	letter-spacing: 0.01em;
}

.dashboard-v2 .dashboard-panel-head .section-helper {
	margin: 4px 0 0;
	max-width: 64ch;
	font-size: 0.87rem;
	line-height: 1.45;
}

.dashboard-v2 .dashboard-panel-head-meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: var(--space-xs);
}

.dashboard-v2 .dashboard-meta-pill {
	display: inline-flex;
	align-items: center;
	padding: 6px 10px;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--dashboard-text);
	background: rgba(96, 165, 250, 0.12);
	border: 1px solid rgba(96, 165, 250, 0.18);
}

.dashboard-v2 .dashboard-meta-pill-muted {
	background: rgba(148, 163, 184, 0.1);
	border-color: rgba(148, 163, 184, 0.14);
	color: var(--dashboard-muted);
}

.dashboard-v2 .dashboard-v2-firstscreen,
.dashboard-v2 .dashboard-v2-hero-kpis,
.dashboard-v2 .dashboard-v2-support-kpis,
.dashboard-v2 .dashboard-v2-secondary-grid,
.dashboard-v2 .dashboard-v2-business-grid,
.dashboard-v2 .dashboard-v2-ops-grid,
.dashboard-v2 .dashboard-v2-charts,
.dashboard-v2 .dashboard-v2-infra-summary,
.dashboard-v2 .dashboard-v2-host-grid {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: var(--dashboard-grid-gap);
	align-items: start;
}

.dashboard-v2 .dashboard-v2-business-grid,
.dashboard-v2 .dashboard-v2-ops-grid {
	grid-auto-rows: minmax(0, auto);
}

.dashboard-v2 .dashboard-pack-grid {
	grid-auto-flow: dense;
}

.dashboard-v2 .dashboard-pack-grid.is-packed {
	grid-auto-rows: 8px;
}

.dashboard-v2 .dashboard-pack-grid.is-packed > * {
	grid-row-end: span var(--row-span, 1);
}

.dashboard-v2 .dashboard-v2-secondary-grid,
.dashboard-v2 .dashboard-v2-chart-grid,
.dashboard-v2 .dashboard-v2-business-grid,
.dashboard-v2 .dashboard-v2-ops-grid {
	align-items: start !important;
}

.dashboard-v2 .dashboard-v2-secondary-grid > .crudx-panel,
.dashboard-v2 .dashboard-v2-chart-grid > .chart-card,
.dashboard-v2 .dashboard-v2-business-grid > .dashboard-business-panel,
.dashboard-v2 .dashboard-v2-ops-grid > .crudx-panel {
	align-self: start !important;
	height: auto !important;
	min-height: 0 !important;
}

.dashboard-v2 .dashboard-summary-panel {
	grid-column: span 12;
	align-self: start;
}

.dashboard-v2 .dashboard-firstscreen-side {
	grid-column: span 12;
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 10px;
	align-content: start;
	align-self: start;
}

.dashboard-v2 .dashboard-firstscreen-side > .dashboard-alerts-panel,
.dashboard-v2 .dashboard-firstscreen-side > .dashboard-today-panel {
	grid-column: span 6;
}

.dashboard-v2 .dashboard-summary-panel,
.dashboard-v2 .dashboard-alerts-panel,
.dashboard-v2 .dashboard-today-panel {
	min-height: 0;
}

.dashboard-v2 .dashboard-summary-panel {
	background: linear-gradient(180deg, rgba(16, 28, 54, 0.98) 0%, rgba(9, 16, 32, 0.96) 100%);
}

.dashboard-v2 .dashboard-alerts-panel {
	background: linear-gradient(180deg, rgba(12, 21, 39, 0.97) 0%, rgba(8, 15, 31, 0.93) 100%);
}

.dashboard-v2 .dashboard-today-panel {
	background: linear-gradient(180deg, rgba(10, 20, 37, 0.96) 0%, rgba(8, 15, 31, 0.92) 100%);
}

.dashboard-v2 .dashboard-summary-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-sm);
	align-content: start;
}

.dashboard-v2 .dashboard-summary-block,
.dashboard-v2 .dashboard-v2-stat-card,
.dashboard-v2 .dashboard-referral-stage {
	padding: var(--dashboard-card-padding);
	border-radius: 16px;
}

.dashboard-v2 .dashboard-summary-title {
	margin-bottom: 10px;
	font-size: 0.76rem;
	letter-spacing: 0.08em;
}

.dashboard-v2 .dashboard-bullet-list {
	gap: var(--space-xs);
	font-size: 0.9rem;
	line-height: 1.4;
}

.dashboard-v2 .dashboard-alert-list,
.dashboard-v2 .dashboard-action-list {
	display: grid;
	gap: var(--space-xs);
	align-content: start;
}

.dashboard-v2 .dashboard-alert {
	padding: 10px 12px;
	border-radius: 14px;
}

.dashboard-v2 .dashboard-alert-top {
	margin-bottom: 6px;
}

.dashboard-v2 .dashboard-alert strong {
	font-size: 0.94rem;
}

.dashboard-v2 .dashboard-alert p {
	font-size: 0.88rem;
	line-height: 1.42;
}

.dashboard-v2 .dashboard-alert-cta,
.dashboard-v2 .dashboard-host-link {
	margin-top: 8px;
	font-size: 0.86rem;
}

.dashboard-v2 .dashboard-action-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 14px;
	text-decoration: none;
	color: var(--dashboard-text);
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(116, 141, 187, 0.14);
	transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.dashboard-v2 .dashboard-action-row:hover {
	transform: translateY(-2px);
	border-color: rgba(103, 232, 249, 0.26);
	background: rgba(255, 255, 255, 0.04);
}

.dashboard-v2 .dashboard-action-row-main {
	min-width: 0;
	flex: 1;
}

.dashboard-v2 .dashboard-action-row-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.dashboard-v2 .dashboard-action-row-main strong {
	display: block;
	font-size: 0.92rem;
}

.dashboard-v2 .dashboard-action-row-main p {
	margin: 4px 0 0;
	font-size: 0.82rem;
	line-height: 1.34;
	color: var(--dashboard-muted);
}

.dashboard-v2 .dashboard-action-row-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 26px;
	padding: 0 8px;
	border-radius: 999px;
	background: rgba(148, 163, 184, 0.12);
	color: var(--dashboard-text);
	font-size: 0.78rem;
	font-weight: 800;
}

.dashboard-v2 .dashboard-action-row-cta {
	font-size: 0.8rem;
	font-weight: 700;
	color: #d8e6ff;
	white-space: nowrap;
}

.dashboard-v2 .dashboard-action-row-critical { border-color: rgba(251, 113, 133, 0.22); }
.dashboard-v2 .dashboard-action-row-warning { border-color: rgba(251, 191, 36, 0.2); }
.dashboard-v2 .dashboard-action-row-opportunity { border-color: rgba(110, 231, 183, 0.2); }

.dashboard-v2 .dashboard-v2-hero-kpis > *:first-child {
	grid-column: span 6;
}

.dashboard-v2 .dashboard-v2-hero-kpis > *:not(:first-child) {
	grid-column: span 3;
}

.dashboard-v2 .dashboard-v2-support-kpis > * {
	grid-column: span 4;
}

.dashboard-v2 .dashboard-v2-kpi {
	padding: 14px;
	min-height: 0;
}

.dashboard-v2 .dashboard-v2-kpi-hero {
	min-height: 0;
	padding: 12px;
}

.dashboard-v2 .dashboard-v2-kpi-support {
	min-height: 0;
}

.dashboard-v2 .dashboard-v2-kpi-head {
	align-items: flex-start;
}

.dashboard-v2 .dashboard-v2-kpi-head span:first-child {
	font-size: 0.84rem;
	line-height: 1.35;
}

.dashboard-v2 .dashboard-v2-kpi-value {
	font-size: clamp(1.7rem, 1.9vw, 2.35rem);
}

.dashboard-v2 .dashboard-v2-kpi-note,
.dashboard-v2 .dashboard-v2-kpi-sub,
.dashboard-v2 .dashboard-v2-stat-note,
.dashboard-v2 .dashboard-empty {
	font-size: 0.86rem;
	line-height: 1.42;
}

.dashboard-v2 .dashboard-v2-kpi-note {
	margin: 6px 0 0;
}

.dashboard-v2 .dashboard-v2-kpi-sub {
	margin: 4px 0 0;
	color: var(--dashboard-muted);
}

.dashboard-v2 .dashboard-v2-secondary-grid > * {
	grid-column: span 6;
}

.dashboard-v2 .dashboard-analytics-panel {
	grid-column: span 7;
	align-self: start;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.dashboard-v2 .dashboard-referral-panel {
	grid-column: span 5;
	align-self: start;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.dashboard-v2 .dashboard-v2-secondary-cards {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	align-content: start;
}

.dashboard-v2 .dashboard-v2-stat-value {
	margin-top: 2px;
	font-size: 1.06rem;
}

.dashboard-v2 .dashboard-v2-stat-stack {
	display: grid;
	gap: 8px;
}

.dashboard-v2 .dashboard-v2-stat-line + .dashboard-v2-stat-line {
	padding-top: 8px;
	border-top: 1px solid rgba(116, 141, 187, 0.12);
}

.dashboard-v2 .dashboard-referral-summary {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin-bottom: 10px;
	align-content: start;
}

.dashboard-v2 .dashboard-referral-metric {
	padding: 12px 14px;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(116, 141, 187, 0.12);
}

.dashboard-v2 .dashboard-referral-metric strong {
	margin-top: 4px;
	font-size: 1.08rem;
}

.dashboard-v2 .dashboard-referral-funnel {
	margin: 0 0 10px;
	gap: 8px;
	align-content: start;
}

.dashboard-v2 .dashboard-referral-stage strong {
	margin-top: 4px;
	font-size: 1.02rem;
}

.dashboard-v2 .dashboard-business-panel,
.dashboard-v2 .chart-card {
	grid-column: span 6;
	width: 100%;
	min-width: 0;
}

.dashboard-v2 .dashboard-mini-table {
	gap: 2px;
	align-content: start;
}

.dashboard-v2 .dashboard-mini-table-head {
	padding-bottom: 6px;
	font-size: 0.75rem;
}

.dashboard-v2 .dashboard-mini-table-row {
	padding: 5px 0;
}

.dashboard-v2 .dashboard-mini-table-row strong {
	font-size: 0.9rem;
}

.dashboard-v2 .dashboard-v2-charts .dashboard-panel-head {
	margin-bottom: 12px;
}

.dashboard-v2 .dashboard-v2-chart-grid {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 10px;
	align-content: start;
	grid-auto-rows: minmax(0, auto);
}

.dashboard-v2 .dashboard-v2-charts > *,
.dashboard-v2 .dashboard-v2-infra > * {
	grid-column: 1 / -1;
}

.dashboard-v2 .dashboard-v2-chart-grid > * {
	grid-column: span 6;
}

.dashboard-v2 .chart-card {
	padding: 10px;
	background: rgba(255, 255, 255, 0.025);
	border: 1px solid rgba(116, 141, 187, 0.12);
	display: flex;
	flex-direction: column;
	min-width: 0;
	align-self: start;
}

.dashboard-v2 .chart-card-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 8px;
}

.dashboard-v2 .chart-card-header h3 {
	font-size: 0.96rem;
}

.dashboard-v2 .chart-label {
	font-size: 0.74rem;
	color: var(--dashboard-muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.dashboard-v2 .chart-card-body {
	position: relative;
	width: 100%;
	min-height: 140px;
	height: clamp(140px, 16vw, 178px);
	overflow: hidden;
}

.dashboard-v2 .chart-card-body.is-empty {
	min-height: 108px;
	height: auto;
	display: flex;
	align-items: center;
}

.dashboard-v2 .chart-card-body.is-empty .dashboard-chart-empty {
	margin: 0;
}

.dashboard-v2 .chart-card canvas {
	display: block;
	width: 100% !important;
	max-width: none !important;
}

.dashboard-v2 .chart-card-body canvas {
	height: 100% !important;
}

.dashboard-v2 .dashboard-referral-panel .dashboard-mini-table {
	max-height: none;
	overflow: visible;
	padding-right: 0;
}

.dashboard-v2 .dashboard-v2-infra-summary > * {
	grid-column: span 3;
}

.dashboard-v2 .dashboard-v2-host-grid > * {
	grid-column: span 6;
}

.dashboard-v2 .dashboard-host-card {
	padding: 12px;
}

.dashboard-v2 .dashboard-host-metrics {
	margin: 8px 0 10px;
	gap: 8px;
	font-size: 0.84rem;
}

.dashboard-v2 .dashboard-host-progress {
	height: 7px;
}

.dashboard-v2 .dashboard-v2-ops-grid > * {
	grid-column: span 6;
}

.dashboard-v2 .dashboard-transactions-panel {
	grid-column: span 8;
}

.dashboard-v2 .dashboard-ops-stack {
	display: grid;
	gap: 10px;
	align-content: start;
}

.dashboard-v2 .dashboard-ops-stack .dashboard-ops-group {
	position: relative;
	padding: 10px 12px;
	border-radius: 14px;
	border: 1px solid rgba(115, 140, 186, 0.2);
	background: linear-gradient(180deg, rgba(14, 25, 45, 0.9) 0%, rgba(10, 19, 35, 0.88) 100%);
}

.dashboard-v2 .dashboard-ops-stack .dashboard-ops-group::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 3px;
	border-radius: 14px 0 0 14px;
	background: rgba(96, 165, 250, 0.55);
}

.dashboard-v2 .dashboard-ops-stack .dashboard-mini-table-head {
	padding-bottom: 8px;
	border-bottom: 1px solid rgba(115, 140, 186, 0.18);
}

.dashboard-v2 .dashboard-ops-kicker {
	display: block;
	margin-bottom: 3px;
	font-size: 0.67rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--dashboard-muted);
}

.dashboard-v2 .dashboard-ops-group .dashboard-mini-table-row {
	padding: 7px 0;
}

.dashboard-v2 .dashboard-ops-group .dashboard-mini-table-row + .dashboard-mini-table-row {
	border-top: 1px solid rgba(115, 140, 186, 0.12);
}

.dashboard-v2 .dashboard-ops-group-onboarding::before {
	background: rgba(110, 231, 183, 0.65);
}

.dashboard-v2 .dashboard-ops-group-keys::before {
	background: rgba(125, 211, 252, 0.65);
}

.dashboard-v2 .dashboard-ops-group-expiring::before {
	background: rgba(251, 191, 36, 0.72);
}

.dashboard-v2 .dashboard-ops-group-problems::before {
	background: rgba(251, 113, 133, 0.72);
}

.dashboard-v2 .dashboard-v2-ops-grid > :not(.dashboard-transactions-panel) {
	grid-column: span 4;
}

.dashboard-v2 .dashboard-compact-wrap {
	margin-top: 4px;
	align-content: start;
}

.dashboard-v2 .dashboard-compact-table th,
.dashboard-v2 .dashboard-compact-table td {
	padding-top: 6px;
	padding-bottom: 6px;
	line-height: 1.3;
}

.dashboard-v2 .dashboard-action-list {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1600px) {
	.dashboard-v2 .dashboard-summary-panel {
		grid-column: span 12;
	}

	.dashboard-v2 .dashboard-firstscreen-side {
		grid-column: span 12;
	}

	.dashboard-v2 .dashboard-analytics-panel,
	.dashboard-v2 .dashboard-referral-panel {
		grid-column: span 6;
	}
}

@media (max-width: 1366px) {
	.dashboard-v2 .dashboard-firstscreen-side > .dashboard-alerts-panel,
	.dashboard-v2 .dashboard-firstscreen-side > .dashboard-today-panel {
		grid-column: span 12;
	}

	.dashboard-v2 .dashboard-v2-firstscreen > *,
	.dashboard-v2 .dashboard-v2-secondary-grid > *,
	.dashboard-v2 .dashboard-v2-ops-grid > *,
	.dashboard-v2 .dashboard-v2-infra-summary > *,
	.dashboard-v2 .dashboard-v2-host-grid > * {
		grid-column: span 12;
	}

	.dashboard-v2 .dashboard-v2-hero-kpis > *:first-child,
	.dashboard-v2 .dashboard-v2-hero-kpis > *:not(:first-child),
	.dashboard-v2 .dashboard-v2-support-kpis > *,
	.dashboard-v2 .dashboard-v2-chart-grid > *,
	.dashboard-v2 .dashboard-business-panel {
		grid-column: span 6;
	}

	.dashboard-v2 .dashboard-action-list {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 1100px) {
	.dashboard-v2 .dashboard-pack-grid {
		grid-auto-flow: row;
	}

	.dashboard-v2 .dashboard-pack-grid.is-packed {
		grid-auto-rows: auto;
	}

	.dashboard-v2 .dashboard-pack-grid.is-packed > * {
		grid-row-end: auto;
	}

	.dashboard-v2 .dashboard-v2-hero-kpis > *,
	.dashboard-v2 .dashboard-v2-support-kpis > *,
	.dashboard-v2 .dashboard-v2-chart-grid > *,
	.dashboard-v2 .dashboard-business-panel,
	.dashboard-v2 .dashboard-v2-secondary-cards > *,
	.dashboard-v2 .dashboard-referral-funnel > * {
		grid-column: span 12;
	}

	.dashboard-v2 .dashboard-summary-grid,
	.dashboard-v2 .dashboard-referral-summary {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 800px) {
	.dashboard-v2 {
		--dashboard-section-gap: 14px;
		--dashboard-panel-padding: 15px;
		--dashboard-card-padding: 12px;
	}

	.dashboard-v2 .dashboard-v2-infra-summary,
	.dashboard-v2 .dashboard-v2-host-grid,
	.dashboard-v2 .dashboard-v2-hero-kpis,
	.dashboard-v2 .dashboard-v2-support-kpis,
	.dashboard-v2 .dashboard-v2-secondary-grid,
	.dashboard-v2 .dashboard-v2-business-grid,
	.dashboard-v2 .dashboard-v2-ops-grid,
	.dashboard-v2 .dashboard-v2-chart-grid,
	.dashboard-v2 .dashboard-v2-firstscreen {
		grid-template-columns: 1fr;
	}

	.dashboard-v2 .dashboard-v2-firstscreen > *,
	.dashboard-v2 .dashboard-firstscreen-side,
	.dashboard-v2 .dashboard-v2-hero-kpis > *,
	.dashboard-v2 .dashboard-v2-support-kpis > *,
	.dashboard-v2 .dashboard-v2-secondary-grid > *,
	.dashboard-v2 .dashboard-business-panel,
	.dashboard-v2 .dashboard-v2-chart-grid > *,
	.dashboard-v2 .dashboard-v2-infra-summary > *,
	.dashboard-v2 .dashboard-v2-host-grid > *,
	.dashboard-v2 .dashboard-v2-ops-grid > * {
		grid-column: auto;
	}

	.dashboard-v2 .dashboard-panel-head {
		flex-direction: column;
	}

	.dashboard-v2 .dashboard-panel-head-meta {
		justify-content: flex-start;
	}

	.dashboard-v2 .dashboard-action-row {
		align-items: flex-start;
		flex-direction: column;
	}
}

/* === Funnels Compact Tuning === */
.funnels-page {
	--funnel-surface: rgba(9, 18, 36, 0.88);
	--funnel-surface-soft: rgba(15, 30, 56, 0.78);
	--funnel-border: rgba(118, 151, 211, 0.24);
	--funnel-text: #e7efff;
	--funnel-muted: #9cb0d8;
	--funnel-accent: #4f8cff;
	--funnel-accent-soft: rgba(79, 140, 255, 0.2);
	--funnel-shadow: 0 14px 34px rgba(2, 8, 20, 0.38);
	max-width: 1360px;
	padding: 4px 24px 44px;
	gap: 16px;
}

.funnels-page .page-header h1,
.funnels-page h2 {
	color: var(--funnel-text);
}

.funnels-page .page-subtitle,
.funnels-page .funnels-summary {
	color: var(--funnel-muted);
}

.funnels-page .stats-section,
.funnels-page .settings-section {
	margin-bottom: 14px;
}

.funnels-page .crudx-panel {
	background: linear-gradient(180deg, rgba(14, 26, 50, 0.88) 0%, rgba(8, 16, 34, 0.86) 100%);
	border: 1px solid var(--funnel-border);
	border-radius: 16px;
	box-shadow: var(--funnel-shadow);
}

.funnels-page .funnels-toolbar {
	gap: 10px 14px;
	padding: 10px 12px;
	border: 1px solid var(--funnel-border);
	border-radius: 14px;
	background: linear-gradient(120deg, rgba(20, 38, 69, 0.88) 0%, rgba(11, 24, 48, 0.92) 100%);
	box-shadow: inset 0 0 0 1px rgba(123, 160, 226, 0.1);
}

.funnels-page .funnels-tabs {
	gap: 8px;
}

.funnels-page .funnels-periods {
	gap: 6px;
}

.funnels-page .funnels-range {
	gap: 8px;
}

.funnels-page .funnels-range .control {
	padding: 6px 8px;
	min-height: auto;
}

.funnels-page .funnels-range .control label {
	font-size: 11px;
	margin-bottom: 4px;
}

.funnels-page .funnels-tabs .button,
.funnels-page .funnels-periods .button,
.funnels-page .funnels-range .button {
	height: 34px;
	min-height: 34px;
	padding: 0 12px;
	font-size: 12px;
	border-radius: 999px;
	border: 1px solid var(--funnel-border);
	background: rgba(11, 22, 42, 0.9);
	color: #cddcff;
}

.funnels-page .funnels-tabs .button.button-primary,
.funnels-page .funnels-periods .button.button-primary {
	border-color: rgba(112, 156, 239, 0.62);
	background: linear-gradient(180deg, rgba(71, 130, 234, 0.36) 0%, rgba(47, 98, 190, 0.28) 100%);
	color: #f3f8ff;
	box-shadow: 0 0 0 1px rgba(120, 166, 244, 0.34) inset;
}

.funnels-page .funnels-tabs .button:hover,
.funnels-page .funnels-periods .button:hover,
.funnels-page .funnels-range .button:hover {
	border-color: rgba(128, 170, 246, 0.56);
	background: rgba(20, 42, 76, 0.95);
	color: #e6f0ff;
}

.funnels-page .funnels-range .control input {
	height: 34px;
	min-height: 34px;
	padding: 0 10px;
	font-size: 13px;
	color: var(--funnel-text);
	background: rgba(7, 16, 32, 0.9);
	border-color: rgba(120, 154, 210, 0.35);
	border-radius: 10px;
}

.funnels-page .funnels-range .control input:focus {
	border-color: rgba(121, 167, 247, 0.75);
	box-shadow: 0 0 0 3px var(--funnel-accent-soft);
}

.funnels-page .stats-grid {
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 10px;
}

.funnels-page .stat-card {
	min-height: 112px;
	padding: 12px 14px;
	border-radius: 14px;
	border: 1px solid var(--funnel-border);
	background: linear-gradient(160deg, rgba(20, 38, 70, 0.8) 0%, rgba(10, 21, 41, 0.88) 100%);
	box-shadow: 0 8px 22px rgba(2, 9, 23, 0.35);
}

.funnels-page .stat-card h3 {
	font-size: 12px;
	margin-bottom: 4px;
	color: #afc2e8;
}

.funnels-page .stat-card .stat-number {
	margin: 2px 0 4px;
	font-size: clamp(1.4rem, 1.8vw, 1.9rem);
	line-height: 1.1;
	color: #f3f8ff;
	letter-spacing: 0.01em;
}

.funnels-page .stat-card .stat-helper {
	font-size: 12px;
	color: var(--funnel-muted);
}

.funnels-page .table-wrapper {
	border-radius: 12px;
	border: 1px solid var(--funnel-border);
	background: var(--funnel-surface);
	box-shadow: var(--funnel-shadow);
	overflow: auto;
}

.funnels-page .users-table th {
	padding: 9px 10px;
	font-size: 11px;
	background: rgba(16, 33, 62, 0.95);
	color: #abc0e6;
	border-bottom: 1px solid var(--funnel-border);
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

.funnels-page .users-table td {
	padding: 8px 10px;
	font-size: 13px;
	line-height: 1.3;
	color: #deebff;
	border-bottom: 1px solid rgba(120, 152, 206, 0.16);
}

.funnels-page .users-table td small {
	font-size: 11px;
	color: var(--funnel-muted);
}

.funnels-page .users-table tbody tr:nth-child(even) td {
	background: rgba(13, 27, 50, 0.56);
}

.funnels-page .users-table tbody tr:hover td {
	background: rgba(28, 54, 94, 0.82);
}

.funnels-page .funnels-texts {
	grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
	gap: 10px;
}

.funnels-page .funnels-texts-group {
	grid-column: 1 / -1;
}

.funnels-page .glossary-item.funnel-text-item {
	padding: 10px;
	border-radius: 10px;
	border-style: solid;
	border-color: rgba(121, 154, 212, 0.3);
	background: var(--funnel-surface-soft);
}

.funnels-page .glossary-desc,
.funnels-page .glossary-text,
.funnels-page .glossary-buttons {
	font-size: 12px;
	color: var(--funnel-muted);
}

.funnels-page .glossary-code {
	color: #8eb6ff;
}

.funnels-page .funnel-text-form textarea {
	min-height: 96px;
	background: rgba(8, 18, 35, 0.9);
	color: var(--funnel-text);
	border-color: rgba(120, 154, 210, 0.4);
	border-radius: 10px;
}

@media (max-width: 900px) {
	.funnels-page {
		padding: 4px 16px 40px;
	}

	.funnels-page .funnels-texts {
		grid-template-columns: 1fr;
	}
}

/* === Funnels Readability Upgrade === */
.funnels-page .funnels-toolbar {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 10px;
	align-items: center;
	width: 100%;
}

.funnels-page .funnels-tabs {
	grid-column: 1 / span 7;
	display: flex;
	flex-wrap: wrap;
}

.funnels-page .funnels-periods {
	grid-column: 8 / span 5;
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.funnels-page .funnels-range {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	align-items: end;
}

.funnels-page .funnels-range .control {
	grid-column: span 4;
}

.funnels-page .funnels-range .button {
	grid-column: span 4;
	justify-self: end;
	min-width: 132px;
}

.funnels-page .funnels-kpi-grid {
	display: grid;
	gap: 10px;
}

.funnels-page .funnels-kpi-grid-trial {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

.funnels-page .funnels-kpi-grid-campaigns {
	grid-template-columns: repeat(6, minmax(0, 1fr));
}

.funnels-page .funnels-kpi-grid-campaigns .stat-card:last-child {
	grid-column: span 2;
}

.funnels-page .funnels-kpi-grid-secondary {
	grid-template-columns: repeat(6, minmax(0, 1fr));
}

.funnels-page .table-wrapper {
	overflow: auto;
}

.funnels-page .users-table {
	min-width: 980px;
}

.funnels-page .users-table thead th {
	position: sticky;
	top: 0;
	z-index: 2;
}

.funnels-page .users-table thead th:first-child,
.funnels-page .users-table tbody td:first-child {
	position: sticky;
	left: 0;
	z-index: 1;
	background: rgba(12, 24, 46, 0.96);
}

.funnels-page .users-table thead th:first-child {
	z-index: 3;
}

.funnels-page .funnel-text-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
}

.funnels-page .funnel-text-collapse {
	margin-top: 6px;
	border-top: 1px dashed rgba(126, 154, 206, 0.3);
	padding-top: 6px;
}

.funnels-page .funnel-text-collapse > summary {
	cursor: pointer;
	color: #b7c9eb;
	font-size: 12px;
}

.funnels-page .funnel-text-collapse .funnel-text-preview {
	margin-top: 8px;
	display: -webkit-box;
	-webkit-line-clamp: 6;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.funnels-page .funnel-text-item.is-editing .funnel-text-collapse {
	display: none;
}

@media (max-width: 1280px) {
	.funnels-page .funnels-kpi-grid-trial {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.funnels-page .funnels-kpi-grid-campaigns,
	.funnels-page .funnels-kpi-grid-secondary {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.funnels-page .funnels-kpi-grid-campaigns .stat-card:last-child {
		grid-column: auto;
	}
}

@media (max-width: 980px) {
	.funnels-page .funnels-toolbar {
		grid-template-columns: 1fr;
	}

	.funnels-page .funnels-tabs,
	.funnels-page .funnels-periods,
	.funnels-page .funnels-range {
		grid-column: auto;
		justify-content: flex-start;
	}

	.funnels-page .funnels-range {
		grid-template-columns: 1fr;
	}

	.funnels-page .funnels-range .control,
	.funnels-page .funnels-range .button {
		grid-column: auto;
		justify-self: stretch;
	}

	.funnels-page .funnels-kpi-grid-trial,
	.funnels-page .funnels-kpi-grid-campaigns,
	.funnels-page .funnels-kpi-grid-secondary {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* === Funnels Theme Alignment (project palette) === */
.funnels-page {
	--funnel-surface: rgba(11, 22, 43, 0.56);
	--funnel-surface-soft: rgba(11, 22, 43, 0.72);
	--funnel-border: var(--ds-border);
	--funnel-text: var(--ds-text);
	--funnel-muted: var(--ds-text-soft);
	--funnel-accent: var(--ds-primary);
	--funnel-accent-soft: rgba(59, 130, 246, 0.2);
	--funnel-shadow: var(--card-shadow-soft);
}

.funnels-page .crudx-panel {
	background: var(--crudx-surface);
	border: 1px solid var(--crudx-border);
	box-shadow: var(--card-shadow-soft);
}

.funnels-page .funnels-toolbar {
	border: 1px solid var(--ds-border);
	background: rgba(17, 27, 49, 0.72);
	box-shadow: none;
}

.funnels-page .funnels-tabs .button,
.funnels-page .funnels-periods .button,
.funnels-page .funnels-range .button {
	border-radius: 10px;
	border: 1px solid var(--ds-border);
	background: var(--ds-surface-soft);
	color: var(--ds-text);
}

.funnels-page .funnels-tabs .button.button-primary,
.funnels-page .funnels-periods .button.button-primary {
	border-color: rgba(93, 140, 226, 0.5);
	background: rgba(52, 98, 184, 0.34);
	color: #e6f0ff;
	box-shadow: none;
}

.funnels-page .funnels-tabs .button:hover,
.funnels-page .funnels-periods .button:hover,
.funnels-page .funnels-range .button:hover {
	border-color: rgba(93, 140, 226, 0.45);
	background: rgba(23, 48, 88, 0.9);
	color: #d9e8ff;
}

.funnels-page .funnels-range .control input {
	color: var(--ds-text);
	background: #0b1529;
	border: 1px solid var(--ds-border);
}

.funnels-page .stat-card {
	border: 1px solid var(--ds-border);
	background: var(--ds-surface-soft);
	box-shadow: none;
}

.funnels-page .stat-card h3 {
	color: var(--ds-text-soft);
}

.funnels-page .stat-card .stat-number {
	color: var(--ds-text);
}

.funnels-page .stat-card .stat-helper {
	color: var(--ds-text-soft);
}

.funnels-page .table-wrapper {
	border: 1px solid var(--ds-border);
	background: rgba(11, 22, 43, 0.56);
	box-shadow: none;
}

.funnels-page .users-table th {
	background: rgba(11, 22, 43, 0.92);
	color: var(--ds-text-soft);
	border-bottom: 1px solid var(--ds-border);
}

.funnels-page .users-table td {
	color: var(--ds-text);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.funnels-page .users-table tbody tr:nth-child(even) td {
	background: rgba(15, 29, 56, 0.4);
}

.funnels-page .users-table tbody tr:hover td {
	background: rgba(20, 37, 69, 0.9);
}

.funnels-page .users-table thead th:first-child,
.funnels-page .users-table tbody td:first-child {
	background: rgba(11, 22, 43, 0.95);
}

.funnels-page .glossary-item.funnel-text-item {
	border-color: var(--ds-border);
	background: rgba(15, 23, 42, 0.55);
}

.funnels-page .glossary-code {
	color: var(--ds-accent, #8bb2ff);
}

.funnels-page .glossary-desc,
.funnels-page .glossary-text,
.funnels-page .glossary-buttons,
.funnels-page .funnel-text-collapse > summary {
	color: var(--ds-text-soft);
}

/* === Broadcast UX Upgrade === */
.broadcast-page .broadcast-layout {
	grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
	gap: 14px;
}

.broadcast-page .broadcast-compose-panel {
	padding: 14px 14px 12px;
}

.broadcast-page .broadcast-compose-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px 12px;
}

.broadcast-page .broadcast-compose-grid .form-group:first-child {
	grid-column: 1 / -1;
}

.broadcast-page .broadcast-compose-grid .form-group {
	margin-bottom: 8px;
}

.broadcast-page textarea#message {
	min-height: 132px;
}

.broadcast-page .broadcast-optional-block {
	margin-top: 6px;
	border: 1px solid var(--ds-border);
	border-radius: 12px;
	background: rgba(11, 22, 43, 0.4);
}

.broadcast-page .broadcast-optional-block > summary {
	padding: 10px 12px;
	cursor: pointer;
	font-weight: 700;
	color: var(--ds-text);
}

.broadcast-page .broadcast-optional-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	padding: 0 12px 10px;
}

.broadcast-page .broadcast-preview-card {
	margin-top: 8px;
	padding: 10px 12px;
	border: 1px solid var(--ds-border);
	border-radius: 12px;
	background: var(--ds-surface-soft);
}

.broadcast-page .broadcast-preview-head {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--ds-text-soft);
	margin-bottom: 6px;
}

.broadcast-page .broadcast-preview-message {
	min-height: 38px;
	font-size: 14px;
	line-height: 1.35;
	color: var(--ds-text);
	white-space: pre-wrap;
}

.broadcast-page .broadcast-preview-meta {
	margin-top: 8px;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 6px;
	font-size: 12px;
	color: var(--ds-text-soft);
}

.broadcast-page .broadcast-preview-button {
	margin-top: 6px;
	font-size: 12px;
	color: var(--ds-text-soft);
}

.broadcast-page .broadcast-preview-button a {
	color: #cfe0ff;
	text-decoration: underline;
}

.broadcast-page .broadcast-confirm-wrap {
	margin-top: 8px;
	margin-bottom: 4px;
}

.broadcast-page .broadcast-action-bar {
	position: sticky;
	bottom: 10px;
	z-index: 20;
	margin-top: 8px;
	padding: 10px 12px;
	display: flex;
	align-items: center;
	gap: 10px;
	border: 1px solid var(--ds-border);
	border-radius: 12px;
	background: rgba(9, 17, 33, 0.9);
	backdrop-filter: blur(4px);
}

.broadcast-page .broadcast-action-meta {
	margin-right: auto;
	font-size: 12px;
	color: var(--ds-text-soft);
}

.broadcast-page .broadcast-kpi-panel .stats-grid {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;
}

.broadcast-page .broadcast-kpi-panel .stat-card {
	padding: 10px 10px;
	min-height: 84px;
}

.broadcast-page .broadcast-kpi-panel .stat-card h3 {
	font-size: 11px;
}

.broadcast-page .broadcast-kpi-panel .stat-card .stat-number {
	font-size: 1.8rem;
	line-height: 1;
}

.broadcast-page .broadcast-rules > summary {
	cursor: pointer;
	font-weight: 700;
	color: var(--ds-text);
}

.broadcast-page .broadcast-segment-list {
	margin: 8px 0 0;
	padding-left: 18px;
	color: var(--ds-text-soft);
	font-size: 13px;
	display: grid;
	gap: 4px;
}

.broadcast-page .broadcast-history-panel {
	margin-top: 6px;
}

.broadcast-page .broadcast-history-toolbar {
	display: grid;
	grid-template-columns: 180px 220px minmax(220px, 1fr) 140px 140px auto auto;
	gap: 8px;
	margin-top: 10px;
}

.broadcast-page .broadcast-history-table {
	min-width: 1150px;
}

.broadcast-page .broadcast-history-table thead th {
	position: sticky;
	top: 0;
	z-index: 2;
}

.broadcast-page .broadcast-history-table thead th:first-child,
.broadcast-page .broadcast-history-table tbody td:first-child {
	position: sticky;
	left: 0;
	z-index: 1;
	background: rgba(11, 22, 43, 0.95);
}

.broadcast-page .broadcast-history-table thead th:first-child {
	z-index: 3;
}

.broadcast-page .broadcast-message-details summary {
	cursor: pointer;
}

.broadcast-page .broadcast-message-full {
	margin-top: 6px;
	white-space: pre-wrap;
	font-size: 12px;
	color: var(--ds-text-soft);
}

@media (max-width: 1200px) {
	.broadcast-page .broadcast-layout {
		grid-template-columns: 1fr;
	}

	.broadcast-page .broadcast-kpi-panel .stats-grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}
}

@media (max-width: 980px) {
	.broadcast-page .broadcast-compose-grid,
	.broadcast-page .broadcast-optional-grid {
		grid-template-columns: 1fr;
	}

	.broadcast-page .broadcast-preview-meta {
		grid-template-columns: 1fr;
	}

	.broadcast-page .broadcast-history-toolbar {
		grid-template-columns: 1fr 1fr;
	}

	.broadcast-page .broadcast-history-toolbar .control,
	.broadcast-page .broadcast-history-toolbar .button {
		width: 100%;
	}

	.broadcast-page .desktop-only.broadcast-action-bar {
		display: none;
	}
}

@media (max-width: 768px) {
	.main-area {
		padding: 14px;
	}

	.main-content {
		min-width: 0;
	}

	.topbar {
		padding: 12px;
		align-items: stretch;
	}

	.topbar-left,
	.topbar-right {
		width: 100%;
	}

	.topbar-right {
		gap: 10px;
	}

	.bot-status-list {
		width: 100%;
		flex-direction: column;
	}

	.bot-status-item {
		width: 100%;
		flex-wrap: wrap;
		justify-content: space-between;
	}

	.admin-account {
		min-width: 0;
	}

	.topbar-right > form,
	.topbar-right > .admin-account,
	.topbar-right > .status-pill {
		width: 100%;
	}

	.topbar-right > form .button {
		width: 100%;
	}

	.dashboard-page .dashboard-v2-head {
		gap: 12px;
	}

	.dashboard-page .dashboard-head-actions,
	.dashboard-page .dashboard-period-pills-header,
	.dashboard-page .dashboard-period-pills {
		width: 100%;
	}

	.dashboard-page .dashboard-period-pills {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}

	.dashboard-page .dashboard-period-pills a {
		width: 100%;
		padding: 10px 12px;
		min-height: 42px;
	}

	.dashboard-v2 .dashboard-mini-table-head,
	.dashboard-v2 .dashboard-mini-table-row,
	.dashboard-v2 .dashboard-host-head,
	.dashboard-v2 .dashboard-host-metrics,
	.dashboard-v2 .chart-card-header {
		gap: 10px;
	}

	.dashboard-v2 .dashboard-mini-table-head,
	.dashboard-v2 .dashboard-mini-table-row,
	.dashboard-v2 .chart-card-header,
	.dashboard-v2 .dashboard-host-head {
		flex-direction: column;
		align-items: flex-start;
	}

	.dashboard-v2 .dashboard-mini-table-row strong,
	.dashboard-v2 .dashboard-mini-table-head > :last-child,
	.dashboard-v2 .chart-label {
		text-align: left;
	}

	.dashboard-v2 .dashboard-host-metrics {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.dashboard-v2 .chart-card-body {
		height: 220px;
		min-height: 220px;
	}

	.dashboard-v2 .dashboard-compact-wrap {
		margin-left: -2px;
		margin-right: -2px;
	}
}

@media (max-width: 520px) {
	body {
		padding: 0;
	}

	.sidebar {
		width: min(86vw, 320px);
	}

	.main-area {
		padding: 12px;
	}

	.topbar {
		padding: 10px;
		border-radius: 18px;
	}

	.topbar-project {
		font-size: 14px;
		line-height: 1.35;
	}

	.topbar-search input {
		min-width: 0;
		height: 42px;
		font-size: 16px;
	}

	.bot-status-item {
		padding: 10px;
	}

	.dashboard-page .page-header h1 {
		font-size: 1.65rem;
	}

	.dashboard-page .page-subtitle {
		font-size: 0.92rem;
		line-height: 1.5;
	}

	.dashboard-page .dashboard-period-pills {
		grid-template-columns: 1fr;
	}

	.dashboard-v2 {
		--dashboard-section-gap: 12px;
		--dashboard-panel-padding: 12px;
		--dashboard-card-padding: 11px;
		--dashboard-grid-gap: 12px;
	}

	.dashboard-v2 .crudx-panel,
	.dashboard-v2 .dashboard-v2-kpi,
	.dashboard-v2 .dashboard-host-card,
	.dashboard-v2 .chart-card {
		border-radius: 16px;
	}

	.dashboard-v2 .dashboard-panel-head h2,
	.dashboard-v2 .chart-card-header h3,
	.dashboard-v2 .dashboard-host-head h3 {
		font-size: 0.94rem;
		line-height: 1.35;
	}

	.dashboard-v2 .dashboard-panel-head .section-helper,
	.dashboard-v2 .dashboard-v2-kpi-note,
	.dashboard-v2 .dashboard-v2-kpi-sub,
	.dashboard-v2 .dashboard-v2-stat-note,
	.dashboard-v2 .dashboard-empty {
		font-size: 0.82rem;
		line-height: 1.45;
	}

	.dashboard-v2 .dashboard-v2-kpi-value,
	.dashboard-v2 .dashboard-v2-stat-value,
	.dashboard-v2 .dashboard-referral-metric strong,
	.dashboard-v2 .dashboard-referral-stage strong {
		font-size: 1.25rem;
	}

	.dashboard-v2 .dashboard-summary-grid,
	.dashboard-v2 .dashboard-referral-summary,
	.dashboard-v2 .dashboard-referral-funnel,
	.dashboard-v2 .dashboard-v2-host-grid,
	.dashboard-v2 .dashboard-v2-infra-summary {
		grid-template-columns: 1fr;
	}

	.dashboard-v2 .dashboard-host-metrics {
		grid-template-columns: 1fr;
	}

	.dashboard-v2 .dashboard-v2-infra-summary > *,
	.dashboard-v2 .dashboard-v2-host-grid > * {
		grid-column: auto;
	}

	.dashboard-v2 .chart-card-body {
		height: 200px;
		min-height: 200px;
	}

	.dashboard-v2 .pagination {
		gap: 6px;
		flex-wrap: wrap;
	}

	.dashboard-v2 .pagination a {
		min-width: 38px;
	}
}
