/* Material Design 3 Color System - Professional Theme */
:root {
	/* M3 Light Theme */
	--md-sys-color-primary: #1a73e8;
	--md-sys-color-on-primary: #FFFFFF;
	--md-sys-color-primary-container: #e8f0fe;
	--md-sys-color-on-primary-container: #1a73e8;
	
	--md-sys-color-secondary: #607d8b;
	--md-sys-color-on-secondary: #FFFFFF;
	--md-sys-color-secondary-container: #eceff1;
	--md-sys-color-on-secondary-container: #37474f;
	
	--md-sys-color-tertiary: #78909c;
	--md-sys-color-on-tertiary: #FFFFFF;
	--md-sys-color-tertiary-container: #cfd8dc;
	--md-sys-color-on-tertiary-container: #263238;
	
	--md-sys-color-error: #BA1A1A;
	--md-sys-color-on-error: #FFFFFF;
	--md-sys-color-error-container: #FFDAD6;
	--md-sys-color-on-error-container: #410002;
	
	--md-sys-color-success: #006A6B;
	--md-sys-color-on-success: #FFFFFF;
	--md-sys-color-success-container: #6FF7F8;
	--md-sys-color-on-success-container: #002020;
	
	--md-sys-color-warning: #7A5900;
	--md-sys-color-on-warning: #FFFFFF;
	--md-sys-color-warning-container: #FFDF9C;
	--md-sys-color-on-warning-container: #261A00;
	
	--md-sys-color-surface: #FFFBFE;
	--md-sys-color-on-surface: #1C1B1F;
	--md-sys-color-surface-variant: #E7E0EC;
	--md-sys-color-on-surface-variant: #49454F;
	--md-sys-color-surface-container: #F3EDF7;
	--md-sys-color-surface-container-high: #ECE6F0;
	--md-sys-color-surface-container-highest: #E6E0E9;
	
	--md-sys-color-outline: #79747E;
	--md-sys-color-outline-variant: #CAC4D0;
	--md-sys-color-shadow: #000000;
	--md-sys-color-scrim: #000000;
	
	/* Elevation */
	--md-sys-elevation-level0: 0px 0px 0px rgba(0,0,0,0);
	--md-sys-elevation-level1: 0px 1px 2px rgba(0,0,0,0.3), 0px 1px 3px 1px rgba(0,0,0,0.15);
	--md-sys-elevation-level2: 0px 1px 2px rgba(0,0,0,0.3), 0px 2px 6px 2px rgba(0,0,0,0.15);
	--md-sys-elevation-level3: 0px 1px 3px rgba(0,0,0,0.3), 0px 4px 8px 3px rgba(0,0,0,0.15);
	--md-sys-elevation-level4: 0px 2px 3px rgba(0,0,0,0.3), 0px 6px 10px 4px rgba(0,0,0,0.15);
	--md-sys-elevation-level5: 0px 4px 4px rgba(0,0,0,0.3), 0px 8px 12px 6px rgba(0,0,0,0.15);
	
	/* Legacy compatibility */
	--primary-color: var(--md-sys-color-primary);
	--success-color: var(--md-sys-color-success);
	--danger-color: var(--md-sys-color-error);
	--warning-color: var(--md-sys-color-warning);
	--light-color: var(--md-sys-color-surface-container);
	--dark-color: var(--md-sys-color-on-surface);
	--border-color: var(--md-sys-color-outline-variant);
	--body-bg: var(--md-sys-color-surface);
	
	/* M3 Motion Tokens */
	--md-motion-duration-short1: 50ms;
	--md-motion-duration-short2: 100ms;
	--md-motion-duration-short3: 150ms;
	--md-motion-duration-short4: 200ms;
	--md-motion-duration-medium1: 250ms;
	--md-motion-duration-medium2: 300ms;
	--md-motion-duration-medium3: 350ms;
	--md-motion-duration-medium4: 400ms;
	--md-motion-duration-long1: 450ms;
	--md-motion-duration-long2: 500ms;
	--md-motion-duration-long3: 550ms;
	--md-motion-duration-long4: 600ms;
	
	--md-motion-easing-linear: cubic-bezier(0, 0, 1, 1);
	--md-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
	--md-motion-easing-standard-accelerate: cubic-bezier(0.3, 0, 1, 1);
	--md-motion-easing-standard-decelerate: cubic-bezier(0, 0, 0, 1);
	--md-motion-easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
	--md-motion-easing-emphasized-accelerate: cubic-bezier(0.3, 0, 0.8, 0.15);
	--md-motion-easing-emphasized-decelerate: cubic-bezier(0.05, 0.7, 0.1, 1);
}

