/* Раздел «Проекты» */

/* Список проектов */
.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .project-list { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
}
.project-item {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem 1rem;
  min-width: 0;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.project-item:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); border-color: #cfd8e4; }
.project-item-head { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.project-avatar {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #e0f4f6 0%, #e6f1fd 100%);
  color: #0f6f86;
  font-weight: 800;
}
.project-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
  min-width: 0;
  flex: 1 1 auto;
}
.project-name:hover { color: var(--accent); text-decoration: none; }
.project-desc {
  margin: 0.65rem 0 0;
  color: #43536a;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  margin: auto 0 0;
  padding-top: 0.8rem;
  font-size: 0.86rem;
}
.project-counts strong { color: var(--text); }
.project-desc + .project-counts { margin-top: 0.85rem; border-top: 1px solid var(--border); }

/* Страница проекта */
.project-head-main { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; min-width: 0; }
.project-head .page-title { overflow-wrap: anywhere; }
.project-desc-card { white-space: pre-wrap; overflow-wrap: anywhere; border-left: 4px solid #0f8fa3; }

.project-layout { display: grid; grid-template-columns: 1fr; gap: 0 1.25rem; align-items: start; }
.project-col { min-width: 0; }
@media (min-width: 1100px) {
  .project-layout { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
}

.project-subtitle {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 1.25rem 0 0.5rem;
  color: var(--muted);
}
.project-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.9rem;
}
.project-section-head .card-title { margin: 0; }

/* Быстрое добавление задачи */
.project-task-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 0.75rem;
  margin-bottom: 1rem;
  padding: 0.9rem 0.9rem 0.15rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.project-task-form .field { margin-bottom: 0.75rem; min-width: 0; }
.project-task-submit { margin-bottom: 0.75rem; }
@media (min-width: 720px) {
  .project-task-form { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.3fr) auto; align-items: start; }
  .project-task-submit { padding-top: 1.6rem; }
}
@media (min-width: 1100px) {
  .project-task-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .project-task-form .field:first-child { grid-column: 1 / -1; }
  .project-task-submit { padding-top: 0; grid-column: 1 / -1; }
}

/* Заметки */
.project-note-form { margin-bottom: 1rem; }
.project-note-form .field { margin-bottom: 0.75rem; }
.note-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.note {
  padding: 0.8rem 0.95rem;
  background: #fffbea;
  border: 1px solid #f3e5a6;
  border-radius: var(--radius);
}
.note-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  margin-bottom: 0.4rem;
}
.note-date { font-size: 0.82rem; }
.note-actions { display: inline-flex; gap: 0.35rem; align-items: center; }
.note-actions form { margin: 0; }
.note-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Договоры проекта */
.project-contracts { list-style: none; margin: 0; padding: 0; }
.project-contract {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.75rem;
  padding: 0.7rem 0.5rem;
  margin: 0 -0.5rem;
  border-top: 1px solid var(--border);
  border-radius: 8px;
  min-width: 0;
}
.project-contract:hover { background: var(--surface-2); }
.project-contract:first-child { border-top: 0; }
.project-contract-title { font-weight: 600; overflow-wrap: anywhere; }
.project-contract-money { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 559px) {
  .project-contract-money { margin-left: 0; flex-basis: 100%; white-space: normal; }
}
