/* Базовые стили */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: #1f2937;
  background: #f9fafb;
  line-height: 1.5;
}

/* Навигация */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.125rem;
  color: #2563eb;
}

.nav-links {
  display: flex;
  gap: 1rem;
  margin-left: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: #6b7280;
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition:
    color 0.15s,
    background 0.15s;
}

.nav-links a:hover {
  color: #2563eb;
}
.nav-links a.active {
  color: #2563eb;
  font-weight: 600;
  background: #eff6ff;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  padding-left: 1.5rem;
  border-left: 1px solid #e5e7eb;
}
.nav-user-name {
  font-size: 0.8125rem;
  color: #374151;
  font-weight: 500;
}
.nav-logout {
  font-size: 0.8125rem;
  color: #9ca3af;
  text-decoration: none;
}
.nav-logout:hover {
  color: #dc2626;
}

/* Контейнер */
.container {
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
}

/* Карточка */
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.card h2 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
}
.btn-primary:hover {
  background: #1d4ed8;
}
.btn-danger {
  background: #dc2626;
  color: #fff;
}
.btn-danger:hover {
  background: #b91c1c;
}
.btn-sm {
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
}

/* Таблица */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.table th,
.table td {
  text-align: left;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}
.table th {
  font-weight: 600;
  color: #6b7280;
  background: #f9fafb;
}
.table tr:hover td {
  background: #f3f4f6;
}

/* Форма */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Kanban */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.kanban-column {
  background: #f3f4f6;
  border-radius: 8px;
  padding: 0.75rem;
  min-height: 200px;
}

.kanban-column h3 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  color: #6b7280;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.kanban-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.kanban-card:hover {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Бейджи */
.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background: #e5e7eb;
  color: #374151;
}

.badge-blue {
  background: #dbeafe;
  color: #1d4ed8;
}
.badge-green {
  background: #dcfce7;
  color: #166534;
}
.badge-red {
  background: #fee2e2;
  color: #991b1b;
}

/* Модалка */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  width: 90%;
  max-width: 640px;
  max-height: 80vh;
  overflow-y: auto;
}

/* Превью чата */
.chat-preview {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
}

.chat-preview .msg {
  max-width: 75%;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  font-size: 0.875rem;
}

.chat-preview .msg-in {
  align-self: flex-start;
  background: #f3f4f6;
}
.chat-preview .msg-out {
  align-self: flex-end;
  background: #dbeafe;
}

/* Адаптивность */
@media (max-width: 768px) {
  .kanban {
    grid-template-columns: 1fr;
  }
  .nav {
    flex-wrap: wrap;
    height: auto;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }
}