/* M3 Dark Theme - Professional */
[data-theme="dark"] {
	--md-sys-color-primary: #8ab4f8;
	--md-sys-color-on-primary: #1a73e8;
	--md-sys-color-primary-container: #1a73e8;
	--md-sys-color-on-primary-container: #e8f0fe;
	--md-sys-color-surface-container-low: #202124;
	
	--md-sys-color-secondary: #b0bec5;
	--md-sys-color-on-secondary: #607d8b;
	--md-sys-color-secondary-container: #455a64;
	--md-sys-color-on-secondary-container: #eceff1;
	
	--md-sys-color-tertiary: #EFB8C8;
	--md-sys-color-on-tertiary: #492532;
	--md-sys-color-tertiary-container: #633B48;
	--md-sys-color-on-tertiary-container: #FFD8E4;
	
	--md-sys-color-error: #FFB4AB;
	--md-sys-color-on-error: #690005;
	--md-sys-color-error-container: #93000A;
	--md-sys-color-on-error-container: #FFDAD6;
	
	--md-sys-color-success: #4DDADB;
	--md-sys-color-on-success: #003738;
	--md-sys-color-success-container: #004F50;
	--md-sys-color-on-success-container: #6FF7F8;
	
	--md-sys-color-warning: #F2B50C;
	--md-sys-color-on-warning: #3F2E00;
	--md-sys-color-warning-container: #5B4300;
	--md-sys-color-on-warning-container: #FFDF9C;
	
	--md-sys-color-surface: #10131B;
	--md-sys-color-on-surface: #E6E0E9;
	--md-sys-color-surface-variant: #49454F;
	--md-sys-color-on-surface-variant: #CAC4D0;
	--md-sys-color-surface-container: #1D1B20;
	--md-sys-color-surface-container-high: #272529;
	--md-sys-color-surface-container-highest: #322F35;
	
	--md-sys-color-outline: #938F99;
	--md-sys-color-outline-variant: #49454F;
	--md-sys-color-shadow: #000000;
	--md-sys-color-scrim: #000000;
	
	/* Elevation for dark theme */
	--md-sys-elevation-level1: 0px 1px 2px rgba(0,0,0,0.3), 0px 1px 3px 1px rgba(0,0,0,0.15);
	--md-sys-elevation-level2: 0px 1px 2px rgba(0,0,0,0.3), 0px 2px 6px 2px rgba(0,0,0,0.15);
	--md-sys-elevation-level3: 0px 1px 3px rgba(0,0,0,0.3), 0px 4px 8px 3px rgba(0,0,0,0.15);
	--md-sys-elevation-level4: 0px 2px 3px rgba(0,0,0,0.3), 0px 6px 10px 4px rgba(0,0,0,0.15);
	--md-sys-elevation-level5: 0px 4px 4px rgba(0,0,0,0.3), 0px 8px 12px 6px rgba(0,0,0,0.15);
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/* M3 Typography Scale */
body {
	font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 
		'Helvetica Neue', Arial, sans-serif;
	background-color: var(--md-sys-color-surface);
	color: var(--md-sys-color-on-surface);
	line-height: 1.5;
	padding: 20px;
	font-size: 16px;
	font-weight: 400;
	transition: background-color 0.3s ease, color 0.3s ease;
}

/* M3 Typography Classes */
.display-large {
	font-family: 'Roboto', sans-serif;
	font-size: 57px;
	line-height: 64px;
	font-weight: 400;
	letter-spacing: -0.25px;
}

.display-medium {
	font-family: 'Roboto', sans-serif;
	font-size: 45px;
	line-height: 52px;
	font-weight: 400;
	letter-spacing: 0px;
}

.display-small {
	font-family: 'Roboto', sans-serif;
	font-size: 36px;
	line-height: 44px;
	font-weight: 400;
	letter-spacing: 0px;
}

.headline-large {
	font-family: 'Roboto', sans-serif;
	font-size: 32px;
	line-height: 40px;
	font-weight: 400;
	letter-spacing: 0px;
}

.headline-medium {
	font-family: 'Roboto', sans-serif;
	font-size: 28px;
	line-height: 36px;
	font-weight: 400;
	letter-spacing: 0px;
}

.headline-small {
	font-family: 'Roboto', sans-serif;
	font-size: 24px;
	line-height: 32px;
	font-weight: 400;
	letter-spacing: 0px;
}

.title-large {
	font-family: 'Roboto', sans-serif;
	font-size: 22px;
	line-height: 28px;
	font-weight: 400;
	letter-spacing: 0px;
}

.title-medium {
	font-family: 'Roboto', sans-serif;
	font-size: 16px;
	line-height: 24px;
	font-weight: 500;
	letter-spacing: 0.15px;
}

.title-small {
	font-family: 'Roboto', sans-serif;
	font-size: 14px;
	line-height: 20px;
	font-weight: 500;
	letter-spacing: 0.1px;
}

.body-large {
	font-family: 'Roboto', sans-serif;
	font-size: 16px;
	line-height: 24px;
	font-weight: 400;
	letter-spacing: 0.5px;
}

.body-medium {
	font-family: 'Roboto', sans-serif;
	font-size: 14px;
	line-height: 20px;
	font-weight: 400;
	letter-spacing: 0.25px;
}

.body-small {
	font-family: 'Roboto', sans-serif;
	font-size: 12px;
	line-height: 16px;
	font-weight: 400;
	letter-spacing: 0.4px;
}

.label-large {
	font-family: 'Roboto', sans-serif;
	font-size: 14px;
	line-height: 20px;
	font-weight: 500;
	letter-spacing: 0.1px;
}

.label-medium {
	font-family: 'Roboto', sans-serif;
	font-size: 12px;
	line-height: 16px;
	font-weight: 500;
	letter-spacing: 0.5px;
}

.label-small {
	font-family: 'Roboto', sans-serif;
	font-size: 11px;
	line-height: 16px;
	font-weight: 500;
	letter-spacing: 0.5px;
}

/* M3 Layout System */
/* Адаптивный контейнер приложения */
.app-container {
	display: grid;
	grid-template-areas:
		"header header"
		"stats stats"
		"main main";
	grid-template-columns: 1fr 1fr;
	grid-template-rows: auto auto 1fr;
	gap: 24px;
	padding: 24px;
	min-height: 100vh;
	background: var(--md-sys-color-surface);
	transition: all var(--md-motion-duration-medium2) var(--md-motion-easing-standard);
}

/* Адаптивный контейнер для мобильных устройств */
@media (max-width: 768px) {
	.app-container {
		grid-template-areas:
			"header"
			"stats"
			"main";
		grid-template-columns: 1fr;
		padding: 16px;
		gap: 16px;
	}
}

.app-header {
	grid-area: header;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 24px;
	background: var(--md-sys-color-surface-container);
	border-radius: 16px;
	box-shadow: var(--md-sys-elevation-level1);
}

/* Адаптивный заголовок для мобильных устройств */
@media (max-width: 768px) {
	.app-header {
		flex-direction: column;
		gap: 16px;
		padding: 16px;
	}
	
	.header-controls {
		width: 100%;
		justify-content: center;
		flex-wrap: wrap;
		gap: 12px;
		padding-left: 0;
		border-left: none;
		border-top: 1px solid var(--md-sys-color-outline-variant);
		padding-top: 16px;
		margin-top: 8px;
	}
}

.stats-section {
	grid-area: stats;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 16px;
	padding: 0 24px;
}

/* Адаптивные карточки статистики для мобильных устройств */
@media (max-width: 768px) {
	.stats-section {
		grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
		gap: 12px;
		padding: 0;
	}
}

@media (max-width: 480px) {
	.stats-section {
		grid-template-columns: 1fr 1fr;
	}
}

/* Sidebar removed */

.main-content {
	grid-area: main;
	background: var(--md-sys-color-surface-container);
	border-radius: 16px;
	padding: 28px;
	box-shadow: var(--md-sys-elevation-level1);
	width: 100%;
	max-width: 100%;
}

/* Адаптивный основной контент для мобильных устройств */
@media (max-width: 768px) {
	.main-content {
		padding: 20px;
	}
	
	.main-content h1 {
		font-size: 24px;
		margin-bottom: 20px;
	}
	
	.main-content h2 {
		font-size: 20px;
	}
}

/* Legacy container support */
.container {
	width: 100%;
	margin: 0 auto;
	background: var(--md-sys-color-surface);
	padding: 32px;
	border-radius: 28px;
	box-shadow: var(--md-sys-elevation-level2);
	transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* M3 Styled Headers */
h1 {
	text-align: center;
	margin-bottom: 32px;
	color: var(--md-sys-color-on-surface);
	font-size: 32px;
	line-height: 40px;
	font-weight: 400;
	letter-spacing: 0px;
}

h2 {
	color: var(--md-sys-color-primary);
	border-bottom: 1px solid var(--md-sys-color-outline-variant);
	padding-bottom: 12px;
	margin-bottom: 24px;
	font-size: 24px;
	line-height: 32px;
	font-weight: 400;
	letter-spacing: 0px;
}

h3 {
	margin-bottom: 16px;
	color: var(--md-sys-color-on-surface);
	font-size: 22px;
	line-height: 28px;
	font-weight: 400;
	letter-spacing: 0px;
}

h4 {
	margin-top: 20px;
	margin-bottom: 12px;
	color: var(--md-sys-color-on-surface);
	font-size: 16px;
	line-height: 24px;
	font-weight: 500;
	letter-spacing: 0.15px;
}

.settings-section {
	margin-bottom: 40px;
}

/* M3 Form System */
.form-group {
	margin-bottom: 24px;
	position: relative;
}

.form-group label {
	display: block;
	margin-bottom: 8px;
	font-size: 12px;
	line-height: 16px;
	font-weight: 500;
	letter-spacing: 0.5px;
	color: var(--md-sys-color-on-surface-variant);
}

/* M3 Outlined Text Fields */
.form-group input[type='text'],
.form-group input[type='url'],
.form-group input[type='password'],
.form-group input[type='number'],
.form-group input[type='email'],
.form-group select,
.form-group textarea {
	width: 100%;
	padding: 16px;
	border: 1px solid var(--md-sys-color-outline);
	border-radius: 4px;
	font-size: 16px;
	line-height: 24px;
	font-weight: 400;
	color: var(--md-sys-color-on-surface);
	background-color: var(--md-sys-color-surface);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	font-family: 'Roboto', sans-serif;
}

.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(--md-sys-color-primary);
	border-width: 2px;
	padding: 15px; /* Adjust padding to compensate for thicker border */
}

.form-group input:hover:not(:focus),
.form-group select:hover:not(:focus),
.form-group textarea:hover:not(:focus) {
	border-color: var(--md-sys-color-on-surface);
}

/* M3 Filled Text Fields (Alternative) */
.form-group.filled input,
.form-group.filled textarea,
.form-group.filled select {
	background-color: var(--md-sys-color-surface-variant);
	border: none;
	border-bottom: 1px solid var(--md-sys-color-on-surface-variant);
	border-radius: 4px 4px 0 0;
}

.form-group.filled input:focus,
.form-group.filled textarea:focus,
.form-group.filled select:focus {
	border-bottom: 2px solid var(--md-sys-color-primary);
}

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

.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: #f1f1f1;
	cursor: pointer;
	border-radius: 5px;
	font-size: 20px;
	padding: 0;
}

