/* Общие стили */
body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #fff;
  color: #24292e;
  display: flex;
  flex-direction: column;
}

/* Контейнер с сайдбаром и контентом */
.page-container {
  display: flex;
  min-height: 100vh;
}

/* Сайдбар */
.sidebar {
  width: 60px;
  background-color: #0366d6;
  color: white;
  transition: width 0.3s ease;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0;
  position: fixed;
  height: 100vh;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  font-weight: 600;
  user-select: none;
}

.sidebar:hover {
  width: 220px;
}

/* Ссылки в сайдбаре */
.sidebar a {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 20px;
  color: white;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  border-left: 4px solid transparent;
  transition: background-color 0.3s ease, border-left-color 0.3s ease;
  font-size: 1rem;
}

.sidebar a .icon {
  margin-right: 15px;
  font-size: 1.4rem;
  min-width: 24px;
  text-align: center;
  flex-shrink: 0;
}

/* Скрываем текст ссылок при свернутой панели */
.sidebar:not(:hover) a span:not(.icon) {
  display: none;
}

/* Показываем текст при наведении */
.sidebar:hover a span:not(.icon) {
  display: inline;
}

.sidebar a:hover, .sidebar a.active {
  background-color: #024ea2;
  border-left-color: #fff;
}

/* Основной контент */
.main-content {
  margin-left: 60px;
  padding: 40px 20px;
  flex-grow: 1;
  transition: margin-left 0.3s ease;
}

/* Сдвигаем контент при расширенной панели */
.sidebar:hover ~ .main-content {
  margin-left: 220px;
}

/* Центрирование main для страниц с формами */
.main-content.centered-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;

  /* Убираем margin-left, чтобы не было сдвига */
  margin-left: 0;

  /* Добавляем padding-left под ширину сайдбара, чтобы форма не была под ним */
  padding-left: 60px;

  padding-right: 20px;
  padding-top: 20px;
  padding-bottom: 20px;

  transition: padding-left 0.3s ease;
}

/* При наведении на сайдбар увеличиваем отступ слева */
.sidebar:hover ~ .main-content.centered-page {
  padding-left: 220px;
  margin-left: 0;
}

/* Центрирование формы */
.form-container {
  max-width: 420px;
  width: 100%;
  background: #f8f9fa;
  padding: 30px 35px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Заголовки */
h2 {
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
  letter-spacing: 0.03em;
  color: #0366d6;
}

/* Метки */
.form-label {
  font-weight: 600;
  color: #444;
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
}

/* Поля ввода */
.form-control {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 20px;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: #0366d6;
  box-shadow: 0 0 5px rgba(3, 102, 214, 0.5);
}

/* Кнопки */
.btn {
  cursor: pointer;
  padding: 12px 18px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  transition: background-color 0.3s ease;
  display: block;
  width: 100%;
  box-sizing: border-box;
  user-select: none;
}

.btn-primary {
  background-color: #0366d6;
  color: white;
}

.btn-primary:hover {
  background-color: #024ea2;
}

.btn-success {
  background-color: #28a745;
  color: white;
}

.btn-success:hover {
  background-color: #1e7e34;
}

/* Текст под формой */
.mt-3 {
  margin-top: 1rem;
}

.text-center {
  text-align: center;
}

/* Сообщения об ошибках */
.error-msg {
  background-color: #f8d7da;
  color: #842029;
  padding: 12px;
  margin-bottom: 15px;
  border-radius: 6px;
  font-weight: 600;
  text-align: center;
}

/* Блок с результатом проверки */
.result-box {
  margin-top: 20px;
  background: #e9f5ff;
  border-left: 5px solid #0366d6;
  border-radius: 6px;
  color: #0366d6;
  font-weight: 600;
  padding: 15px 20px;
  word-wrap: break-word;
  user-select: text;
}

/* Flash сообщения */
.flash-messages {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  max-width: 400px;
}

.alert {
  padding: 15px 20px;
  margin-bottom: 15px;
  border-radius: 6px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.alert-danger {
  background-color: #f8d7da;
  color: #842029;
  border-left: 5px solid #dc3545;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border-left: 5px solid #28a745;
}

.alert-warning {
  background-color: #fff3cd;
  color: #856404;
  border-left: 5px solid #ffc107;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
  border-left: 5px solid #17a2b8;
}

.dashboard-container {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
  text-align: center;
  color: #333;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.dashboard-container table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 auto;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  background: #fff;
  text-align: center;
}

.dashboard-container thead th {
  background-color: #0366d6;
  color: white;
  padding: 12px 15px;
  font-weight: 600;
  border-bottom: 2px solid #024ea2;
}

.dashboard-container tbody td {
  padding: 12px 15px;
  border-bottom: 1px solid #ddd;
  vertical-align: middle;
}

.dashboard-container tbody tr:hover {
  background-color: #f1f9ff;
}

.dashboard-container details summary {
  cursor: pointer;
  font-weight: 600;
  color: #0366d6;
  margin-top: 10px;
}

.dashboard-container details ul {
  list-style-type: disc;
  margin: 8px auto 0;
  padding-left: 20px;
  text-align: left;
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid #ddd;
  background: #fafafa;
  border-radius: 4px;
  width: fit-content;
}

