* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: #f0f2f5;
  color: #333;
}

/* --- СТРАНИЦА ВХОДА --- */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.login-box {
  background: #fff;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.login-box h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.login-box p {
  color: #666;
  margin-bottom: 24px;
}

.login-box input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  margin-bottom: 12px;
}

.login-box input:focus {
  outline: none;
  border-color: #4a90e2;
}

.login-box button {
  width: 100%;
  padding: 12px;
  background: #4a90e2;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
}

.login-box button:hover {
  background: #357abd;
}

.error-msg {
  color: #e74c3c;
  font-size: 14px;
  margin-bottom: 12px;
  min-height: 20px;
}

/* --- ОБЩИЙ LAYOUT --- */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: #2c3e50;
  color: #fff;
  padding: 20px 0;
  flex-shrink: 0;
}

.sidebar h2 {
  padding: 0 20px 20px;
  font-size: 16px;
  border-bottom: 1px solid #3d5166;
}

.sidebar nav a {
  display: block;
  padding: 12px 20px;
  color: #bdc3c7;
  text-decoration: none;
  font-size: 14px;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: #3d5166;
  color: #fff;
}

.main-content {
  flex: 1;
  padding: 30px;
}

.main-content h1 {
  font-size: 22px;
  margin-bottom: 24px;
}

/* --- КАРТОЧКИ --- */
.card {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

.card h2 {
  font-size: 16px;
  margin-bottom: 16px;
  color: #555;
}

/* --- ФОРМЫ --- */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #4a90e2;
}

/* --- КНОПКИ --- */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
}

.btn-primary {
  background: #4a90e2;
  color: #fff;
}

.btn-primary:hover {
  background: #357abd;
}

.btn-danger {
  background: #e74c3c;
  color: #fff;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-success {
  background: #27ae60;
  color: #fff;
}

.btn-success:hover {
  background: #219a52;
}

/* --- ТАБЛИЦА --- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  text-align: left;
  padding: 10px;
  background: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  color: #555;
}

.table td {
  padding: 10px;
  border-bottom: 1px solid #f0f0f0;
}

.table tr:hover td {
  background: #f8f9fa;
}

/* --- СООБЩЕНИЯ --- */
.alert {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-success {
  background: #d4edda;
  color: #155724;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
}

/* --- TOGGLE --- */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.toggle {
  position: relative;
  width: 50px;
  height: 26px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #ccc;
  border-radius: 26px;
  transition: 0.3s;
}

.toggle-slider:before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle input:checked + .toggle-slider {
  background: #27ae60;
}

.toggle input:checked + .toggle-slider:before {
  transform: translateX(24px);
}