.toggle-password:hover {
	background: #e7e7e7;
}

/* M3 Button System */
.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 24px;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.1px;
	text-align: center;
	cursor: pointer;
	border: none;
	border-radius: 20px;
	min-height: 40px;
	text-decoration: none;
	position: relative;
	overflow: hidden;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	font-family: 'Roboto', sans-serif;
	user-select: none;
}

.button:before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: currentColor;
	opacity: 0;
	transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.button:hover:before {
	opacity: 0.08;
}

.button:focus:before {
	opacity: 0.12;
}

.button:active {
	transform: scale(0.98);
}

/* M3 Filled Button (Primary) */
.button-primary {
	background-color: var(--md-sys-color-primary);
	color: var(--md-sys-color-on-primary);
	box-shadow: var(--md-sys-elevation-level0);
}

.button-primary:hover {
	box-shadow: var(--md-sys-elevation-level1);
}

.button-primary:focus {
	box-shadow: var(--md-sys-elevation-level0);
}

/* M3 Filled Button (Success) */
.button-start {
	background-color: var(--md-sys-color-success);
	color: var(--md-sys-color-on-success);
	box-shadow: var(--md-sys-elevation-level0);
}

.button-start:hover {
	box-shadow: var(--md-sys-elevation-level1);
}

/* M3 Filled Button (Error/Danger) */
.button-danger,
.button-stop {
	background-color: var(--md-sys-color-error);
	color: var(--md-sys-color-on-error);
	box-shadow: var(--md-sys-elevation-level0);
}

