/* Base application shell for Django template screens. */
body {
  background: #f6f7f9;
  color: #1f2937;
}

.pm-shell {
  padding: 24px 0 40px;
}

.pm-messages {
  margin-bottom: 18px;
}

.pm-panel,
.pm-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.pm-panel {
  padding: 28px;
}

.pm-section {
  padding: 22px;
}

.pm-page-header {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.pm-section-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.pm-empty {
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  padding: 18px;
}

.pm-project-list {
  display: grid;
  gap: 12px;
}

.pm-project-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.pm-project-row {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px;
}

.pm-project-row-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pm-project-row-main strong {
  overflow-wrap: anywhere;
}

.pm-project-actions {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 8px;
}

.pm-project-edit-form {
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  padding: 14px;
}

.pm-excel-menu {
  min-width: 280px;
}

.pm-user-list {
  display: grid;
  gap: 12px;
}

.pm-user-card {
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  padding: 14px;
}

.pm-user-avatar {
  align-items: center;
  background: #eef2ff;
  border: 1px solid #dbeafe;
  border-radius: 50%;
  color: #1e40af;
  display: flex;
  font-size: 0.85rem;
  font-weight: 700;
  height: 44px;
  justify-content: center;
  letter-spacing: 0;
  width: 44px;
}

.pm-user-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pm-user-main span,
.pm-user-title strong {
  overflow-wrap: anywhere;
}

.pm-user-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table td,
.table th {
  vertical-align: middle;
}

@media (max-width: 767.98px) {
  .pm-shell {
    padding-top: 16px;
  }

  .pm-panel,
  .pm-section {
    padding: 18px;
  }

  .pm-page-header,
  .pm-project-row,
  .pm-user-card {
    align-items: stretch;
  }

  .pm-page-header,
  .pm-project-row {
    flex-direction: column;
  }

  .pm-user-card {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .pm-user-card form {
    grid-column: 1 / -1;
  }

  .pm-project-actions {
    justify-content: flex-start;
  }
}

/* User info in navbar */
.user-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

.role-badge {
  font-size: 11px;
  font-weight: 500;
}
.role-badge.role-admin    { background: #fee2e2; color: #991b1b; }
.role-badge.role-manager  { background: #dbeafe; color: #1e40af; }
.role-badge.role-analyst  { background: #d1fae5; color: #065f46; }
.role-badge.role-user     { background: #f3f4f6; color: #374151; }

/* Settings secondary navigation (Проекты / Эпики / Пользователи). */
.pm-settings-tabs .nav-link {
  color: #374151;
  border: 1px solid transparent;
}
.pm-settings-tabs .nav-link:hover {
  background: #eef2ff;
}
.pm-settings-tabs .nav-link.active {
  background: #4f46e5;
  color: #fff;
}

/* Эпики overview — the epic colour scheme lives INLINE in epics.html
   (extra_head) on purpose: app.css is served un-hashed and caches hard, so
   colour edits there don't reliably reach browsers. Only the shared tag-chip
   plaque (also used elsewhere) stays here. */
/* Task tags — a single calm slate plaque for every tag (no per-tag colour),
   matching the chip look used on requirement cards. */
.pm-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pm-tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  white-space: nowrap;
}
