* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Основные цвета */
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    
    /* Светлая тема по умолчанию */
    --bg-primary: #ecf0f1;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0,0,0,0.1);
}

/* Темная тема */
body.theme-dark {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-card: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
    --shadow-color: rgba(0,0,0,0.3);
}

/* Применение CSS переменных */
body {
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

/* Auth Pages */
.auth-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--dark-text);
}

/* Dashboard */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--secondary-color);
    color: white;
    padding: 20px 0;
}

.user-info {
    padding: 0 20px 20px;
    border-bottom: 1px solid #34495e;
    margin-bottom: 20px;
}

.user-info h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

.server-info {
    background: #34495e;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 14px;
}

.main-menu {
    display: flex;
    flex-direction: column;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
}

.menu-item:hover {
    background: #34495e;
}

.menu-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.menu-item.logout {
    margin-top: auto;
    color: var(--danger-color);
}

.main-content {
    flex: 1;
    background: var(--light-bg);
    padding: 30px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--dark-text);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card i {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.stat-card h3 {
    margin-bottom: 10px;
    color: var(--light-text);
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: var(--dark-text);
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Таблицы */
.table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #34495e;
    color: white;
    font-weight: 600;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table td {
    font-size: 14px;
}

/* Глобальные стили для темной темы */
body.theme-dark .main-content {
    background: var(--bg-primary);
    color: var(--text-primary);
}

body.theme-dark .sidebar {
    background: var(--secondary-color);
    color: var(--text-primary);
}

body.theme-dark .menu-item {
    color: var(--text-primary);
}

body.theme-dark .menu-item:hover {
    background: #34495e;
}

body.theme-dark .user-info {
    border-bottom: 1px solid var(--border-color);
}

body.theme-dark .server-info {
    background: #34495e;
    color: var(--text-primary);
}

body.theme-dark .data-table {
    color: var(--text-primary);
}

body.theme-dark .data-table th {
    background: var(--secondary-color);
    color: var(--text-primary);
}

body.theme-dark .data-table td {
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

body.theme-dark .table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

body.theme-dark .search-form {
    background: var(--bg-card);
    color: var(--text-primary);
}

body.theme-dark .form-group label {
    color: var(--text-primary);
}

body.theme-dark .form-group input {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

body.theme-dark .alert {
    color: var(--text-primary);
}

body.theme-dark .alert-info {
    background: #2c3e50;
    border: 1px solid #34495e;
}

body.theme-dark .alert-error {
    background: #5c2a2a;
    border: 1px solid #7a3737;
    color: #ffb8b8;
}

body.theme-dark .alert-success {
    background: #1e4a2e;
    border: 1px solid #2d6b44;
    color: #a8ffc8;
}

/* Убедимся, что все тексты видны */
body.theme-dark .page-header h1,
body.theme-dark .page-header p,
body.theme-dark .content,
body.theme-dark .search-results h3,
body.theme-dark .results-count {
    color: var(--text-primary) !important;
}