.button-danger:hover,
.button-stop:hover {
	box-shadow: var(--md-sys-elevation-level1);
}

/* M3 Filled Button (Warning) */
.button-warning {
	background-color: var(--md-sys-color-warning);
	color: var(--md-sys-color-on-warning);
	box-shadow: var(--md-sys-elevation-level0);
}

.button-warning:hover {
	box-shadow: var(--md-sys-elevation-level1);
}

/* M3 Outlined Button (Secondary) */
.button-secondary {
	background-color: transparent;
	color: var(--md-sys-color-primary);
	border: 1px solid var(--md-sys-color-outline);
}

.button-secondary:hover {
	background-color: var(--md-sys-color-primary-container);
	color: var(--md-sys-color-on-primary-container);
}

/* M3 Text Button */
.button-text {
	background-color: transparent;
	color: var(--md-sys-color-primary);
	padding: 10px 12px;
}

.button-text:hover {
	background-color: var(--md-sys-color-primary-container);
	color: var(--md-sys-color-on-primary-container);
}

/* M3 Elevated Button */
.button-elevated {
	background-color: var(--md-sys-color-surface-container-low);
	color: var(--md-sys-color-primary);
	box-shadow: var(--md-sys-elevation-level1);
}

.button-elevated:hover {
	box-shadow: var(--md-sys-elevation-level2);
}

