:root {
	--primary-color: #4dabf7;
	--success-color: #51cf66;
	--danger-color: #ff6b6b;
	--warning-color: #ff6b6b;
	--light-color: #e9ecef;
	--dark-color: #212529;
	--border-color: #495057;
	--body-bg: #212529;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}
.bm {
	display: none;
}
#burger {
	display: none;
}
body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
		'Helvetica Neue', Arial, sans-serif;
	background-color: var(--body-bg);
	color: var(--light-color);
	line-height: 1.6;
	padding: 20px;
}

.container {
	max-width: 80%;
	margin: 0 auto;
	background: #2d3238;
	padding: 30px;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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 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;
}

.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 !important;
	font-size: 14px !important;
}

.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;
}

.users-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 20px;
}

.users-table th,
.users-table td {
	border: 1px solid var(--border-color);
	padding: 10px 12px;
	text-align: left;
	vertical-align: middle;
	color: var(--light-color);
}

.users-table thead {
	background-color: #343a40;
}

.users-table th {
	font-weight: 600;
}

.users-table .actions-cell {
	width: 250px;
	text-align: right;
}

.actions-cell form {
	display: inline-block;
	margin-left: 5px;
}

.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);
}

@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%;
	}

	.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;
	}
}
