/* ===== ACTIVITY LOGS ===== */
.modal-logs {
  max-width: 560px;
  max-height: 70vh;
}
.logs-header {
  margin-bottom: 12px;
}
.logs-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border-default);
  font-size: 11px;
}
.log-entry {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 12px;
  background: var(--bg-card);
  font-size: 11px;
  border-left: 3px solid transparent;
}
.log-entry.log-moved { border-left-color: var(--accent); }
.log-entry.log-field-position { border-left-color: var(--accent-amber); }
.log-entry.log-field-blocker { border-left-color: var(--accent-red); }
.log-entry.log-updated:not(.log-field-position):not(.log-field-blocker) { border-left-color: var(--accent-green); }
.log-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.log-user {
  font-weight: 600;
  color: var(--text-secondary);
}
.log-action {
  color: var(--text-primary);
  line-height: 1.4;
}
.log-values {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  padding-left: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
}
.log-arrow {
  color: var(--text-muted);
  font-size: 12px;
}
.log-old {
  color: var(--accent-red);
  text-decoration: line-through;
  opacity: 0.7;
}
.log-new {
  color: var(--accent-green);
}
.logs-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}
.logs-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px;
  border-top: 1px solid var(--border-default);
}
.logs-pg-info {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 32px; margin-bottom: 6px; }

.section-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-primary);
  margin-bottom: 10px;
  margin-top: 20px;
}
.section-title:first-child { margin-top: 0; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 14px;
  transition: color 0.1s;
  font-family: var(--font-mono);
}
.back-link:hover { color: var(--accent); }

.project-detail .back-link {
  display: block;
  text-align: right;
  margin-bottom: 8px;
}

.role-badge {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 7px;
  border-radius: 3px;
  font-family: var(--font-mono);
}
.role-admin { background: var(--accent-amber-dim); color: var(--accent-amber); }
.role-pe { background: var(--accent-dim); color: var(--accent); }
.role-dev { background: var(--accent-green-dim); color: var(--accent-green); }
.role-client { background: var(--accent-purple-dim); color: var(--accent-purple); }

/* ===== MODAL / POPUP ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 620px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: slideUp 0.15s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-default);
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  padding-right: 16px;
}

.modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.1s;
}
.modal-close:hover { border-color: var(--accent-red); color: var(--accent-red); }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-body .spec-id {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.modal-body .spec-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  white-space: pre-wrap;
}

.modal-body .spec-meta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.modal-meta-item {
  font-size: 11px;
  color: var(--text-muted);
}
.modal-meta-item strong { color: var(--text-primary); font-weight: 600; }

.modal-body .spec-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 14px;
}
.modal-body .spec-meta-row .modal-meta-item {
  flex: 0 0 calc(33.333% - 11px);
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.modal-body .meta-label {
  flex-shrink: 0;
  white-space: nowrap;
}

.ac-list {
  margin-bottom: 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ac-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-default);
  background: var(--bg-tertiary);
}

.ac-list-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
}

.ac-counter {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 1px 7px;
  border-radius: 8px;
}

.ac-list-scroll {
  padding: 4px 12px;
}

.ac-list-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text-primary);
  padding: 5px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s;
}

.ac-list-item:hover {
  background: var(--bg-card-hover);
}

.ac-list-item .ac-check {
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 12px;
}

.ac-list-item .ac-text {
  flex: 1;
  line-height: 1.4;
}

.ac-list-item.ac-done .ac-check {
  color: var(--accent-green);
}

.ac-list-item.ac-done .ac-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.ac-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
  margin-left: 4px;
  flex-shrink: 0;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s;
}
.ac-list-item:hover .ac-delete-btn { opacity: 0.6; }
.ac-delete-btn:hover { opacity: 1 !important; color: var(--accent-red); }

.ac-add-row {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-default);
}
.ac-add-input {
  flex: 1;
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-mono);
}
.ac-add-input:focus { outline: none; border-color: var(--accent); }
.ac-add-input::placeholder { color: var(--text-muted); font-size: 11px; }
.ac-add-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.ac-add-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

.ac-edit-input {
  flex: 1;
  font-size: 12px;
  padding: 2px 6px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-mono);
  outline: none;
}

.inline-edit-title {
  outline: none;
  border-radius: 4px;
  padding: 2px 6px;
  margin: -2px -6px;
  transition: background 0.15s;
}
.inline-edit-title:hover { background: var(--bg-tertiary); }
.inline-edit-title:focus { background: var(--bg-primary); box-shadow: 0 0 0 1px var(--accent); }

.spec-description-wrap { position: relative; }
.spec-description { cursor: pointer; padding: 4px 6px; border-radius: 4px; margin: -4px -6px; transition: background 0.15s; min-height: 24px; }
.spec-description:hover { background: var(--bg-tertiary); }
.spec-description-editor textarea {
  width: 100%;
  min-height: 120px;
  font-size: 13px;
  padding: 8px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-mono);
  outline: none;
  resize: vertical;
}

.ac-textarea {
  font-family: var(--font-mono) !important;
  font-size: 12px !important;
  line-height: 1.7 !important;
}

.form-hint {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}

.modal-attachments {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-default);
}

.attach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
  margin-top: 6px;
}
.attach-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.attach-thumb:hover {
  transform: scale(1.05);
}
.attach-file-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--border-default);
}
.attach-file-chip i {
  font-size: 14px;
  color: var(--text-secondary);
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-default);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Cover image in project view */
.project-cover .project-cover-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1;
}