/* Button Sizes */
.button-small {
	padding: 6px 16px;
	font-size: 12px;
	min-height: 32px;
	border-radius: 16px;
}

.button-tiny {
	padding: 4px 12px;
	font-size: 11px;
	min-height: 24px;
	border-radius: 12px;
	font-weight: 500;
	letter-spacing: 0.5px;
}

/* Touch-friendly кнопки для мобильных устройств */
@media (max-width: 768px) {
	.button {
		padding: 12px 20px;
		min-height: 44px; /* Увеличиваем для удобства касания */
	}
	
	.button-small {
		padding: 8px 16px;
		min-height: 36px;
	}
	
	/* Увеличиваем расстояние между кнопками для удобства касания */
	.actions-cell form {
		margin-bottom: 8px;
	}
}

.button-large {
	padding: 14px 32px;
	font-size: 16px;
	min-height: 48px;
	border-radius: 24px;
}

/* Disabled State */
.button-disabled,
.button:disabled {
	background-color: var(--md-sys-color-on-surface);
	color: var(--md-sys-color-surface);
	opacity: 0.38;
	cursor: not-allowed;
	box-shadow: none;
	pointer-events: none;
}

/* Logout Button */
.button-logout {
	background-color: var(--md-sys-color-surface-variant);
	color: var(--md-sys-color-on-surface-variant);
	padding: 8px 16px;
	font-size: 14px;
	min-height: 36px;
	border-radius: 18px;
}

