/* БАЗА */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #dde6f1;
  color: #111827;
}

/* ОБЩИЙ КАРКАС */

.app-frame {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

/* САЙДБАР */

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  background: rgba(245, 248, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid rgba(148, 163, 184, 0.4);
}

.sidebar-header {
  margin-bottom: 18px;
}

.sidebar-caption {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

/* ЛОГОТИП */

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-dot {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffffff, #8bb8ff);
  box-shadow: 0 0 10px rgba(120,160,255,0.75);
}

.logo-text-regular {
  font-size: 18px;
  font-weight: 400;
  color: #111827;
}

.logo-text-bold {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

/* НАВИГАЦИЯ В САЙДБАРЕ */

.sidebar-nav {
  flex: 1;
  font-size: 14px;
}

.nav-section-title {
  margin: 14px 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9ca3af;
}

.nav-link {
  display: block;
  padding: 6px 8px;
  margin: 1px 0;
  border-radius: 6px;
  color: #111827;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.nav-link:hover {
  background-color: rgba(229, 231, 235, 0.7);
  border-color: #64748b;
}

.nav-link-accent {
  border-color: #2563eb;
}

/* НИЖНЯЯ ПАНЕЛЬ В САЙДБАРЕ */

.sidebar-footer {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid rgba(209, 213, 219, 0.7);
  font-size: 12px;
}

.hint-label {
  color: #9ca3af;
}

.hint-value {
  color: #374151;
}

/* ПРАВАЯ ОБЛАСТЬ */

.content {
  padding: 20px 28px 28px;
  background: #edf1f8;
}

/* ШАПКА ПРАВОЙ ОБЛАСТИ */

.content-header {
  margin-bottom: 18px;
}

.content-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 600;
}

.content-subtitle {
  margin: 0;
  font-size: 14px;
  color: #4b5563;
}

/* БЛОКИ КОНТЕНТА */

.content-block {
  margin-bottom: 18px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #d1d5db;
}

.block-title {
  margin: 0;
  padding: 10px 14px 6px;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
}

.block-body {
  padding: 10px 14px 12px;
  font-size: 14px;
}

/* ОБЫЧНЫЙ СПИСОК */

.plain-list {
  margin: 0;
  padding-left: 18px;
}

.plain-list li + li {
  margin-top: 4px;
}

/* ТАБЛИЦЫ ДАННЫХ */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table thead {
  background-color: #f9fafb;
}

.data-table th,
.data-table td {
  padding: 6px 6px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.data-table th {
  font-weight: 600;
  color: #1f2933;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

/* ТАБЛИЦА НАВИГАЦИИ (НА ГЛАВНОЙ) */

.nav-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.nav-table th,
.nav-table td {
  padding: 6px 4px;
  vertical-align: top;
}

.nav-table th {
  width: 160px;
  text-align: left;
  font-weight: 600;
  color: #1f2933;
}

.nav-table th a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed rgba(75, 85, 99, 0.7);
}

.nav-table th a:hover {
  border-bottom-style: solid;
}

.nav-table tr + tr td,
.nav-table tr + tr th {
  border-top: 1px solid #e5e7eb;
}

/* ФОРМЫ */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 24px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-row label {
  font-size: 13px;
  color: #4b5563;
}

input[type="text"],
input[type="number"],
select {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  font-family: inherit;
  background-color: #f9fafb;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: #2563eb;
  background-color: #ffffff;
}

.form-actions {
  margin-top: 12px;
}

/* серые кнопки */
button[type="submit"] {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #9ca3af;
  background-color: #e5e7eb;
  color: #111827;
  font-size: 14px;
  cursor: pointer;
}

button[type="submit"]:hover {
  background-color: #d1d5db;
}

/* кнопка‑иконка для удаления */
.icon-button {
  border: none;
  background: transparent;
  padding: 0 4px;
  cursor: pointer;
  font-size: 14px;
}

.icon-button:hover {
  opacity: 0.8;
}

/* ПОДСВЕТКА ЛУЧШЕЙ СТРОКИ */

.row-best {
  background-color: #e0f2fe !important;
}

/* АДАПТИВ */

@media (max-width: 800px) {
  .app-frame {
    grid-template-columns: 1fr;
  }

  .sidebar {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    border-right: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .nav-section-title,
  .sidebar-footer {
    display: none;
  }

  .nav-link {
    padding: 4px 8px;
    border-left: none;
    border-radius: 999px;
    background: rgba(229, 231, 235, 0.7);
  }

  .content {
    padding: 16px;
  }
}


/* Кнопки действий в таблицах (редактирование / удаление) */
.action-btn {
  border: 1px solid #d1d5db;
  background: #ffffff;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  text-decoration: none;
}

.action-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  transform: translateY(-1px);
}

.action-edit {
  color: #1d4ed8; /* синий */
}

.action-del {
  color: #b91c1c; /* красный */
}

.action-del:hover {
  background: #fee2e2;
  border-color: #ef4444;
}


/* Выравнивание размеров кнопок действий */
.action-btn {
  width: 70px;
  justify-content: center;
}
