.projects-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--ds-space-6);
  min-height: 100vh;
}

.projects-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-4);
  margin-bottom: var(--ds-space-6);
  flex-wrap: wrap;
}

.projects-header h1 {
  margin: 0;
  font-size: var(--ds-font-size-2xl);
}

.projects-header__actions {
  display: flex;
  align-items: center;
  gap: var(--ds-space-4);
}

.projects-link {
  color: var(--ds-color-text-secondary);
  text-decoration: none;
  font-size: var(--ds-font-size-sm);
}

.projects-link:hover {
  color: var(--ds-color-text-primary);
}

.projects-toast {
  position: fixed;
  top: var(--ds-space-4);
  right: var(--ds-space-4);
  padding: var(--ds-space-3) var(--ds-space-4);
  border-radius: var(--ds-radius-md);
  background: var(--ds-color-surface-elevated);
  color: var(--ds-color-text-primary);
  box-shadow: var(--ds-shadow-md);
  z-index: 1000;
}

.projects-toast.error {
  background: var(--ds-color-danger);
  color: white;
}

.projects-panel {
  background: var(--ds-color-surface-elevated);
  border: 1px solid var(--ds-color-border);
  border-radius: var(--ds-radius-lg);
  padding: var(--ds-space-5);
  margin-bottom: var(--ds-space-6);
}

.projects-form {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-4);
}

.projects-form--inline {
  flex-direction: row;
  align-items: flex-end;
}

.projects-field {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-2);
  font-size: var(--ds-font-size-sm);
  color: var(--ds-color-text-secondary);
}

.projects-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--ds-space-3);
  margin-top: var(--ds-space-2);
}

.btn {
  padding: var(--ds-space-2) var(--ds-space-4);
  border-radius: var(--ds-radius-md);
  border: 1px solid var(--ds-color-border);
  background: var(--ds-color-surface-elevated);
  cursor: pointer;
  font-size: var(--ds-font-size-sm);
}

.btn--primary {
  background: var(--ds-color-primary);
  color: white;
  border-color: var(--ds-color-primary);
}

.btn--danger {
  background: var(--ds-color-danger);
  color: white;
  border-color: var(--ds-color-danger);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--ds-space-4);
}

.projects-empty {
  color: var(--ds-color-text-secondary);
  padding: var(--ds-space-8) 0;
  text-align: center;
  grid-column: 1 / -1;
}

.project-card {
  display: block;
  background: var(--ds-color-surface-elevated);
  border: 1px solid var(--ds-color-border);
  border-radius: var(--ds-radius-lg);
  padding: var(--ds-space-4);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease;
}

.project-card:hover {
  box-shadow: var(--ds-shadow-md);
}

.project-card__title {
  font-weight: var(--ds-font-weight-semibold);
  margin-bottom: var(--ds-space-2);
}

.project-card__meta,
.project-card__hint {
  font-size: var(--ds-font-size-sm);
  color: var(--ds-color-text-secondary);
}

.project-layout {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-6);
}

.project-section {
  background: var(--ds-color-surface-elevated);
  border: 1px solid var(--ds-color-border);
  border-radius: var(--ds-radius-lg);
  padding: var(--ds-space-5);
}

.project-section h2 {
  margin-top: 0;
  font-size: var(--ds-font-size-lg);
}

.project-section__actions {
  margin-top: var(--ds-space-3);
  display: flex;
  justify-content: flex-end;
}

.upload-area {
  border: 2px dashed var(--ds-color-border);
  border-radius: var(--ds-radius-lg);
  padding: var(--ds-space-6);
  text-align: center;
  color: var(--ds-color-text-secondary);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.upload-area--dragover {
  border-color: var(--ds-color-primary);
  background: var(--ds-color-surface);
}

.upload-area__hint {
  font-size: var(--ds-font-size-xs);
  margin-top: var(--ds-space-2);
}

.link-btn {
  background: none;
  border: none;
  color: var(--ds-color-primary);
  cursor: pointer;
  padding: 0;
  font-size: inherit;
}

.documents-list,
.members-list {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-3);
  margin-top: var(--ds-space-4);
}

.documents-empty,
.members-empty {
  color: var(--ds-color-text-secondary);
  font-size: var(--ds-font-size-sm);
  padding: var(--ds-space-4) 0;
}

.document-item,
.member-item {
  display: flex;
  align-items: center;
  gap: var(--ds-space-3);
  padding: var(--ds-space-3);
  border: 1px solid var(--ds-color-border);
  border-radius: var(--ds-radius-md);
  background: var(--ds-color-surface);
}

.document-item__icon {
  color: var(--ds-color-text-secondary);
}

.document-item__body {
  flex: 1;
  min-width: 0;
}

.document-item__title {
  font-weight: var(--ds-font-weight-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-item__meta {
  font-size: var(--ds-font-size-xs);
  color: var(--ds-color-text-secondary);
}

.document-item__delete,
.member-item__delete {
  background: none;
  border: none;
  color: var(--ds-color-text-secondary);
  cursor: pointer;
  padding: var(--ds-space-1);
}

.document-item__delete:hover,
.member-item__delete:hover {
  color: var(--ds-color-danger);
}

.member-item__role {
  font-size: var(--ds-font-size-xs);
  color: var(--ds-color-text-secondary);
  text-transform: lowercase;
}

.member-item--owner {
  background: var(--ds-color-surface-elevated);
}

@media (max-width: 640px) {
  .projects-shell {
    padding: var(--ds-space-4);
  }

  .projects-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .projects-form--inline {
    flex-direction: column;
    align-items: stretch;
  }
}