/* M3 Flash Messages */
.flash {
	padding: 16px 20px;
	margin-bottom: 16px;
	border: none;
	border-radius: 12px;
	font-size: 14px;
	line-height: 20px;
	font-weight: 400;
	letter-spacing: 0.25px;
	box-shadow: var(--md-sys-elevation-level1);
	transition: all var(--md-motion-duration-medium2) var(--md-motion-easing-standard);
}

.flash-success {
	color: var(--md-sys-color-on-success-container);
	background-color: var(--md-sys-color-success-container);
}

.flash-danger {
	color: var(--md-sys-color-on-error-container);
	background-color: var(--md-sys-color-error-container);
}

.flash-warning {
	color: var(--md-sys-color-on-warning-container);
	background-color: var(--md-sys-color-warning-container);
}

.flash-info {
	color: var(--md-sys-color-on-primary-container);
	background-color: var(--md-sys-color-primary-container);
}

.user-session-controls {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 4px;
	border-radius: 28px;
	background-color: var(--md-sys-color-surface-variant);
}

.button-logout {
	background-color: var(--md-sys-color-error);
	color: var(--md-sys-color-on-error);
	padding: 8px 16px;
	font-size: 14px;
	border-radius: 20px;
	transition: all var(--md-motion-duration-medium2) var(--md-motion-easing-standard);
}

.button-logout:hover {
	background-color: var(--md-sys-color-error);
	box-shadow: var(--md-sys-elevation-level2);
	transform: translateY(-1px);
}

.button-logout:active {
	transform: translateY(0);
	box-shadow: var(--md-sys-elevation-level1);
}

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: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.login-container h1 {
	text-align: center;
	margin-bottom: 25px;
}

.main-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid var(--border-color);
	padding-bottom: 15px;
	margin-bottom: 20px;
}

/* M3 Navigation */
.navigation {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	justify-content: center;
}

.navigation .nav-link {
	font-size: 14px;
	line-height: 20px;
	font-weight: 500;
	letter-spacing: 0.1px;
	color: var(--md-sys-color-on-surface-variant);
	text-decoration: none;
	padding: 12px 20px;
	border-radius: 24px;
	transition: all var(--md-motion-duration-medium2) var(--md-motion-easing-standard);
	position: relative;
	white-space: nowrap;
	display: flex;
	align-items: center;
	gap: 8px;
	background-color: transparent;
}

/* Адаптивная навигация для мобильных устройств */
@media (max-width: 768px) {
	.navigation {
		width: 100%;
		justify-content: center;
	}
	
	.navigation .nav-link {
		padding: 10px 16px;
		font-size: 13px;
	}
}

.navigation .nav-link:hover {
	background-color: var(--md-sys-color-surface-variant);
	color: var(--md-sys-color-on-surface);
	transform: translateY(-1px);
}

.navigation .nav-link.active {
	background-color: var(--md-sys-color-primary-container);
	color: var(--md-sys-color-on-primary-container);
	font-weight: 500;
}

.navigation .nav-link.active::after {
	content: '';
	position: absolute;
	bottom: -4px;
	left: 50%;
	transform: translateX(-50%);
	width: 32px;
	height: 3px;
	background-color: var(--md-sys-color-primary);
	border-radius: 1.5px;
	opacity: 0;
	transition: opacity var(--md-motion-duration-medium2) var(--md-motion-easing-standard);
}

.navigation .nav-link.active:hover::after {
	opacity: 1;
}

.header-controls {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 24px;
	padding-left: 24px;
	border-left: 1px solid var(--md-sys-color-outline-variant);
}

/* Theme Switcher */
.theme-switcher {
	display: flex;
	align-items: center;
}

#themeToggle {
	min-width: 40px;
	padding: 10px;
	border-radius: 20px;
	transition: all var(--md-motion-duration-medium2) var(--md-motion-easing-standard);
	background-color: var(--md-sys-color-surface-variant);
}

#themeToggle:hover {
	background-color: var(--md-sys-color-primary-container);
	color: var(--md-sys-color-on-primary-container);
	transform: scale(1.05);
}

#themeToggle:active {
	transform: scale(0.95);
}