.project-cover .project-cover-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  padding: 6px 14px;
  border-radius: 4px;
  margin: 0;
  align-self: flex-start;
}

.project-cover .project-cover-subtitle {
  font-size: 12px;
  color: #fff;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  padding: 3px 10px;
  border-radius: 3px;
  align-self: flex-start;
  margin: 0;
}

.project-cover .project-cover-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 3px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  color: #fff;
  font-family: var(--font-mono);
}

.status-select {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  color: #fff;
  font-family: var(--font-mono);
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  outline: none;
}

.cover-edit-btn {
  position: absolute;
  bottom: 12px;
  right: 14px;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 3px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  font-family: var(--font-heading);
  letter-spacing: 0.3px;
  transition: all 0.15s;
  display: none;
}
.project-cover:hover .cover-edit-btn { display: block; }
.cover-edit-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* ===== COVER COLLAPSE TOGGLE ===== */
.cover-toggle-btn {
  position: absolute;
  top: 10px;
  left: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  z-index: 2;
  transition: all 0.2s;
  opacity: 0;
}
.project-cover:hover .cover-toggle-btn { opacity: 1; }
.cover-toggle-btn:hover { background: var(--accent); border-color: var(--accent); }

.project-cover.cover-collapsed {
  height: 52px;
  align-items: center;
  padding: 6px 14px;
  margin-bottom: 8px;
}
.project-cover.cover-collapsed:hover::before { transform: none; }
.project-cover.cover-collapsed { cursor: default; }

.project-cover.cover-collapsed .cover-toggle-btn {
  opacity: 1;
  position: static;
  margin-right: 10px;
  order: -1;
  flex-shrink: 0;
}
.project-cover.cover-collapsed .project-cover-info {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.project-cover.cover-collapsed .project-cover-title {
  font-size: 15px;
  line-height: 15px;
  padding: 4px 10px;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-cover.cover-collapsed .project-cover-subtitle {
  font-size: 12px;
  line-height: 15px;
  padding: 4px 10px;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-cover.cover-collapsed .cover-edit-btn,
.project-cover.cover-collapsed .project-cover-badge,
.project-cover.cover-collapsed .attention-load-widget {
  display: none;
}

/* ===== ATTENTION LOAD WIDGET ===== */
.attention-load-widget {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  min-width: 160px;
}
.attention-load-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 2px;
}
.attention-load-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}
.attention-load-bar {
  margin-top: 5px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
  overflow: hidden;
}
.attention-load-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.attention-load-focused { background: #10B981; }
.attention-load-busy { background: #F59E0B; }
.attention-load-high_load { background: #F97316; }
.attention-load-overloaded { background: #EF4444; }
.attention-load-state {
  margin-top: 3px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.attention-load-state-focused { color: #10B981; }
.attention-load-state-busy { color: #F59E0B; }
.attention-load-state-high_load { color: #F97316; }
.attention-load-state-overloaded { color: #EF4444; }

/* ===== COVER MODAL ===== */
.modal-card.modal-cover {
  width: 720px;
  max-width: 92vw;
  max-height: 82vh;
}

.cover-preview {
  margin: 0 20px 10px;
  height: 120px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-tertiary);
}

.cover-preview-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: background-image 0.2s;
}

.cover-categories {
  display: flex;
  gap: 6px;
  padding: 0 20px 12px;
  flex-wrap: wrap;
}

.cover-cat {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.1s;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.cover-cat:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.cover-cat.active { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }

.cover-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 0 20px 16px;
  overflow-y: auto;
  max-height: 320px;
}

.cover-option {
  aspect-ratio: 2 / 1;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.12s;
}

.cover-option:hover { border-color: var(--text-muted); opacity: 0.85; }
.cover-option.selected { border-color: var(--accent); }

/* Raw Spec section */
.raw-spec-section {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  background: var(--bg-tertiary);
}

/* ===== SPEC FORM LAYOUT ===== */
