/* ---------- Material: what the town hall lends ---------- */

.material-list,
.material-grid {
  margin: 0;
  padding: 0;
  list-style: none;
}

.material-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4);

  & + & {
    border-top: var(--border);
  }

  form {
    margin: 0;
  }
}

.material-row__main {
  display: flex;
  flex: 1 1 14rem;
  flex-direction: column;
  min-width: 0;
}

.material-row__title {
  margin: 0;
  font-weight: var(--weight-semibold);
}

.material-row__actions,
.material-approve {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.material-approve .input {
  width: auto;
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: var(--space-4);
}

.material-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);

  p {
    margin: 0;
  }
}

.material-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.material-card__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.material-card__action {
  margin-top: auto;
}

/* The rest of an item's past loans or history, opened from the last one shown */
.show-all {
  border-top: var(--border);
}

.show-all__toggle {
  padding: var(--space-3) var(--space-4);
  color: var(--color-primary-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

.show-all__less,
.show-all[open] .show-all__more {
  display: none;
}

.show-all[open] .show-all__less {
  display: inline;
}

.show-all[open] .show-all__toggle {
  border-bottom: var(--border);
}

/* The filters beside the Material | Solicitudes | Préstamos tabs, kept in one line: the search gives up room before
   anything wraps. On narrow screens the whole row goes under the tabs and may wrap there */
.objectives-toolbar .filters {
  flex: 1 1 auto;
  flex-wrap: nowrap;
  justify-content: flex-end;
  margin-bottom: 0;

  .filters__search {
    min-width: 8rem;
  }
}

/* The loans' single dropdown: straight after the tabs, on the left */
.objectives-toolbar .filters--start {
  justify-content: flex-start;
}

@media (max-width: 56rem) {
  .objectives-toolbar .filters {
    flex-basis: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}