#themeIcon {
	font-size: 18px;
	display: block;
	transition: transform var(--md-motion-duration-medium2) var(--md-motion-easing-emphasized);
}

#themeToggle:hover #themeIcon {
	transform: rotate(360deg);
}

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

/* M3 Stat Cards */
.stat-card {
	background-color: var(--md-sys-color-surface-container);
	padding: 24px;
	border-radius: 28px;
	text-align: left;
	border: none;
	box-shadow: var(--md-sys-elevation-level1);
	transition: all var(--md-motion-duration-medium2) var(--md-motion-easing-standard);
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Адаптивные карточки статистики для мобильных устройств */
@media (max-width: 768px) {
	.stat-card {
		padding: 16px;
		border-radius: 20px;
		gap: 8px;
	}
	
	.stat-card h3 {
		font-size: 12px;
	}
	
	.stat-card .stat-number {
		font-size: 36px;
		line-height: 44px;
	}
}

@media (max-width: 480px) {
	.stat-card .stat-number {
		font-size: 28px;
		line-height: 36px;
	}
	
	.stat-card .stat-trend {
		font-size: 12px;
	}
}

.stat-card:hover {
	box-shadow: var(--md-sys-elevation-level2);
	transform: translateY(-2px);
	background-color: var(--md-sys-color-surface-container-high);
}

.stat-card:before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 4px;
	background: var(--md-sys-color-primary);
	opacity: 0;
	transition: opacity var(--md-motion-duration-medium2) var(--md-motion-easing-standard);
}

.stat-card:hover:before {
	opacity: 1;
}

.stat-card h3 {
	margin: 0;
	color: var(--md-sys-color-on-surface-variant);
	font-size: 14px;
	line-height: 20px;
	font-weight: 500;
	letter-spacing: 0.1px;
}

.stat-card .stat-number {
	font-size: 48px;
	line-height: 56px;
	font-weight: 400;
	color: var(--md-sys-color-on-surface);
	margin: 0;
	display: flex;
	align-items: baseline;
	gap: 8px;
}

.stat-card .stat-number small {
	font-size: 16px;
	line-height: 24px;
	font-weight: 400;
	color: var(--md-sys-color-on-surface-variant);
	letter-spacing: 0.15px;
}

.stat-card .stat-trend {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	line-height: 20px;
	color: var(--md-sys-color-on-surface-variant);
}

.stat-trend.positive {
	color: var(--md-sys-color-success);
}

.stat-trend.negative {
	color: var(--md-sys-color-error);
}

/* Progress Bar для системных ресурсов */
.progress-bar {
	width: 100%;
	height: 6px;
	background-color: var(--md-sys-color-surface-variant);
	border-radius: 3px;
	overflow: hidden;
	margin-top: 12px;
	position: relative;
}

.progress-fill {
	height: 100%;
	background-color: var(--md-sys-color-primary);
	border-radius: 3px;
	transition: width 0.5s ease-in-out;
}

/* Цветовая индикация для прогресс-бара */
.progress-fill[style*="width: 8"] {
	background-color: var(--md-sys-color-error);
}

.progress-fill[style*="width: 9"] {
	background-color: var(--md-sys-color-error);
}

.progress-fill[style*="width: 7"] {
	background-color: var(--md-sys-color-warning);
}

.progress-fill[style*="width: 6"] {
	background-color: var(--md-sys-color-warning);
}

/* Разделитель для блоков статистики */
.stats-divider {
	grid-column: 1 / -1;
	margin: 16px 0;
	padding: 8px 16px;
	background-color: var(--md-sys-color-surface-variant);
	border-radius: 16px;
	box-shadow: var(--md-sys-elevation-level1);
	text-align: center;
}

.stats-divider h4 {
	margin: 0;
	color: var(--md-sys-color-on-surface-variant);
	font-size: 16px;
	font-weight: 500;
	letter-spacing: 0.1px;
}

/* Стили для карточек системного мониторинга */
.system-stat {
	background-color: var(--md-sys-color-surface-container-high);
	border-left: 4px solid var(--md-sys-color-primary);
}

.system-stat:hover {
	transform: translateY(-3px);
	box-shadow: var(--md-sys-elevation-level3);
}

/* Индикаторы сети */
.network-indicators {
	display: flex;
	gap: 12px;
	margin-top: 12px;
}

.network-indicator {
	width: 48%;
	height: 6px;
	border-radius: 3px;
	position: relative;
	overflow: hidden;
}

.network-indicator::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, var(--md-sys-color-primary), transparent);
	animation: pulse 2s infinite;
}

.network-indicator.rx {
	background-color: var(--md-sys-color-primary-container);
}

.network-indicator.tx {
	background-color: var(--md-sys-color-secondary-container);
}

@keyframes pulse {
	0% {
		transform: translateX(-100%);
	}
	100% {
		transform: translateX(100%);
	}
}

.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: #f8f9fa;
	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;
}

.plans-section h4,
.plans-section h5 {
	color: var(--dark-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 #e9ecef;
}

.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: 16px;
	padding: 8px 16px;
	background-color: var(--md-sys-color-surface-variant);
	border-radius: 16px;
	transition: all var(--md-motion-duration-medium2) var(--md-motion-easing-standard);
}

.bot-control:hover {
	transform: translateY(-1px);
	box-shadow: var(--md-sys-elevation-level1);
}

.bot-control p {
	margin: 0;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.1px;
	white-space: nowrap;
	display: flex;
	align-items: center;
	gap: 8px;
}

.status-running {
	color: var(--md-sys-color-success);
}

.status-stopped {
	color: var(--md-sys-color-on-surface-variant);
}

.status-warning {
	color: var(--md-sys-color-warning);
	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;
}

/* Адаптивный dashboard-container для мобильных устройств */
@media (max-width: 768px) {
	.dashboard-container {
		gap: 20px;
	}
	
	.dashboard-column-left,
	.dashboard-column-right {
		flex: 1 1 100%;
		min-width: 100%;
	}
}

.chart-container {
	background-color: #f8f9fa;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 30px;
}

.transaction-list {
	list-style: none;
	padding: 0;
}

.transaction-item {
	background-color: #f8f9fa;
	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;
}

.transaction-item p strong {
	color: var(--dark-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;
}

.transactions-table thead {
	background-color: #f8f9fa;
}

.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: #fff;
	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: #f1f1f1;
}

.pagination a.active {
	background-color: var(--primary-color);
	color: #fff;
	border-color: var(--primary-color);
	cursor: default;
}

.pagination a.disabled {
	color: #aaa;
	background-color: #f8f9fa;
	border-color: #eee;
	pointer-events: none;
}

/* M3 Data Tables */
.users-table,
.transactions-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 20px;
	background-color: var(--md-sys-color-surface);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: var(--md-sys-elevation-level1);
}

/* Адаптивные таблицы для мобильных устройств */
@media (max-width: 768px) {
	.users-table,
	.transactions-table {
		display: block;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
	
	.users-table th,
	.users-table td,
	.transactions-table th,
	.transactions-table td {
		padding: 12px;
		font-size: 13px;
	}
}

@media (max-width: 480px) {
	.users-table th,
	.users-table td,
	.transactions-table th,
	.transactions-table td {
		padding: 8px;
		font-size: 12px;
	}
}

.users-table th,
.users-table td,
.transactions-table th,
.transactions-table td {
	border: none;
	border-bottom: 1px solid var(--md-sys-color-outline-variant);
	padding: 16px;
	text-align: left;
	vertical-align: middle;
	font-size: 14px;
	line-height: 20px;
	color: var(--md-sys-color-on-surface);
}

.users-table thead,
.transactions-table thead {
	background-color: var(--md-sys-color-surface-variant);
}

.users-table th,
.transactions-table th {
	font-weight: 500;
	font-size: 12px;
	line-height: 16px;
	letter-spacing: 0.5px;
	color: var(--md-sys-color-on-surface-variant);
	text-transform: uppercase;
}

.users-table tbody tr:hover,
.transactions-table tbody tr:hover {
	background-color: var(--md-sys-color-surface-variant);
	transition: background-color var(--md-motion-duration-short4) var(--md-motion-easing-standard);
}

.users-table .actions-cell {
	width: 200px;
	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);
}
